]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa: Add allarch sstate sig test
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Aug 2015 16:56:53 +0000 (17:56 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 30 Aug 2015 23:04:21 +0000 (00:04 +0100)
"allarch" targets should be MACHINE invariant. This means their sstate
signature should not change regardless of which MACHINE is built.

Errors keep creeping in around this area so automating this as part
of self test seems the best way to maintain this.

The "do_build" stamps are known to differ and are harmless so those
are excluded from the test.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/sstatetests.py

index 0a761671a0a8b9e308199ab64ab215353e9379c1..1ce8773ff7c59b2a155a6c068ba286c46391e099 100644 (file)
@@ -272,3 +272,37 @@ NATIVELSBSTRING = \"DistroB\"
         files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
         self.assertItemsEqual(files1, files2)
 
+    def test_sstate_allarch_samesigs(self):
+        """
+        The sstate checksums off allarch packages should be independent of whichever 
+        MACHINE is set. Check this using bitbake -S.
+        """
+
+        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.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+        bitbake("world -S none")
+        self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+MACHINE = \"qemuarm\"
+""")
+        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+        bitbake("world -S none")
+
+        def get_files(d):
+            f = []
+            for root, dirs, files in os.walk(d):
+                for name in files:
+                    if "do_build" not in name:
+                        f.append(os.path.join(root, name))
+            return f
+        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/all" + targetvendor + "-" + targetos)
+        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/all" + targetvendor + "-" + targetos)
+        files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
+        self.maxDiff = None
+        self.assertItemsEqual(files1, files2)