summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2023-12-18 09:43:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-05 11:59:08 +0000
commitc45ffa9e9489956444cfe0189aea34af883656c4 (patch)
treee40cecca8540dae8f9d6c2c13141c7904c38ee68 /meta/lib/oeqa/selftest/cases
parent71c0d311baad6874c7c832fa3334a238a99cc661 (diff)
downloadpoky-c45ffa9e9489956444cfe0189aea34af883656c4.tar.gz
sstatesig/find_siginfo: unify a disjointed API
find_siginfo() returns two different data structures depending on whether its third argument (list of hashes to find) is empty or not: - a dict of timestamps keyed by path - a dict of paths keyed by hash This is not a good API design; it's much better to return a dict of dicts that include both timestamp and path, keyed by hash. Then the API consumer can decide how they want to use these fields, particularly for additional diagnostics or informational output. I also took the opportunity to add a binary field that tells if the match came from sstate or local stamps dir, which will help prioritize local stamps when looking up most recent task signatures. (From OE-Core rev: 8721c52041e910bd4d8a9235b52f274f4f02c8a3) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r--meta/lib/oeqa/selftest/cases/sstatetests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index 9eecb4381b..393eaf6339 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -761,14 +761,14 @@ addtask tmptask2 before do_tmptask1
761 hashes = [hash1, hash2] 761 hashes = [hash1, hash2]
762 hashfiles = find_siginfo(key, None, hashes) 762 hashfiles = find_siginfo(key, None, hashes)
763 self.assertCountEqual(hashes, hashfiles) 763 self.assertCountEqual(hashes, hashfiles)
764 bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb) 764 bb.siggen.compare_sigfiles(hashfiles[hash1]['path'], hashfiles[hash2]['path'], recursecb)
765 765
766 for pn in pns: 766 for pn in pns:
767 recursecb_count = 0 767 recursecb_count = 0
768 filedates = find_siginfo(pn, "do_tmptask1") 768 matches = find_siginfo(pn, "do_tmptask1")
769 self.assertGreaterEqual(len(filedates), 2) 769 self.assertGreaterEqual(len(matches), 2)
770 latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-2:] 770 latesthashes = sorted(matches.keys(), key=lambda h: matches[h]['time'])[-2:]
771 bb.siggen.compare_sigfiles(latestfiles[-2], latestfiles[-1], recursecb) 771 bb.siggen.compare_sigfiles(matches[latesthashes[-2]]['path'], matches[latesthashes[-1]]['path'], recursecb)
772 self.assertEqual(recursecb_count,1) 772 self.assertEqual(recursecb_count,1)
773 773
774class SStatePrintdiff(SStateBase): 774class SStatePrintdiff(SStateBase):