summary refs log tree commit diff stats
path: root/tests/functional/qemu_test/asset.py
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2025-03-12 23:00:00 +1000
committerThomas Huth <thuth@redhat.com>2025-03-12 18:20:50 +0100
commita5e8299d1a119b9d757ae28a57612f633894d2f6 (patch)
treee60a7024df243f1b58ba083a2f2573f1a5cede6f /tests/functional/qemu_test/asset.py
parent15ef93dd48c2635d0e9f9e9a4f6dd92a40e23bff (diff)
downloadfocaccia-qemu-a5e8299d1a119b9d757ae28a57612f633894d2f6.tar.gz
focaccia-qemu-a5e8299d1a119b9d757ae28a57612f633894d2f6.zip
tests/functional/asset: Fail assert fetch when retries are exceeded
Currently the fetch code does not fail gracefully when retry limit is
exceeded, it just falls through the loop with no file, which ends up
hitting other errors.

Add a check for non-existing file, which indicates the retry limit was
exceeded.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20250312130002.945508-2-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/functional/qemu_test/asset.py')
-rw-r--r--tests/functional/qemu_test/asset.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index f0730695f0..27dd839e70 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -138,6 +138,9 @@ class Asset:
                 tmp_cache_file.unlink()
                 raise
 
+        if not os.path.exists(tmp_cache_file):
+            raise Exception("Retries exceeded downloading %s", self.url)
+
         try:
             # Set these just for informational purposes
             os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",