iotests/MRCE: Write data to source
commitfc2c3996a59683685a663deb3af12183ad24e4a7
authorHanna Reitz <hreitz@redhat.com>
Thu, 23 Dec 2021 16:53:08 +0000 (23 17:53 +0100)
committerHanna Reitz <hreitz@redhat.com>
Tue, 1 Feb 2022 09:51:39 +0000 (1 10:51 +0100)
treecd068491d5499b066a24abd2ab5639e498046d7b
parent0c83471bd75d329f4945e27dc1aa3a6cc2fda3bf
iotests/MRCE: Write data to source

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