[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/7] iotests: use TEST_IMG_FILE instead of TEST_IMG in _require_la
From: |
Eric Blake |
Subject: |
[PULL 1/7] iotests: use TEST_IMG_FILE instead of TEST_IMG in _require_large_file |
Date: |
Mon, 25 Sep 2023 14:01:16 -0500 |
From: "Denis V. Lunev" <den@openvz.org>
We need to check that we are able to create large enough file which is
used as an export base rather than connection URL. Unfortunately, there
are cases when the TEST_IMG_FILE is not defined. We should fallback to
TEST_IMG in that case.
This problem has been detected when running
./check -nbd 5
The test should be able to run while it does not.
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Hanna Reitz <hreitz@redhat.com>
CC: Eric Blake <eblake@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID: <20230906140917.559129-2-den@openvz.org>
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/common.rc | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index d145f08201c..95c12577dd4 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -979,10 +979,15 @@ _require_drivers()
#
_require_large_file()
{
- if ! truncate --size="$1" "$TEST_IMG"; then
+ if [ -z "$TEST_IMG_FILE" ]; then
+ FILENAME="$TEST_IMG"
+ else
+ FILENAME="$TEST_IMG_FILE"
+ fi
+ if ! truncate --size="$1" "$FILENAME"; then
_notrun "file system on $TEST_DIR does not support large enough files"
fi
- rm "$TEST_IMG"
+ rm "$FILENAME"
}
# Check that a set of devices is available in the QEMU binary
--
2.41.0
- [PULL 0/7] NBD patches through 2023-09-25, Eric Blake, 2023/09/25
- [PULL 1/7] iotests: use TEST_IMG_FILE instead of TEST_IMG in _require_large_file,
Eric Blake <=
- [PULL 4/7] nbd/client: Pass mode through to nbd_send_request, Eric Blake, 2023/09/25
- [PULL 7/7] nbd/server: Refactor handling of command sanity checks, Eric Blake, 2023/09/25
- [PULL 6/7] nbd: Prepare for 64-bit request effect lengths, Eric Blake, 2023/09/25
- [PULL 5/7] nbd: Add types for extended headers, Eric Blake, 2023/09/25
- [PULL 2/7] iotests: improve 'not run' message for nbd-multiconn test, Eric Blake, 2023/09/25
- [PULL 3/7] nbd: Replace bool structured_reply with mode enum, Eric Blake, 2023/09/25
- Re: [PULL 0/7] NBD patches through 2023-09-25, Stefan Hajnoczi, 2023/09/26