[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/22] tests: extend test 131 to cover availability of the write-z
From: |
Denis V. Lunev |
Subject: |
[PULL 22/22] tests: extend test 131 to cover availability of the write-zeroes |
Date: |
Wed, 20 Sep 2023 11:21:08 +0200 |
This patch contains test which minimally tests write-zeroes on top of
working discard.
The following checks are added:
* write 2 clusters, write-zero to the first allocated cluster
* write 2 cluster, write-zero to the half the first allocated cluster
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
tests/qemu-iotests/131 | 21 +++++++++++++++++++++
tests/qemu-iotests/131.out | 22 ++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/tests/qemu-iotests/131 b/tests/qemu-iotests/131
index 324008b3f6..3119100e78 100755
--- a/tests/qemu-iotests/131
+++ b/tests/qemu-iotests/131
@@ -105,6 +105,27 @@ _make_test_img $size
{ $QEMU_IO -c "read -P 0 0 $CLUSTER_HALF_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
{ $QEMU_IO -c "read -P 0 $((CLUSTER_SIZE + CLUSTER_HALF_SIZE))
$CLUSTER_HALF_SIZE" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo "== check write-zeroes =="
+
+# Clear image
+_make_test_img $size
+
+{ $QEMU_IO -c "write -P 0x11 0 $CLUSTER_DBL_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+{ $QEMU_IO -c "write -z 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 | _filter_qemu_io
| _filter_testdir
+{ $QEMU_IMG map "$TEST_IMG"; } 2>&1 | _filter_qemu_img_map
+{ $QEMU_IO -c "read -P 0 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+{ $QEMU_IO -c "read -P 0x11 $CLUSTER_SIZE $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+
+echo "== check cluster-partial write-zeroes =="
+
+# Clear image
+_make_test_img $size
+
+{ $QEMU_IO -c "write -P 0x11 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+{ $QEMU_IO -c "write -z 0 $CLUSTER_HALF_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+{ $QEMU_IO -c "read -P 0 0 $CLUSTER_HALF_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+{ $QEMU_IO -c "read -P 0x11 $CLUSTER_HALF_SIZE $CLUSTER_HALF_SIZE"
"$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+
echo "== allocate with backing =="
# Verify that allocating clusters works fine even when there is a backing
image.
# Regression test for a bug where we would pass a buffer read from the backing
diff --git a/tests/qemu-iotests/131.out b/tests/qemu-iotests/131.out
index 27df91ca97..86a2d2a49b 100644
--- a/tests/qemu-iotests/131.out
+++ b/tests/qemu-iotests/131.out
@@ -64,6 +64,28 @@ read 524288/524288 bytes at offset 0
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 524288/524288 bytes at offset 1572864
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== check write-zeroes ==
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+wrote 2097152/2097152 bytes at offset 0
+2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Offset Length File
+0x100000 0x100000 TEST_DIR/t.IMGFMT
+read 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 1048576/1048576 bytes at offset 1048576
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== check cluster-partial write-zeroes ==
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+wrote 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 524288/524288 bytes at offset 0
+512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 524288/524288 bytes at offset 0
+512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 524288/524288 bytes at offset 524288
+512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
== allocate with backing ==
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
--
2.34.1
- [PULL 08/22] parallels: create mark_used() helper which sets bit in used bitmap, (continued)
- [PULL 08/22] parallels: create mark_used() helper which sets bit in used bitmap, Denis V. Lunev, 2023/09/20
- [PULL 04/22] parallels: invent parallels_opts_prealloc() helper to parse prealloc opts, Denis V. Lunev, 2023/09/20
- [PULL 03/22] parallels: fix memory leak in parallels_open(), Denis V. Lunev, 2023/09/20
- [PULL 06/22] parallels: return earlier from parallels_open() function on error, Denis V. Lunev, 2023/09/20
- [PULL 05/22] parallels: return earler in fail_format branch in parallels_open(), Denis V. Lunev, 2023/09/20
- [PULL 09/22] tests: ensure that image validation will not cure the corruption, Denis V. Lunev, 2023/09/20
- [PULL 07/22] parallels: refactor path when we need to re-check image in parallels_open, Denis V. Lunev, 2023/09/20
- [PULL 11/22] parallels: add test which will validate data_off fixes through repair, Denis V. Lunev, 2023/09/20
- [PULL 19/22] parallels: naive implementation of parallels_co_pdiscard, Denis V. Lunev, 2023/09/20
- [PULL 15/22] parallels: accept multiple clusters in mark_used(), Denis V. Lunev, 2023/09/20
- [PULL 22/22] tests: extend test 131 to cover availability of the write-zeroes,
Denis V. Lunev <=
- [PULL 12/22] parallels: collect bitmap of used clusters at open, Denis V. Lunev, 2023/09/20
- [PULL 18/22] parallels: improve readability of allocate_clusters, Denis V. Lunev, 2023/09/20
- [PULL 21/22] parallels: naive implementation of parallels_co_pwrite_zeroes, Denis V. Lunev, 2023/09/20
- [PULL 10/22] parallels: fix broken parallels_check_data_off(), Denis V. Lunev, 2023/09/20
- [PULL 16/22] parallels: update used bitmap in allocate_cluster, Denis V. Lunev, 2023/09/20
- [PULL 20/22] tests: extend test 131 to cover availability of the discard operation, Denis V. Lunev, 2023/09/20
- [PULL 17/22] parallels: naive implementation of allocate_clusters with used bitmap, Denis V. Lunev, 2023/09/20
- [PULL 13/22] tests: fix broken deduplication check in parallels format test, Denis V. Lunev, 2023/09/20
- [PULL 14/22] tests: test self-cure of parallels image with duplicated clusters, Denis V. Lunev, 2023/09/20
- Re: [PULL 00/22] implement discard operation for Parallels images, Stefan Hajnoczi, 2023/09/20