[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 06/13] tests/avocado: use more distinct names for assets
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 06/13] tests/avocado: use more distinct names for assets |
Date: |
Mon, 29 Jul 2024 11:49:14 +0100 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
On Fri, Jul 26, 2024 at 09:44:31AM -0400, Cleber Rosa wrote:
> Avocado's asset system will deposit files in a cache organized either
> by their original location (the URI) or by their names. Because the
> cache (and the "by_name" sub directory) is common across tests, it's a
> good idea to make these names as distinct as possible.
>
> This avoid name clashes, which makes future Avocado runs to attempt to
> redownload the assets with the same name, but from the different
> locations they actually are from. This causes cache misses, extra
> downloads, and possibly canceled tests.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
> tests/avocado/kvm_xen_guest.py | 3 ++-
> tests/avocado/netdev-ethtool.py | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/avocado/kvm_xen_guest.py b/tests/avocado/kvm_xen_guest.py
> index f8cb458d5d..318fadebc3 100644
> --- a/tests/avocado/kvm_xen_guest.py
> +++ b/tests/avocado/kvm_xen_guest.py
> @@ -40,7 +40,8 @@ def get_asset(self, name, sha1):
> url = base_url + name
> # use explicit name rather than failing to neatly parse the
> # URL into a unique one
> - return self.fetch_asset(name=name, locations=(url), asset_hash=sha1)
> + return self.fetch_asset(name=f"qemu-kvm-xen-guest-{name}",
> + locations=(url), asset_hash=sha1)
Why do we need to pass a name here at all ? I see the comment here
but it isn't very clear about what the problem is. It just feels
wrong to be creating ourselves uniqueness naming problems, when we
have a nicely unique URL, and that cached URL can be shared across
tests, where as the custom names added by this patch are forcing
no-caching of the same URL between tests.
>
> def common_vm_setup(self):
> # We also catch lack of KVM_XEN support if we fail to launch
> diff --git a/tests/avocado/netdev-ethtool.py b/tests/avocado/netdev-ethtool.py
> index 5f33288f81..462cf8de7d 100644
> --- a/tests/avocado/netdev-ethtool.py
> +++ b/tests/avocado/netdev-ethtool.py
> @@ -27,7 +27,8 @@ def get_asset(self, name, sha1):
> url = base_url + name
> # use explicit name rather than failing to neatly parse the
> # URL into a unique one
> - return self.fetch_asset(name=name, locations=(url), asset_hash=sha1)
> + return self.fetch_asset(name=f"qemu-netdev-ethtool-{name}",
> + locations=(url), asset_hash=sha1)
>
> def common_test_code(self, netdev, extra_args=None):
>
> --
> 2.45.2
>
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH 02/13] tests/avocado: mips: add hint for fetchasset plugin, (continued)
- [PATCH 02/13] tests/avocado: mips: add hint for fetchasset plugin, Cleber Rosa, 2024/07/26
- [PATCH 03/13] tests/avocado/intel_iommu.py: increase timeout, Cleber Rosa, 2024/07/26
- [PATCH 04/13] tests/avocado: add cdrom permission related tests, Cleber Rosa, 2024/07/26
- [PATCH 05/13] tests/avocado: machine aarch64: standardize location and RO access, Cleber Rosa, 2024/07/26
- [PATCH 06/13] tests/avocado: use more distinct names for assets, Cleber Rosa, 2024/07/26
- [PATCH 09/13] tests/avocado/boot_xen.py: fetch kernel during test setUp(), Cleber Rosa, 2024/07/26
- [PATCH 11/13] tests/avocado/machine_aarch64_sbsaref.py: allow for rw usage of image, Cleber Rosa, 2024/07/26
- [PATCH 08/13] testa/avocado: test_arm_emcraft_sf2: handle RW requirements for asset, Cleber Rosa, 2024/07/26