Add a test for qcow2 copy-on-read behavior, including exposure for the just-fixed bugs. The copy-on-read behavior is always to a qcow2 image, but the test is careful to allow running with most image protocol/format combos as the backing file being copied from (luks being the exception, as it is harder to pass the right secret to all the right places). In fact, for './check nbd', this appears to be the first time we've had a qcow2 image wrapping NBD, requiring an additional line in _filter_img_create to match the similar line in _filter_img_info. Invoking blkdebug to prove we don't write too much took some effort to get working; and it requires that $TEST_WRAP (based on $TEST_DIR) not be subject to word splitting. We may decide later to have the entire iotests suite use relative rather than absolute names, to avoid problems inherited by the absolute name of $PWD or $TEST_DIR, at which point the sanity check in this commit could be simplified. This test requires at least 2G of consecutive memory to succeed; as such, it is prone to spurious failures, particularly on 32-bit machines under load. This situation is detected and triggers an early exit to skip the test, rather than a failure. To manually provoke this setup on a beefier machine, I used: $ (ulimit -S -v 1000000; ./check -qcow2 197) Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
27 lines
1.2 KiB
Plaintext
27 lines
1.2 KiB
Plaintext
QA output created by 197
|
|
|
|
=== Copy-on-read ===
|
|
|
|
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296
|
|
wrote 1024/1024 bytes at offset 3221225472
|
|
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
Formatting 'TEST_DIR/t.wrap.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
|
|
wrote 65536/65536 bytes at offset 1048576
|
|
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
read 131072/131072 bytes at offset 1048576
|
|
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
read 0/0 bytes at offset 0
|
|
0 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
read 2147483136/2147483136 bytes at offset 1024
|
|
2 GiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
read 1024/1024 bytes at offset 3221226496
|
|
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
can't open device TEST_DIR/t.wrap.qcow2: Can't use copy-on-read on read-only device
|
|
2 GiB (0x80010000) bytes allocated at offset 0 bytes (0x0)
|
|
1023.938 MiB (0x3fff0000) bytes not allocated at offset 2 GiB (0x80010000)
|
|
64 KiB (0x10000) bytes allocated at offset 3 GiB (0xc0000000)
|
|
1023.938 MiB (0x3fff0000) bytes not allocated at offset 3 GiB (0xc0010000)
|
|
No errors were found on the image.
|
|
Images are identical.
|
|
*** done
|