diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2023-10-27 14:50:19 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-31 11:12:33 +0000 |
commit | 3a7b408178439482d49d573113cc61a69fb28147 (patch) | |
tree | 75f594111b5fe4e3732a586f9eeda4872f67d1ac /meta/lib/oeqa/selftest/cases | |
parent | 6745d5eb7ccf73ffaf215b3cdc9181292a05e15f (diff) | |
download | poky-3a7b408178439482d49d573113cc61a69fb28147.tar.gz |
selftest/sstatetests: add a test for CDN sstate cache
Specifically, the test checks that everything needed for building
standard oe-core images for x86_64 and arm64 is available from
the cache (with minor exceptions). Going forward, a complete
world check could be enabled and additional configurations,
but that requires improvements to performance of hash equivalence
server in particular.
RP: I've disabled the tests by default so we can merge them. We will
make them live once we get to the bottom of the failures.
(From OE-Core rev: 5f3aeadb65d3b7216db783b2c500ac241b03deb8)
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.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py index b96eacc9ad..a6865a5ba7 100644 --- a/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py | |||
@@ -14,6 +14,7 @@ import re | |||
14 | 14 | ||
15 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, get_bb_vars | 15 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, get_bb_vars |
16 | from oeqa.selftest.case import OESelftestTestCase | 16 | from oeqa.selftest.case import OESelftestTestCase |
17 | from oeqa.core.decorator import OETestTag | ||
17 | 18 | ||
18 | import oe | 19 | import oe |
19 | import bb.siggen | 20 | import bb.siggen |
@@ -886,3 +887,50 @@ expected_sametmp_output, expected_difftmp_output) | |||
886 | INHERIT += "base-do-configure-modified" | 887 | INHERIT += "base-do-configure-modified" |
887 | """, | 888 | """, |
888 | expected_sametmp_output, expected_difftmp_output) | 889 | expected_sametmp_output, expected_difftmp_output) |
890 | |||
891 | @OETestTag("yocto-mirrors") | ||
892 | class SStateMirrors(SStateBase): | ||
893 | def check_bb_output(self, output, exceptions): | ||
894 | in_tasks = False | ||
895 | missing_objects = [] | ||
896 | checked_urls = [] | ||
897 | for l in output.splitlines(): | ||
898 | if "Testing URL" in l: | ||
899 | checked_urls.append(l.split()[3]) | ||
900 | if "The differences between the current build and any cached tasks start at the following tasks" in l: | ||
901 | in_tasks = True | ||
902 | continue | ||
903 | if "Writing task signature files" in l: | ||
904 | in_tasks = False | ||
905 | continue | ||
906 | if in_tasks: | ||
907 | recipe_task = l.split("/")[-1] | ||
908 | recipe, task = recipe_task.split(":") | ||
909 | for e in exceptions: | ||
910 | if e[0] in recipe and task == e[1]: | ||
911 | break | ||
912 | else: | ||
913 | missing_objects.append(recipe_task) | ||
914 | self.assertTrue(len(missing_objects) == 0, "URLs checked:\n{}\nMissing objects in the cache:\n{}".format("\n".join(checked_urls), "\n".join(missing_objects))) | ||
915 | |||
916 | def run_test_cdn_mirror(self, machine, targets, exceptions): | ||
917 | exceptions = exceptions + [[t, "do_deploy_source_date_epoch"] for t in targets.split()] | ||
918 | exceptions = exceptions + [[t, "do_image_qa"] for t in targets.split()] | ||
919 | self.config_sstate(True) | ||
920 | self.append_config(""" | ||
921 | MACHINE = "{}" | ||
922 | BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687" | ||
923 | SSTATE_MIRRORS ?= "file://.* http://cdn.jsdelivr.net/yocto/sstate/all/PATH;downloadfilename=PATH" | ||
924 | """.format(machine)) | ||
925 | result = bitbake("-D -S printdiff {}".format(targets)) | ||
926 | self.check_bb_output(result.output, exceptions) | ||
927 | |||
928 | def _test_cdn_mirror_qemux86_64(self): | ||
929 | # Example: | ||
930 | # exceptions = [ ["packagegroup-core-sdk","do_package"] ] | ||
931 | exceptions = [] | ||
932 | self.run_test_cdn_mirror("qemux86-64", "core-image-minimal core-image-full-cmdline core-image-sato-sdk", exceptions) | ||
933 | |||
934 | def _test_cdn_mirror_qemuarm64(self): | ||
935 | exceptions = [] | ||
936 | self.run_test_cdn_mirror("qemuarm64", "core-image-minimal core-image-full-cmdline core-image-sato-sdk", exceptions) | ||