Skip to contentSkip to conversation

iotests: fix _check_o_direct

PATCH Applied Vladimir Sementsov-Ogievskiy 2 participants 4 messages Dec 18, 2020 – Dec 22, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iotests: fix _check_o_direct

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
---
 tests/qemu-iotests/common.rc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
tests/qemu-iotests/common.rc +4 -3
index 29354654cc..297acf9b6a 100644
@@ -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"* ]]
 }
Signature · 1 line
2.25.4
Applied
#1 lore raw
Quoted 10 lines · Vladimir Sementsov-Ogievskiy

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

Quoted 7 lines

Use TEST_DIR instead.

Fixes cfdca2b9f9d4ca26bb2b2dfe8de3149092e39170
---
  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

#2 lore raw
Quoted 4 lines · Max Reitz
Quoted 3 lines · Vladimir Sementsov-Ogievskiy

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.

Quoted 15 lines
Quoted 7 lines

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

Quoted 7 lines

Use TEST_DIR instead.

Fixes cfdca2b9f9d4ca26bb2b2dfe8de3149092e39170

---
  tests/qemu-iotests/common.rc | 7 ++++---

  1 file changed, 4 insertions(+), 3 deletions(-)
Quoted 4 lines

Thanks, applied to my block branch:

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

Thanks!

Signature · 2 lines
Best regards,
Vladimir
#3 lore raw
Quoted 7 lines · Vladimir Sementsov-Ogievskiy
Quoted 4 lines · Max Reitz
Quoted 3 lines · Vladimir Sementsov-Ogievskiy

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:)