selftest/sstatetests: separate sstate presence check into its own class

This allows reusing the check function in tests other than CDN/local mirror
ones, such as sstate bundle testing.

(From OE-Core rev: 8a4ab4c063f307b480d98c6aac1e76cde0b9e99e)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2024-05-07 13:46:27 +02:00
committed by Richard Purdie
parent 11762e4dc3
commit c149c74605

View File

@@ -917,8 +917,7 @@ INHERIT += "base-do-configure-modified"
""",
expected_sametmp_output, expected_difftmp_output)
@OETestTag("yocto-mirrors")
class SStateMirrors(SStateBase):
class SStateCheckObjectPresence(SStateBase):
def check_bb_output(self, output, exceptions, check_cdn):
def is_exception(object, exceptions):
for e in exceptions:
@@ -960,6 +959,8 @@ class SStateMirrors(SStateBase):
self.assertEqual(len(failed_urls), missing_objects, "Amount of reported missing objects does not match failed URLs: {}\nFailed URLs:\n{}\nFetcher diagnostics:\n{}".format(missing_objects, "\n".join(failed_urls), "\n".join(failed_urls_extrainfo)))
self.assertEqual(len(failed_urls), 0, "Missing objects in the cache:\n{}\nFetcher diagnostics:\n{}".format("\n".join(failed_urls), "\n".join(failed_urls_extrainfo)))
@OETestTag("yocto-mirrors")
class SStateMirrors(SStateCheckObjectPresence):
def run_test(self, machine, targets, exceptions, check_cdn = True, ignore_errors = False):
# sstate is checked for existence of these, but they never get written out to begin with
exceptions += ["{}.*image_qa".format(t) for t in targets.split()]