Skip to contentSkip to conversation

iotests/nbd-reconnect-on-open: Fix NBD socket path

PATCH In review Kevin Wolf 3 participants 3 messages May 3, 2023

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 iotests/nbd-reconnect-on-open: Fix NBD socket path

Socket paths need to be short to avoid failures. This is why there is a iotests.sock_dir (defaulting to /tmp) separate from the disk image base directory.

Make use of it to fix failures in too deeply nested test directories.

Fixes ab7f7e67a7e7b49964109501dfcde4ec29bae60e
---
 tests/qemu-iotests/tests/nbd-reconnect-on-open     | 3 ++-
 tests/qemu-iotests/tests/nbd-reconnect-on-open.out | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
tests/qemu-iotests/tests/nbd-reconnect-on-open +2 -1
index d0b401b060..3ce52021c3 100755
@@ -26,7 +26,8 @@ from iotests import qemu_img_create, file_path, qemu_io_popen, qemu_nbd, \
 
 iotests.script_initialize(supported_fmts=['qcow2'])
 
-disk, nbd_sock = file_path('disk', 'nbd-sock')
+disk = file_path('disk')
+nbd_sock = file_path('nbd-sock', base_dir=iotests.sock_dir)
 
 
 def create_args(open_timeout):
tests/qemu-iotests/tests/nbd-reconnect-on-open.out +2 -2
index a35ae30ea4..b3dd90f2a3 100644
@@ -2,10 +2,10 @@ read 1048576/1048576 bytes at offset 0
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
 Check fail to connect with 0 seconds of timeout
-qemu-io: can't open: Failed to connect to 'TEST_DIR/PID-nbd-sock': No such file or directory
+qemu-io: can't open: Failed to connect to 'SOCK_DIR/PID-nbd-sock': No such file or directory
 
 qemu_io finished in 0..0.2 seconds, OK
 Check fail to connect with 1 seconds of timeout
-qemu-io: can't open: Failed to connect to 'TEST_DIR/PID-nbd-sock': No such file or directory
+qemu-io: can't open: Failed to connect to 'SOCK_DIR/PID-nbd-sock': No such file or directory
 
 qemu_io finished in 1..1.2 seconds, OK
Signature · 1 line
2.40.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Kevin Wolf

Socket paths need to be short to avoid failures. This is why there is a iotests.sock_dir (defaulting to /tmp) separate from the disk image base directory.

Quoted 8 lines

Make use of it to fix failures in too deeply nested test directories.

Fixes ab7f7e67a7e7b49964109501dfcde4ec29bae60e
---
 tests/qemu-iotests/tests/nbd-reconnect-on-open     | 3 ++-
 tests/qemu-iotests/tests/nbd-reconnect-on-open.out | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Just barely missed today's NBD pull request; I'll queue it for my next one, or it can go in through your block tree if you beat me to it.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v1 1/1
#2 lore raw
In reply to Kevin Wolf
Quoted 8 lines · Kevin Wolf

Socket paths need to be short to avoid failures. This is why there is a iotests.sock_dir (defaulting to /tmp) separate from the disk image base directory.

Make use of it to fix failures in too deeply nested test directories.

Fixes ab7f7e67a7e7b49964109501dfcde4ec29bae60e
Signature · 2 lines
Best regards,
Vladimir