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