We want iotests pass with both the default zlib compression and with
IMGOPTS='compression_type=zstd'.
Actually the only test that is interested in real compression type in
test output is 287 (test for qcow2 compression type) and it's in bash.
So for now we can safely filter out compression type in all qcow2
tests.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
tests/qemu-iotests/206.out | 10 +++---
tests/qemu-iotests/242.out | 10 +++---
tests/qemu-iotests/255.out | 8 ++---
tests/qemu-iotests/274.out | 68 +++++++++++++++++------------------
tests/qemu-iotests/280.out | 2 +-
tests/qemu-iotests/iotests.py | 13 ++++++-
6 files changed, 61 insertions(+), 50 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 80f0cb4f42..6a8cc1bad7 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -224,9 +224,18 @@ def qemu_img_verbose(*args):
% (-exitcode, ' '.join(qemu_img_args + list(args))))
return exitcode
+def filter_img_create(text: str) -> str:
+ return re.sub('(compression_type=)(zlib|zstd)', r'\1COMPRESSION_TYPE',
+ text)
+
def qemu_img_pipe(*args: str) -> str:
'''Run qemu-img and return its output'''
- return qemu_img_pipe_and_status(*args)[0]
+ output = qemu_img_pipe_and_status(*args)[0]
def qemu_img_log(*args):
result = qemu_img_pipe(*args)
@@ -479,6 +488,8 @@ def filter_img_info(output, filename):
'uuid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
line)
line = re.sub('cid: [0-9]+', 'cid: XXXXXXXXXX', line)
+ line = re.sub('(compression type: )(zlib|zstd)', r'\1COMPRESSION_TYPE',
+ line)
lines.append(line)
return '\n'.join(lines)