diff options
Diffstat (limited to 'import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py')
-rw-r--r-- | import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py | 75 |
1 files changed, 56 insertions, 19 deletions
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py index acaf405ac..6642539eb 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py @@ -237,6 +237,7 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash" BUILD_ARCH = "x86_64" BUILD_OS = "linux" SDKMACHINE = "x86_64" +PACKAGE_CLASSES = "package_rpm package_ipk package_deb" """) self.track_for_cleanup(topdir + "/tmp-sstatesamehash") bitbake("core-image-sato -S none") @@ -246,6 +247,7 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash2" BUILD_ARCH = "i686" BUILD_OS = "linux" SDKMACHINE = "i686" +PACKAGE_CLASSES = "package_rpm package_ipk package_deb" """) self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") bitbake("core-image-sato -S none") @@ -264,7 +266,7 @@ SDKMACHINE = "i686" files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash").replace("i686-linux", "x86_64-linux").replace("i686" + targetvendor + "-linux", "x86_64" + targetvendor + "-linux", ) for x in files2] self.maxDiff = None - self.assertItemsEqual(files1, files2) + self.assertCountEqual(files1, files2) @testcase(1271) @@ -298,7 +300,7 @@ NATIVELSBSTRING = \"DistroB\" files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] self.maxDiff = None - self.assertItemsEqual(files1, files2) + self.assertCountEqual(files1, files2) @testcase(1368) def test_sstate_allarch_samesigs(self): @@ -309,19 +311,48 @@ NATIVELSBSTRING = \"DistroB\" the two MACHINE values. """ + configA = """ +TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" +MACHINE = \"qemux86-64\" +""" + configB = """ +TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" +MACHINE = \"qemuarm\" +""" + self.sstate_allarch_samesigs(configA, configB) + + def test_sstate_allarch_samesigs_multilib(self): + """ + The sstate checksums of allarch multilib packages should be independent of whichever + MACHINE is set. Check this using bitbake -S. + Also, rather than duplicate the test, check nativesdk stamps are the same between + the two MACHINE values. + """ + + configA = """ +TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" +MACHINE = \"qemux86-64\" +require conf/multilib.conf +MULTILIBS = \"multilib:lib32\" +DEFAULTTUNE_virtclass-multilib-lib32 = \"x86\" +""" + configB = """ +TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" +MACHINE = \"qemuarm\" +require conf/multilib.conf +MULTILIBS = \"\" +""" + self.sstate_allarch_samesigs(configA, configB) + + def sstate_allarch_samesigs(self, configA, configB): + topdir = get_bb_var('TOPDIR') targetos = get_bb_var('TARGET_OS') targetvendor = get_bb_var('TARGET_VENDOR') - self.write_config(""" -TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" -MACHINE = \"qemux86\" -""") + self.write_config(configA) self.track_for_cleanup(topdir + "/tmp-sstatesamehash") bitbake("world meta-toolchain -S none") - self.write_config(""" -TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" -MACHINE = \"qemuarm\" -""") + self.write_config(configB) self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") bitbake("world meta-toolchain -S none") @@ -393,7 +424,7 @@ DEFAULTTUNE_virtclass-multilib-lib32 = "x86" files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps") files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] self.maxDiff = None - self.assertItemsEqual(files1, files2) + self.assertCountEqual(files1, files2) def test_sstate_noop_samesigs(self): @@ -411,9 +442,11 @@ PARALLEL_MAKE = "-j 1" DL_DIR = "${TOPDIR}/download1" TIME = "111111" DATE = "20161111" -INHERIT_remove = "buildstats-summary buildhistory" +INHERIT_remove = "buildstats-summary buildhistory uninative" +http_proxy = "" """) self.track_for_cleanup(topdir + "/tmp-sstatesamehash") + self.track_for_cleanup(topdir + "/download1") bitbake("world meta-toolchain -S none") self.write_config(""" TMPDIR = "${TOPDIR}/tmp-sstatesamehash2" @@ -422,9 +455,13 @@ PARALLEL_MAKE = "-j 2" DL_DIR = "${TOPDIR}/download2" TIME = "222222" DATE = "20161212" +# Always remove uninative as we're changing proxies +INHERIT_remove = "uninative" INHERIT += "buildstats-summary buildhistory" +http_proxy = "http://example.com/" """) self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") + self.track_for_cleanup(topdir + "/download2") bitbake("world meta-toolchain -S none") def get_files(d): @@ -439,23 +476,23 @@ INHERIT += "buildstats-summary buildhistory" files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/") files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") # Remove items that are identical in both sets - for k,v in files1.viewitems() & files2.viewitems(): + for k,v in files1.items() & files2.items(): del files1[k] del files2[k] if not files1 and not files2: # No changes, so we're done return - for k in files1.viewkeys() | files2.viewkeys(): + for k in files1.keys() | files2.keys(): if k in files1 and k in files2: - print "%s differs:" % k - print subprocess.check_output(("bitbake-diffsigs", + print("%s differs:" % k) + print(subprocess.check_output(("bitbake-diffsigs", topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k], - topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k])) + topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]))) elif k in files1 and k not in files2: - print "%s in files1" % k + print("%s in files1" % k) elif k not in files1 and k in files2: - print "%s in files2" % k + print("%s in files2" % k) else: assert "shouldn't reach here" self.fail("sstate hashes not identical.") |