mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 01:40:07 +00:00
bitbake: tests/runqueue: Add hashserv+runqueue test
Add a test which tests the runqueue adaptations for hash equivalency. (Bitbake rev: 477321d0780df177c1582db119c2bb6795912fc6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -12,6 +12,7 @@ import bb.data
|
||||
import difflib
|
||||
import simplediff
|
||||
from bb.checksum import FileChecksumCache
|
||||
from bb import runqueue
|
||||
|
||||
logger = logging.getLogger('BitBake.SigGen')
|
||||
|
||||
@@ -473,10 +474,12 @@ class SignatureGeneratorUniHashMixIn(object):
|
||||
|
||||
locs = {'path': path, 'sigfile': sigfile, 'task': task, 'd': d}
|
||||
|
||||
(module, method) = self.method.rsplit('.', 1)
|
||||
locs['method'] = getattr(importlib.import_module(module), method)
|
||||
|
||||
outhash = bb.utils.better_eval('method(path, sigfile, task, d)', locs)
|
||||
if "." in self.method:
|
||||
(module, method) = self.method.rsplit('.', 1)
|
||||
locs['method'] = getattr(importlib.import_module(module), method)
|
||||
outhash = bb.utils.better_eval('method(path, sigfile, task, d)', locs)
|
||||
else:
|
||||
outhash = bb.utils.better_eval(self.method + '(path, sigfile, task, d)', locs)
|
||||
|
||||
try:
|
||||
url = '%s/v1/equivalent' % self.server
|
||||
@@ -527,6 +530,18 @@ class SignatureGeneratorUniHashMixIn(object):
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
#
|
||||
# Dummy class used for bitbake-selftest
|
||||
#
|
||||
class SignatureGeneratorTestEquivHash(SignatureGeneratorUniHashMixIn, SignatureGeneratorBasicHash):
|
||||
name = "TestEquivHash"
|
||||
def init_rundepcheck(self, data):
|
||||
super().init_rundepcheck(data)
|
||||
self.server = "http://" + data.getVar('BB_HASHSERVE')
|
||||
self.method = "sstate_output_hash"
|
||||
|
||||
|
||||
def dump_this_task(outfile, d):
|
||||
import bb.parse
|
||||
fn = d.getVar("BB_FILENAME")
|
||||
|
||||
Reference in New Issue
Block a user