diff mbox series

[09/14] iotests/common.rc: introduce _qcow2_dump_header helper

Message ID 20210705091549.178335-10-vsementsov@virtuozzo.com (mailing list archive)
State New, archived
Headers show
Series iotests: support zstd | expand

Commit Message

Vladimir Sementsov-Ogievskiy July 5, 2021, 9:15 a.m. UTC
We'll use it in tests instead of explicit qcow2.py. Then we are going
to add some filtering in _qcow2_dump_header.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/common.rc | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Max Reitz July 16, 2021, 12:56 p.m. UTC | #1
On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote:
> We'll use it in tests instead of explicit qcow2.py. Then we are going
> to add some filtering in _qcow2_dump_header.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   tests/qemu-iotests/common.rc | 10 ++++++++++
>   1 file changed, 10 insertions(+)

Reviewed-by: Max Reitz <mreitz@redhat.com>
diff mbox series

Patch

diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 4cae5b2d70..ee4b9d795e 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -994,5 +994,15 @@  _require_one_device_of()
     _notrun "$* not available"
 }
 
+_qcow2_dump_header()
+{
+    img="$1"
+    if [ -z "$img" ]; then
+        img="$TEST_IMG"
+    fi
+
+    $PYTHON qcow2.py "$img" dump-header
+}
+
 # make sure this script returns success
 true