diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2021-12-23 17:01:32 +0100 |
---|---|---|
committer | Hanna Reitz <hreitz@redhat.com> | 2022-02-01 10:51:39 +0100 |
commit | 677e0bae686e7c670a71d1f6a491a7f06f77de73 (patch) | |
tree | 546cd2ca3e11f2086ead4866ef9736117098c85a /tests/qemu-iotests/303 | |
parent | 28a5ad93da08ae55c8dfac0db8615936ca14b822 (diff) | |
download | qemu-677e0bae686e7c670a71d1f6a491a7f06f77de73.zip qemu-677e0bae686e7c670a71d1f6a491a7f06f77de73.tar.gz qemu-677e0bae686e7c670a71d1f6a491a7f06f77de73.tar.bz2 |
iotest 303: explicit compression type
The test prints qcow2 header fields which depends on chosen compression
type. So, let's be explicit in what compression type we want and
independent of IMGOPTS. Test both existing compression types.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20211223160144.1097696-8-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/303')
-rwxr-xr-x | tests/qemu-iotests/303 | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/qemu-iotests/303 b/tests/qemu-iotests/303 index 475cb54..16c2e10 100755 --- a/tests/qemu-iotests/303 +++ b/tests/qemu-iotests/303 @@ -54,12 +54,19 @@ def add_bitmap(num, begin, end, disabled): log('') -qemu_img_create('-f', iotests.imgfmt, disk, '10M') - -add_bitmap(1, 0, 6, False) -add_bitmap(2, 6, 8, True) -dump = ['./qcow2.py', disk, 'dump-header'] -subprocess.run(dump) -# Dump the metadata in JSON format -dump.append('-j') -subprocess.run(dump) +def test(compression_type: str, json_output: bool) -> None: + qemu_img_create('-f', iotests.imgfmt, + '-o', f'compression_type={compression_type}', + disk, '10M') + add_bitmap(1, 0, 6, False) + add_bitmap(2, 6, 8, True) + + cmd = ['./qcow2.py', disk, 'dump-header'] + if json_output: + cmd.append('-j') + + subprocess.run(cmd) + + +test('zlib', False) +test('zstd', True) |