diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-24 18:17:22 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-30 16:55:21 +0100 |
commit | ca6cc9fa529c207a761e3cd5d2b09dc658ed45dc (patch) | |
tree | 35ed5d4f13d2d9bef5adb692410e0411e4774561 /meta/lib | |
parent | c92aca546ea9c0c4b36b9e39619df14d3b803f88 (diff) | |
download | poky-ca6cc9fa529c207a761e3cd5d2b09dc658ed45dc.tar.gz |
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/signing.py | 7 |
1 files changed, 5 insertions, 2 deletions
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): | |||
180 | AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> | 180 | AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> |
181 | """ | 181 | """ |
182 | 182 | ||
183 | import uuid | ||
184 | |||
183 | test_recipe = 'ed' | 185 | test_recipe = 'ed' |
184 | locked_sigs_file = 'locked-sigs.inc' | 186 | locked_sigs_file = 'locked-sigs.inc' |
185 | 187 | ||
@@ -197,9 +199,10 @@ class LockedSignatures(OESelftestTestCase): | |||
197 | bitbake(test_recipe) | 199 | bitbake(test_recipe) |
198 | 200 | ||
199 | # Make a change that should cause the locked task signature to change | 201 | # Make a change that should cause the locked task signature to change |
202 | # Use uuid so hash equivalance server isn't triggered | ||
200 | recipe_append_file = test_recipe + '_' + get_bb_var('PV', test_recipe) + '.bbappend' | 203 | recipe_append_file = test_recipe + '_' + get_bb_var('PV', test_recipe) + '.bbappend' |
201 | recipe_append_path = os.path.join(self.testlayer_path, 'recipes-test', test_recipe, recipe_append_file) | 204 | recipe_append_path = os.path.join(self.testlayer_path, 'recipes-test', test_recipe, recipe_append_file) |
202 | feature = 'SUMMARY += "test locked signature"\n' | 205 | feature = 'SUMMARY_${PN} = "test locked signature%s"\n' % uuid.uuid4() |
203 | 206 | ||
204 | os.mkdir(os.path.join(self.testlayer_path, 'recipes-test', test_recipe)) | 207 | os.mkdir(os.path.join(self.testlayer_path, 'recipes-test', test_recipe)) |
205 | write_file(recipe_append_path, feature) | 208 | write_file(recipe_append_path, feature) |
@@ -210,7 +213,7 @@ class LockedSignatures(OESelftestTestCase): | |||
210 | ret = bitbake(test_recipe) | 213 | ret = bitbake(test_recipe) |
211 | 214 | ||
212 | # Verify you get the warning and that the real task *isn't* run (i.e. the locked signature has worked) | 215 | # Verify you get the warning and that the real task *isn't* run (i.e. the locked signature has worked) |
213 | 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 | 216 | 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 |
214 | found_warn = re.search(patt, ret.output) | 217 | found_warn = re.search(patt, ret.output) |
215 | 218 | ||
216 | self.assertIsNotNone(found_warn, "Didn't find the expected warning message. Output: %s" % ret.output) | 219 | self.assertIsNotNone(found_warn, "Didn't find the expected warning message. Output: %s" % ret.output) |