diff options
author | Fam Zheng <famz@redhat.com> | 2015-05-13 13:12:01 +0000 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2015-07-29 18:18:59 -0500 |
commit | b48a391cffd2f918ec9a12d2eb6cb6252202b495 (patch) | |
tree | 92600dba74fa3f148b4726ed4682170003032ccf | |
parent | cc883fe42ddc717b62f46118e17b45ce46dd9a11 (diff) | |
download | qemu-b48a391cffd2f918ec9a12d2eb6cb6252202b495.zip qemu-b48a391cffd2f918ec9a12d2eb6cb6252202b495.tar.gz qemu-b48a391cffd2f918ec9a12d2eb6cb6252202b495.tar.bz2 |
qemu-iotests: Test unaligned sub-block zero write
Test zero write in byte range 512~1024 for 4k alignment.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1431522721-3266-4-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit ab53c44718305d3fde3d9d2251889f1cab694be2)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rwxr-xr-x | tests/qemu-iotests/033 | 13 | ||||
-rw-r--r-- | tests/qemu-iotests/033.out | 30 |
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033 index 4008f10..a61d8ce 100755 --- a/tests/qemu-iotests/033 +++ b/tests/qemu-iotests/033 @@ -78,6 +78,19 @@ for align in 512 4k; do echo echo "== verifying patterns (2) ==" do_test $align "read -P 0x0 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io + + echo + echo "== rewriting unaligned zeroes ==" + do_test $align "write -P 0xb 0x0 0x1000" "$TEST_IMG" | _filter_qemu_io + do_test $align "write -z 0x200 0x200" "$TEST_IMG" | _filter_qemu_io + + echo + echo "== verifying patterns (3) ==" + do_test $align "read -P 0xb 0x0 0x200" "$TEST_IMG" | _filter_qemu_io + do_test $align "read -P 0x0 0x200 0x200" "$TEST_IMG" | _filter_qemu_io + do_test $align "read -P 0xb 0x400 0xc00" "$TEST_IMG" | _filter_qemu_io + + echo done # success, all done diff --git a/tests/qemu-iotests/033.out b/tests/qemu-iotests/033.out index 305949f..c3d18aa 100644 --- a/tests/qemu-iotests/033.out +++ b/tests/qemu-iotests/033.out @@ -27,6 +27,21 @@ wrote 65536/65536 bytes at offset 65536 read 131072/131072 bytes at offset 1024 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +== rewriting unaligned zeroes == +wrote 4096/4096 bytes at offset 0 +4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +== verifying patterns (3) == +read 512/512 bytes at offset 0 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 3072/3072 bytes at offset 1024 +3 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + + == preparing image == wrote 1024/1024 bytes at offset 512 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -52,4 +67,19 @@ wrote 65536/65536 bytes at offset 65536 == verifying patterns (2) == read 131072/131072 bytes at offset 1024 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +== rewriting unaligned zeroes == +wrote 4096/4096 bytes at offset 0 +4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +== verifying patterns (3) == +read 512/512 bytes at offset 0 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 3072/3072 bytes at offset 1024 +3 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + *** done |