tests/functional: add a module for handling asset download & caching
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 30 Aug 2024 13:38:08 +0000 (15:38 +0200)
committerThomas Huth <thuth@redhat.com>
Wed, 4 Sep 2024 08:52:29 +0000 (10:52 +0200)
commit9903217a4ed013228d95d8b1876b6053b2bc5e95
treebd2e6e09328651ec597a94a310e090756f1d8cb6
parenteeba3d736527191f3126fe0d4cc539f43cdba009
tests/functional: add a module for handling asset download & caching

The 'Asset' class is a simple module that declares a downloadable
asset that can be cached locally. Downloads are stored in the user's
home dir at ~/.cache/qemu/download, using a sha256 sum of the URL.

[thuth: Drop sha1 support, use hash on file content for naming instead of URL,
        add the possibility to specify the cache dir via environment variable]

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240830133841.142644-15-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/functional/qemu_test/__init__.py
tests/functional/qemu_test/asset.py [new file with mode: 0644]