diff mbox series

[blktests,v3,17/20] nvme: drop default subsysnqn argument from _nvmet_passthru_target_connect

Message ID 20240326131402.5092-18-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series refactoring and various cleanups/fixes | expand

Commit Message

Daniel Wagner March 26, 2024, 1:13 p.m. UTC
Remove the last positional argument for _nvmet_passthru_target_connect
which most test pass in the default subsysnqn anyway. There is little
point in cluttering all the test textual noise.

While at it, also use subsysnqn as variable name everywhere, instead of
subsys_name.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/033 |  2 +-
 tests/nvme/034 |  2 +-
 tests/nvme/035 |  2 +-
 tests/nvme/036 |  2 +-
 tests/nvme/037 |  3 ++-
 tests/nvme/rc  | 19 ++++++++++++++++---
 6 files changed, 22 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/tests/nvme/033 b/tests/nvme/033
index f7d9f04450a8..70a73b8c7b6a 100755
--- a/tests/nvme/033
+++ b/tests/nvme/033
@@ -53,7 +53,7 @@  test_device() {
 
 	_nvmet_passthru_target_setup
 
-	nsdev=$(_nvmet_passthru_target_connect "${def_subsysnqn}")
+	nsdev=$(_nvmet_passthru_target_connect)
 
 	compare_dev_info "${nsdev}"
 
diff --git a/tests/nvme/034 b/tests/nvme/034
index e5518d497377..409324aafb39 100755
--- a/tests/nvme/034
+++ b/tests/nvme/034
@@ -23,7 +23,7 @@  test_device() {
 	local nsdev
 
 	_nvmet_passthru_target_setup
-	nsdev=$(_nvmet_passthru_target_connect "${def_subsysnqn}")
+	nsdev=$(_nvmet_passthru_target_connect)
 
 	_run_fio_verify_io --size="${nvme_img_size}" --filename="${nsdev}"
 
diff --git a/tests/nvme/035 b/tests/nvme/035
index 8a66c2c15218..ecf6b7285ee5 100755
--- a/tests/nvme/035
+++ b/tests/nvme/035
@@ -29,7 +29,7 @@  test_device() {
 	local nsdev
 
 	_nvmet_passthru_target_setup
-	nsdev=$(_nvmet_passthru_target_connect "${def_subsysnqn}")
+	nsdev=$(_nvmet_passthru_target_connect)
 
 	if ! _xfs_run_fio_verify_io "${nsdev}" "${nvme_img_size}"; then
 		echo "FAIL: fio verify failed"
diff --git a/tests/nvme/036 b/tests/nvme/036
index 20cd3af7081a..36ea792e3d40 100755
--- a/tests/nvme/036
+++ b/tests/nvme/036
@@ -21,7 +21,7 @@  test_device() {
 	local ctrldev
 
 	_nvmet_passthru_target_setup
-	nsdev=$(_nvmet_passthru_target_connect "${def_subsysnqn}")
+	nsdev=$(_nvmet_passthru_target_connect)
 
 	ctrldev=$(_find_nvme_dev "${def_subsysnqn}")
 
diff --git a/tests/nvme/037 b/tests/nvme/037
index 2fe37a7a7340..3e733d201d6a 100755
--- a/tests/nvme/037
+++ b/tests/nvme/037
@@ -23,7 +23,8 @@  test_device() {
 
 	for ((i = 0; i < iterations; i++)); do
 		_nvmet_passthru_target_setup --subsysnqn "${subsys}${i}"
-		nsdev=$(_nvmet_passthru_target_connect "${subsys}${i}")
+		nsdev=$(_nvmet_passthru_target_connect \
+				--subsysnqn "${subsys}${i}")
 
 		_nvme_disconnect_subsys \
 			--subsysnqn "${subsys}${i}" >>"${FULL}" 2>&1
diff --git a/tests/nvme/rc b/tests/nvme/rc
index fca7408062ee..fb7a5fa864e8 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -922,10 +922,23 @@  _nvmet_passthru_target_setup() {
 }
 
 _nvmet_passthru_target_connect() {
-	local subsys_name=$1
+	local subsysnqn="$def_subsysnqn"
+
+	while [[ $# -gt 0 ]]; do
+		case $1 in
+			--subsysnqn)
+				subsysnqn="$2"
+				shift 2
+				;;
+			*)
+				echo "WARNING: unknown argument: $1"
+				shift
+				;;
+		esac
+	done
 
-	_nvme_connect_subsys --subsysnqn "${subsys_name}" --no-wait || return
-	nsdev=$(_find_nvme_passthru_loop_dev "${subsys_name}")
+	_nvme_connect_subsys --subsysnqn "${subsysnqn}" --no-wait || return
+	nsdev=$(_find_nvme_passthru_loop_dev "${subsysnqn}")
 
 	# The following tests can race with the creation
 	# of the device so ensure the block device exists