[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/22] tests: fix broken deduplication check in parallels format t
From: |
Denis V. Lunev |
Subject: |
[PULL 13/22] tests: fix broken deduplication check in parallels format test |
Date: |
Wed, 20 Sep 2023 11:20:59 +0200 |
Original check is broken as supposed reading from 2 different clusters
results in read from the same file offset twice. This is definitely
wrong.
We should be sure that
* the content of both clusters is correct after repair
* clusters are at the different offsets after repair
In order to check the latter we write some content into the first one
and validate that fact.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
tests/qemu-iotests/tests/parallels-checks | 14 ++++++++++----
tests/qemu-iotests/tests/parallels-checks.out | 16 ++++++++++++----
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/tests/qemu-iotests/tests/parallels-checks
b/tests/qemu-iotests/tests/parallels-checks
index f4ca50295e..df99558486 100755
--- a/tests/qemu-iotests/tests/parallels-checks
+++ b/tests/qemu-iotests/tests/parallels-checks
@@ -117,14 +117,20 @@ echo "== check second cluster =="
echo "== repair image =="
_check_test_img -r all
+echo "== check the first cluster =="
+{ $QEMU_IO -r -c "read -P 0x11 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+
echo "== check second cluster =="
{ $QEMU_IO -r -c "read -P 0x11 $CLUSTER_SIZE $CLUSTER_SIZE" "$TEST_IMG"; }
2>&1 | _filter_qemu_io | _filter_testdir
-echo "== check first cluster on host =="
-printf "content: 0x%02x\n" `peek_file_le $TEST_IMG $(($CLUSTER_SIZE)) 1`
+echo "== write another pattern to the first clusters =="
+{ $QEMU_IO -c "write -P 0x66 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+
+echo "== check the first cluster =="
+{ $QEMU_IO -r -c "read -P 0x66 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
-echo "== check second cluster on host =="
-printf "content: 0x%02x\n" `peek_file_le $TEST_IMG $(($CLUSTER_SIZE)) 1`
+echo "== check the second cluster (deduplicated) =="
+{ $QEMU_IO -r -c "read -P 0x11 $CLUSTER_SIZE $CLUSTER_SIZE" "$TEST_IMG"; }
2>&1 | _filter_qemu_io | _filter_testdir
# Clear image
_make_test_img $SIZE
diff --git a/tests/qemu-iotests/tests/parallels-checks.out
b/tests/qemu-iotests/tests/parallels-checks.out
index 74a5e29260..1325d2b611 100644
--- a/tests/qemu-iotests/tests/parallels-checks.out
+++ b/tests/qemu-iotests/tests/parallels-checks.out
@@ -55,13 +55,21 @@ The following inconsistencies were found and repaired:
Double checking the fixed image now...
No errors were found on the image.
+== check the first cluster ==
+read 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
== check second cluster ==
read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-== check first cluster on host ==
-content: 0x11
-== check second cluster on host ==
-content: 0x11
+== write another pattern to the first clusters ==
+wrote 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== check the first cluster ==
+read 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== check the second cluster (deduplicated) ==
+read 1048576/1048576 bytes at offset 1048576
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4194304
== TEST DATA_OFF CHECK ==
== write pattern to first cluster ==
--
2.34.1
- [PULL 19/22] parallels: naive implementation of parallels_co_pdiscard, (continued)
- [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, 2023/09/20
- [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 <=
- [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