diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-08 12:56:13 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-09 18:00:17 +0100 |
commit | 9fa842addcbcd1fb6cd32df5b335a20a730a1610 (patch) | |
tree | 0d55ba989627b5d475cae19d29dd8ac23d7143db /meta/lib/oeqa | |
parent | 0aaa67a790ab211b35eed58173efa115ceb6e243 (diff) | |
download | poky-9fa842addcbcd1fb6cd32df5b335a20a730a1610.tar.gz |
oeqa/sstatetests: Add test for comparing 32 and 64 bit sstate checksums
The sstate checksums for both native and target should not vary whether
they're built on a 32 or 64 bit system. Rather than requiring two different
build machines and running a builds, override the variables calling uname()
manually and check using bitbake -S.
[YOCTO #5970]
(From OE-Core rev: da91637dd6991ae085ce82d932f1053d820b0cc4)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/sstatetests.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py index d578ddd489..6281d50066 100644 --- a/meta/lib/oeqa/selftest/sstatetests.py +++ b/meta/lib/oeqa/selftest/sstatetests.py | |||
@@ -202,3 +202,38 @@ class SStateTests(SStateBase): | |||
202 | global_config.append('MACHINE = "qemux86"') | 202 | global_config.append('MACHINE = "qemux86"') |
203 | target_config.append('') | 203 | target_config.append('') |
204 | self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) | 204 | self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) |
205 | |||
206 | def test_sstate_32_64_same_hash(self): | ||
207 | """ | ||
208 | The sstate checksums for both native and target should not vary whether | ||
209 | they're built on a 32 or 64 bit system. Rather than requiring two different | ||
210 | build machines and running a builds, override the variables calling uname() | ||
211 | manually and check using bitbake -S. | ||
212 | """ | ||
213 | |||
214 | topdir = get_bb_var('TOPDIR') | ||
215 | targetvendor = get_bb_var('TARGET_VENDOR') | ||
216 | self.write_config(""" | ||
217 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" | ||
218 | BUILD_ARCH = \"x86_64\" | ||
219 | BUILD_OS = \"linux\" | ||
220 | """) | ||
221 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash") | ||
222 | bitbake("core-image-sato -S printdiff", ignore_status=True) | ||
223 | self.write_config(""" | ||
224 | TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" | ||
225 | BUILD_ARCH = \"i686\" | ||
226 | BUILD_OS = \"linux\" | ||
227 | """) | ||
228 | self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") | ||
229 | bitbake("core-image-sato -S printdiff", ignore_status=True) | ||
230 | |||
231 | def get_files(d): | ||
232 | f = [] | ||
233 | for root, dirs, files in os.walk(d): | ||
234 | f.extend(os.path.join(root, name) for name in files) | ||
235 | return f | ||
236 | files1 = get_files(topdir + "/tmp-sstatesamehash/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] | ||
239 | self.assertItemsEqual(files1, files2) | ||