summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-04-11 18:33:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-12 22:50:21 +0100
commit85dbd7bf9e4b6eccdbb8102e462dd681240c1c57 (patch)
tree2480c9f62b2cd18484a359e0a2e91925d3e4cdde /meta/lib/oeqa/selftest
parent57be6dddeb6ef24ad429fd7a10b1a059bc31743a (diff)
downloadpoky-85dbd7bf9e4b6eccdbb8102e462dd681240c1c57.tar.gz
oeqa/selftest/sstatetests: split 32/64 build host from no-op action tests
As more variables were being added it made sense to split this test into two: one quick test that verifies that the host being 32-bit or 64-bit doesn't impact the hashes, and another which compares stamps for two builds with several variables changed and classes inherited. (From OE-Core rev: d29ede773fc94da5ff932e0cd306295a8d3871a3) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/sstatetests.py80
1 files changed, 68 insertions, 12 deletions
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index c02d16dbc9..d41b1d3a76 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -4,6 +4,7 @@ import os
4import re 4import re
5import shutil 5import shutil
6import glob 6import glob
7import subprocess
7 8
8import oeqa.utils.ftools as ftools 9import oeqa.utils.ftools as ftools
9from oeqa.selftest.base import oeSelfTest 10from oeqa.selftest.base import oeSelfTest
@@ -226,9 +227,6 @@ class SStateTests(SStateBase):
226 they're built on a 32 or 64 bit system. Rather than requiring two different 227 they're built on a 32 or 64 bit system. Rather than requiring two different
227 build machines and running a builds, override the variables calling uname() 228 build machines and running a builds, override the variables calling uname()
228 manually and check using bitbake -S. 229 manually and check using bitbake -S.
229
230 Also check that SDKMACHINE and PARALLEL_MAKE changing doesn't change any
231 of these stamps.
232 """ 230 """
233 231
234 topdir = get_bb_var('TOPDIR') 232 topdir = get_bb_var('TOPDIR')
@@ -239,9 +237,6 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
239BUILD_ARCH = "x86_64" 237BUILD_ARCH = "x86_64"
240BUILD_OS = "linux" 238BUILD_OS = "linux"
241SDKMACHINE = "x86_64" 239SDKMACHINE = "x86_64"
242PARALLEL_MAKE = "-j 1"
243DL_DIR = "${TOPDIR}/download1"
244TIME = "111111"
245""") 240""")
246 self.track_for_cleanup(topdir + "/tmp-sstatesamehash") 241 self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
247 bitbake("core-image-sato -S none") 242 bitbake("core-image-sato -S none")
@@ -251,9 +246,6 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
251BUILD_ARCH = "i686" 246BUILD_ARCH = "i686"
252BUILD_OS = "linux" 247BUILD_OS = "linux"
253SDKMACHINE = "i686" 248SDKMACHINE = "i686"
254PARALLEL_MAKE = "-j 2"
255DL_DIR = "${TOPDIR}/download2"
256TIME = "222222"
257""") 249""")
258 self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") 250 self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
259 bitbake("core-image-sato -S none") 251 bitbake("core-image-sato -S none")
@@ -279,7 +271,7 @@ TIME = "222222"
279 def test_sstate_nativelsbstring_same_hash(self): 271 def test_sstate_nativelsbstring_same_hash(self):
280 """ 272 """
281 The sstate checksums should be independent of whichever NATIVELSBSTRING is 273 The sstate checksums should be independent of whichever NATIVELSBSTRING is
282 detected. Rather than requiring two different build machines and running 274 detected. Rather than requiring two different build machines and running
283 builds, override the variables manually and check using bitbake -S. 275 builds, override the variables manually and check using bitbake -S.
284 """ 276 """
285 277
@@ -311,7 +303,7 @@ NATIVELSBSTRING = \"DistroB\"
311 @testcase(1368) 303 @testcase(1368)
312 def test_sstate_allarch_samesigs(self): 304 def test_sstate_allarch_samesigs(self):
313 """ 305 """
314 The sstate checksums of allarch packages should be independent of whichever 306 The sstate checksums of allarch packages should be independent of whichever
315 MACHINE is set. Check this using bitbake -S. 307 MACHINE is set. Check this using bitbake -S.
316 Also, rather than duplicate the test, check nativesdk stamps are the same between 308 Also, rather than duplicate the test, check nativesdk stamps are the same between
317 the two MACHINE values. 309 the two MACHINE values.
@@ -359,7 +351,7 @@ MACHINE = \"qemuarm\"
359 @testcase(1369) 351 @testcase(1369)
360 def test_sstate_sametune_samesigs(self): 352 def test_sstate_sametune_samesigs(self):
361 """ 353 """
362 The sstate checksums of two identical machines (using the same tune) should be the 354 The sstate checksums of two identical machines (using the same tune) should be the
363 same, apart from changes within the machine specific stamps directory. We use the 355 same, apart from changes within the machine specific stamps directory. We use the
364 qemux86copy machine to test this. Also include multilibs in the test. 356 qemux86copy machine to test this. Also include multilibs in the test.
365 """ 357 """
@@ -402,3 +394,67 @@ DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
402 files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] 394 files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
403 self.maxDiff = None 395 self.maxDiff = None
404 self.assertItemsEqual(files1, files2) 396 self.assertItemsEqual(files1, files2)
397
398
399 def test_sstate_noop_samesigs(self):
400 """
401 The sstate checksums of two builds with these variables changed or
402 classes inherits should be the same.
403 """
404
405 topdir = get_bb_var('TOPDIR')
406 targetvendor = get_bb_var('TARGET_VENDOR')
407 self.write_config("""
408TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
409BB_NUMBER_THREADS = "1"
410PARALLEL_MAKE = "-j 1"
411DL_DIR = "${TOPDIR}/download1"
412TIME = "111111"
413DATE = "20161111"
414""")
415 self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
416 bitbake("world meta-toolchain -S none")
417 self.write_config("""
418TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
419BB_NUMBER_THREADS = "2"
420PARALLEL_MAKE = "-j 2"
421DL_DIR = "${TOPDIR}/download2"
422TIME = "222222"
423DATE = "20161212"
424INHERIT += "buildstats-summary buildhistory"
425""")
426 self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
427 bitbake("world meta-toolchain -S none")
428
429 def get_files(d):
430 f = {}
431 for root, dirs, files in os.walk(d):
432 for name in files:
433 name, shash = name.rsplit('.', 1)
434 # Extract just the machine and recipe name
435 base = os.sep.join(root.rsplit(os.sep, 2)[-2:] + [name])
436 f[base] = shash
437 return f
438 files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
439 files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
440 # Remove items that are identical in both sets
441 for k,v in files1.viewitems() & files2.viewitems():
442 del files1[k]
443 del files2[k]
444 if not files1 and not files2:
445 # No changes, so we're done
446 return
447
448 for k in files1.viewkeys() | files2.viewkeys():
449 if k in files1 and k in files2:
450 print "%s differs:" % k
451 print subprocess.check_output(("bitbake-diffsigs",
452 topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k],
453 topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]))
454 elif k in files1 and k not in files2:
455 print "%s in files1" % k
456 elif k not in files1 and k in files2:
457 print "%s in files2" % k
458 else:
459 assert "shouldn't reach here"
460 self.fail("sstate hashes not identical.")