yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 445ea167eadbc4b951b46c8a2ab52cc0ce681aac Mon Sep 17 00:00:00 2001
9ae3a8
From: Jeffrey Cody <jcody@redhat.com>
9ae3a8
Date: Wed, 20 Nov 2013 19:44:07 +0100
9ae3a8
Subject: [PATCH 24/25] block: qemu-iotests for vhdx, add write test support
9ae3a8
9ae3a8
RH-Author: Jeffrey Cody <jcody@redhat.com>
9ae3a8
Message-id: <dfa3072f5edd6daf7e2088b868ababb5ff8afe06.1384975172.git.jcody@redhat.com>
9ae3a8
Patchwork-id: 55817
9ae3a8
O-Subject: [RHEL7 qemu-kvm PATCH 24/26] block: qemu-iotests for vhdx, add write test support
9ae3a8
Bugzilla: 879234
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
9ae3a8
This removes the IMGFMT_GENERIC blocker for read-only, so existing
9ae3a8
iotests run read/write tests for vhdx images created by qemu-img (e.g.
9ae3a8
tests 001, 002, 003).
9ae3a8
9ae3a8
In addition, this updates the sample image test for the Hyper-V
9ae3a8
created image, to verify we can write it as well.
9ae3a8
9ae3a8
Signed-off-by: Jeff Cody <jcody@redhat.com>
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
(cherry picked from commit 751aec24cdcd4359b5927df5cebfe6b8d3e74515)
9ae3a8
9ae3a8
RHEL7 Note:  Difference from upstream - there was a typo in this patch,
9ae3a8
             that used 'MM' instead of 'M' for size passed into qemu-io.
9ae3a8
             Upstream apparently gobbles the extra 'M' without error,
9ae3a8
             but RHEL7 does not.  Fix this so that test 064 passes.
9ae3a8
9ae3a8
Signed-off-by: Jeff Cody <jcody@redhat.com>
9ae3a8
---
9ae3a8
 tests/qemu-iotests/064     | 11 +++++++++++
9ae3a8
 tests/qemu-iotests/064.out | 14 ++++++++++++++
9ae3a8
 tests/qemu-iotests/common  |  1 -
9ae3a8
 3 files changed, 25 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 tests/qemu-iotests/064     |   11 +++++++++++
9ae3a8
 tests/qemu-iotests/064.out |   14 ++++++++++++++
9ae3a8
 tests/qemu-iotests/common  |    1 -
9ae3a8
 3 files changed, 25 insertions(+), 1 deletions(-)
9ae3a8
9ae3a8
diff --git a/tests/qemu-iotests/064 b/tests/qemu-iotests/064
9ae3a8
index 6789aa6..906205e 100755
9ae3a8
--- a/tests/qemu-iotests/064
9ae3a8
+++ b/tests/qemu-iotests/064
9ae3a8
@@ -56,6 +56,17 @@ echo
9ae3a8
 echo "=== Verify pattern 0x00, 66M - 1024M ==="
9ae3a8
 $QEMU_IO -r -c "read -pP 0x00 66M 958M" "$TEST_IMG" | _filter_qemu_io
9ae3a8
 
9ae3a8
+echo
9ae3a8
+echo "=== Verify pattern write, 0xc3 99M-157M ==="
9ae3a8
+$QEMU_IO -c "write -pP 0xc3 99M 58M" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+# first verify we didn't write where we should not have
9ae3a8
+$QEMU_IO -c "read -pP 0xa5 0 33M" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+$QEMU_IO -c "read -pP 0x96 33M 33M" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+$QEMU_IO -c "read -pP 0x00 66M 33M" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+$QEMU_IO -c "read -pP 0x00 157M 867M" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+# now verify what we should have actually written
9ae3a8
+$QEMU_IO -c "read -pP 0xc3 99M 58M" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+
9ae3a8
 # success, all done
9ae3a8
 echo "*** done"
9ae3a8
 rm -f $seq.full
9ae3a8
diff --git a/tests/qemu-iotests/064.out b/tests/qemu-iotests/064.out
9ae3a8
index b9e8e4a..5346a4e 100644
9ae3a8
--- a/tests/qemu-iotests/064.out
9ae3a8
+++ b/tests/qemu-iotests/064.out
9ae3a8
@@ -11,4 +11,18 @@ read 34603008/34603008 bytes at offset 34603008
9ae3a8
 === Verify pattern 0x00, 66M - 1024M ===
9ae3a8
 read 1004535808/1004535808 bytes at offset 69206016
9ae3a8
 958 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+
9ae3a8
+=== Verify pattern write, 0xc3 99M-157M ===
9ae3a8
+wrote 60817408/60817408 bytes at offset 103809024
9ae3a8
+58 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+read 34603008/34603008 bytes at offset 0
9ae3a8
+33 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+read 34603008/34603008 bytes at offset 34603008
9ae3a8
+33 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+read 34603008/34603008 bytes at offset 69206016
9ae3a8
+33 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+read 909115392/909115392 bytes at offset 164626432
9ae3a8
+867 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+read 60817408/60817408 bytes at offset 103809024
9ae3a8
+58 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
 *** done
9ae3a8
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
9ae3a8
index 2932e14..8cde7f1 100644
9ae3a8
--- a/tests/qemu-iotests/common
9ae3a8
+++ b/tests/qemu-iotests/common
9ae3a8
@@ -200,7 +200,6 @@ testlist options
9ae3a8
         -vhdx)
9ae3a8
             IMGFMT=vhdx
9ae3a8
             xpand=false
9ae3a8
-            IMGFMT_GENERIC=false
9ae3a8
             ;;
9ae3a8
 
9ae3a8
         -rbd)
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8