]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
nbd/002: fix wrong -L/-nonetlink option usage
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 17 Apr 2024 10:42:08 +0000 (19:42 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 25 Apr 2024 11:15:46 +0000 (20:15 +0900)
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.

Tested-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/nbd/002

index fd992a099bdd6f1507e733f972b3ee50ef08ae70..968c9facd8230313cc2f3060c2e447a0ba9f3a51 100755 (executable)
@@ -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?"