]> www.infradead.org Git - users/sagi/blktests.git/commit
nbd/004: avoid left connection
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 29 Sep 2023 01:16:40 +0000 (10:16 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 6 Oct 2023 00:45:49 +0000 (09:45 +0900)
commit1aeff011213d79e5fedd32ec24a9aa869c078478
tree0a74310d4feea04a54092b134a7d53e26eb1b28b
parent11ab7cc7ee32d6c3e16ac74c34c4bbdbf8f99292
nbd/004: avoid left connection

The test case nbd/004 disconnects /dev/nbd0 in most cases, but sometimes
leaves it in connected status. The test case stops the nbd server then
/dev/nbd0 does not work even when it is in connected status. This makes
"udevadm settle" command to wait for nbd udev events infinitely and
causes failures of following test cases.

There are two causes of the left connection. The first cause is left
nbd-client process. The test case waits for completion of its child
process connect_and_disconnect. However, it does not wait for completion
of nbd-client process that connect_and_disconnect spawns. After the test
case end, the left nbd-client process establishes the connection of
/dev/nbd0. The second cause is missing disconnect operation. The
connect_and_disconnect process repeats _netlink_connect and
_netlink_disconnect. When this process is killed after _netlink_connect
and before _netlink_disconnect, the connected status is left.

To avoid the left connection, wait for nbd-client process completion
and call _netlink_disconnect at the test case end.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/nbd/004