All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oeqa/selftest/sstatetests: prettier output for allarch test
@ 2015-11-09 21:54 Ross Burton
  0 siblings, 0 replies; only message in thread
From: Ross Burton @ 2015-11-09 21:54 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/lib/oeqa/selftest/sstatetests.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index 3c23062..512cb4f 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -309,27 +309,27 @@ MACHINE = \"qemuarm\"
         bitbake("world meta-toolchain -S none")
 
         def get_files(d):
-            f = []
+            f = {}
             for root, dirs, files in os.walk(d):
                 for name in files:
                     if "meta-environment" in root or "cross-canadian" in root:
                         continue
                     if "do_build" not in name:
-                        f.append(os.path.join(root, name))
+                        # 1.4.1+gitAUTOINC+302fca9f4c-r0.do_package_write_ipk.sigdata.f3a2a38697da743f0dbed8b56aafcf79
+                        (_, task, _, shash) = name.rsplit(".", 3)
+                        f[os.path.join(os.path.basename(root), task)] = shash
             return f
         files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/all" + targetvendor + "-" + targetos)
         files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/all" + targetvendor + "-" + targetos)
-        files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
         self.maxDiff = None
-        self.assertItemsEqual(files1, files2)
+        self.assertEqual(files1, files2)
 
         nativesdkdir = os.path.basename(glob.glob(topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0])
 
         files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir)
         files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir)
-        files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
         self.maxDiff = None
-        self.assertItemsEqual(files1, files2)
+        self.assertEqual(files1, files2)
 
     @testcase(1369)
     def test_sstate_sametune_samesigs(self):
-- 
2.1.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-09 22:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-09 21:54 [PATCH] oeqa/selftest/sstatetests: prettier output for allarch test Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.