[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/13] qemu-iotests/197: use more generic commands for formats oth
From: |
Eric Blake |
Subject: |
[PULL 01/13] qemu-iotests/197: use more generic commands for formats other than qcow2 |
Date: |
Thu, 7 Sep 2023 20:35:37 -0500 |
From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
In the previous commit e2f938265e0 ("tests/qemu-iotests/197: add
testcase for CoR with subclusters") we've introduced a new testcase for
copy-on-read with subclusters. Test 197 always forces qcow2 as the top
image, but allows backing image to be in any format. That last test
case didn't meet these requirements, so let's fix it by using more
generic "qemu-io -c map" command.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Message-ID: <20230907220718.983430-1-andrey.drobyshev@virtuozzo.com>
Tested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
tests/qemu-iotests/197 | 8 ++++----
tests/qemu-iotests/197.out | 18 ++++++++----------
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197
index f07a9da136a..8ad2bdb035e 100755
--- a/tests/qemu-iotests/197
+++ b/tests/qemu-iotests/197
@@ -136,18 +136,18 @@ IMGPROTO=file IMGFMT=qcow2 TEST_IMG_FILE="$TEST_WRAP" \
$QEMU_IO -c "write -P 0xaa 0 64k" "$TEST_IMG" | _filter_qemu_io
# Allocate individual subclusters in the top image, and not the whole cluster
-$QEMU_IO -c "write -P 0xbb 28K 2K" -c "write -P 0xcc 34K 2K" "$TEST_WRAP" \
+$QEMU_IO -f qcow2 -c "write -P 0xbb 28K 2K" -c "write -P 0xcc 34K 2K"
"$TEST_WRAP" \
| _filter_qemu_io
# Only 2 subclusters should be allocated in the top image at this point
-$QEMU_IMG map "$TEST_WRAP" | _filter_qemu_img_map
+$QEMU_IO -f qcow2 -c map "$TEST_WRAP"
# Actual copy-on-read operation
-$QEMU_IO -C -c "read -P 0xaa 30K 4K" "$TEST_WRAP" | _filter_qemu_io
+$QEMU_IO -f qcow2 -C -c "read -P 0xaa 30K 4K" "$TEST_WRAP" | _filter_qemu_io
# And here we should have 4 subclusters allocated right in the middle of the
# top image. Make sure the whole cluster remains unallocated
-$QEMU_IMG map "$TEST_WRAP" | _filter_qemu_img_map
+$QEMU_IO -f qcow2 -c map "$TEST_WRAP"
_check_test_img
diff --git a/tests/qemu-iotests/197.out b/tests/qemu-iotests/197.out
index 8f34a30afea..86c57b51d30 100644
--- a/tests/qemu-iotests/197.out
+++ b/tests/qemu-iotests/197.out
@@ -42,17 +42,15 @@ wrote 2048/2048 bytes at offset 28672
2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 2048/2048 bytes at offset 34816
2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Offset Length File
-0 0x7000 TEST_DIR/t.IMGFMT
-0x7000 0x800 TEST_DIR/t.wrap.IMGFMT
-0x7800 0x1000 TEST_DIR/t.IMGFMT
-0x8800 0x800 TEST_DIR/t.wrap.IMGFMT
-0x9000 0x7000 TEST_DIR/t.IMGFMT
+28 KiB (0x7000) bytes not allocated at offset 0 bytes (0x0)
+2 KiB (0x800) bytes allocated at offset 28 KiB (0x7000)
+4 KiB (0x1000) bytes not allocated at offset 30 KiB (0x7800)
+2 KiB (0x800) bytes allocated at offset 34 KiB (0x8800)
+28 KiB (0x7000) bytes not allocated at offset 36 KiB (0x9000)
read 4096/4096 bytes at offset 30720
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Offset Length File
-0 0x7000 TEST_DIR/t.IMGFMT
-0x7000 0x2000 TEST_DIR/t.wrap.IMGFMT
-0x9000 0x7000 TEST_DIR/t.IMGFMT
+28 KiB (0x7000) bytes not allocated at offset 0 bytes (0x0)
+8 KiB (0x2000) bytes allocated at offset 28 KiB (0x7000)
+28 KiB (0x7000) bytes not allocated at offset 36 KiB (0x9000)
No errors were found on the image.
*** done
--
2.41.0
- [PULL 00/13] NBD patches through 2023-09-07, Eric Blake, 2023/09/07
- [PULL 01/13] qemu-iotests/197: use more generic commands for formats other than qcow2,
Eric Blake <=
- [PULL 02/13] nbd: drop unused nbd_receive_negotiate() aio_context argument, Eric Blake, 2023/09/07
- [PULL 04/13] io: check there are no qio_channel_yield() coroutines during ->finalize(), Eric Blake, 2023/09/07
- [PULL 03/13] nbd: drop unused nbd_start_negotiate() aio_context argument, Eric Blake, 2023/09/07
- [PULL 07/13] qemu-nbd: improve error message for dup2 error, Eric Blake, 2023/09/07
- [PULL 05/13] io: follow coroutine AioContext in qio_channel_yield(), Eric Blake, 2023/09/07
- [PULL 06/13] util/iov: Avoid dynamic stack allocation, Eric Blake, 2023/09/07
- [PULL 08/13] qemu-nbd: define struct NbdClientOpts when HAVE_NBD_DEVICE is not defined, Eric Blake, 2023/09/07
- [PULL 09/13] qemu-nbd: move srcpath into struct NbdClientOpts, Eric Blake, 2023/09/07
- [PULL 10/13] qemu-nbd: put saddr into into struct NbdClientOpts, Eric Blake, 2023/09/07
- [PULL 11/13] qemu-nbd: invent nbd_client_release_pipe() helper, Eric Blake, 2023/09/07