[PATCH blktests v3 13/20] nvme: drop default trtype argument for _nvmet_connect_subsys
Daniel Wagner
dwagner at suse.de
Tue Mar 26 06:13:55 PDT 2024
Every invocation of _nvmet_connect_subsys passes in the default
nvme_trtype argument. nvme/rc also assumes the test is always using
nvme_trtype for trtype (e.g. cleanup code paths), thus just drop
this argument.
Signed-off-by: Daniel Wagner <dwagner at suse.de>
---
tests/nvme/003 | 2 +-
tests/nvme/004 | 3 +--
tests/nvme/005 | 2 +-
tests/nvme/008 | 2 +-
tests/nvme/009 | 2 +-
tests/nvme/010 | 2 +-
tests/nvme/011 | 2 +-
tests/nvme/012 | 2 +-
tests/nvme/013 | 2 +-
tests/nvme/014 | 2 +-
tests/nvme/015 | 2 +-
tests/nvme/018 | 2 +-
tests/nvme/019 | 2 +-
tests/nvme/020 | 2 +-
tests/nvme/021 | 2 +-
tests/nvme/022 | 2 +-
tests/nvme/023 | 2 +-
tests/nvme/024 | 2 +-
tests/nvme/025 | 2 +-
tests/nvme/026 | 2 +-
tests/nvme/027 | 2 +-
tests/nvme/028 | 2 +-
tests/nvme/029 | 2 +-
tests/nvme/031 | 2 +-
tests/nvme/040 | 2 +-
tests/nvme/041 | 4 ++--
tests/nvme/042 | 4 ++--
tests/nvme/043 | 4 ++--
tests/nvme/044 | 8 ++++----
tests/nvme/045 | 2 +-
tests/nvme/047 | 4 ++--
tests/nvme/048 | 2 +-
tests/nvme/rc | 12 +++++-------
33 files changed, 44 insertions(+), 47 deletions(-)
diff --git a/tests/nvme/003 b/tests/nvme/003
index b5ea2720100e..9a7c41f0856b 100755
--- a/tests/nvme/003
+++ b/tests/nvme/003
@@ -25,7 +25,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" nqn.2014-08.org.nvmexpress.discovery
+ _nvme_connect_subsys nqn.2014-08.org.nvmexpress.discovery
# This is ugly but checking for the absence of error messages is ...
sleep 10
diff --git a/tests/nvme/004 b/tests/nvme/004
index cc5310e78e0b..024ac986e5c1 100755
--- a/tests/nvme/004
+++ b/tests/nvme/004
@@ -22,10 +22,9 @@ test() {
_setup_nvmet
-
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
local nvmedev
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
diff --git a/tests/nvme/005 b/tests/nvme/005
index f9956e960a56..80a5359e862e 100755
--- a/tests/nvme/005
+++ b/tests/nvme/005
@@ -25,7 +25,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
diff --git a/tests/nvme/008 b/tests/nvme/008
index 6ff3362e9c9b..fb1726723d43 100755
--- a/tests/nvme/008
+++ b/tests/nvme/008
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/009 b/tests/nvme/009
index 4ea00636e5dd..a9d83b675ba2 100755
--- a/tests/nvme/009
+++ b/tests/nvme/009
@@ -23,7 +23,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/010 b/tests/nvme/010
index 5ed6cb5c0374..496f6e5c6a52 100755
--- a/tests/nvme/010
+++ b/tests/nvme/010
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/011 b/tests/nvme/011
index f9150e06434e..14a17a774d5f 100755
--- a/tests/nvme/011
+++ b/tests/nvme/011
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/012 b/tests/nvme/012
index f0914ce3206b..8dbf8eb1a9f0 100755
--- a/tests/nvme/012
+++ b/tests/nvme/012
@@ -28,7 +28,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/013 b/tests/nvme/013
index 3cef009cb9f4..eb22933fdec6 100755
--- a/tests/nvme/013
+++ b/tests/nvme/013
@@ -27,7 +27,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/014 b/tests/nvme/014
index c02167142cb3..20ff69176231 100755
--- a/tests/nvme/014
+++ b/tests/nvme/014
@@ -27,7 +27,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/015 b/tests/nvme/015
index 8ea90f10bda7..634c42c07a86 100755
--- a/tests/nvme/015
+++ b/tests/nvme/015
@@ -27,7 +27,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/018 b/tests/nvme/018
index e631434d7bd6..9225f7d58377 100755
--- a/tests/nvme/018
+++ b/tests/nvme/018
@@ -25,7 +25,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/019 b/tests/nvme/019
index 3ab22e2cba01..9cf9f5299305 100755
--- a/tests/nvme/019
+++ b/tests/nvme/019
@@ -26,7 +26,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/020 b/tests/nvme/020
index 10de114b83af..f6a204e6e417 100755
--- a/tests/nvme/020
+++ b/tests/nvme/020
@@ -25,7 +25,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/021 b/tests/nvme/021
index 7dc6a41b9f7b..73e414e9db47 100755
--- a/tests/nvme/021
+++ b/tests/nvme/021
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/022 b/tests/nvme/022
index c70fbbae822e..31435cd2e9c7 100755
--- a/tests/nvme/022
+++ b/tests/nvme/022
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/023 b/tests/nvme/023
index 58f03e8603a7..c4c292899f32 100755
--- a/tests/nvme/023
+++ b/tests/nvme/023
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/024 b/tests/nvme/024
index 4608f015c4c3..b0d6f5a3c0b9 100755
--- a/tests/nvme/024
+++ b/tests/nvme/024
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/025 b/tests/nvme/025
index 46f6197cdfed..107eb38ba787 100755
--- a/tests/nvme/025
+++ b/tests/nvme/025
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/026 b/tests/nvme/026
index d5e13db0a916..ff4ff91d5d4f 100755
--- a/tests/nvme/026
+++ b/tests/nvme/026
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/027 b/tests/nvme/027
index 82b77a963623..a15e6d6e92d0 100755
--- a/tests/nvme/027
+++ b/tests/nvme/027
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/028 b/tests/nvme/028
index 0b49e2016d30..41dcb6ef7a4f 100755
--- a/tests/nvme/028
+++ b/tests/nvme/028
@@ -24,7 +24,7 @@ test() {
_nvmet_target_setup --blkdev file
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/029 b/tests/nvme/029
index a4f0cb1402b1..7bde5565b020 100755
--- a/tests/nvme/029
+++ b/tests/nvme/029
@@ -58,7 +58,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
_check_uuid "${nvmedev}"
diff --git a/tests/nvme/031 b/tests/nvme/031
index 204ba7d2892f..19854ccb903f 100755
--- a/tests/nvme/031
+++ b/tests/nvme/031
@@ -43,7 +43,7 @@ test() {
_nvmet_target_setup --subsysnqn "${subsys}$i" \
--blkdev "${loop_dev}"
- _nvme_connect_subsys "${nvme_trtype}" "${subsys}$i"
+ _nvme_connect_subsys "${subsys}$i"
_nvme_disconnect_subsys "${subsys}$i" >> "${FULL}" 2>&1
_nvmet_target_cleanup --subsysnqn "${subsys}$i" \
diff --git a/tests/nvme/040 b/tests/nvme/040
index 7759bac9b43c..06d0d0d47368 100755
--- a/tests/nvme/040
+++ b/tests/nvme/040
@@ -26,7 +26,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
+ _nvme_connect_subsys "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
# start fio job
diff --git a/tests/nvme/041 b/tests/nvme/041
index c4588d7058ac..02452fd52628 100755
--- a/tests/nvme/041
+++ b/tests/nvme/041
@@ -38,7 +38,7 @@ test() {
# Test unauthenticated connection (should fail)
echo "Test unauthenticated connection (should fail)"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}"
@@ -46,7 +46,7 @@ test() {
# Test authenticated connection
echo "Test authenticated connection"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}"
diff --git a/tests/nvme/042 b/tests/nvme/042
index 815d65e7c610..961301ff6993 100755
--- a/tests/nvme/042
+++ b/tests/nvme/042
@@ -41,7 +41,7 @@ test() {
fi
_set_nvmet_hostkey "${def_hostnqn}" "${hostkey}"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}"
@@ -58,7 +58,7 @@ test() {
fi
_set_nvmet_hostkey "${def_hostnqn}" "${hostkey}"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}"
diff --git a/tests/nvme/043 b/tests/nvme/043
index e65abb09fe7c..ed18869a5977 100755
--- a/tests/nvme/043
+++ b/tests/nvme/043
@@ -45,7 +45,7 @@ test() {
_set_nvmet_hash "${def_hostnqn}" "${hash}"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}"
@@ -59,7 +59,7 @@ test() {
_set_nvmet_dhgroup "${def_hostnqn}" "${dhgroup}"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}"
diff --git a/tests/nvme/044 b/tests/nvme/044
index 9ee07475e738..8e2b4131b969 100755
--- a/tests/nvme/044
+++ b/tests/nvme/044
@@ -49,7 +49,7 @@ test() {
# Step 1: Connect with host authentication only
echo "Test host authentication"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}"
@@ -59,7 +59,7 @@ test() {
# Step 2: Connect with host authentication
# and invalid ctrl authentication
echo "Test invalid ctrl authentication (should fail)"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}" \
@@ -70,7 +70,7 @@ test() {
# Step 3: Connect with host authentication
# and valid ctrl authentication
echo "Test valid ctrl authentication"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}" \
@@ -82,7 +82,7 @@ test() {
# and invalid ctrl key
echo "Test invalid ctrl key (should fail)"
invkey="DHHC-1:00:Jc/My1o0qtLCWRp+sHhAVafdfaS7YQOMYhk9zSmlatobqB8C:"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}" \
diff --git a/tests/nvme/045 b/tests/nvme/045
index 9e5cb54e9533..f89378836e67 100755
--- a/tests/nvme/045
+++ b/tests/nvme/045
@@ -51,7 +51,7 @@ test() {
_set_nvmet_dhgroup "${def_hostnqn}" "ffdhe2048"
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--dhchap-secret "${hostkey}" \
diff --git a/tests/nvme/047 b/tests/nvme/047
index 94d7d50f9f98..162bd3bf70fa 100755
--- a/tests/nvme/047
+++ b/tests/nvme/047
@@ -27,7 +27,7 @@ test() {
_nvmet_target_setup
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys \
--nr-write-queues 1 || echo FAIL
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
@@ -37,7 +37,7 @@ test() {
_nvme_disconnect_subsys "${def_subsysnqn}" >> "$FULL" 2>&1
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--nr-write-queues 1 \
--nr-poll-queues 1 || echo FAIL
diff --git a/tests/nvme/048 b/tests/nvme/048
index f76cfedf8b03..44fdffe287c8 100755
--- a/tests/nvme/048
+++ b/tests/nvme/048
@@ -99,7 +99,7 @@ test() {
_nvmet_target_setup --blkdev file
if [[ -f "${cfs_path}/attr_qid_max" ]] ; then
- _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \
+ _nvme_connect_subsys "${def_subsysnqn}" \
--hostnqn "${def_hostnqn}" \
--hostid "${def_hostid}" \
--keep-alive-tmo 1 \
diff --git a/tests/nvme/rc b/tests/nvme/rc
index 9d47c737f9b0..9ce2fd787f8d 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -408,7 +408,6 @@ _nvme_disconnect_subsys() {
_nvme_connect_subsys() {
local positional_args=()
- local trtype=""
local subsysnqn=""
local hostnqn="$def_hostnqn"
local hostid="$def_hostid"
@@ -478,13 +477,12 @@ _nvme_connect_subsys() {
set -- "${positional_args[@]}"
- trtype="$1"
- subsysnqn="$2"
+ subsysnqn="$1"
- ARGS=(--transport "${trtype}" --nqn "${subsysnqn}")
- if [[ "${trtype}" == "fc" ]] ; then
+ ARGS=(--transport "${nvme_trtype}" --nqn "${subsysnqn}")
+ if [[ "${nvme_trtype}" == "fc" ]] ; then
ARGS+=(--traddr "${def_traddr}" --host-traddr "${def_host_traddr}")
- elif [[ "${trtype}" != "loop" ]]; then
+ elif [[ "${nvme_trtype}" != "loop" ]]; then
ARGS+=(--traddr "${def_traddr}" --trsvcid "${def_trsvcid}")
fi
ARGS+=(--hostnqn="${hostnqn}")
@@ -902,7 +900,7 @@ _nvmet_passthru_target_connect() {
local trtype=$1
local subsys_name=$2
- _nvme_connect_subsys "${trtype}" "${subsys_name}" --no-wait || return
+ _nvme_connect_subsys "${subsys_name}" --no-wait || return
nsdev=$(_find_nvme_passthru_loop_dev "${subsys_name}")
# The following tests can race with the creation
--
2.44.0
More information about the Linux-nvme
mailing list