mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
tests/functional: enable force refresh of cached assets
If the 'QEMU_TEST_REFRESH_CACHE' environment variable is set, then ignore any existing cached asset and download a fresh copy. This can be used to selectively refresh assets if set before running a single test script. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250829142616.2633254-2-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
committed by
Thomas Huth
parent
5f81033e5b
commit
9f80f3695d
@@ -312,6 +312,9 @@ The cache is populated in the ``~/.cache/qemu/download`` directory by
|
||||
default, but the location can be changed by setting the
|
||||
``QEMU_TEST_CACHE_DIR`` environment variable.
|
||||
|
||||
To force the test suite to re-download the cache, even if still valid,
|
||||
set the ``QEMU_TEST_REFRESH_CACHE`` environment variable.
|
||||
|
||||
Skipping tests
|
||||
--------------
|
||||
|
||||
|
||||
@@ -72,6 +72,10 @@ class Asset:
|
||||
return self.hash == hl.hexdigest()
|
||||
|
||||
def valid(self):
|
||||
if os.getenv("QEMU_TEST_REFRESH_CACHE", None) is not None:
|
||||
self.log.info("Force refresh of asset %s", self.url)
|
||||
return False
|
||||
|
||||
return self.cache_file.exists() and self._check(self.cache_file)
|
||||
|
||||
def fetchable(self):
|
||||
|
||||
Reference in New Issue
Block a user