diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-10 14:07:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-12 22:55:38 +0100 |
commit | e9817d59d322b4a942341ecd3d0099f817537998 (patch) | |
tree | 8104e60b80e72fd01cf27619a029d2c98701546c /meta/lib | |
parent | ee69463f4e2e4f6eac86385e36edda2fccbae7fd (diff) | |
download | poky-e9817d59d322b4a942341ecd3d0099f817537998.tar.gz |
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.
(From OE-Core rev: 2da156d491caf25dfa3efd567d6dbb451dd7e9dc)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/sstatetests.py | 34 |
1 files changed, 34 insertions, 0 deletions
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\" | |||
237 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") | 237 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") |
238 | 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] | 238 | 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] |
239 | self.assertItemsEqual(files1, files2) | 239 | self.assertItemsEqual(files1, files2) |
240 | |||
241 | |||
242 | def test_sstate_nativelsbstring_same_hash(self): | ||
243 | """ | ||
244 | The sstate checksums should be independent of whichever NATIVELSBSTRING is | ||
245 | detected. Rather than requiring two different build machines and running | ||
246 | builds, override the variables manually and check using bitbake -S. | ||
247 | """ | ||
248 | |||
249 | topdir = get_bb_var('TOPDIR') | ||
250 | targetvendor = get_bb_var('TARGET_VENDOR') | ||
251 | self.write_config(""" | ||
252 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" | ||
253 | NATIVELSBSTRING = \"DistroA\" | ||
254 | """) | ||
255 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash") | ||
256 | bitbake("core-image-sato -S printdiff", ignore_status=True) | ||
257 | self.write_config(""" | ||
258 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" | ||
259 | NATIVELSBSTRING = \"DistroB\" | ||
260 | """) | ||
261 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") | ||
262 | bitbake("core-image-sato -S printdiff", ignore_status=True) | ||
263 | |||
264 | def get_files(d): | ||
265 | f = [] | ||
266 | for root, dirs, files in os.walk(d): | ||
267 | f.extend(os.path.join(root, name) for name in files) | ||
268 | return f | ||
269 | files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/") | ||
270 | files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") | ||
271 | files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] | ||
272 | self.assertItemsEqual(files1, files2) | ||
273 | |||