cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From af156d9a912c96203f26cde732f95357d7f63cd4 Mon Sep 17 00:00:00 2001
9ae3a8
From: Max Reitz <mreitz@redhat.com>
9ae3a8
Date: Tue, 7 Jan 2014 21:57:18 +0100
9ae3a8
Subject: [PATCH 13/14] qemu-iotests: New test case in 061
9ae3a8
9ae3a8
RH-Author: Max Reitz <mreitz@redhat.com>
9ae3a8
Message-id: <1389131839-12920-14-git-send-email-mreitz@redhat.com>
9ae3a8
Patchwork-id: 56549
9ae3a8
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 13/14] qemu-iotests: New test case in 061
9ae3a8
Bugzilla: 1033490
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
9ae3a8
BZ: 1033490
9ae3a8
9ae3a8
Add one test case for zero cluster expansion on qcow2 version downgrade
9ae3a8
in shared L2 tables (i.e., L2 tables with a refcount > 1) and one for
9ae3a8
zero expansion on backed clusters in shared L2 tables.
9ae3a8
9ae3a8
Signed-off-by: Max Reitz <mreitz@redhat.com>
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
(cherry picked from commit d982919d3897f36d79e215c46e3bc27fd6e27bf8)
9ae3a8
9ae3a8
Signed-off-by: Max Reitz <mreitz@redhat.com>
9ae3a8
---
9ae3a8
 tests/qemu-iotests/061     | 28 ++++++++++++++++++++++++++++
9ae3a8
 tests/qemu-iotests/061.out | 27 +++++++++++++++++++++++++++
9ae3a8
 2 files changed, 55 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 tests/qemu-iotests/061     |   28 ++++++++++++++++++++++++++++
9ae3a8
 tests/qemu-iotests/061.out |   27 +++++++++++++++++++++++++++
9ae3a8
 2 files changed, 55 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
9ae3a8
index 86404e6..5f04bfa 100644
9ae3a8
--- a/tests/qemu-iotests/061
9ae3a8
+++ b/tests/qemu-iotests/061
9ae3a8
@@ -146,6 +146,19 @@ _check_test_img
9ae3a8
 $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
9ae3a8
 
9ae3a8
 echo
9ae3a8
+echo "=== Testing zero expansion on shared L2 table ==="
9ae3a8
+echo
9ae3a8
+IMGOPTS="compat=1.1" _make_test_img 64M
9ae3a8
+$QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
9ae3a8
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
9ae3a8
+_check_test_img
9ae3a8
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
9ae3a8
+_check_test_img
9ae3a8
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+
9ae3a8
+echo
9ae3a8
 echo "=== Testing zero expansion on backed image ==="
9ae3a8
 echo
9ae3a8
 IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
9ae3a8
@@ -172,6 +185,21 @@ $QEMU_IMG snapshot -a foo "$TEST_IMG"
9ae3a8
 _check_test_img
9ae3a8
 $QEMU_IO -c "read -P 0 0 64k" -c "read -P 0x2a 64k 64k" "$TEST_IMG" | _filter_qemu_io
9ae3a8
 
9ae3a8
+echo
9ae3a8
+echo "=== Testing zero expansion on backed image with shared L2 table ==="
9ae3a8
+echo
9ae3a8
+IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
9ae3a8
+$QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
9ae3a8
+IMGOPTS="compat=1.1,backing_file=$TEST_IMG.base" _make_test_img 64M
9ae3a8
+$QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
9ae3a8
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
9ae3a8
+_check_test_img
9ae3a8
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
9ae3a8
+_check_test_img
9ae3a8
+$QEMU_IO -c "read -P 0 0 128k" "$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/061.out b/tests/qemu-iotests/061.out
9ae3a8
index 05bd1d5..d42127f 100644
9ae3a8
--- a/tests/qemu-iotests/061.out
9ae3a8
+++ b/tests/qemu-iotests/061.out
9ae3a8
@@ -312,6 +312,18 @@ No errors were found on the image.
9ae3a8
 read 131072/131072 bytes at offset 0
9ae3a8
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
 
9ae3a8
+=== Testing zero expansion on shared L2 table ===
9ae3a8
+
9ae3a8
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
9ae3a8
+wrote 131072/131072 bytes at offset 0
9ae3a8
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+No errors were found on the image.
9ae3a8
+read 131072/131072 bytes at offset 0
9ae3a8
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+No errors were found on the image.
9ae3a8
+read 131072/131072 bytes at offset 0
9ae3a8
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+
9ae3a8
 === Testing zero expansion on backed image ===
9ae3a8
 
9ae3a8
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
9ae3a8
@@ -346,4 +358,19 @@ read 65536/65536 bytes at offset 0
9ae3a8
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
 read 65536/65536 bytes at offset 65536
9ae3a8
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+
9ae3a8
+=== Testing zero expansion on backed image with shared L2 table ===
9ae3a8
+
9ae3a8
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
9ae3a8
+wrote 131072/131072 bytes at offset 0
9ae3a8
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='TEST_DIR/t.IMGFMT.base' 
9ae3a8
+wrote 131072/131072 bytes at offset 0
9ae3a8
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+No errors were found on the image.
9ae3a8
+read 131072/131072 bytes at offset 0
9ae3a8
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+No errors were found on the image.
9ae3a8
+read 131072/131072 bytes at offset 0
9ae3a8
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
 *** done
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8