[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/24] iotests/MRCE: Write data to source
From: |
Hanna Reitz |
Subject: |
[PULL 02/24] iotests/MRCE: Write data to source |
Date: |
Tue, 1 Feb 2022 15:42:11 +0100 |
This test assumes that mirror flushes the source when entering the READY
state, and that the format level will pass that flush on to the protocol
level (where we intercept it with blkdebug).
However, apparently that does not happen when using a VMDK image with
zeroed_grain=on, which actually is the default set by testenv.py. Right
now, Python tests ignore IMGOPTS, though, so this has no effect; but
Vladimir has a series that will change this, so we need to fix this test
before that series lands.
We can fix it by writing data to the source before we start the mirror
job; apparently that makes the (VMDK) format layer change its mind and
pass on the pre-READY flush to the protocol level, so the test passes
again. (I presume, without any data written, mirror just does a 64M
zero write on the target, which VMDK with zeroed_grain=on basically just
ignores.)
Without this, we do not get a flush, and so blkdebug only sees a single
flush at the end of the job instead of two, and therefore does not
inject an error, which makes the block job complete instead of raising
an error.
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20211223165308.103793-1-hreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
tests/qemu-iotests/tests/mirror-ready-cancel-error | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/tests/mirror-ready-cancel-error
b/tests/qemu-iotests/tests/mirror-ready-cancel-error
index f2dc88881f..770ffca379 100755
--- a/tests/qemu-iotests/tests/mirror-ready-cancel-error
+++ b/tests/qemu-iotests/tests/mirror-ready-cancel-error
@@ -36,6 +36,11 @@ class TestMirrorReadyCancelError(iotests.QMPTestCase):
assert iotests.qemu_img_create('-f', iotests.imgfmt, target,
str(image_size)) == 0
+ # Ensure that mirror will copy something before READY so the
+ # target format layer will forward the pre-READY flush to its
+ # file child
+ assert iotests.qemu_io_silent('-c', 'write -P 1 0 64k', source) == 0
+
self.vm = iotests.VM()
self.vm.launch()
@@ -97,7 +102,7 @@ class TestMirrorReadyCancelError(iotests.QMPTestCase):
# Write something so will not leave the job immediately, but
# flush first (which will fail, thanks to blkdebug)
res = self.vm.qmp('human-monitor-command',
- command_line='qemu-io mirror-top "write 0 64k"')
+ command_line='qemu-io mirror-top "write -P 2 0 64k"')
self.assert_qmp(res, 'return', '')
# Drain status change events
--
2.34.1
- [PULL 12/24] iotests.py: filter compression type out, (continued)
- [PULL 12/24] iotests.py: filter compression type out, Hanna Reitz, 2022/02/01
- [PULL 06/24] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd', Hanna Reitz, 2022/02/01
- [PULL 19/24] iotests 60: more accurate set dirty bit in qcow2 header, Hanna Reitz, 2022/02/01
- [PULL 08/24] iotests.py: rewrite default luks support in qemu_img, Hanna Reitz, 2022/02/01
- [PULL 10/24] iotest 065: explicit compression type, Hanna Reitz, 2022/02/01
- [PULL 07/24] iotests: drop qemu_img_verbose() helper, Hanna Reitz, 2022/02/01
- [PULL 14/24] qcow2: simple case support for downgrading of qcow2 images with zstd, Hanna Reitz, 2022/02/01
- [PULL 05/24] iotests: specify some unsupported_imgopts for python iotests, Hanna Reitz, 2022/02/01
- [PULL 04/24] iotests.py: implement unsupported_imgopts, Hanna Reitz, 2022/02/01
- [PULL 02/24] iotests/MRCE: Write data to source,
Hanna Reitz <=
- [PULL 23/24] iotests/migration-permissions: New test, Hanna Reitz, 2022/02/01
- [PULL 20/24] iotest 214: explicit compression type, Hanna Reitz, 2022/02/01
- [PULL 21/24] iotests: declare lack of support for compresion_type in IMGOPTS, Hanna Reitz, 2022/02/01
- [PULL 18/24] iotests: bash tests: filter compression type, Hanna Reitz, 2022/02/01
- [PULL 13/24] iotest 302: use img_info_log() helper, Hanna Reitz, 2022/02/01
- [PULL 15/24] iotests/common.rc: introduce _qcow2_dump_header helper, Hanna Reitz, 2022/02/01
- [PULL 17/24] iotest 39: use _qcow2_dump_header, Hanna Reitz, 2022/02/01
- [PULL 09/24] iotest 303: explicit compression type, Hanna Reitz, 2022/02/01
- [PULL 22/24] block-backend: Retain permissions after migration, Hanna Reitz, 2022/02/01
- [PULL 24/24] block.h: remove outdated comment, Hanna Reitz, 2022/02/01