iotests: fix _check_o_direct
Unfortunately commit "iotests: handle tmpfs" breaks running iotests
with -nbd -nocache, as _check_o_direct tries to create
$TEST_IMG.test_o_direct, but in case of nbd TEST_IMG is something like
nbd+unix:///... , and test fails with message
qemu-img: nbd+unix:///?socket[...]test_o_direct: Protocol driver
'nbd' does not support image creation, and opening the image
failed: Failed to connect to '/tmp/tmp.[...]/nbd/test_o_direct': No
such file or directory
Use TEST_DIR instead.
Fixes: cfdca2b9f9
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20201218182012.47607-1-vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
31ee895047
commit
0c8de0a133
|
@ -821,9 +821,10 @@ _supported_cache_modes()
|
||||||
# Check whether the filesystem supports O_DIRECT
|
# Check whether the filesystem supports O_DIRECT
|
||||||
_check_o_direct()
|
_check_o_direct()
|
||||||
{
|
{
|
||||||
$QEMU_IMG create -f raw "$TEST_IMG".test_o_direct 1M > /dev/null
|
testfile="$TEST_DIR"/_check_o_direct
|
||||||
out=$($QEMU_IO -f raw -t none -c quit "$TEST_IMG".test_o_direct 2>&1)
|
$QEMU_IMG create -f raw "$testfile" 1M > /dev/null
|
||||||
rm -f "$TEST_IMG".test_o_direct
|
out=$($QEMU_IO -f raw -t none -c quit "$testfile" 2>&1)
|
||||||
|
rm -f "$testfile"
|
||||||
|
|
||||||
[[ "$out" != *"O_DIRECT"* ]]
|
[[ "$out" != *"O_DIRECT"* ]]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue