diff options
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sstatetests.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py index c5beb4de39..2be96f1781 100644 --- a/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py | |||
@@ -11,6 +11,7 @@ import tempfile | |||
11 | from oeqa.selftest.case import OESelftestTestCase | 11 | from oeqa.selftest.case import OESelftestTestCase |
12 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer, create_temp_layer | 12 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer, create_temp_layer |
13 | from oeqa.selftest.cases.sstate import SStateBase | 13 | from oeqa.selftest.cases.sstate import SStateBase |
14 | import oe | ||
14 | 15 | ||
15 | import bb.siggen | 16 | import bb.siggen |
16 | 17 | ||
@@ -573,3 +574,44 @@ BB_SIGNATURE_HANDLER = "OEBasicHash" | |||
573 | compare_sigfiles(rest, files1, files2, compare=False) | 574 | compare_sigfiles(rest, files1, files2, compare=False) |
574 | 575 | ||
575 | self.fail("sstate hashes not identical.") | 576 | self.fail("sstate hashes not identical.") |
577 | |||
578 | def test_sstate_movelayer_samesigs(self): | ||
579 | """ | ||
580 | The sstate checksums of two builds with the same oe-core layer in two | ||
581 | different locations should be the same. | ||
582 | """ | ||
583 | core_layer = os.path.join( | ||
584 | self.tc.td["COREBASE"], 'meta') | ||
585 | copy_layer_1 = self.topdir + "/meta-copy1/meta" | ||
586 | copy_layer_2 = self.topdir + "/meta-copy2/meta" | ||
587 | |||
588 | oe.path.copytree(core_layer, copy_layer_1) | ||
589 | self.write_config(""" | ||
590 | TMPDIR = "${TOPDIR}/tmp-sstatesamehash" | ||
591 | """) | ||
592 | bblayers_conf = 'BBLAYERS += "%s"\nBBLAYERS:remove = "%s"' % (copy_layer_1, core_layer) | ||
593 | self.write_bblayers_config(bblayers_conf) | ||
594 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash") | ||
595 | bitbake("bash -S none") | ||
596 | |||
597 | oe.path.copytree(core_layer, copy_layer_2) | ||
598 | self.write_config(""" | ||
599 | TMPDIR = "${TOPDIR}/tmp-sstatesamehash2" | ||
600 | """) | ||
601 | bblayers_conf = 'BBLAYERS += "%s"\nBBLAYERS:remove = "%s"' % (copy_layer_2, core_layer) | ||
602 | self.write_bblayers_config(bblayers_conf) | ||
603 | self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2") | ||
604 | bitbake("bash -S none") | ||
605 | |||
606 | def get_files(d): | ||
607 | f = [] | ||
608 | for root, dirs, files in os.walk(d): | ||
609 | for name in files: | ||
610 | f.append(os.path.join(root, name)) | ||
611 | return f | ||
612 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps") | ||
613 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps") | ||
614 | files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] | ||
615 | self.maxDiff = None | ||
616 | self.assertCountEqual(files1, files2) | ||
617 | |||