]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: qemu-iotests - add vhdx log replay tests for qemu-img
authorJeff Cody <jcody@redhat.com>
Wed, 12 Feb 2014 21:30:53 +0000 (16:30 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 14 Feb 2014 17:05:39 +0000 (18:05 +0100)
VHDX logs can now be replayed via 'qemu-img check -r all'.  Add
tests to verify that the log replay is successful when using qemu-img.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/qemu-iotests/070
tests/qemu-iotests/070.out

index f84d2cb4ed3a1addd7d7add2c2300b2a076c920c..ce71fa4a225d955e1e1c1b1bf68da4dc41105f4f 100755 (executable)
@@ -62,6 +62,16 @@ $QEMU_IO -r -c "read -pP 0xa5 0 18M" "$TEST_IMG" 2>&1 | _filter_testdir \
 echo "=== Verify open image replays log  ==="
 $QEMU_IO  -c "read -pP 0xa5 0 18M" "$TEST_IMG" | _filter_qemu_io
 
+# extract fresh sample image again
+_use_sample_img iotest-dirtylog-10G-4M.vhdx.bz2
+
+echo "=== Verify qemu-img check -r all replays log  ==="
+$QEMU_IMG check -r all "$TEST_IMG" 2>&1 | _filter_testdir | _filter_qemu
+
+echo "=== Verify open image read-only succeeds after log replay ==="
+$QEMU_IO -r -c "read -pP 0xa5 0 18M" "$TEST_IMG" 2>&1 | _filter_testdir \
+                                                      | _filter_qemu_io
+
 # success, all done
 echo "*** done"
 rm -f $seq.full
index 0352adced4f99e79d962cb1e9fe055657204c651..922d62cb516c416c9d98d6478eeb850e69ccd2d9 100644 (file)
@@ -7,4 +7,15 @@ qemu-io: can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image file
 === Verify open image replays log  ===
 read 18874368/18874368 bytes at offset 0
 18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+=== Verify qemu-img check -r all replays log  ===
+The following inconsistencies were found and repaired:
+
+    0 leaked clusters
+    1 corruptions
+
+Double checking the fixed image now...
+No errors were found on the image.
+=== Verify open image read-only succeeds after log replay ===
+read 18874368/18874368 bytes at offset 0
+18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done