Skip to contentSkip to conversation

qemu-iotest fixes and updates for 070

PATCH Applied Jeff Cody 2 participants 4 messages Feb 12, 2014 – Feb 14, 2014

lore
Share & tools
lore

Jeff Cody

author
#0 lore raw

cover qemu-iotest fixes and updates for 070

This fixes a bug with test 070 (incorrect output expectation), and adds additional test for log replay.

Jeff Cody (2):
block: qemu-iotests - fix test 070 (vhdx)
block: qemu-iotests - add vhdx log replay tests for qemu-img

 tests/qemu-iotests/070     | 13 ++++++++++++-
 tests/qemu-iotests/070.out | 15 ++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/2 block: qemu-iotests - fix test 070 (vhdx)

VHDX test 070 failed, due to different output from qemu-io / qemu when opening an image read-only that contains a log file. Filter the output, and update the expected results to match the correct output.

---
 tests/qemu-iotests/070     | 3 ++-
 tests/qemu-iotests/070.out | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)
tests/qemu-iotests/070 +2 -1
index 41bf100..f84d2cb 100755
@@ -56,7 +56,8 @@ _use_sample_img iotest-dirtylog-10G-4M.vhdx.bz2
 
 echo
 echo "=== Verify open image read-only fails, due to dirty log ==="
-$QEMU_IO -r -c "read -pP 0xa5 0 18M" "$TEST_IMG" 2>&1 | grep -o "Permission denied"
+$QEMU_IO -r -c "read -pP 0xa5 0 18M" "$TEST_IMG" 2>&1 | _filter_testdir \
+                                                      | _filter_qemu_io
 
 echo "=== Verify open image replays log  ==="
 $QEMU_IO  -c "read -pP 0xa5 0 18M" "$TEST_IMG" | _filter_qemu_io
tests/qemu-iotests/070.out +3 -1
index 9db8ff2..0352adc 100644
@@ -1,7 +1,9 @@
 QA output created by 070
 
 === Verify open image read-only fails, due to dirty log ===
-Permission denied
+qemu-io: can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image file 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' opened read-only, but contains a log that needs to be replayed.  To replay the log, execute:
+ qemu-img check -r all 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx': Operation not permitted
+ no file open, try 'help open'
 === 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)
Signature · 1 line
1.8.3.1
author
#2 lore raw

PATCH 2/2 block: qemu-iotests - add vhdx log replay tests for qemu-img

In reply to Jeff Cody

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.

---
 tests/qemu-iotests/070     | 10 ++++++++++
 tests/qemu-iotests/070.out | 11 +++++++++++
 2 files changed, 21 insertions(+)
tests/qemu-iotests/070 +10 -0
index f84d2cb..ce71fa4 100755
@@ -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
tests/qemu-iotests/070.out +11 -0
index 0352adc..922d62c 100644
@@ -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
Signature · 1 line
1.8.3.1
#3 lore raw
In reply to Jeff Cody
Quoted 4 lines · Jeff Cody

This fixes a bug with test 070 (incorrect output expectation), and adds additional test for log replay.

Quoted 12 lines

Jeff Cody (2):
block: qemu-iotests - fix test 070 (vhdx)
block: qemu-iotests - add vhdx log replay tests for qemu-img

 tests/qemu-iotests/070     | 13 ++++++++++++-
 tests/qemu-iotests/070.out | 15 ++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.3.1

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan