]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstatetests: Use python function instead of bitbake-diffsigs script
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Mon, 7 Aug 2017 21:33:50 +0000 (14:33 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Aug 2017 11:53:02 +0000 (12:53 +0100)
Using a python function instead of launching a subprocess fasten the
diffsigs computation.

[YOCTO #11651]

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/sstatetests.py

index 07a206824aaf403297e75a925791067020fba410..0b36027918ba53b4641e33fe3816d854552d0583 100644 (file)
@@ -8,6 +8,8 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
 from oeqa.selftest.cases.sstate import SStateBase
 from oeqa.core.decorator.oeid import OETestID
 
+import bb.siggen
+
 class SStateTests(SStateBase):
 
     # Test sstate files creation and their location
@@ -469,9 +471,11 @@ http_proxy = "http://example.com/"
         for k in files1.keys() | files2.keys():
             if k in files1 and k in files2:
                 print("%s differs:" % k)
-                print(subprocess.check_output(("bitbake-diffsigs",
-                                               self.topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k],
-                                               self.topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k])))
+                sigdatafile1 = self.topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k]
+                sigdatafile2 = self.topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]
+                output = bb.siggen.compare_sigfiles(sigdatafile1, sigdatafile2)
+                if output:
+                    print('\n'.join(output))
             elif k in files1 and k not in files2:
                 print("%s in files1" % k)
             elif k not in files1 and k in files2: