Skip to content

Commit

Permalink
iotests: use TEST_IMG_FILE instead of TEST_IMG in _require_large_file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis V. Lunev authored and ebblake committed Sep 22, 2023
1 parent b55e4b9 commit 0189c27
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/qemu-iotests/common.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0189c27

Please sign in to comment.