summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-11-09 18:07:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-24 15:55:41 +0000
commita6c68d85a9584e9d6e92f8479146283aa1fafafe (patch)
tree698197eceb593de7f4f00e2a735dbae669a92caa
parent92328b43bcda730839bdfbf7fa8ac5171d784868 (diff)
downloadpoky-a6c68d85a9584e9d6e92f8479146283aa1fafafe.tar.gz
oeqa/selftest/sstatetests: prettier output for allarch test
Instead of creating two lists of full paths and comparing them which in failure produces a list of every stamp file (so all tasks, twice), reduce the filename down to a recipe/task->hash dictionary and compare those, meaning unittest shows the differences in the dictionaries. In the future get_files() should be generalised so all tests in this class can use it, and find a pair of hashes that don't match and run diffsigs on them. (From OE-Core rev: b612628081b81b50965ae9454df4b2747c6997b2) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/sstatetests.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index 3c230620ed..512cb4faa4 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -309,27 +309,27 @@ MACHINE = \"qemuarm\"
309 bitbake("world meta-toolchain -S none") 309 bitbake("world meta-toolchain -S none")
310 310
311 def get_files(d): 311 def get_files(d):
312 f = [] 312 f = {}
313 for root, dirs, files in os.walk(d): 313 for root, dirs, files in os.walk(d):
314 for name in files: 314 for name in files:
315 if "meta-environment" in root or "cross-canadian" in root: 315 if "meta-environment" in root or "cross-canadian" in root:
316 continue 316 continue
317 if "do_build" not in name: 317 if "do_build" not in name:
318 f.append(os.path.join(root, name)) 318 # 1.4.1+gitAUTOINC+302fca9f4c-r0.do_package_write_ipk.sigdata.f3a2a38697da743f0dbed8b56aafcf79
319 (_, task, _, shash) = name.rsplit(".", 3)
320 f[os.path.join(os.path.basename(root), task)] = shash
319 return f 321 return f
320 files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/all" + targetvendor + "-" + targetos) 322 files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/all" + targetvendor + "-" + targetos)
321 files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/all" + targetvendor + "-" + targetos) 323 files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/all" + targetvendor + "-" + targetos)
322 files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
323 self.maxDiff = None 324 self.maxDiff = None
324 self.assertItemsEqual(files1, files2) 325 self.assertEqual(files1, files2)
325 326
326 nativesdkdir = os.path.basename(glob.glob(topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0]) 327 nativesdkdir = os.path.basename(glob.glob(topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0])
327 328
328 files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir) 329 files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir)
329 files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir) 330 files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir)
330 files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
331 self.maxDiff = None 331 self.maxDiff = None
332 self.assertItemsEqual(files1, files2) 332 self.assertEqual(files1, files2)
333 333
334 @testcase(1369) 334 @testcase(1369)
335 def test_sstate_sametune_samesigs(self): 335 def test_sstate_sametune_samesigs(self):