]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
tests/nvme/031: fix connecting faiure
authorYi Zhang <yi.zhang@redhat.com>
Thu, 7 Sep 2023 03:44:23 +0000 (11:44 +0800)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 11 Sep 2023 10:18:30 +0000 (19:18 +0900)
allow_any_host was disabled during _create_nvmet_subsystem, call
_create_nvmet_host before connecting to allow the host to connect.

[76096.420586] nvmet: adding nsid 1 to subsystem blktests-subsystem-0
[76096.440595] nvmet_tcp: enabling port 0 (127.0.0.1:4420)
[76096.491344] nvmet: connect by host nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349 for subsystem blktests-subsystem-0 not allowed
[76096.505049] nvme nvme2: Connect for subsystem blktests-subsystem-0 is not allowed, hostnqn: nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349
[76096.519609] nvme nvme2: failed to connect queue: 0 ret=16772

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
Fixes: c32b233b7dd6 ("nvme/rc: Add helper for adding/removing to allow list")
Link: https://lore.kernel.org/linux-block/20230907034423.3928010-1-yi.zhang@redhat.com/
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/nvme/031

index d5c2561b941b5d943e7722ee54f9a065100eeb1a..696db2dfa4aa434cf79decb24e36381d121b652c 100755 (executable)
@@ -42,10 +42,12 @@ test() {
        for ((i = 0; i < iterations; i++)); do
                _create_nvmet_subsystem "${subsys}$i" "${loop_dev}"
                _add_nvmet_subsys_to_port "${port}" "${subsys}$i"
+               _create_nvmet_host "${subsys}$i" "${def_hostnqn}"
                _nvme_connect_subsys "${nvme_trtype}" "${subsys}$i"
                _nvme_disconnect_subsys "${subsys}$i" >> "${FULL}" 2>&1
                _remove_nvmet_subsystem_from_port "${port}" "${subsys}$i"
                _remove_nvmet_subsystem "${subsys}$i"
+               _remove_nvmet_host "${def_hostnqn}"
        done
 
        _remove_nvmet_port "${port}"