* [Qemu-devel] [PATCH 1/2] block: qemu-iotests - fix test 070 (vhdx)
2014-02-12 21:30 [Qemu-devel] [PATCH 0/2] qemu-iotest fixes and updates for 070 Jeff Cody
@ 2014-02-12 21:30 ` Jeff Cody
2014-02-12 21:30 ` [Qemu-devel] [PATCH 2/2] block: qemu-iotests - add vhdx log replay tests for qemu-img Jeff Cody
2014-02-14 15:18 ` [Qemu-devel] [PATCH 0/2] qemu-iotest fixes and updates for 070 Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Cody @ 2014-02-12 21:30 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
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.
Signed-off-by: Jeff Cody <jcody@redhat.com>
---
tests/qemu-iotests/070 | 3 ++-
tests/qemu-iotests/070.out | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070
index 41bf100..f84d2cb 100755
--- a/tests/qemu-iotests/070
+++ b/tests/qemu-iotests/070
@@ -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
diff --git a/tests/qemu-iotests/070.out b/tests/qemu-iotests/070.out
index 9db8ff2..0352adc 100644
--- a/tests/qemu-iotests/070.out
+++ b/tests/qemu-iotests/070.out
@@ -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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 2/2] block: qemu-iotests - add vhdx log replay tests for qemu-img
2014-02-12 21:30 [Qemu-devel] [PATCH 0/2] qemu-iotest fixes and updates for 070 Jeff Cody
2014-02-12 21:30 ` [Qemu-devel] [PATCH 1/2] block: qemu-iotests - fix test 070 (vhdx) Jeff Cody
@ 2014-02-12 21:30 ` Jeff Cody
2014-02-14 15:18 ` [Qemu-devel] [PATCH 0/2] qemu-iotest fixes and updates for 070 Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Cody @ 2014-02-12 21:30 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
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>
---
tests/qemu-iotests/070 | 10 ++++++++++
tests/qemu-iotests/070.out | 11 +++++++++++
2 files changed, 21 insertions(+)
diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070
index f84d2cb..ce71fa4 100755
--- a/tests/qemu-iotests/070
+++ b/tests/qemu-iotests/070
@@ -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
diff --git a/tests/qemu-iotests/070.out b/tests/qemu-iotests/070.out
index 0352adc..922d62c 100644
--- a/tests/qemu-iotests/070.out
+++ b/tests/qemu-iotests/070.out
@@ -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
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] qemu-iotest fixes and updates for 070
2014-02-12 21:30 [Qemu-devel] [PATCH 0/2] qemu-iotest fixes and updates for 070 Jeff Cody
2014-02-12 21:30 ` [Qemu-devel] [PATCH 1/2] block: qemu-iotests - fix test 070 (vhdx) Jeff Cody
2014-02-12 21:30 ` [Qemu-devel] [PATCH 2/2] block: qemu-iotests - add vhdx log replay tests for qemu-img Jeff Cody
@ 2014-02-14 15:18 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2014-02-14 15:18 UTC (permalink / raw)
To: Jeff Cody; +Cc: kwolf, qemu-devel, stefanha
On Wed, Feb 12, 2014 at 04:30:51PM -0500, Jeff Cody wrote:
> 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(-)
>
> --
> 1.8.3.1
>
>
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread