[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 11/22] parallels: add test which will validate data_off fixes t
From: |
Denis V. Lunev |
Subject: |
[PULL v2 11/22] parallels: add test which will validate data_off fixes through repair |
Date: |
Thu, 21 Sep 2023 09:54:49 +0200 |
We have only check through self-repair and that proven to be not enough.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
tests/qemu-iotests/tests/parallels-checks | 17 +++++++++++++++++
tests/qemu-iotests/tests/parallels-checks.out | 18 ++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/tests/qemu-iotests/tests/parallels-checks
b/tests/qemu-iotests/tests/parallels-checks
index 5917ee079d..f4ca50295e 100755
--- a/tests/qemu-iotests/tests/parallels-checks
+++ b/tests/qemu-iotests/tests/parallels-checks
@@ -140,6 +140,23 @@ poke_file "$TEST_IMG" "$DATA_OFF_OFFSET" "\xff\xff\xff\xff"
echo "== check first cluster =="
{ $QEMU_IO -c "read -P 0x55 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+# Clear image
+_make_test_img $SIZE
+
+echo "== TEST DATA_OFF THROUGH REPAIR =="
+
+echo "== write pattern to first cluster =="
+{ $QEMU_IO -c "write -P 0x55 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+
+echo "== spoil data_off field =="
+poke_file "$TEST_IMG" "$DATA_OFF_OFFSET" "\xff\xff\xff\xff"
+
+echo "== repair image =="
+_check_test_img -r all
+
+echo "== check first cluster =="
+{ $QEMU_IO -r -c "read -P 0x55 0 $CLUSTER_SIZE" "$TEST_IMG"; } 2>&1 |
_filter_qemu_io | _filter_testdir
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/tests/parallels-checks.out
b/tests/qemu-iotests/tests/parallels-checks.out
index 98a3a7f55e..74a5e29260 100644
--- a/tests/qemu-iotests/tests/parallels-checks.out
+++ b/tests/qemu-iotests/tests/parallels-checks.out
@@ -72,4 +72,22 @@ wrote 1048576/1048576 bytes at offset 0
Repairing data_off field has incorrect value
read 1048576/1048576 bytes at offset 0
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 THROUGH REPAIR ==
+== write pattern to first cluster ==
+wrote 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== spoil data_off field ==
+== repair image ==
+Repairing data_off field has incorrect value
+The following inconsistencies were found and repaired:
+
+ 0 leaked clusters
+ 1 corruptions
+
+Double checking the fixed image now...
+No errors were found on the image.
+== check first cluster ==
+read 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
*** done
--
2.34.1
- [PULL v2 07/22] parallels: refactor path when we need to re-check image in parallels_open, (continued)
- [PULL v2 07/22] parallels: refactor path when we need to re-check image in parallels_open, Denis V. Lunev, 2023/09/21
- [PULL v2 19/22] parallels: naive implementation of parallels_co_pdiscard, Denis V. Lunev, 2023/09/21
- [PULL v2 13/22] tests: fix broken deduplication check in parallels format test, Denis V. Lunev, 2023/09/21
- [PULL v2 10/22] parallels: fix broken parallels_check_data_off(), Denis V. Lunev, 2023/09/21
- [PULL v2 15/22] parallels: accept multiple clusters in mark_used(), Denis V. Lunev, 2023/09/21
- [PULL v2 16/22] parallels: update used bitmap in allocate_cluster, Denis V. Lunev, 2023/09/21
- [PULL v2 14/22] tests: test self-cure of parallels image with duplicated clusters, Denis V. Lunev, 2023/09/21
- [PULL v2 12/22] parallels: collect bitmap of used clusters at open, Denis V. Lunev, 2023/09/21
- [PULL v2 21/22] parallels: naive implementation of parallels_co_pwrite_zeroes, Denis V. Lunev, 2023/09/21
- [PULL v2 17/22] parallels: naive implementation of allocate_clusters with used bitmap, Denis V. Lunev, 2023/09/21
- [PULL v2 11/22] parallels: add test which will validate data_off fixes through repair,
Denis V. Lunev <=
- [PULL v2 18/22] parallels: improve readability of allocate_clusters, Denis V. Lunev, 2023/09/21
- [PULL v2 20/22] tests: extend test 131 to cover availability of the discard operation, Denis V. Lunev, 2023/09/21
- [PULL v2 22/22] tests: extend test 131 to cover availability of the write-zeroes, Denis V. Lunev, 2023/09/21
- Re: [PULL v2 00/22] implement discard operation for Parallels images, Stefan Hajnoczi, 2023/09/21