Signed-off-by: Max Reitz <mre...@redhat.com> --- tests/qemu-iotests/255 | 20 +++++++++----------- tests/qemu-iotests/255.out | 8 -------- 2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/tests/qemu-iotests/255 b/tests/qemu-iotests/255 index ff16402268..4e745b68fa 100755 --- a/tests/qemu-iotests/255 +++ b/tests/qemu-iotests/255 @@ -21,7 +21,7 @@ # import iotests -from iotests import imgfmt +from iotests import imgfmt, create_test_image iotests.script_initialize(supported_fmts=['qcow2']) @@ -39,8 +39,8 @@ iotests.log('Finishing a commit job with background reads') iotests.log('============================================') iotests.log('') -with iotests.FilePath('t.qcow2') as disk_path, \ - iotests.FilePath('t.qcow2.mid') as mid_path, \ +with iotests.ImagePath('t.qcow2') as disk_path, \ + iotests.ImagePath('t.qcow2.mid') as mid_path, \ iotests.FilePath('t.qcow2.base') as base_path, \ iotests.VM() as vm: @@ -48,11 +48,10 @@ with iotests.FilePath('t.qcow2') as disk_path, \ iotests.log("") size = 128 * 1024 * 1024 - 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) + assert create_test_image(mid_path, size) == 0 + assert create_test_image(disk_path, size) == 0 # Create a backing chain like this: # base <- [throttled: bps-read=4096] <- mid <- overlay @@ -91,18 +90,17 @@ iotests.log('Closing the VM while a job is being cancelled') iotests.log('=============================================') iotests.log('') -with iotests.FilePath('src.qcow2') as src_path, \ - iotests.FilePath('dst.qcow2') as dst_path, \ +with iotests.ImagePath('src.qcow2') as src_path, \ + iotests.ImagePath('dst.qcow2') as dst_path, \ iotests.VM() as vm: iotests.log('=== Create images and start VM ===') iotests.log('') 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) + assert create_test_image(src_path, size) == 0 + assert create_test_image(dst_path, size) == 0 iotests.log(iotests.qemu_io('-f', iotests.imgfmt, '-c', 'write 0 1M', src_path), diff --git a/tests/qemu-iotests/255.out b/tests/qemu-iotests/255.out index 348909fdef..2e837cbb5f 100644 --- a/tests/qemu-iotests/255.out +++ b/tests/qemu-iotests/255.out @@ -3,10 +3,6 @@ Finishing a commit job with background reads === Create backing chain and start VM === -Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 - -Formatting 'TEST_DIR/PID-t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 - === Start background read requests === === Run a commit job === @@ -23,10 +19,6 @@ Closing the VM while a job is being cancelled === Create images and start VM === -Formatting 'TEST_DIR/PID-src.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 - -Formatting 'TEST_DIR/PID-dst.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 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) -- 2.21.0