summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-10 14:07:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-12 22:53:18 +0100
commit2da156d491caf25dfa3efd567d6dbb451dd7e9dc (patch)
tree1047b898b7ad6da60c17b6fe43e74ccad2fa7c3f
parentc9821a56da9c6e341408ea21e0d8a4cc5291dba6 (diff)
downloadopenembedded-core-contrib-2da156d491caf25dfa3efd567d6dbb451dd7e9dc.tar.gz
openembedded-core-contrib-2da156d491caf25dfa3efd567d6dbb451dd7e9dc.tar.bz2
openembedded-core-contrib-2da156d491caf25dfa3efd567d6dbb451dd7e9dc.zip
oeqa/sstatetests: Add NATIVELSB sstate signature equivalence test
The sstate checksums should be independent of whichever NATIVELSBSTRING is detected. Add an automated QA test which tests this using bitbake -S. To make this possible, we need to be able to override the value of NATIVELSBSTRING so make a small change to allow this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass3
-rw-r--r--meta/lib/oeqa/selftest/sstatetests.py34
2 files changed, 36 insertions, 1 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 56fe5f2122..fe803f1836 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -210,7 +210,8 @@ addhandler base_eventhandler
base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise"
python base_eventhandler() {
if isinstance(e, bb.event.ConfigParsed):
- e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
+ if not e.data.getVar("NATIVELSBSTRING", False):
+ e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
e.data.setVar('BB_VERSION', bb.__version__)
pkgarch_mapping(e.data)
oe.utils.features_backfill("DISTRO_FEATURES", e.data)
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index 6281d50066..9258b53210 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -237,3 +237,37 @@ BUILD_OS = \"linux\"
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.assertItemsEqual(files1, files2)
+
+
+ def test_sstate_nativelsbstring_same_hash(self):
+ """
+ The sstate checksums should be independent of whichever NATIVELSBSTRING is
+ detected. Rather than requiring two different build machines and running
+ builds, override the variables manually and check using bitbake -S.
+ """
+
+ topdir = get_bb_var('TOPDIR')
+ targetvendor = get_bb_var('TARGET_VENDOR')
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+NATIVELSBSTRING = \"DistroA\"
+""")
+ self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+ bitbake("core-image-sato -S printdiff", ignore_status=True)
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+NATIVELSBSTRING = \"DistroB\"
+""")
+ self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+ bitbake("core-image-sato -S printdiff", ignore_status=True)
+
+ def get_files(d):
+ f = []
+ for root, dirs, files in os.walk(d):
+ f.extend(os.path.join(root, name) for name in files)
+ return f
+ files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
+ files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
+ files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
+ self.assertItemsEqual(files1, files2)
+