0a122b
From 63a9a6b55ad06913d6ed8c83708d8828149ad24b Mon Sep 17 00:00:00 2001
0a122b
From: Signed-off-by: Max Reitz <mreitz@redhat.com>
0a122b
Date: Thu, 9 Jan 2014 09:19:58 +0100
0a122b
Subject: [PATCH 12/14] qemu-iotest: qcow2 image option amendment
0a122b
0a122b
Message-id: <1389131839-12920-13-git-send-email-mreitz@redhat.com>
0a122b
Patchwork-id: 56548
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 12/14] qemu-iotest: qcow2 image option amendment
0a122b
Bugzilla: 1033490
0a122b
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
0a122b
RH-Acked-by: Fam Zheng <famz@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
0a122b
BZ: 1033490
0a122b
0a122b
Add tests for qemu-img amend on qcow2 image files.
0a122b
0a122b
Signed-off-by: Max Reitz <mreitz@redhat.com>
0a122b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
0a122b
(cherry picked from commit a8110c3d327cabff8dc258c5c8705903b56c1513)
0a122b
0a122b
Signed-off-by: Max Reitz <mreitz@redhat.com>
0a122b
---
0a122b
 tests/qemu-iotests/061     | 178 +++++++++++++++++++++++
0a122b
 tests/qemu-iotests/061.out | 349 +++++++++++++++++++++++++++++++++++++++++++++
0a122b
 tests/qemu-iotests/group   |   1 +
0a122b
 3 files changed, 528 insertions(+)
0a122b
 create mode 100755 tests/qemu-iotests/061
0a122b
 create mode 100644 tests/qemu-iotests/061.out
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 tests/qemu-iotests/061     |  178 ++++++++++++++++++++++
0a122b
 tests/qemu-iotests/061.out |  349 ++++++++++++++++++++++++++++++++++++++++++++
0a122b
 tests/qemu-iotests/group   |    1 +
0a122b
 3 files changed, 528 insertions(+), 0 deletions(-)
0a122b
 create mode 100644 tests/qemu-iotests/061
0a122b
 create mode 100644 tests/qemu-iotests/061.out
