qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] qemu-iotests: add reducing image test in 02


From: Pavel Butsykin
Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-iotests: add reducing image test in 025
Date: Wed, 31 May 2017 17:54:05 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1



On 31.05.2017 17:43, Pavel Butsykin wrote:
Signed-off-by: Pavel Butsykin <address@hidden>
---
  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

I'm not sure, can I so blatantly drop QED here. But this place is very
suitable for reduce image case. Perhaps the alternative would be adding
a new test, I just didn't want to copy the tests, which are testing
almost the same thing.

  _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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]