qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 12/16] iotests: testcase for backing in parallels fo


From: Denis V. Lunev
Subject: [Qemu-devel] [PATCH 12/16] iotests: testcase for backing in parallels format
Date: Mon, 15 Dec 2014 11:27:57 +0300

From: Roman Kagan <address@hidden>

This patch adds a testcase for reading from a backing file when both the
current image and the backing one are in parallels format.

Signed-off-by: Roman Kagan <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Jeff Cody <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
---
 tests/qemu-iotests/076     | 21 +++++++++++++++++++++
 tests/qemu-iotests/076.out |  4 ++++
 2 files changed, 25 insertions(+)

diff --git a/tests/qemu-iotests/076 b/tests/qemu-iotests/076
index 766b359..04b359b 100755
--- a/tests/qemu-iotests/076
+++ b/tests/qemu-iotests/076
@@ -31,6 +31,11 @@ status=1     # failure is the default!
 _cleanup()
 {
        _cleanup_test_img
+
+   if [ -n "$TEST_IMG_BASE" ]
+   then
+       rm -f "$TEST_IMG_BASE"
+   fi
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
@@ -87,6 +92,22 @@ _use_sample_img parallels-v2-padded.bz2
 _use_sample_img parallels-padded.xml.bz2
 { $QEMU_IO -c "read -P 0x11 0 64k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | 
_filter_testdir
 
+echo
+echo "== Read from an image with a backing image =="
+TEST_IMG_BASE="$TEST_IMG.base"
+_use_sample_img parallels-v1.bz2
+mv -f "$TEST_IMG" "$TEST_IMG_BASE"
+dd if="$TEST_IMG_BASE" of="$TEST_IMG" bs=64 count=1 &>/dev/null
+dd if=/dev/zero of="$TEST_IMG" bs=1M count=0 seek=1 conv=notrunc &>/dev/null
+{ $QEMU_IO -c "read -P 0x11 0 64k" \
+    "json:{
+        \"file\": {\"filename\": \"$TEST_IMG\"},
+        \"backing\":{
+            \"file\":{\"filename\":\"$TEST_IMG_BASE\"},
+            \"driver\":\"parallels\"
+        }
+    }"; } 2>&1 | _filter_qemu_io | _filter_testdir
+
 # success, all done
 echo "*** done"
 rm -f $seq.full
diff --git a/tests/qemu-iotests/076.out b/tests/qemu-iotests/076.out
index 46680d8..0cce00c 100644
--- a/tests/qemu-iotests/076.out
+++ b/tests/qemu-iotests/076.out
@@ -27,4 +27,8 @@ read 65536/65536 bytes at offset 0
 == Read from a valid v2 image opened through xml with padding ==
 read 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+== Read from an image with a backing image ==
+read 65536/65536 bytes at offset 0
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
-- 
1.9.1




reply via email to

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