iotests: replace qemu_img_log('create', ...) calls

qemu_img_log() calls into qemu_img_pipe(), which always removes output
for 'create' commands on success anyway. Replace all of these calls to
the simpler qemu_img_create(...) which doesn't log, but raises a
detailed exception object on failure instead.

Blank lines are removed from output files where appropriate.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220321201618.903471-17-jsnow@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
This commit is contained in:
John Snow 2022-03-21 16:16:16 -04:00 committed by Hanna Reitz
parent 97576f8c0a
commit 3c8b7358d6
6 changed files with 13 additions and 48 deletions

View File

@ -42,8 +42,8 @@ with iotests.FilePath('t.qcow2') as disk_path, \
size_str = str(size)
iotests.create_image(base_path, size)
iotests.qemu_img_log('create', '-f', iotests.imgfmt, mid_path, size_str)
iotests.qemu_img_log('create', '-f', iotests.imgfmt, disk_path, size_str)
iotests.qemu_img_create('-f', iotests.imgfmt, mid_path, size_str)
iotests.qemu_img_create('-f', iotests.imgfmt, disk_path, size_str)
# Create a backing chain like this:
# base <- [throttled: bps-read=4096] <- mid <- overlay
@ -92,8 +92,8 @@ with iotests.FilePath('src.qcow2') as src_path, \
size = 128 * 1024 * 1024
size_str = str(size)
iotests.qemu_img_log('create', '-f', iotests.imgfmt, src_path, size_str)
iotests.qemu_img_log('create', '-f', iotests.imgfmt, dst_path, size_str)
iotests.qemu_img_create('-f', iotests.imgfmt, src_path, size_str)
iotests.qemu_img_create('-f', iotests.imgfmt, dst_path, size_str)
iotests.log(iotests.qemu_io('-f', iotests.imgfmt, '-c', 'write 0 1M',
src_path),

View File

@ -3,8 +3,6 @@ Finishing a commit job with background reads
=== Create backing chain and start VM ===
=== Start background read requests ===
=== Run a commit job ===
@ -21,8 +19,6 @@ Closing the VM while a job is being cancelled
=== Create images and start VM ===
wrote 1048576/1048576 bytes at offset 0
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)

View File

@ -31,11 +31,10 @@ size_long = 2 * 1024 * 1024
size_diff = size_long - size_short
def create_chain() -> None:
iotests.qemu_img_log('create', '-f', iotests.imgfmt, base,
str(size_long))
iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', base,
iotests.qemu_img_create('-f', iotests.imgfmt, base, str(size_long))
iotests.qemu_img_create('-f', iotests.imgfmt, '-b', base,
'-F', iotests.imgfmt, mid, str(size_short))
iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', mid,
iotests.qemu_img_create('-f', iotests.imgfmt, '-b', mid,
'-F', iotests.imgfmt, top, str(size_long))
iotests.qemu_io_log('-c', 'write -P 1 0 %d' % size_long, base)
@ -160,8 +159,8 @@ with iotests.FilePath('base') as base, \
('off', '512k', '256k', '500k', '436k')]:
iotests.log('=== preallocation=%s ===' % prealloc)
iotests.qemu_img_log('create', '-f', iotests.imgfmt, base, base_size)
iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', base,
iotests.qemu_img_create('-f', iotests.imgfmt, base, base_size)
iotests.qemu_img_create('-f', iotests.imgfmt, '-b', base,
'-F', iotests.imgfmt, top, top_size_old)
iotests.qemu_io_log('-c', 'write -P 1 %s 64k' % off, base)

View File

@ -1,7 +1,4 @@
== Commit tests ==
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -63,9 +60,6 @@ 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) ===
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -92,9 +86,6 @@ 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) ===
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -127,9 +118,6 @@ 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) ===
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -154,9 +142,6 @@ 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) ===
wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -190,8 +175,6 @@ read 1048576/1048576 bytes at offset 1048576
== Resize tests ==
=== preallocation=off ===
wrote 65536/65536 bytes at offset 5368709120
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -207,8 +190,6 @@ read 65536/65536 bytes at offset 5368709120
{ "start": 1073741824, "length": 7516192768, "depth": 0, "present": true, "zero": true, "data": false}]
=== preallocation=metadata ===
wrote 65536/65536 bytes at offset 33285996544
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -229,8 +210,6 @@ read 65536/65536 bytes at offset 33285996544
{ "start": 34896609280, "length": 536870912, "depth": 0, "present": true, "zero": true, "data": false, "offset": 2685075456}]
=== preallocation=falloc ===
wrote 65536/65536 bytes at offset 9437184
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -246,8 +225,6 @@ read 65536/65536 bytes at offset 9437184
{ "start": 5242880, "length": 10485760, "depth": 0, "present": true, "zero": false, "data": true, "offset": 327680}]
=== preallocation=full ===
wrote 65536/65536 bytes at offset 11534336
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -263,8 +240,6 @@ read 65536/65536 bytes at offset 11534336
{ "start": 8388608, "length": 4194304, "depth": 0, "present": true, "zero": false, "data": true, "offset": 327680}]
=== preallocation=off ===
wrote 65536/65536 bytes at offset 259072
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -281,8 +256,6 @@ read 65536/65536 bytes at offset 259072
{ "start": 262144, "length": 262144, "depth": 0, "present": true, "zero": true, "data": false}]
=== preallocation=off ===
wrote 65536/65536 bytes at offset 344064
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -298,8 +271,6 @@ read 65536/65536 bytes at offset 344064
{ "start": 262144, "length": 262144, "depth": 0, "present": true, "zero": true, "data": false}]
=== preallocation=off ===
wrote 65536/65536 bytes at offset 446464
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)

View File

@ -33,7 +33,7 @@ with iotests.FilePath('base') as base_path , \
iotests.FilePath('top') as top_path, \
iotests.VM() as vm:
iotests.qemu_img_log('create', '-f', iotests.imgfmt, base_path, '64M')
iotests.qemu_img_create('-f', iotests.imgfmt, base_path, '64M')
iotests.log('=== Launch VM ===')
vm.add_object('iothread,id=iothread0')

View File

@ -1,4 +1,3 @@
=== Launch VM ===
Enabling migration QMP events on VM...
{"return": {}}