[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/3] iotests, parallels: Add a test for duplicated cluster

From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v2 3/3] iotests, parallels: Add a test for duplicated clusters
Date: Sat, 6 Aug 2022 23:56:20 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

On 8/5/22 18:47, alexander.ivanov@virtuozzo.com wrote:
From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>

Check if original and duplicated offsets refer to the same cluster.
Repair the image and check that writing to a referred cluster
doesn't affects another referred cluster.

Signed-off-by: Natalia Kuzmina <natalia.kuzmina@openvz.org>
Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
  tests/qemu-iotests/314                        |  89 ++++++++++++++++++

New tests should be added to tests/qemu-iotests/tests with good file names.

  tests/qemu-iotests/314.out                    |  36 +++++++
  .../parallels-2-duplicated-cluster.bz2        | Bin 0 -> 148 bytes
  3 files changed, 125 insertions(+)
  create mode 100755 tests/qemu-iotests/314
  create mode 100644 tests/qemu-iotests/314.out
  create mode 100644 

diff --git a/tests/qemu-iotests/314 b/tests/qemu-iotests/314
new file mode 100755
index 0000000000..79b4d3a749
--- /dev/null
+++ b/tests/qemu-iotests/314
@@ -0,0 +1,89 @@
+#!/usr/bin/env bash
+# group: rw auto quick


+#read one cluster from original offset
+$QEMU_IO -c "read -P 0x55 0 $CLUSTER_SIZE" "$TEST_IMG" | \
+    _filter_qemu_io
+#read copied data from new offset
+$QEMU_IO -c "read -P 0x55 $((4 * CLUSTER_SIZE)) $CLUSTER_SIZE" "$TEST_IMG" | \
+    _filter_qemu_io
+#change data from original offset
+$QEMU_IO -c "write -P 0x11 0 $CLUSTER_SIZE" "$TEST_IMG" | \
+    _filter_qemu_io
+#read from new offset (fail, now this data was left unchanged)
+$QEMU_IO -c "read -P 0x11 $((4 * CLUSTER_SIZE)) $CLUSTER_SIZE" "$TEST_IMG" | \
+    _filter_qemu_io

Maybe, add also read -P 0x55 for 4th cluster, to be sure that it's really 
And maybe read 0x11 for 0th cluster, to be sure that it's really rewritten.

+# success, all done
+echo "*** done"
+rm -f $seq.full



literal 0

With at least new test renamed and moved to tests/qemu-iotests/tests:

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]