summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-16 21:53:01 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-18 09:05:30 +0100
commit4727384a74c9e7e8a909db7899643a49bbe74f6a (patch)
tree8b5c80ecfdde1923c5b80eb8f4a97204c94a0e4b
parent56b2c53ef03a5be39c2a859518fdd26d5dbdd53a (diff)
downloadpoky-4727384a74c9e7e8a909db7899643a49bbe74f6a.tar.gz
oeqa/sstatetests: Add test for nativesdk stamp invariance with MACHINE
nativesdk-glbic should not rebuild when you change MACHINE but it was. We've fixed that, now add tests to ensure this doesn't happen again. Rather than add yet another stamps test, extend one of the existing ones to cover this instead. (From OE-Core rev: e55b3d88e7a9138f518301a7217f74ba98e979aa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/sstatetests.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index 6906b21237..c4efc47fe4 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -3,6 +3,7 @@ import unittest
3import os 3import os
4import re 4import re
5import shutil 5import shutil
6import glob
6 7
7import oeqa.utils.ftools as ftools 8import oeqa.utils.ftools as ftools
8from oeqa.selftest.base import oeSelfTest 9from oeqa.selftest.base import oeSelfTest
@@ -276,6 +277,8 @@ NATIVELSBSTRING = \"DistroB\"
276 """ 277 """
277 The sstate checksums off allarch packages should be independent of whichever 278 The sstate checksums off allarch packages should be independent of whichever
278 MACHINE is set. Check this using bitbake -S. 279 MACHINE is set. Check this using bitbake -S.
280 Also, rather than duplicate the test, check nativesdk stamps are the same between
281 the two MACHINE values.
279 """ 282 """
280 283
281 topdir = get_bb_var('TOPDIR') 284 topdir = get_bb_var('TOPDIR')
@@ -286,18 +289,20 @@ TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
286MACHINE = \"qemux86\" 289MACHINE = \"qemux86\"
287""") 290""")
288 self.track_for_cleanup(topdir + "/tmp-sstatesamehash") 291 self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
289 bitbake("world -S none") 292 bitbake("world meta-toolchain -S none")
290 self.write_config(""" 293 self.write_config("""
291TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" 294TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
292MACHINE = \"qemuarm\" 295MACHINE = \"qemuarm\"
293""") 296""")
294 self.track_for_cleanup(topdir + "/tmp-sstatesamehash2") 297 self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
295 bitbake("world -S none") 298 bitbake("world meta-toolchain -S none")
296 299
297 def get_files(d): 300 def get_files(d):
298 f = [] 301 f = []
299 for root, dirs, files in os.walk(d): 302 for root, dirs, files in os.walk(d):
300 for name in files: 303 for name in files:
304 if "meta-environment" in root or "cross-canadian" in root:
305 continue
301 if "do_build" not in name: 306 if "do_build" not in name:
302 f.append(os.path.join(root, name)) 307 f.append(os.path.join(root, name))
303 return f 308 return f
@@ -306,3 +311,12 @@ MACHINE = \"qemuarm\"
306 files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2] 311 files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
307 self.maxDiff = None 312 self.maxDiff = None
308 self.assertItemsEqual(files1, files2) 313 self.assertItemsEqual(files1, files2)
314
315 nativesdkdir = os.path.basename(glob.glob(topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0])
316
317 files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir)
318 files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir)
319 files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
320 self.maxDiff = None
321 self.assertItemsEqual(files1, files2)
322