[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 61/62] iotests: Add test for image header overlap
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 61/62] iotests: Add test for image header overlap |
Date: |
Fri, 8 Aug 2014 19:40:02 +0200 |
From: Max Reitz <address@hidden>
Add a test for an image with an unallocated image header; instead of an
assertion, this should result in the image being marked corrupt.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/060 | 9 +++++++++
tests/qemu-iotests/060.out | 8 ++++++++
2 files changed, 17 insertions(+)
diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index 3cffc12..830386f 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -164,6 +164,15 @@ wait_break 0
write 64k 64k
resume 0" | $QEMU_IO | _filter_qemu_io
+echo
+echo "=== Testing unallocated image header ==="
+echo
+_make_test_img 64M
+# Create L1/L2
+$QEMU_IO -c "$OPEN_RW" -c "write 0 64k" | _filter_qemu_io
+poke_file "$TEST_IMG" "$rb_offset" "\x00\x00"
+$QEMU_IO -c "$OPEN_RW" -c "write 64k 64k" | _filter_qemu_io
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
index a517948..c27c952 100644
--- a/tests/qemu-iotests/060.out
+++ b/tests/qemu-iotests/060.out
@@ -93,4 +93,12 @@ blkdebug: Suspended request '0'
write failed: Input/output error
blkdebug: Resuming request '0'
aio_write failed: No medium found
+
+=== Testing unallocated image header ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+wrote 65536/65536 bytes at offset 0
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qcow2: Preventing invalid write on metadata (overlaps with qcow2_header);
image marked as corrupt.
+write failed: Input/output error
*** done
--
1.8.3.1
- [Qemu-devel] [PULL 52/62] raw-win32: Handle failure for potentially large allocations, (continued)
- [Qemu-devel] [PULL 52/62] raw-win32: Handle failure for potentially large allocations, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 49/62] qcow2: Handle failure for potentially large allocations, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 54/62] vdi: Handle failure for potentially large allocations, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 53/62] rbd: Handle failure for potentially large allocations, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 55/62] vhdx: Handle failure for potentially large allocations, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 57/62] vpc: Handle failure for potentially large allocations, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 58/62] mirror: Handle failure for potentially large allocations, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 59/62] qcow2: Return useful error code in refcount_init(), Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 56/62] vmdk: Handle failure for potentially large allocations, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 60/62] qcow2: Catch !*host_offset for data allocation, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 61/62] iotests: Add test for image header overlap,
Kevin Wolf <=
- [Qemu-devel] [PULL 62/62] block: Catch !bs->drv in bdrv_check(), Kevin Wolf, 2014/08/08
- Re: [Qemu-devel] [PULL 00/62] Block patches, Peter Maydell, 2014/08/15