diff mbox series

[blktests,v2,1/2] nbd/002: fix wrong -L/-nonetlink option usage

Message ID 20240417104209.2898526-2-shinichiro.kawasaki@wdc.com (mailing list archive)
State New, archived
Headers show
Series fix nbd/002 | expand

Commit Message

Shinichiro Kawasaki April 17, 2024, 10:42 a.m. UTC
As the commit 3c014acd5171 ("nbd/001: use -L for nbd-client") explains,
the nbd-client command uses the netlink interface instead of the ioctl
interface. The default interface changed at nbd version 3.17 in March
2018. Before that, the default was ioctl. After the change, the
nbd-client command requires -L or -nonetlink option to use the ioctl
interface.

The commit 3c014acd5171 adjusted nbd/001 test script to the default
interface change. However, it is not reflected to nbd/002. This caused
mismatch between the comments in the test case and the actual test. The
comments describe the first half as "Do it with ioctls", and the last
half as "Do it with netlink". However, the test script does opposite. It
specifies no option for the first half, then tests with netlink
interface. It specifies -L option for the last half, then tests with the
ioctl interface.

This makes it difficult to debug the failure of the test case. Fix the
nbd-client command option to match the comments. Also, use the long
option -nonetlink instead of -L for easier reading.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 tests/nbd/002 | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/tests/nbd/002 b/tests/nbd/002
index fd992a0..968c9fa 100755
--- a/tests/nbd/002
+++ b/tests/nbd/002
@@ -53,11 +53,11 @@  test() {
 
 	echo "Testing IOCTL path"
 
-	nbd-client -N export localhost /dev/nbd0 >> "$FULL" 2>&1
+	nbd-client -nonetlink -N export localhost /dev/nbd0 >> "$FULL" 2>&1
 
 	if ! _wait_for_nbd_connect; then
 		echo "Connect didn't happen?"
-		nbd-client -d /dev/nbd0 >> "$FULL" 2>&1
+		nbd-client -nonetlink -d /dev/nbd0 >> "$FULL" 2>&1
 		_stop_nbd_server
 		return 1
 	fi
@@ -66,12 +66,12 @@  test() {
 
 	if ! stat /dev/nbd0p1 >> "$FULL" 2>&1; then
 		echo "Didn't have partition on ioctl path"
-		nbd-client -d /dev/nbd0 >> "$FULL" 2>&1
+		nbd-client -nonetlink -d /dev/nbd0 >> "$FULL" 2>&1
 		_stop_nbd_server
 		return 1
 	fi
 
-	nbd-client -d /dev/nbd0 >> "$FULL" 2>&1
+	nbd-client -nonetlink -d /dev/nbd0 >> "$FULL" 2>&1
 
 	udevadm settle
 
@@ -83,7 +83,7 @@  test() {
 
 	# Do it with netlink
 	echo "Testing the netlink path"
-	nbd-client -L -N export localhost /dev/nbd0 >> "$FULL" 2>&1
+	nbd-client -N export localhost /dev/nbd0 >> "$FULL" 2>&1
 
 	if ! _wait_for_nbd_connect; then
 		echo "Connect didn't happen?"
@@ -96,12 +96,12 @@  test() {
 
 	if  ! stat /dev/nbd0p1 >/dev/null 2>&1; then
 		echo "Didn't have partition on the netlink path"
-		nbd-client -L -d /dev/nbd0 >> "$FULL" 2>&1
+		nbd-client -d /dev/nbd0 >> "$FULL" 2>&1
 		_stop_nbd_server
 		return 1
 	fi
 
-	nbd-client -L -d /dev/nbd0 >> "$FULL" 2>&1
+	nbd-client -d /dev/nbd0 >> "$FULL" 2>&1
 
 	if ! _wait_for_nbd_disconnect; then
 		echo "Disconnect didn't happen?"