[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 16/25] iotests: Add test for failing qemu-img commit
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 16/25] iotests: Add test for failing qemu-img commit |
Date: |
Fri, 17 Nov 2017 19:16:44 +0100 |
From: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/020 | 27 +++++++++++++++++++++++++++
tests/qemu-iotests/020.out | 17 +++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index 7a111100ec..cefe3a830e 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -110,6 +110,33 @@ for offset in $TEST_OFFSETS; do
io_zero readv $(( offset + 64 * 1024 + 65536 * 4 )) 65536 65536 1
done
_check_test_img
+_cleanup
+TEST_IMG=$TEST_IMG_SAVE
+
+echo
+echo 'Testing failing commit'
+echo
+
+# Create an image with a null backing file to which committing will fail (with
+# ENOSPC so we can distinguish the result from some generic EIO which may be
+# generated anywhere in the block layer)
+_make_test_img -b "json:{'driver': 'raw',
+ 'file': {
+ 'driver': 'blkdebug',
+ 'inject-error': [{
+ 'event': 'write_aio',
+ 'errno': 28,
+ 'once': true
+ }],
+ 'image': {
+ 'driver': 'null-co'
+ }}}"
+
+# Just write anything so committing will not be a no-op
+$QEMU_IO -c 'writev 0 64k' "$TEST_IMG" | _filter_qemu_io
+
+$QEMU_IMG commit "$TEST_IMG"
+_cleanup_test_img
# success, all done
echo "*** done"
diff --git a/tests/qemu-iotests/020.out b/tests/qemu-iotests/020.out
index 42f6c1b151..165b70aa49 100644
--- a/tests/qemu-iotests/020.out
+++ b/tests/qemu-iotests/020.out
@@ -1075,4 +1075,21 @@ read 65536/65536 bytes at offset 4295098368
read 65536/65536 bytes at offset 4295294976
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
No errors were found on the image.
+
+Testing failing commit
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
backing_file=json:{'driver': 'raw',,
+ 'file': {
+ 'driver': 'blkdebug',,
+ 'inject-error': [{
+ 'event': 'write_aio',,
+ 'errno': 28,,
+ 'once': true
+ }],,
+ 'image': {
+ 'driver': 'null-co'
+ }}}
+wrote 65536/65536 bytes at offset 0
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-img: Block job failed: No space left on device
*** done
--
2.13.6
- [Qemu-block] [PULL 05/25] block: Deprecate bdrv_set_read_only() and users, (continued)
- [Qemu-block] [PULL 05/25] block: Deprecate bdrv_set_read_only() and users, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 07/25] block: Fix permissions in image activation, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 06/25] qcow2: fix image corruption after committing qcow2 image into base, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 08/25] iotests: test clearing unknown autoclear_features by qcow2, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 11/25] qapi/qlist: Add qlist_append_null() macro, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 10/25] qapi/qnull: Add own header, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 12/25] qapi: Add qobject_is_equal(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 13/25] block: qobject_is_equal() in bdrv_reopen_prepare(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 09/25] qcow2: fix image corruption on commit with persistent bitmap, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 14/25] iotests: Add test for non-string option reopening, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 16/25] iotests: Add test for failing qemu-img commit,
Kevin Wolf <=
- [Qemu-block] [PULL 19/25] qcow2: Unaligned zero cluster in handle_alloc(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 15/25] tests: Add check-qobject for equality tests, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 17/25] qcow2: reject unaligned offsets in write compressed, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 18/25] qcow2: check_errors are fatal, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 23/25] qcow2: Fix overly broad madvise(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 20/25] block: Guard against NULL bs->drv, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 22/25] qcow2: Refuse to get unaligned offsets from cache, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 21/25] qcow2: Add bounds check to get_refblock_offset(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 25/25] iotests: Make 087 pass without AIO enabled, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 24/25] block: Make bdrv_next() keep strong references, Kevin Wolf, 2017/11/17