]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
selftest/SStatePrintdiff: ensure all base signatures are present in sstate in test_im...
authorAlexander Kanavin <alex.kanavin@gmail.com>
Wed, 10 Jan 2024 10:44:59 +0000 (11:44 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 12 Jan 2024 11:51:18 +0000 (11:51 +0000)
The test relies on all tasks in the dependency tree of the tasks being changed
having valid signatures in sstate, so that the recursive discovery of the
base invalid tasks stops there, and doesn't go further.

This may not always occur, particularly when hash equivalency combined with
different build host architectures prevents them from getting created in regular builds:
https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/2725/steps/15/logs/stdio

The other two tests (that change specific recipes) already ensure this, but
this test (which changes a basic task definition) does not.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/sstatetests.py

index 6a6c2e5f11a9013e94739abb100ce49c82466879..f763228645064166531e3c300553ef31c618d588 100644 (file)
@@ -797,13 +797,14 @@ TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-difftmp-{}"
         for item in expected_difftmp_output:
             self.assertIn(item, result_difftmp.output, msg = "Item {} not found in output:\n{}".format(item, result_difftmp.output))
 
-    def run_test_printdiff_changeconfig(self, target, change_content, expected_sametmp_output, expected_difftmp_output):
+    def run_test_printdiff_changeconfig(self, target, change_bbtasks, change_content, expected_sametmp_output, expected_difftmp_output):
         import time
         self.write_config("""
 TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-sametmp-{}"
 """.format(time.time()))
         bitbake("--runall build --runall deploy_source_date_epoch {}".format(target))
         bitbake("-S none {}".format(target))
+        bitbake(" ".join(change_bbtasks))
         self.append_config(change_content)
         result_sametmp = bitbake("-S printdiff {}".format(target))
 
@@ -859,24 +860,27 @@ expected_sametmp_output, expected_difftmp_output)
 
     # Check if changing a really base task definiton is reported against multiple core recipes using it
     def test_image_minimal_vs_base_do_configure(self):
-        expected_output = ("Task zstd-native:do_configure couldn't be used from the cache because:",
-"Task texinfo-dummy-native:do_configure couldn't be used from the cache because:",
-"Task ldconfig-native:do_configure couldn't be used from the cache because:",
-"Task gettext-minimal-native:do_configure couldn't be used from the cache because:",
-"Task tzcode-native:do_configure couldn't be used from the cache because:",
-"Task makedevs-native:do_configure couldn't be used from the cache because:",
-"Task pigz-native:do_configure couldn't be used from the cache because:",
-"Task update-rc.d-native:do_configure couldn't be used from the cache because:",
-"Task unzip-native:do_configure couldn't be used from the cache because:",
-"Task gnu-config-native:do_configure couldn't be used from the cache because:",
+        change_bbtasks = ('zstd-native:do_configure',
+'texinfo-dummy-native:do_configure',
+'ldconfig-native:do_configure',
+'gettext-minimal-native:do_configure',
+'tzcode-native:do_configure',
+'makedevs-native:do_configure',
+'pigz-native:do_configure',
+'update-rc.d-native:do_configure',
+'unzip-native:do_configure',
+'gnu-config-native:do_configure')
+
+        expected_output = ["Task {} couldn't be used from the cache because:".format(t) for t in change_bbtasks] + [
 "We need hash",
-"most recent matching task was")
-        expected_sametmp_output = expected_output + (
+"most recent matching task was"]
+
+        expected_sametmp_output = expected_output + [
 "Variable base_do_configure value changed",
-'+     echo "this changes base_do_configure() definiton "')
+'+     echo "this changes base_do_configure() definiton "']
         expected_difftmp_output = expected_output
 
-        self.run_test_printdiff_changeconfig("core-image-minimal",
+        self.run_test_printdiff_changeconfig("core-image-minimal",change_bbtasks,
 """
 INHERIT += "base-do-configure-modified"
 """,