summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-02 15:32:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-06 11:21:32 +0100
commitfd79638046891fb5ab6091f7ef3e7ae6df12c39b (patch)
tree04a256b8a35158fbb1d90b6d4fbcb84cb2301066 /bitbake/lib/bb/siggen.py
parent347c2056022d21deea6e2e7359eca2b96c6f01fe (diff)
downloadpoky-fd79638046891fb5ab6091f7ef3e7ae6df12c39b.tar.gz
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>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r--bitbake/lib/bb/siggen.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 912c92c8be..b503559305 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -12,6 +12,7 @@ import bb.data
12import difflib 12import difflib
13import simplediff 13import simplediff
14from bb.checksum import FileChecksumCache 14from bb.checksum import FileChecksumCache
15from bb import runqueue
15 16
16logger = logging.getLogger('BitBake.SigGen') 17logger = logging.getLogger('BitBake.SigGen')
17 18
@@ -473,10 +474,12 @@ class SignatureGeneratorUniHashMixIn(object):
473 474
474 locs = {'path': path, 'sigfile': sigfile, 'task': task, 'd': d} 475 locs = {'path': path, 'sigfile': sigfile, 'task': task, 'd': d}
475 476
476 (module, method) = self.method.rsplit('.', 1) 477 if "." in self.method:
477 locs['method'] = getattr(importlib.import_module(module), method) 478 (module, method) = self.method.rsplit('.', 1)
478 479 locs['method'] = getattr(importlib.import_module(module), method)
479 outhash = bb.utils.better_eval('method(path, sigfile, task, d)', locs) 480 outhash = bb.utils.better_eval('method(path, sigfile, task, d)', locs)
481 else:
482 outhash = bb.utils.better_eval(self.method + '(path, sigfile, task, d)', locs)
480 483
481 try: 484 try:
482 url = '%s/v1/equivalent' % self.server 485 url = '%s/v1/equivalent' % self.server
@@ -527,6 +530,18 @@ class SignatureGeneratorUniHashMixIn(object):
527 except OSError: 530 except OSError:
528 pass 531 pass
529 532
533
534#
535# Dummy class used for bitbake-selftest
536#
537class SignatureGeneratorTestEquivHash(SignatureGeneratorUniHashMixIn, SignatureGeneratorBasicHash):
538 name = "TestEquivHash"
539 def init_rundepcheck(self, data):
540 super().init_rundepcheck(data)
541 self.server = "http://" + data.getVar('BB_HASHSERVE')
542 self.method = "sstate_output_hash"
543
544
530def dump_this_task(outfile, d): 545def dump_this_task(outfile, d):
531 import bb.parse 546 import bb.parse
532 fn = d.getVar("BB_FILENAME") 547 fn = d.getVar("BB_FILENAME")