iotests: Clean up "mv $TEST_IMG $TEST_IMG.XXX"
v2 cover iotests: Clean up "mv $TEST_IMG $TEST_IMG.XXX"
v2: Add Max's rev-by in patches 1-9.
Fix quote bugs in patch 10 and split out _img_info filtering patch 11.
Commit 794d00f71d fixed two "mv" commands into the TEST_IMG override approach. There are still more occasions of "mv", this series fixes them.
The benefit is it drops the assumption that the created image is a single file, which is not true for VMDK or the coming QBM format. On top of this, those formats can be added to these cases later.
The patches stems from QBM work, but I will also take a look at adding applicable VMDK subformats once merged.
Please review.
Fam
Fam Zheng (11):
iotests: 018: Use TEST_IMG override instead of "mv"
iotests: 019: Use TEST_IMG override instead of "mv"
iotests: 020: Use TEST_IMG override instead of "mv"
iotests: 024: Use TEST_IMG override instead of "mv"
iotests: 028: Use TEST_IMG override instead of "mv"
iotests: 034: Use TEST_IMG override instead of "mv"
iotests: 037: Use TEST_IMG override instead of "mv"
iotests: 038: Use TEST_IMG override instead of "mv"
iotests: 050: Use TEST_IMG override instead of "mv"
iotests: 095: Use TEST_IMG override instead of "mv"
iotests: 095: Filter _img_info output
tests/qemu-iotests/018 | 8 ++++---- tests/qemu-iotests/018.out | 2 +- tests/qemu-iotests/019 | 13 +++++++------ tests/qemu-iotests/019.out | 4 ++-- tests/qemu-iotests/020 | 7 +++++-- tests/qemu-iotests/020.out | 2 +- tests/qemu-iotests/024 | 10 ++++++++-- tests/qemu-iotests/024.out | 4 ++-- tests/qemu-iotests/028 | 5 ++++- tests/qemu-iotests/028.out | 2 +- tests/qemu-iotests/034 | 6 +++++- tests/qemu-iotests/034.out | 2 +- tests/qemu-iotests/037 | 5 ++++- tests/qemu-iotests/037.out | 2 +- tests/qemu-iotests/038 | 5 ++++- tests/qemu-iotests/038.out | 2 +- tests/qemu-iotests/050 | 9 +++++++-- tests/qemu-iotests/050.out | 4 ++-- tests/qemu-iotests/095 | 10 ++++------ tests/qemu-iotests/095.out | 6 ++---- 20 files changed, 66 insertions(+), 42 deletions(-)
Signature · 1 line
2.4.3
PATCH v2 1/11 iotests: 018: Use TEST_IMG override instead of "mv"
--- tests/qemu-iotests/018 | 8 ++++---- tests/qemu-iotests/018.out | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
tests/qemu-iotests/018 +4 -4
@@ -66,8 +66,8 @@ _check_test_img echo "Creating test image with backing file" echo -TEST_IMG=$TEST_IMG_SAVE -_make_test_img -b "$TEST_IMG.base" 6G +TEST_IMG="$TEST_IMG_SAVE.orig" +_make_test_img -b "$TEST_IMG_SAVE.base" 6G echo "Filling test image" echo
@@ -81,8 +81,8 @@ for offset in $TEST_OFFSETS; do done _check_test_img -mv "$TEST_IMG" "$TEST_IMG.orig" -$QEMU_IMG convert -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG" +TEST_IMG="$TEST_IMG_SAVE" +$QEMU_IMG convert -f $IMGFMT -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG" echo "Reading" echo
tests/qemu-iotests/018.out +1 -1
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4295032832 No errors were found on the image. Creating test image with backing file -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base Filling test image === IO: pattern 1
Signature · 1 line
2.4.3
PATCH v2 2/11 iotests: 019: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/019 | 13 +++++++------ tests/qemu-iotests/019.out | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-)
tests/qemu-iotests/019 +7 -6
@@ -54,6 +54,9 @@ _unsupported_imgopts "subformat=monolithicFlat" \ TEST_OFFSETS="0 4294967296" CLUSTER_SIZE=65536 +TEST_IMG_SAVE="$TEST_IMG" +TEST_IMG="$TEST_IMG.base" + _make_test_img 6G echo "Filling base image"
@@ -71,8 +74,8 @@ _check_test_img echo "Creating test image with backing file" echo -mv "$TEST_IMG" "$TEST_IMG.base" -_make_test_img -b "$TEST_IMG.base" 6G +TEST_IMG="$TEST_IMG_SAVE.orig" +_make_test_img -b "$TEST_IMG_SAVE.base" 6G echo "Filling test image" echo
@@ -86,9 +89,7 @@ for offset in $TEST_OFFSETS; do done _check_test_img -mv "$TEST_IMG" "$TEST_IMG.orig" - - +TEST_IMG="$TEST_IMG_SAVE" # Test the conversion twice: One test with the old-style -B option and another # one with -o backing_file
@@ -98,7 +99,7 @@ for backing_option in "-B " "-o backing_file="; do echo echo Testing conversion with $backing_option"$TEST_IMG.base" | _filter_testdir | _filter_imgfmt echo - $QEMU_IMG convert -O $IMGFMT $backing_option"$TEST_IMG.base" "$TEST_IMG.orig" "$TEST_IMG" + $QEMU_IMG convert -f $IMGFMT -O $IMGFMT $backing_option"$TEST_IMG.base" "$TEST_IMG.orig" "$TEST_IMG" echo "Checking if backing clusters are allocated when they shouldn't" echo
tests/qemu-iotests/019.out +2 -2
@@ -1,5 +1,5 @@ QA output created by 019 -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=6442450944 Filling base image === IO: pattern 42
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4296015872 No errors were found on the image. Creating test image with backing file -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base Filling test image === IO: pattern 43
Signature · 1 line
2.4.3
PATCH v2 3/11 iotests: 020: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/020 | 7 +++++-- tests/qemu-iotests/020.out | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-)
tests/qemu-iotests/020 +5 -2
@@ -56,6 +56,9 @@ fi TEST_OFFSETS="0 4294967296" +TEST_IMG_SAVE="$TEST_IMG" +TEST_IMG="$TEST_IMG.base" + _make_test_img 6G echo "Filling base image"
@@ -73,7 +76,7 @@ _check_test_img echo "Creating test image with backing file" echo -mv "$TEST_IMG" "$TEST_IMG.base" +TEST_IMG="$TEST_IMG_SAVE" _make_test_img -b "$TEST_IMG.base" 6G echo "Filling test image"
@@ -89,7 +92,7 @@ done _check_test_img $QEMU_IMG commit "$TEST_IMG" -mv "$TEST_IMG.base" "$TEST_IMG" +TEST_IMG="$TEST_IMG.base" echo "Reading from the backing file" echo
tests/qemu-iotests/020.out +1 -1
@@ -1,5 +1,5 @@ QA output created by 020 -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=6442450944 Filling base image === IO: pattern 0
Signature · 1 line
2.4.3
PATCH v2 4/11 iotests: 024: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/024 | 10 ++++++++-- tests/qemu-iotests/024.out | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-)
tests/qemu-iotests/024 +8 -2
@@ -60,16 +60,22 @@ CLUSTER_SIZE=65536 echo "Creating backing file" echo +TEST_IMG_SAVE="$TEST_IMG" +TEST_IMG="$TEST_IMG.base_old" + _make_test_img 1G io_pattern writev 0 $CLUSTER_SIZE $((2 * CLUSTER_SIZE)) 8 0x11 -mv "$TEST_IMG" "$TEST_IMG.base_old" + +TEST_IMG="$TEST_IMG_SAVE.base_new" echo "Creating new backing file" echo _make_test_img 1G io_pattern writev 0 $((2 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 4 0x22 -mv "$TEST_IMG" "$TEST_IMG.base_new" + + +TEST_IMG="$TEST_IMG_SAVE" echo "Creating COW image" echo
tests/qemu-iotests/024.out +2 -2
@@ -1,7 +1,7 @@ QA output created by 024 Creating backing file -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 +Formatting 'TEST_DIR/t.IMGFMT.base_old', fmt=IMGFMT size=1073741824 === IO: pattern 0x11 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -21,7 +21,7 @@ wrote 65536/65536 bytes at offset 917504 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Creating new backing file -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 +Formatting 'TEST_DIR/t.IMGFMT.base_new', fmt=IMGFMT size=1073741824 === IO: pattern 0x22 wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Signature · 1 line
2.4.3
PATCH v2 5/11 iotests: 028: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/028 | 5 ++++- tests/qemu-iotests/028.out | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
tests/qemu-iotests/028 +4 -1
@@ -60,6 +60,9 @@ base_size=$(( image_size - 1024 * 1024 * 1024 )) offset=$(( base_size - 32 * 1024 )) +TEST_IMG_SAVE="$TEST_IMG" +TEST_IMG="$TEST_IMG.base" + _make_test_img $base_size echo "Filling base image"
@@ -73,7 +76,7 @@ _check_test_img echo "Creating test image with backing file" echo -mv "$TEST_IMG" "$TEST_IMG.base" +TEST_IMG="$TEST_IMG_SAVE" _make_test_img -b "$TEST_IMG.base" $image_size echo "Filling test image"
tests/qemu-iotests/028.out +1 -1
@@ -1,5 +1,5 @@ QA output created by 028 -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=3221227008 +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=3221227008 Filling base image === IO: pattern 195
Signature · 1 line
2.4.3
PATCH v2 6/11 iotests: 034: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/034 | 6 +++++- tests/qemu-iotests/034.out | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
tests/qemu-iotests/034 +5 -1
@@ -51,9 +51,13 @@ size=128M echo echo "== creating backing file for COW tests ==" +TEST_IMG_SAVE="$TEST_IMG" +TEST_IMG="$TEST_IMG.base" + _make_test_img $size $QEMU_IO -c "write -P 0x55 0 1M" "$TEST_IMG" | _filter_qemu_io -mv "$TEST_IMG" "$TEST_IMG.base" + +TEST_IMG="$TEST_IMG_SAVE" _make_test_img -b "$TEST_IMG.base" 6G
tests/qemu-iotests/034.out +1 -1
@@ -1,7 +1,7 @@ QA output created by 034 == creating backing file for COW tests == -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728 wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
Signature · 1 line
2.4.3
PATCH v2 7/11 iotests: 037: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/037 | 5 ++++- tests/qemu-iotests/037.out | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
tests/qemu-iotests/037 +4 -1
@@ -51,6 +51,9 @@ size=128M echo echo "== creating backing file for COW tests ==" +TEST_IMG_SAVE="$TEST_IMG" +TEST_IMG="$TEST_IMG.base" + _make_test_img $size function backing_io()
@@ -71,7 +74,7 @@ function backing_io() backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io -mv "$TEST_IMG" "$TEST_IMG.base" +TEST_IMG="$TEST_IMG_SAVE" _make_test_img -b "$TEST_IMG.base" 6G
tests/qemu-iotests/037.out +1 -1
@@ -1,7 +1,7 @@ QA output created by 037 == creating backing file for COW tests == -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 512/512 bytes at offset 512
Signature · 1 line
2.4.3
PATCH v2 8/11 iotests: 038: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/038 | 5 ++++- tests/qemu-iotests/038.out | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
tests/qemu-iotests/038 +4 -1
@@ -48,6 +48,9 @@ size=128M echo echo "== creating backing file for COW tests ==" +TEST_IMG_SAVE="$TEST_IMG" +TEST_IMG="$TEST_IMG.base" + _make_test_img $size function backing_io()
@@ -68,7 +71,7 @@ function backing_io() backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io -mv "$TEST_IMG" "$TEST_IMG.base" +TEST_IMG="$TEST_IMG_SAVE" _make_test_img -b "$TEST_IMG.base" 6G
tests/qemu-iotests/038.out +1 -1
@@ -1,7 +1,7 @@ QA output created by 038 == creating backing file for COW tests == -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 65536
Signature · 1 line
2.4.3
PATCH v2 9/11 iotests: 050: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/050 | 9 +++++++-- tests/qemu-iotests/050.out | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-)
tests/qemu-iotests/050 +7 -2
@@ -51,14 +51,19 @@ fi echo echo "== Creating images ==" +TEST_IMG_SAVE="$TEST_IMG" +TEST_IMG="$TEST_IMG.old" + size=10M _make_test_img $size $QEMU_IO -c "write -P 0x40 0 1048576" "$TEST_IMG" | _filter_qemu_io -mv "$TEST_IMG" "$TEST_IMG.old" + +TEST_IMG="$TEST_IMG_SAVE.new" _make_test_img $size $QEMU_IO -c "write -P 0x5a 0 1048576" "$TEST_IMG" | _filter_qemu_io -mv "$TEST_IMG" "$TEST_IMG.new" + +TEST_IMG="$TEST_IMG_SAVE" _make_test_img -b "$TEST_IMG.old" $size $QEMU_IO -c "write -z 0 1048576" "$TEST_IMG" | _filter_qemu_io
tests/qemu-iotests/050.out +2 -2
@@ -1,10 +1,10 @@ QA output created by 050 == Creating images == -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=10485760 +Formatting 'TEST_DIR/t.IMGFMT.old', fmt=IMGFMT size=10485760 wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=10485760 +Formatting 'TEST_DIR/t.IMGFMT.new', fmt=IMGFMT size=10485760 wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=10485760 backing_file=TEST_DIR/t.IMGFMT.old
Signature · 1 line
2.4.3
PATCH v2 10/11 iotests: 095: Use TEST_IMG override instead of "mv"
In reply to Fam Zheng--- tests/qemu-iotests/095 | 6 ++---- tests/qemu-iotests/095.out | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-)
tests/qemu-iotests/095 +2 -4
@@ -50,11 +50,9 @@ _supported_os Linux size_smaller=5M size_larger=100M -_make_test_img $size_smaller -mv "${TEST_IMG}" "${TEST_IMG}.base" +TEST_IMG="$TEST_IMG.base" _make_test_img $size_smaller -_make_test_img -b "${TEST_IMG}.base" $size_larger -mv "${TEST_IMG}" "${TEST_IMG}.snp1" +TEST_IMG="$TEST_IMG.snp1" _make_test_img -b "$TEST_IMG.base" $size_larger _make_test_img -b "${TEST_IMG}.snp1" $size_larger
tests/qemu-iotests/095.out +2 -2
@@ -1,6 +1,6 @@ QA output created by 095 -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=5242880 -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.base +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=5242880 +Formatting 'TEST_DIR/t.IMGFMT.snp1', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.base Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.snp1 === Base image info before commit and resize ===
Signature · 1 line
2.4.3
PATCH v2 11/11 iotests: 095: Filter _img_info output
In reply to Fam Zheng--- tests/qemu-iotests/095 | 4 ++-- tests/qemu-iotests/095.out | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-)
tests/qemu-iotests/095 +2 -2
@@ -58,7 +58,7 @@ _make_test_img -b "${TEST_IMG}.snp1" $size_larger echo echo "=== Base image info before commit and resize ===" -TEST_IMG="${TEST_IMG}.base" _img_info +TEST_IMG="${TEST_IMG}.base" _img_info | _filter_img_info echo echo === Running QEMU Live Commit Test ===
@@ -76,7 +76,7 @@ _send_qemu_cmd $h "{ 'execute': 'block-commit', echo echo "=== Base image info after commit and resize ===" -TEST_IMG="${TEST_IMG}.base" _img_info +TEST_IMG="${TEST_IMG}.base" _img_info | _filter_img_info # success, all done echo "*** done"
tests/qemu-iotests/095.out +0 -2
@@ -7,7 +7,6 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/ image: TEST_DIR/t.IMGFMT.base file format: IMGFMT virtual size: 5.0M (5242880 bytes) -cluster_size: 65536 === Running QEMU Live Commit Test ===
@@ -19,5 +18,4 @@ cluster_size: 65536 image: TEST_DIR/t.IMGFMT.base file format: IMGFMT virtual size: 100M (104857600 bytes) -cluster_size: 65536 *** done
Signature · 1 line
2.4.3
Max Reitz
AppliedQuoted 10 lines · Fam Zheng
v2: Add Max's rev-by in patches 1-9.
Fix quote bugs in patch 10 and split out_img_infofiltering patch 11.Commit
794d00f71dfixed two "mv" commands into theTEST_IMGoverride approach. There are still more occasions of "mv", this series fixes them.The benefit is it drops the assumption that the created image is a single file, which is not true for VMDK or the coming QBM format. On top of this, those formats can be added to these cases later.
Quoted 6 lines
The patches stems from QBM work, but I will also take a look at adding applicable VMDK subformats once merged.
Please review.
Fam
Thanks, applied to my block tree:
https://github.com/XanClic/qemu/commits/block
Max