diff mbox series

[RFC,blktests,v1,08/10] nvme/031: do not open code target setup/cleanup

Message ID 20240318093856.22307-10-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series Add support to run against real target | expand

Commit Message

Daniel Wagner March 18, 2024, 9:38 a.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 | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/tests/nvme/031 b/tests/nvme/031
index ed5f19668674..892a52170ce9 100755
--- a/tests/nvme/031
+++ b/tests/nvme/031
@@ -40,14 +40,12 @@  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"
 	done
 
 	_remove_nvmet_port "${port}"