0a122b
0a122b
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
0a122b
new file mode 100644
0a122b
index 0000000..86404e6
0a122b
--- /dev/null
0a122b
+++ b/tests/qemu-iotests/061
0a122b
@@ -0,0 +1,178 @@
0a122b
+#!/bin/bash
0a122b
+#
0a122b
+# Test case for image option amendment in qcow2.
0a122b
+#
0a122b
+# Copyright (C) 2013 Red Hat, Inc.
0a122b
+#
0a122b
+# This program is free software; you can redistribute it and/or modify
0a122b
+# it under the terms of the GNU General Public License as published by
0a122b
+# the Free Software Foundation; either version 2 of the License, or
0a122b
+# (at your option) any later version.
0a122b
+#
0a122b
+# This program is distributed in the hope that it will be useful,
0a122b
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
0a122b
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0a122b
+# GNU General Public License for more details.
0a122b
+#
0a122b
+# You should have received a copy of the GNU General Public License
0a122b
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
0a122b
+#
0a122b
+
0a122b
+# creator
0a122b
+owner=mreitz@redhat.com
0a122b
+
0a122b
+seq=`basename $0`
0a122b
+echo "QA output created by $seq"
0a122b
+
0a122b
+here=`pwd`
0a122b
+tmp=/tmp/$$
0a122b
+status=1	# failure is the default!
0a122b
+
0a122b
+_cleanup()
0a122b
+{
0a122b
+	_cleanup_test_img
0a122b
+}
0a122b
+trap "_cleanup; exit \$status" 0 1 2 3 15
0a122b
+
0a122b
+# get standard environment, filters and checks
0a122b
+. ./common.rc
0a122b
+. ./common.filter
0a122b
+
0a122b
+# This tests qocw2-specific low-level functionality
0a122b
+_supported_fmt qcow2
0a122b
+_supported_proto generic
0a122b
+_supported_os Linux
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing version downgrade with zero expansion ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1,lazy_refcounts=on" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+_check_test_img
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing dirty version downgrade ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1,lazy_refcounts=on" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -P 0x2a 0 128k" -c flush -c abort "$TEST_IMG" | _filter_qemu_io
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IO -c "read -P 0x2a 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+_check_test_img
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing version downgrade with unknown compat/autoclear flags ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1" _make_test_img 64M
0a122b
+./qcow2.py "$TEST_IMG" set-feature-bit compatible 42
0a122b
+./qcow2.py "$TEST_IMG" set-feature-bit autoclear 42
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+_check_test_img
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing version upgrade and resize ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=0.10" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -P 0x2a 42M 64k" "$TEST_IMG" | _filter_qemu_io
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IMG amend -o "compat=1.1,lazy_refcounts=on,size=128M" "$TEST_IMG"
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IO -c "read -P 0x2a 42M 64k" "$TEST_IMG" | _filter_qemu_io
0a122b
+_check_test_img
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing dirty lazy_refcounts=off ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1,lazy_refcounts=on" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -P 0x2a 0 128k" -c flush -c abort "$TEST_IMG" | _filter_qemu_io
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IMG amend -o "lazy_refcounts=off" "$TEST_IMG"
0a122b
+./qcow2.py "$TEST_IMG" dump-header
0a122b
+$QEMU_IO -c "read -P 0x2a 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+_check_test_img
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing backing file ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1" _make_test_img 64M
0a122b
+IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
0a122b
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+$QEMU_IMG amend -o "backing_file=$TEST_IMG.base,backing_fmt=qcow2" "$TEST_IMG"
0a122b
+$QEMU_IO -c "read -P 0x2a 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+_check_test_img
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing invalid configurations ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=0.10" _make_test_img 64M
0a122b
+$QEMU_IMG amend -o "lazy_refcounts=on" "$TEST_IMG"
0a122b
+$QEMU_IMG amend -o "compat=1.1" "$TEST_IMG" # actually valid
0a122b
+$QEMU_IMG amend -o "compat=0.10,lazy_refcounts=on" "$TEST_IMG"
0a122b
+$QEMU_IMG amend -o "compat=0.42" "$TEST_IMG"
0a122b
+$QEMU_IMG amend -o "foo=bar" "$TEST_IMG"
0a122b
+$QEMU_IMG amend -o "cluster_size=1k" "$TEST_IMG"
0a122b
+$QEMU_IMG amend -o "encryption=on" "$TEST_IMG"
0a122b
+$QEMU_IMG amend -o "preallocation=on" "$TEST_IMG"
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing correct handling of unset value ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1,cluster_size=1k" _make_test_img 64M
0a122b
+echo "Should work:"
0a122b
+$QEMU_IMG amend -o "lazy_refcounts=on" "$TEST_IMG"
0a122b
+echo "Should not work:" # Just to know which of these tests actually fails
0a122b
+$QEMU_IMG amend -o "cluster_size=64k" "$TEST_IMG"
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing zero expansion on inactive clusters ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
0a122b
+$QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
0a122b
+_check_test_img
0a122b
+$QEMU_IO -c "read -P 0x2a 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
0a122b
+_check_test_img
0a122b
+$QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing zero expansion on backed image ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
0a122b
+IMGOPTS="compat=1.1,backing_file=$TEST_IMG.base" _make_test_img 64M
0a122b
+$QEMU_IO -c "read -P 0x2a 0 128k" -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io
0a122b
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
0a122b
+_check_test_img
0a122b
+$QEMU_IO -c "read -P 0 0 64k" -c "read -P 0x2a 64k 64k" "$TEST_IMG" | _filter_qemu_io
0a122b
+
0a122b
+echo
0a122b
+echo "=== Testing zero expansion on backed inactive clusters ==="
0a122b
+echo
0a122b
+IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
0a122b
+IMGOPTS="compat=1.1,backing_file=$TEST_IMG.base" _make_test_img 64M
0a122b
+$QEMU_IO -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io
0a122b
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
0a122b
+$QEMU_IO -c "write -P 0x42 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
0a122b
+_check_test_img
0a122b
+$QEMU_IO -c "read -P 0x42 0 128k" "$TEST_IMG" | _filter_qemu_io
0a122b
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
0a122b
+_check_test_img
0a122b
+$QEMU_IO -c "read -P 0 0 64k" -c "read -P 0x2a 64k 64k" "$TEST_IMG" | _filter_qemu_io
0a122b
+
0a122b
+# success, all done
0a122b
+echo "*** done"
0a122b
+rm -f $seq.full
0a122b
+status=0
0a122b
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
0a122b
new file mode 100644
0a122b
index 0000000..05bd1d5
0a122b
--- /dev/null
0a122b
+++ b/tests/qemu-iotests/061.out
0a122b
@@ -0,0 +1,349 @@
0a122b
+QA output created by 061
0a122b
+
0a122b
+=== Testing version downgrade with zero expansion ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+magic                     0x514649fb
0a122b
+version                   3
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x0
0a122b
+compatible_features       0x1
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             104
0a122b
+
0a122b
+magic                     0x514649fb
0a122b
+version                   2
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x0
0a122b
+compatible_features       0x0
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             72
0a122b
+
0a122b
+Header extension:
0a122b
+magic                     0x6803f857
0a122b
+length                    144
0a122b
+data                      <binary>
0a122b
+
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+
0a122b
+=== Testing dirty version downgrade ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+magic                     0x514649fb
0a122b
+version                   3
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x1
0a122b
+compatible_features       0x1
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             104
0a122b
+
0a122b
+Repairing cluster 5 refcount=0 reference=1
0a122b
+Repairing cluster 6 refcount=0 reference=1
0a122b
+magic                     0x514649fb
0a122b
+version                   2
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x0
0a122b
+compatible_features       0x0
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             72
0a122b
+
0a122b
+Header extension:
0a122b
+magic                     0x6803f857
0a122b
+length                    144
0a122b
+data                      <binary>
0a122b
+
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+
0a122b
+=== Testing version downgrade with unknown compat/autoclear flags ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+magic                     0x514649fb
0a122b
+version                   3
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x0
0a122b
+compatible_features       0x40000000000
0a122b
+autoclear_features        0x40000000000
0a122b
+refcount_order            4
0a122b
+header_length             104
0a122b
+
0a122b
+magic                     0x514649fb
0a122b
+version                   2
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x0
0a122b
+compatible_features       0x0
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             72
0a122b
+
0a122b
+Header extension:
0a122b
+magic                     0x6803f857
0a122b
+length                    144
0a122b
+data                      <binary>
0a122b
+
0a122b
+No errors were found on the image.
0a122b
+
0a122b
+=== Testing version upgrade and resize ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+wrote 65536/65536 bytes at offset 44040192
0a122b
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+magic                     0x514649fb
0a122b
+version                   2
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x0
0a122b
+compatible_features       0x0
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             72
0a122b
+
0a122b
+magic                     0x514649fb
0a122b
+version                   3
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      134217728
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x0
0a122b
+compatible_features       0x1
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             104
0a122b
+
0a122b
+Header extension:
0a122b
+magic                     0x6803f857
0a122b
+length                    144
0a122b
+data                      <binary>
0a122b
+
0a122b
+read 65536/65536 bytes at offset 44040192
0a122b
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+
0a122b
+=== Testing dirty lazy_refcounts=off ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+magic                     0x514649fb
0a122b
+version                   3
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x1
0a122b
+compatible_features       0x1
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             104
0a122b
+
0a122b
+Repairing cluster 5 refcount=0 reference=1
0a122b
+Repairing cluster 6 refcount=0 reference=1
0a122b
+magic                     0x514649fb
0a122b
+version                   3
0a122b
+backing_file_offset       0x0
0a122b
+backing_file_size         0x0
0a122b
+cluster_bits              16
0a122b
+size                      67108864
0a122b
+crypt_method              0
0a122b
+l1_size                   1
0a122b
+l1_table_offset           0x30000
0a122b
+refcount_table_offset     0x10000
0a122b
+refcount_table_clusters   1
0a122b
+nb_snapshots              0
0a122b
+snapshot_offset           0x0
0a122b
+incompatible_features     0x0
0a122b
+compatible_features       0x0
0a122b
+autoclear_features        0x0
0a122b
+refcount_order            4
0a122b
+header_length             104
0a122b
+
0a122b
+Header extension:
0a122b
+magic                     0x6803f857
0a122b
+length                    144
0a122b
+data                      <binary>
0a122b
+
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+
0a122b
+=== Testing backing file ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+
0a122b
+=== Testing invalid configurations ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+Lazy refcounts only supported with compatibility level 1.1 and above (use compat=1.1 or greater)
0a122b
+qemu-img: Error while amending options: Invalid argument
0a122b
+Lazy refcounts only supported with compatibility level 1.1 and above (use compat=1.1 or greater)
0a122b
+qemu-img: Error while amending options: Invalid argument
0a122b
+Unknown compatibility level 0.42.
0a122b
+qemu-img: Error while amending options: Invalid argument
0a122b
+Unknown option 'foo'
0a122b
+qemu-img: Invalid options for file format 'qcow2'
0a122b
+Changing the cluster size is not supported.
0a122b
+qemu-img: Error while amending options: Operation not supported
0a122b
+Changing the encryption flag is not supported.
0a122b
+qemu-img: Error while amending options: Operation not supported
0a122b
+Cannot change preallocation mode.
0a122b
+qemu-img: Error while amending options: Operation not supported
0a122b
+
0a122b
+=== Testing correct handling of unset value ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+Should work:
0a122b
+Should not work:
0a122b
+Changing the cluster size is not supported.
0a122b
+qemu-img: Error while amending options: Operation not supported
0a122b
+
0a122b
+=== Testing zero expansion on inactive clusters ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+
0a122b
+=== Testing zero expansion on backed image ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='TEST_DIR/t.IMGFMT.base' 
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+wrote 65536/65536 bytes at offset 0
0a122b
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+read 65536/65536 bytes at offset 0
0a122b
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+read 65536/65536 bytes at offset 65536
0a122b
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+
0a122b
+=== Testing zero expansion on backed inactive clusters ===
0a122b
+
0a122b
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='TEST_DIR/t.IMGFMT.base' 
0a122b
+wrote 65536/65536 bytes at offset 0
0a122b
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+wrote 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+read 131072/131072 bytes at offset 0
0a122b
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+No errors were found on the image.
0a122b
+read 65536/65536 bytes at offset 0
0a122b
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+read 65536/65536 bytes at offset 65536
0a122b
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0a122b
+*** done
0a122b
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
0a122b
index 2d0aba0..50a726e 100644
0a122b
--- a/tests/qemu-iotests/group
0a122b
+++ b/tests/qemu-iotests/group
0a122b
@@ -63,6 +63,7 @@
0a122b
 054 rw auto
0a122b
 059 rw auto
0a122b
 060 rw auto
0a122b
+061 rw auto
0a122b
 062 rw auto
0a122b
 063 rw auto
0a122b
 064 rw auto
0a122b
-- 
0a122b
1.7.1
0a122b