From ca6cc9fa529c207a761e3cd5d2b09dc658ed45dc Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 24 Sep 2019 18:17:22 +0100 Subject: oeqa/selftest/signing: Fix for hash equivlance server There were two issues with the test one is that an equivalent hash could come from the server meaning the signature didn't change when it should. A uuid string is injected to ensure this does not happen. If there were multiple warnings the test would also fail as only the first is prefixed with WARNING. Tweak the string to avoid that failure mode. (From OE-Core rev: e58eaf5b8c93521dc311b77593e0dd7debca602d) Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/signing.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'meta/lib/oeqa/selftest') diff --git a/meta/lib/oeqa/selftest/cases/signing.py b/meta/lib/oeqa/selftest/cases/signing.py index b390f37d8e..5c4e01b2c3 100644 --- a/meta/lib/oeqa/selftest/cases/signing.py +++ b/meta/lib/oeqa/selftest/cases/signing.py @@ -180,6 +180,8 @@ class LockedSignatures(OESelftestTestCase): AutomatedBy: Daniel Istrate """ + import uuid + test_recipe = 'ed' locked_sigs_file = 'locked-sigs.inc' @@ -197,9 +199,10 @@ class LockedSignatures(OESelftestTestCase): bitbake(test_recipe) # Make a change that should cause the locked task signature to change + # Use uuid so hash equivalance server isn't triggered recipe_append_file = test_recipe + '_' + get_bb_var('PV', test_recipe) + '.bbappend' recipe_append_path = os.path.join(self.testlayer_path, 'recipes-test', test_recipe, recipe_append_file) - feature = 'SUMMARY += "test locked signature"\n' + feature = 'SUMMARY_${PN} = "test locked signature%s"\n' % uuid.uuid4() os.mkdir(os.path.join(self.testlayer_path, 'recipes-test', test_recipe)) write_file(recipe_append_path, feature) @@ -210,7 +213,7 @@ class LockedSignatures(OESelftestTestCase): ret = bitbake(test_recipe) # Verify you get the warning and that the real task *isn't* run (i.e. the locked signature has worked) - patt = r'WARNING: The %s:do_package sig is computed to be \S+, but the sig is locked to \S+ in SIGGEN_LOCKEDSIGS\S+' % test_recipe + patt = r'The %s:do_package sig is computed to be \S+, but the sig is locked to \S+ in SIGGEN_LOCKEDSIGS\S+' % test_recipe found_warn = re.search(patt, ret.output) self.assertIsNotNone(found_warn, "Didn't find the expected warning message. Output: %s" % ret.output) -- cgit v1.2.3-54-g00ecf