Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- tests/qemu-iotests/025 | 19 +++++++++++++++++-- tests/qemu-iotests/025.out | 12 +++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/025 b/tests/qemu-iotests/025 index f5e672e6b3..658601579b 100755 --- a/tests/qemu-iotests/025 +++ b/tests/qemu-iotests/025 @@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter . ./common.pattern -_supported_fmt raw qcow2 qed +_supported_fmt raw qcow2 _supported_proto file sheepdog rbd nfs _supported_os Linux @@ -46,6 +46,7 @@ echo "=== Creating image" echo small_size=$((128 * 1024 * 1024)) big_size=$((384 * 1024 * 1024)) +bigger_size=$((512 * 1024 * 1024)) _make_test_img $small_size echo @@ -54,7 +55,20 @@ io_pattern write 0 $small_size 0 1 0xc5 _check_test_img echo -echo "=== Resizing image" +echo "=== Growing image" +$QEMU_IO "$TEST_IMG" <<EOF | _filter_qemu_io +length +truncate $bigger_size +length +EOF +_check_test_img + +echo +echo "=== Verifying image size after reopen" +$QEMU_IO -c "length" "$TEST_IMG" + +echo +echo "=== Reducing image" $QEMU_IO "$TEST_IMG" <<EOF | _filter_qemu_io length truncate $big_size @@ -70,6 +84,7 @@ echo echo "=== Verifying resized image" io_pattern read 0 $small_size 0 1 0xc5 io_pattern read $small_size $(($big_size - $small_size)) 0 1 0 +io_pattern read $big_size $(($bigger_size - $big_size)) 0 1 0 # success, all done echo "*** done" diff --git a/tests/qemu-iotests/025.out b/tests/qemu-iotests/025.out index f13fc2863c..a0293711c7 100644 --- a/tests/qemu-iotests/025.out +++ b/tests/qemu-iotests/025.out @@ -9,8 +9,16 @@ wrote 134217728/134217728 bytes at offset 0 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) No errors were found on the image. -=== Resizing image +=== Growing image 128 MiB +512 MiB +No errors were found on the image. + +=== Verifying image size after reopen +512 MiB + +=== Reducing image +512 MiB 384 MiB No errors were found on the image. @@ -24,4 +32,6 @@ read 134217728/134217728 bytes at offset 0 === IO: pattern 0 read 268435456/268435456 bytes at offset 134217728 256 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +=== IO: pattern 0 +read failed: Input/output error *** done -- 2.11.0