[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/8] iotests.py: Add supports_qcow2_zstd_compression()
From: |
Hanna Reitz |
Subject: |
[PULL 3/8] iotests.py: Add supports_qcow2_zstd_compression() |
Date: |
Wed, 20 Apr 2022 14:40:59 +0200 |
Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220323105522.53660-2-hreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
---
tests/qemu-iotests/iotests.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index fcec3e51e5..fe10a6cf05 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1471,6 +1471,26 @@ def verify_working_luks():
if not working:
notrun(reason)
+def supports_qcow2_zstd_compression() -> bool:
+ img_file = f'{test_dir}/qcow2-zstd-test.qcow2'
+ res = qemu_img('create', '-f', 'qcow2', '-o', 'compression_type=zstd',
+ img_file, '0',
+ check=False)
+ try:
+ os.remove(img_file)
+ except OSError:
+ pass
+
+ if res.returncode == 1 and \
+ "'compression-type' does not accept value 'zstd'" in res.stdout:
+ return False
+ else:
+ return True
+
+def verify_qcow2_zstd_compression():
+ if not supports_qcow2_zstd_compression():
+ notrun('zstd compression not supported')
+
def qemu_pipe(*args: str) -> str:
"""
Run qemu with an option to print something and exit (e.g. a help option).
--
2.35.1
- [PULL 0/8] Block patches, Hanna Reitz, 2022/04/20
- [PULL 1/8] tests/qemu-iotests/meson.build: Improve the indentation, Hanna Reitz, 2022/04/20
- [PULL 3/8] iotests.py: Add supports_qcow2_zstd_compression(),
Hanna Reitz <=
- [PULL 4/8] iotests/065: Check for zstd support, Hanna Reitz, 2022/04/20
- [PULL 8/8] qcow2: Add errp to rebuild_refcount_structure(), Hanna Reitz, 2022/04/20
- [PULL 5/8] iotests/303: Check for zstd support, Hanna Reitz, 2022/04/20
- [PULL 6/8] qcow2: Improve refcount structure rebuilding, Hanna Reitz, 2022/04/20
- [PULL 2/8] tests/qemu-iotests: Move the bash and sanitizer checks to meson.build, Hanna Reitz, 2022/04/20
- [PULL 7/8] iotests/108: Test new refcount rebuild algorithm, Hanna Reitz, 2022/04/20
- Re: [PULL 0/8] Block patches, Richard Henderson, 2022/04/20