qemu/tests/functional/qemu_test
Nicholas Piggin 28adad0a4d tests/functional/asset: Add AssetError exception class
Assets are uniquely identified by human-readable-ish url, so make an
AssetError exception class that prints url with error message.

A property 'transient' is used to capture whether the client may retry
or try again later, or if it is a serious and likely permanent error.
This is used to retain the existing behaviour of treating HTTP errors
other than 404 as 'transient' and not causing precache step to fail.
Additionally, partial-downloads and stale asset caches that fail to
resolve after the retry limit are now treated as transient and do not
cause precache step to fail.

For background: The NetBSD archive is, at the time of writing, failing
with short transfer. Retrying the fetch at that position (as wget does)
results in a "503 backend unavailable" error. We would like to get that
error code directly, but I have not found a way to do that with urllib,
so treating the short-copy as a transient failure covers that case (and
seems like a reasonable way to handle it in general).

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20250312130002.945508-4-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-03-12 18:20:50 +01:00
..
__init__.py tests/functional: Introduce the dso_suffix() helper 2025-03-10 10:30:00 +00:00
archive.py tests/functional: replace 'run_cmd' with subprocess helpers 2024-12-17 19:39:53 +01:00
asset.py tests/functional/asset: Add AssetError exception class 2025-03-12 18:20:50 +01:00
cmd.py tests/functional: remove now unused 'run_cmd' helper 2024-12-17 19:39:53 +01:00
config.py tests/functional: Introduce the dso_suffix() helper 2025-03-10 10:30:00 +00:00
decorators.py tests/functional: Add a decorator for skipping long running tests 2025-01-30 10:50:56 +01:00
linuxkernel.py tests/functional: Move the code for testing HTTP downloads to a common function 2025-03-07 07:50:19 +01:00
ports.py tests/functional: Extract the find_free_ports() function into a helper file 2025-01-02 08:58:08 +01:00
tesseract.py tests/functional: replace 'run_cmd' with subprocess helpers 2024-12-17 19:39:53 +01:00
testcase.py tests/functional: Allow running TCG plugins tests on non-Linux/BSD hosts 2025-03-10 10:30:00 +00:00
tuxruntest.py tests/functional: drop unused 'get_tag' method 2025-03-07 07:50:19 +01:00
uncompress.py tests/functional: stop output from zstd command when uncompressing 2025-03-07 07:50:19 +01:00
utils.py tests/functional: Add a helper function for retrieving the hostfwd port 2024-12-17 20:33:29 +01:00