summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/cases/sstatetests.py48
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
15from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, get_bb_vars 15from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, get_bb_vars
16from oeqa.selftest.case import OESelftestTestCase 16from oeqa.selftest.case import OESelftestTestCase
17from oeqa.core.decorator import OETestTag
17 18
18import oe 19import oe
19import bb.siggen 20import bb.siggen
@@ -886,3 +887,50 @@ expected_sametmp_output, expected_difftmp_output)
886INHERIT += "base-do-configure-modified" 887INHERIT += "base-do-configure-modified"
887""", 888""",
888expected_sametmp_output, expected_difftmp_output) 889expected_sametmp_output, expected_difftmp_output)
890
891@OETestTag("yocto-mirrors")
892class 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("""
921MACHINE = "{}"
922BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687"
923SSTATE_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)