[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/8] iotests/065: Check for zstd support
From: |
Hanna Reitz |
Subject: |
[PULL 4/8] iotests/065: Check for zstd support |
Date: |
Wed, 20 Apr 2022 14:41:00 +0200 |
Some test cases run in iotest 065 want to run with zstd compression just
for added coverage. Run them with zlib if there is no zstd support
compiled in.
Reported-by: Thomas Huth <thuth@redhat.com>
Fixes: 12a936171d71f839dc907ff ("iotest 065: explicit compression type")
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220323105522.53660-3-hreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
---
tests/qemu-iotests/065 | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065
index ba94e19349..b724c89c7c 100755
--- a/tests/qemu-iotests/065
+++ b/tests/qemu-iotests/065
@@ -24,7 +24,7 @@ import os
import re
import json
import iotests
-from iotests import qemu_img, qemu_img_info
+from iotests import qemu_img, qemu_img_info, supports_qcow2_zstd_compression
import unittest
test_img = os.path.join(iotests.test_dir, 'test.img')
@@ -95,11 +95,17 @@ class TestQCow2(TestQemuImgInfo):
class TestQCow3NotLazy(TestQemuImgInfo):
'''Testing a qcow2 version 3 image with lazy refcounts disabled'''
- img_options = 'compat=1.1,lazy_refcounts=off,compression_type=zstd'
+ if supports_qcow2_zstd_compression():
+ compression_type = 'zstd'
+ else:
+ compression_type = 'zlib'
+
+ img_options = 'compat=1.1,lazy_refcounts=off'
+ img_options += f',compression_type={compression_type}'
json_compare = { 'compat': '1.1', 'lazy-refcounts': False,
'refcount-bits': 16, 'corrupt': False,
- 'compression-type': 'zstd', 'extended-l2': False }
- human_compare = [ 'compat: 1.1', 'compression type: zstd',
+ 'compression-type': compression_type, 'extended-l2':
False }
+ human_compare = [ 'compat: 1.1', f'compression type: {compression_type}',
'lazy refcounts: false', 'refcount bits: 16',
'corrupt: false', 'extended l2: false' ]
@@ -126,11 +132,17 @@ class TestQCow3NotLazyQMP(TestQMP):
class TestQCow3LazyQMP(TestQMP):
'''Testing a qcow2 version 3 image with lazy refcounts enabled, opening
with lazy refcounts disabled'''
- img_options = 'compat=1.1,lazy_refcounts=on,compression_type=zstd'
+ if supports_qcow2_zstd_compression():
+ compression_type = 'zstd'
+ else:
+ compression_type = 'zlib'
+
+ img_options = 'compat=1.1,lazy_refcounts=on'
+ img_options += f',compression_type={compression_type}'
qemu_options = 'lazy-refcounts=off'
compare = { 'compat': '1.1', 'lazy-refcounts': True,
'refcount-bits': 16, 'corrupt': False,
- 'compression-type': 'zstd', 'extended-l2': False }
+ 'compression-type': compression_type, 'extended-l2': False }
TestImageInfoSpecific = None
TestQemuImgInfo = None
--
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, 2022/04/20
- [PULL 4/8] iotests/065: Check for zstd support,
Hanna Reitz <=
- [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