[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/34] iotests/221: Discard image before qemu-img map
From: |
Kevin Wolf |
Subject: |
[PULL 26/34] iotests/221: Discard image before qemu-img map |
Date: |
Fri, 11 Dec 2020 18:08:04 +0100 |
From: Max Reitz <mreitz@redhat.com>
See the new comment for why this should be done.
I do not have a reproducer on master, but when using FUSE block exports,
this test breaks depending on the underlying filesystem (for me, it
works on tmpfs, but fails on xfs, because the block allocated by
file-posix has 16 kB there instead of 4 kB).
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201207152245.66987-1-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/221 | 7 +++++++
tests/qemu-iotests/221.out | 14 ++++++--------
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/tests/qemu-iotests/221 b/tests/qemu-iotests/221
index ca62b3baa1..7e6086b205 100755
--- a/tests/qemu-iotests/221
+++ b/tests/qemu-iotests/221
@@ -46,6 +46,13 @@ echo "=== Check mapping of unaligned raw image ==="
echo
_make_test_img 65537 # qemu-img create rounds size up
+
+# file-posix allocates the first block of any images when it is created;
+# the size of this block depends on the host page size and the file
+# system block size, none of which are constant. Discard the whole
+# image so we will not see this allocation in qemu-img map's output.
+$QEMU_IO -c 'discard 0 65537' "$TEST_IMG" | _filter_qemu_io
+
$QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
truncate --size=65537 "$TEST_IMG" # so we resize it and check again
diff --git a/tests/qemu-iotests/221.out b/tests/qemu-iotests/221.out
index dca024a0c3..93846c7dab 100644
--- a/tests/qemu-iotests/221.out
+++ b/tests/qemu-iotests/221.out
@@ -3,18 +3,16 @@ QA output created by 221
=== Check mapping of unaligned raw image ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65537
-[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true,
"offset": OFFSET},
-{ "start": 4096, "length": 61952, "depth": 0, "zero": true, "data": false,
"offset": OFFSET}]
-[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true,
"offset": OFFSET},
-{ "start": 4096, "length": 61952, "depth": 0, "zero": true, "data": false,
"offset": OFFSET}]
+discard 65537/65537 bytes at offset 0
+64.001 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+[{ "start": 0, "length": 66048, "depth": 0, "zero": true, "data": false,
"offset": OFFSET}]
+[{ "start": 0, "length": 66048, "depth": 0, "zero": true, "data": false,
"offset": OFFSET}]
wrote 1/1 bytes at offset 65536
1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true,
"offset": OFFSET},
-{ "start": 4096, "length": 61440, "depth": 0, "zero": true, "data": false,
"offset": OFFSET},
+[{ "start": 0, "length": 65536, "depth": 0, "zero": true, "data": false,
"offset": OFFSET},
{ "start": 65536, "length": 1, "depth": 0, "zero": false, "data": true,
"offset": OFFSET},
{ "start": 65537, "length": 511, "depth": 0, "zero": true, "data": false,
"offset": OFFSET}]
-[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true,
"offset": OFFSET},
-{ "start": 4096, "length": 61440, "depth": 0, "zero": true, "data": false,
"offset": OFFSET},
+[{ "start": 0, "length": 65536, "depth": 0, "zero": true, "data": false,
"offset": OFFSET},
{ "start": 65536, "length": 1, "depth": 0, "zero": false, "data": true,
"offset": OFFSET},
{ "start": 65537, "length": 511, "depth": 0, "zero": true, "data": false,
"offset": OFFSET}]
*** done
--
2.29.2
- [PULL 10/34] fuse: Implement hole detection through lseek, (continued)
- [PULL 10/34] fuse: Implement hole detection through lseek, Kevin Wolf, 2020/12/11
- [PULL 12/34] iotests: Do not pipe _make_test_img, Kevin Wolf, 2020/12/11
- [PULL 11/34] iotests: Do not needlessly filter _make_test_img, Kevin Wolf, 2020/12/11
- [PULL 13/34] iotests: Use convert -n in some cases, Kevin Wolf, 2020/12/11
- [PULL 15/34] iotests: Derive image names from $TEST_IMG, Kevin Wolf, 2020/12/11
- [PULL 14/34] iotests/046: Avoid renaming images, Kevin Wolf, 2020/12/11
- [PULL 17/34] iotests: Restrict some Python tests to file, Kevin Wolf, 2020/12/11
- [PULL 18/34] iotests: Let _make_test_img guess $TEST_IMG_FILE, Kevin Wolf, 2020/12/11
- [PULL 20/34] storage-daemon: Call bdrv_close_all() on exit, Kevin Wolf, 2020/12/11
- [PULL 16/34] iotests/091: Use _cleanup_qemu instad of "wait", Kevin Wolf, 2020/12/11
- [PULL 26/34] iotests/221: Discard image before qemu-img map,
Kevin Wolf <=
- [PULL 24/34] iotests/308: Add test for FUSE exports, Kevin Wolf, 2020/12/11
- [PULL 19/34] iotests/287: Clean up subshell test image, Kevin Wolf, 2020/12/11
- [PULL 25/34] file-posix: check the use_lock before setting the file lock, Kevin Wolf, 2020/12/11
- [PULL 27/34] can-host: Fix crash when 'canbus' property is not set, Kevin Wolf, 2020/12/11
- [PULL 22/34] iotests: Allow testing FUSE exports, Kevin Wolf, 2020/12/11
- [PULL 21/34] iotests: Give access to the qemu-storage-daemon, Kevin Wolf, 2020/12/11
- [PULL 23/34] iotests: Enable fuse for many tests, Kevin Wolf, 2020/12/11
- [PULL 28/34] block/file-posix: fix workaround in raw_do_pwrite_zeroes(), Kevin Wolf, 2020/12/11
- [PULL 29/34] block/io: bdrv_refresh_limits(): use ERRP_GUARD, Kevin Wolf, 2020/12/11
- [PULL 31/34] block: introduce BDRV_MAX_LENGTH, Kevin Wolf, 2020/12/11