[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/17] iotests.py: filter out successful output of qemu-img cr
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 07/17] iotests.py: filter out successful output of qemu-img crate |
Date: |
Tue, 20 Jul 2021 14:38:22 +0300 |
The only "feature" of this "Formatting ..." line is that we have to
update it every time we add new option. Let's drop it.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
tests/qemu-iotests/255.out | 4 ----
tests/qemu-iotests/274.out | 29 -----------------------------
tests/qemu-iotests/280.out | 1 -
tests/qemu-iotests/iotests.py | 10 ++++++++--
4 files changed, 8 insertions(+), 36 deletions(-)
diff --git a/tests/qemu-iotests/255.out b/tests/qemu-iotests/255.out
index 33b7f22de3..11a05a5213 100644
--- a/tests/qemu-iotests/255.out
+++ b/tests/qemu-iotests/255.out
@@ -3,9 +3,7 @@ Finishing a commit job with background reads
=== Create backing chain and start VM ===
-Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=qcow2 cluster_size=65536
extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=off
refcount_bits=16
-Formatting 'TEST_DIR/PID-t.qcow2', fmt=qcow2 cluster_size=65536
extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=off
refcount_bits=16
=== Start background read requests ===
@@ -23,9 +21,7 @@ Closing the VM while a job is being cancelled
=== Create images and start VM ===
-Formatting 'TEST_DIR/PID-src.qcow2', fmt=qcow2 cluster_size=65536
extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=off
refcount_bits=16
-Formatting 'TEST_DIR/PID-dst.qcow2', fmt=qcow2 cluster_size=65536
extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=off
refcount_bits=16
wrote 1048576/1048576 bytes at offset 0
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/qemu-iotests/274.out b/tests/qemu-iotests/274.out
index 16a95a4850..1d2928e14d 100644
--- a/tests/qemu-iotests/274.out
+++ b/tests/qemu-iotests/274.out
@@ -1,9 +1,6 @@
== Commit tests ==
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-mid', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=1048576 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 backing_file=TEST_DIR/PID-mid
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -66,11 +63,8 @@ read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Testing HMP commit (top -> mid) ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-mid', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=1048576 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 backing_file=TEST_DIR/PID-mid
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -98,11 +92,8 @@ read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Testing QMP active commit (top -> mid) ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-mid', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=1048576 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 backing_file=TEST_DIR/PID-mid
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -136,11 +127,8 @@ read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Testing qemu-img commit (top -> base) ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-mid', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=1048576 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 backing_file=TEST_DIR/PID-mid
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -166,11 +154,8 @@ read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Testing QMP active commit (top -> base) ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-mid', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=1048576 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=2097152 backing_file=TEST_DIR/PID-mid
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -205,9 +190,7 @@ read 1048576/1048576 bytes at offset 1048576
== Resize tests ==
=== preallocation=off ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=6442450944 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=1073741824 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 65536/65536 bytes at offset 5368709120
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -224,9 +207,7 @@ read 65536/65536 bytes at offset 5368709120
{ "start": 1073741824, "length": 7516192768, "depth": 0, "present": true,
"zero": true, "data": false}]
=== preallocation=metadata ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=34359738368 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=32212254720 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 65536/65536 bytes at offset 33285996544
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -248,9 +229,7 @@ read 65536/65536 bytes at offset 33285996544
{ "start": 34896609280, "length": 536870912, "depth": 0, "present": true,
"zero": true, "data": false, "offset": 2685075456}]
=== preallocation=falloc ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=10485760 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=5242880 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 65536/65536 bytes at offset 9437184
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -267,9 +246,7 @@ read 65536/65536 bytes at offset 9437184
{ "start": 5242880, "length": 10485760, "depth": 0, "present": true, "zero":
false, "data": true, "offset": 327680}]
=== preallocation=full ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=16777216 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=8388608 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 65536/65536 bytes at offset 11534336
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -286,9 +263,7 @@ read 65536/65536 bytes at offset 11534336
{ "start": 8388608, "length": 4194304, "depth": 0, "present": true, "zero":
false, "data": true, "offset": 327680}]
=== preallocation=off ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=393216 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=259072 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 65536/65536 bytes at offset 259072
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -306,9 +281,7 @@ read 65536/65536 bytes at offset 259072
{ "start": 262144, "length": 262144, "depth": 0, "present": true, "zero":
true, "data": false}]
=== preallocation=off ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=409600 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=262144 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 65536/65536 bytes at offset 344064
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -325,9 +298,7 @@ read 65536/65536 bytes at offset 344064
{ "start": 262144, "length": 262144, "depth": 0, "present": true, "zero":
true, "data": false}]
=== preallocation=off ===
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=524288 lazy_refcounts=off refcount_bits=16
-Formatting 'TEST_DIR/PID-top', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=262144 backing_file=TEST_DIR/PID-base
backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
wrote 65536/65536 bytes at offset 446464
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/qemu-iotests/280.out b/tests/qemu-iotests/280.out
index 09a0f1a7cb..e39164c579 100644
--- a/tests/qemu-iotests/280.out
+++ b/tests/qemu-iotests/280.out
@@ -1,4 +1,3 @@
-Formatting 'TEST_DIR/PID-base', fmt=qcow2 cluster_size=65536 extended_l2=off
compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
=== Launch VM ===
Enabling migration QMP events on VM...
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 484f616270..857676a329 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -108,7 +108,9 @@ def unarchive_sample_image(sample, fname):
def qemu_tool_pipe_and_status(tool: str, args: Sequence[str],
- connect_stderr: bool = True) -> Tuple[str, int]:
+ connect_stderr: bool = True,
+ drop_successful_output: bool = False) \
+ -> Tuple[str, int]:
"""
Run a tool and return both its output and its exit code
"""
@@ -120,6 +122,8 @@ def qemu_tool_pipe_and_status(tool: str, args:
Sequence[str],
cmd = ' '.join(args)
sys.stderr.write(f'{tool} received signal \
{-subp.returncode}: {cmd}\n')
+ if drop_successful_output and subp.returncode == 0:
+ output = ''
return (output, subp.returncode)
def qemu_img_create_prepare_args(args: List[str]) -> List[str]:
@@ -164,8 +168,10 @@ def qemu_img_pipe_and_status(*args: str) -> Tuple[str,
int]:
"""
Run qemu-img and return both its output and its exit code
"""
+ is_create = bool(args and args[0] == 'create')
full_args = qemu_img_args + qemu_img_create_prepare_args(list(args))
- return qemu_tool_pipe_and_status('qemu-img', full_args)
+ return qemu_tool_pipe_and_status('qemu-img', full_args,
+ drop_successful_output=is_create)
def qemu_img(*args: str) -> int:
'''Run qemu-img and return the exit code'''
--
2.29.2
- [PATCH v2 00/17] iotests: support zstd, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 03/17] iotests: drop qemu_img_verbose() helper, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 02/17] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd', Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 01/17] iotests.py: img_info_log(): rename imgopts argument, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 04/17] iotests.py: rewrite default luks support in qemu_img, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 05/17] iotest 303: explicit compression type, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 07/17] iotests.py: filter out successful output of qemu-img crate,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v2 06/17] iotest 065: explicit compression type, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 17/17] iotests: declare lack of support for compresion_type in IMGOPTS, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 11/17] iotests/common.rc: introduce _qcow2_dump_header helper, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 09/17] iotest 302: use img_info_log() helper, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 08/17] iotests.py: filter compression type out, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 10/17] qcow2: simple case support for downgrading of qcow2 images with zstd, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 14/17] iotests: bash tests: filter compression type, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 16/17] iotest 214: explicit compression type, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 12/17] iotests: massive use _qcow2_dump_header, Vladimir Sementsov-Ogievskiy, 2021/07/20
- [PATCH v2 13/17] iotest 39: use _qcow2_dump_header, Vladimir Sementsov-Ogievskiy, 2021/07/20