qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iotests: fix _check_o_direct
@ 2020-12-18 18:20 Vladimir Sementsov-Ogievskiy
  2020-12-22 15:15 ` Max Reitz
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2020-12-18 18:20 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, vsementsov, qemu-devel, mreitz

Unfortunately commit "iotests: handle tmpfs" break 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 smothing 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: cfdca2b9f9d4ca26bb2b2dfe8de3149092e39170
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/common.rc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 29354654cc..297acf9b6a 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -821,9 +821,10 @@ _supported_cache_modes()
 # Check whether the filesystem supports O_DIRECT
 _check_o_direct()
 {
-    $QEMU_IMG create -f raw "$TEST_IMG".test_o_direct 1M > /dev/null
-    out=$($QEMU_IO -f raw -t none -c quit "$TEST_IMG".test_o_direct 2>&1)
-    rm -f "$TEST_IMG".test_o_direct
+    testfile="$TEST_DIR"/_check_o_direct
+    $QEMU_IMG create -f raw "$testfile" 1M > /dev/null
+    out=$($QEMU_IO -f raw -t none -c quit "$testfile" 2>&1)
+    rm -f "$testfile"
 
     [[ "$out" != *"O_DIRECT"* ]]
 }
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iotests: fix _check_o_direct
  2020-12-18 18:20 [PATCH] iotests: fix _check_o_direct Vladimir Sementsov-Ogievskiy
@ 2020-12-22 15:15 ` Max Reitz
  2020-12-22 15:35   ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Max Reitz @ 2020-12-22 15:15 UTC (permalink / raw)
  To: Vladimir Sementsov-Ogievskiy, qemu-block; +Cc: kwolf, qemu-devel

On 18.12.20 19:20, Vladimir Sementsov-Ogievskiy wrote:
> Unfortunately commit "iotests: handle tmpfs" break 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 smothing 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: cfdca2b9f9d4ca26bb2b2dfe8de3149092e39170
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   tests/qemu-iotests/common.rc | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iotests: fix _check_o_direct
  2020-12-22 15:15 ` Max Reitz
@ 2020-12-22 15:35   ` Vladimir Sementsov-Ogievskiy
  2020-12-22 16:20     ` Max Reitz
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2020-12-22 15:35 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: kwolf, qemu-devel

22.12.2020 18:15, Max Reitz wrote:
> On 18.12.20 19:20, Vladimir Sementsov-Ogievskiy wrote:
>> Unfortunately commit "iotests: handle tmpfs" break 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 smothing like

s/smothing/something/ , sorry.

>> 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: cfdca2b9f9d4ca26bb2b2dfe8de3149092e39170
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>>   tests/qemu-iotests/common.rc | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Thanks, applied to my block branch:
> 
> https://git.xanclic.moe/XanClic/qemu/commits/branch/block
> 

Thanks!

-- 
Best regards,
Vladimir


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iotests: fix _check_o_direct
  2020-12-22 15:35   ` Vladimir Sementsov-Ogievskiy
@ 2020-12-22 16:20     ` Max Reitz
  0 siblings, 0 replies; 4+ messages in thread
From: Max Reitz @ 2020-12-22 16:20 UTC (permalink / raw)
  To: Vladimir Sementsov-Ogievskiy, qemu-block; +Cc: kwolf, qemu-devel

On 22.12.20 16:35, Vladimir Sementsov-Ogievskiy wrote:
> 22.12.2020 18:15, Max Reitz wrote:
>> On 18.12.20 19:20, Vladimir Sementsov-Ogievskiy wrote:
>>> Unfortunately commit "iotests: handle tmpfs" break 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 smothing like
> 
> s/smothing/something/ , sorry.

Already done O:)



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-22 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 18:20 [PATCH] iotests: fix _check_o_direct Vladimir Sementsov-Ogievskiy
2020-12-22 15:15 ` Max Reitz
2020-12-22 15:35   ` Vladimir Sementsov-Ogievskiy
2020-12-22 16:20     ` Max Reitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).