diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2024-01-08 15:27:26 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-10 17:01:28 +0000 |
commit | 46262ee83edd98d4f2cd7faf45a0cb4ff44a8647 (patch) | |
tree | 8f9d0e67705660279201545daa5eea4f399dbd79 /meta/lib/oeqa/selftest/cases | |
parent | 90ca84dbf927536828f0d00942dddf541c5d123f (diff) | |
download | poky-46262ee83edd98d4f2cd7faf45a0cb4ff44a8647.tar.gz |
selftest/sstatetests: include fetcher diagnostics into CDN test failure message
This will help finding out what kind of error the server actually returned,
as sporadic CDN failures continue to occur.
[YOCTO #15335]
(From OE-Core rev: 7f09c4c5a0fe4ff213f205927f618a77b72aeef3)
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>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sstatetests.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py index 340f41162f..6a6c2e5f11 100644 --- a/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py | |||
@@ -905,6 +905,7 @@ class SStateMirrors(SStateBase): | |||
905 | self.fail("Did not find 'Sstate summary' line in bitbake output") | 905 | self.fail("Did not find 'Sstate summary' line in bitbake output") |
906 | 906 | ||
907 | failed_urls = [] | 907 | failed_urls = [] |
908 | failed_urls_extrainfo = [] | ||
908 | for l in output_l: | 909 | for l in output_l: |
909 | if "SState: Unsuccessful fetch test for" in l and check_cdn: | 910 | if "SState: Unsuccessful fetch test for" in l and check_cdn: |
910 | missing_object = l.split()[6] | 911 | missing_object = l.split()[6] |
@@ -918,8 +919,11 @@ class SStateMirrors(SStateBase): | |||
918 | else: | 919 | else: |
919 | missing_objects -= 1 | 920 | missing_objects -= 1 |
920 | 921 | ||
921 | self.assertEqual(len(failed_urls), missing_objects, "Amount of reported missing objects does not match failed URLs: {}\nFailed URLs:\n{}".format(missing_objects, "\n".join(failed_urls))) | 922 | if "urlopen failed for" in l: |
922 | self.assertEqual(len(failed_urls), 0, "Missing objects in the cache:\n{}".format("\n".join(failed_urls))) | 923 | failed_urls_extrainfo.append(l) |
924 | |||
925 | 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))) | ||
926 | 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))) | ||
923 | 927 | ||
924 | def run_test(self, machine, targets, exceptions, check_cdn = True): | 928 | def run_test(self, machine, targets, exceptions, check_cdn = True): |
925 | # sstate is checked for existence of these, but they never get written out to begin with | 929 | # sstate is checked for existence of these, but they never get written out to begin with |