On 10/24/2014 07:57 AM, Max Reitz wrote:
Add a test for qcow2's fast bdrv_make_empty implementation on images
without internal snapshots.
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/098 | 82 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/098.out | 52 +++++++++++++++++++++++++++++
tests/qemu-iotests/group | 1 +
3 files changed, 135 insertions(+)
create mode 100755 tests/qemu-iotests/098
create mode 100644 tests/qemu-iotests/098.out
+
+IMGOPTS="compat=1.1"
+
+for event in l1_update empty_image_prepare reftable_update refblock_alloc; do
Is it also worth a test where no I/O error occurs, to be sure we cover
the common case output? Maybe by adding '' to this list...
+
+echo
+echo "=== $event ==="
+echo
+
+TEST_IMG="$TEST_IMG.base" _make_test_img 64M
+_make_test_img -b "$TEST_IMG.base" 64M
+
+# Some data that can be leaked when emptying the top image
+$QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io
+
+cat > "$TEST_DIR/blkdebug.conf" <<EOF
+[inject-error]
+event = "$event"
+EOF
...and changing this file to be a no-op if $event is empty?