Skip to content

Commit

Permalink
iotests/nbd-reconnect-on-open: Fix NBD socket path
Browse files Browse the repository at this point in the history
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: ab7f7e6
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230503165019.8867-1-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
kevmw committed May 10, 2023
1 parent e262687 commit cf6052f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/qemu-iotests/tests/nbd-reconnect-on-open
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/qemu-iotests/tests/nbd-reconnect-on-open.out
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cf6052f

Please sign in to comment.