[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 7/9] tests/avocado/tuxrun_baselines.py: use Avocado's zstd sup
|
From: |
Cleber Rosa |
|
Subject: |
[PATCH v2 7/9] tests/avocado/tuxrun_baselines.py: use Avocado's zstd support |
|
Date: |
Tue, 6 Aug 2024 13:31:17 -0400 |
This makes use of the avocado.utils.archive support for zstd.
In order to not duplicate code, the skip condition uses a private
utility from the module which is going to become public in Avocado
versions 103.1 LTS (and also in versions >= 107.0).
Reference: https://github.com/avocado-framework/avocado/pull/5996
Reference: https://github.com/avocado-framework/avocado/pull/5953
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
tests/avocado/tuxrun_baselines.py | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/tests/avocado/tuxrun_baselines.py
b/tests/avocado/tuxrun_baselines.py
index 736e4aa289..bd02e88ed6 100644
--- a/tests/avocado/tuxrun_baselines.py
+++ b/tests/avocado/tuxrun_baselines.py
@@ -17,6 +17,7 @@
from avocado_qemu import QemuSystemTest
from avocado_qemu import exec_command, exec_command_and_wait_for_pattern
from avocado_qemu import wait_for_console_pattern
+from avocado.utils import archive
from avocado.utils import process
from avocado.utils.path import find_command
@@ -40,17 +41,12 @@ def get_tag(self, tagname, default=None):
return default
+ @skipUnless(archive._probe_zstd_cmd(),
+ 'Could not find "zstd", or it is not able to properly '
+ 'decompress decompress the rootfs')
def setUp(self):
super().setUp()
- # We need zstd for all the tuxrun tests
- # See https://github.com/avocado-framework/avocado/issues/5609
- zstd = find_command('zstd', False)
- if zstd is False:
- self.cancel('Could not find "zstd", which is required to '
- 'decompress rootfs')
- self.zstd = zstd
-
# Process the TuxRun specific tags, most machines work with
# reasonable defaults but we sometimes need to tweak the
# config. To avoid open coding everything we store all these
@@ -99,8 +95,8 @@ def fetch_tuxrun_assets(self, csums=None, dt=None):
asset_hash = isum,
algorithm = "sha256")
- cmd = f"{self.zstd} -d {disk_image_zst} -o {self.workdir}/rootfs.ext4"
- process.run(cmd)
+ archive.extract(disk_image_zst, os.path.join(self.workdir,
+ "rootfs.ext4"))
if dt:
dsum = csums.get(dt, None)
--
2.45.2
- [PATCH v2 0/9] Bump Avocado to 103.0 LTS and update tests for compatibility and new features, Cleber Rosa, 2024/08/06
- [PATCH v2 1/9] Bump avocado to 103.0, Cleber Rosa, 2024/08/06
- [PATCH v2 2/9] tests/avocado: apply proper skipUnless decorator, Cleber Rosa, 2024/08/06
- [PATCH v2 3/9] tests/avocado: add cdrom permission related tests, Cleber Rosa, 2024/08/06
- [PATCH v2 4/9] tests/avocado: machine aarch64: standardize location and RO access, Cleber Rosa, 2024/08/06
- [PATCH v2 5/9] tests/avocado: simplify parameters on fetch_asset with name only, Cleber Rosa, 2024/08/06
- [PATCH v2 7/9] tests/avocado/tuxrun_baselines.py: use Avocado's zstd support,
Cleber Rosa <=
- [PATCH v2 6/9] tests/avocado/boot_xen.py: fetch kernel during test setUp(), Cleber Rosa, 2024/08/06
- [PATCH v2 8/9] tests/avocado/machine_aarch64_sbsaref.py: allow for rw usage of image, Cleber Rosa, 2024/08/06
- [PATCH v2 9/9] Avocado tests: allow for parallel execution of tests, Cleber Rosa, 2024/08/06