diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sstatetests.py | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py index 0b36027918..47900886a3 100644 --- a/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py | |||
@@ -458,6 +458,24 @@ http_proxy = "http://example.com/" | |||
458 | base = os.sep.join(root.rsplit(os.sep, 2)[-2:] + [name]) | 458 | base = os.sep.join(root.rsplit(os.sep, 2)[-2:] + [name]) |
459 | f[base] = shash | 459 | f[base] = shash |
460 | return f | 460 | return f |
461 | |||
462 | def compare_sigfiles(files, files1, files2, compare=False): | ||
463 | for k in files: | ||
464 | if k in files1 and k in files2: | ||
465 | print("%s differs:" % k) | ||
466 | if compare: | ||
467 | sigdatafile1 = self.topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k] | ||
468 | sigdatafile2 = self.topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k] | ||
469 | output = bb.siggen.compare_sigfiles(sigdatafile1, sigdatafile2) | ||
470 | if output: | ||
471 | print('\n'.join(output)) | ||
472 | elif k in files1 and k not in files2: | ||
473 | print("%s in files1" % k) | ||
474 | elif k not in files1 and k in files2: | ||
475 | print("%s in files2" % k) | ||
476 | else: | ||
477 | assert "shouldn't reach here" | ||
478 | |||
461 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/") | 479 | files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/") |
462 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/") | 480 | files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/") |
463 | # Remove items that are identical in both sets | 481 | # Remove items that are identical in both sets |
@@ -468,18 +486,11 @@ http_proxy = "http://example.com/" | |||
468 | # No changes, so we're done | 486 | # No changes, so we're done |
469 | return | 487 | return |
470 | 488 | ||
471 | for k in files1.keys() | files2.keys(): | 489 | files = list(files1.keys() | files2.keys()) |
472 | if k in files1 and k in files2: | 490 | # this is an expensive computation, thus just compare the first 'max_sigfiles_to_compare' k files |
473 | print("%s differs:" % k) | 491 | max_sigfiles_to_compare = 20 |
474 | sigdatafile1 = self.topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k] | 492 | first, rest = files[:max_sigfiles_to_compare], files[max_sigfiles_to_compare:] |
475 | sigdatafile2 = self.topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k] | 493 | compare_sigfiles(first, files1.keys(), files2.keys(), compare=True) |
476 | output = bb.siggen.compare_sigfiles(sigdatafile1, sigdatafile2) | 494 | compare_sigfiles(rest, files1.keys(), files2.keys(), compare=False) |
477 | if output: | 495 | |
478 | print('\n'.join(output)) | ||
479 | elif k in files1 and k not in files2: | ||
480 | print("%s in files1" % k) | ||
481 | elif k not in files1 and k in files2: | ||
482 | print("%s in files2" % k) | ||
483 | else: | ||
484 | assert "shouldn't reach here" | ||
485 | self.fail("sstate hashes not identical.") | 496 | self.fail("sstate hashes not identical.") |