diff mbox series

[blktests,v3,12/20] nvme/031: do not open code target setup/cleanup

Message ID 20240326131402.5092-13-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
No need to open code the target setup and cleanup step. Just use the
common helper to setup and cleanup the target.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/031 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/tests/nvme/031 b/tests/nvme/031
index ed5f19668674..204ba7d2892f 100755
--- a/tests/nvme/031
+++ b/tests/nvme/031
@@ -40,14 +40,14 @@  test() {
 	port="$(_create_nvmet_port "${nvme_trtype}")"
 
 	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}"
+		_nvmet_target_setup --subsysnqn "${subsys}$i" \
+			--blkdev "${loop_dev}"
+
 		_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}"
+
+		_nvmet_target_cleanup --subsysnqn "${subsys}$i" \
+			--blkdev "${loop_dev}"
 	done
 
 	_remove_nvmet_port "${port}"