aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/061
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2013-09-05 10:55:54 +0200
committerKevin Wolf <kwolf@redhat.com>2013-09-12 10:12:47 +0200
commitd982919d3897f36d79e215c46e3bc27fd6e27bf8 (patch)
tree75d8c1b1c38e7e8f9f6dca1aa326e789bcf9722f /tests/qemu-iotests/061
parentfd9c577b24818e0051e93c4f1e3db7262869f162 (diff)
downloadqemu-d982919d3897f36d79e215c46e3bc27fd6e27bf8.zip
qemu-d982919d3897f36d79e215c46e3bc27fd6e27bf8.tar.gz
qemu-d982919d3897f36d79e215c46e3bc27fd6e27bf8.tar.bz2
qemu-iotests: New test case in 061
Add one test case for zero cluster expansion on qcow2 version downgrade in shared L2 tables (i.e., L2 tables with a refcount > 1) and one for zero expansion on backed clusters in shared L2 tables. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/061')
-rwxr-xr-xtests/qemu-iotests/06128
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
index 86404e6..5f04bfa 100755
--- a/tests/qemu-iotests/061
+++ b/tests/qemu-iotests/061
@@ -146,6 +146,19 @@ _check_test_img
$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
echo
+echo "=== Testing zero expansion on shared L2 table ==="
+echo
+IMGOPTS="compat=1.1" _make_test_img 64M
+$QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
+_check_test_img
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
+_check_test_img
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
+
+echo
echo "=== Testing zero expansion on backed image ==="
echo
IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
@@ -172,6 +185,21 @@ $QEMU_IMG snapshot -a foo "$TEST_IMG"
_check_test_img
$QEMU_IO -c "read -P 0 0 64k" -c "read -P 0x2a 64k 64k" "$TEST_IMG" | _filter_qemu_io
+echo
+echo "=== Testing zero expansion on backed image with shared L2 table ==="
+echo
+IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
+$QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
+IMGOPTS="compat=1.1,backing_file=$TEST_IMG.base" _make_test_img 64M
+$QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
+_check_test_img
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
+_check_test_img
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
+
# success, all done
echo "*** done"
rm -f $seq.full