[PATCH blktests 10/11] nvme/037: Add test which loops passthru connect and disconnect

Logan Gunthorpe logang at deltatee.com
Thu Aug 27 15:49:11 EDT 2020


Similar to test nvme/031 except for passthru controllers.

Note: it's normal to get I/O errors in this test as
when the controller disconnects it races with the partition
table read.

Signed-off-by: Logan Gunthorpe <logang at deltatee.com>
---
 tests/nvme/037     | 36 ++++++++++++++++++++++++++++++++++++
 tests/nvme/037.out |  2 ++
 2 files changed, 38 insertions(+)
 create mode 100755 tests/nvme/037
 create mode 100644 tests/nvme/037.out

diff --git a/tests/nvme/037 b/tests/nvme/037
new file mode 100755
index 000000000000..dce25b9f63cf
--- /dev/null
+++ b/tests/nvme/037
@@ -0,0 +1,36 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2019 Logan Gunthorpe
+# Copyright (C) 2019 Eideticom Communications Inc.
+
+. tests/nvme/rc
+
+DESCRIPTION="test deletion of NVMeOF passthru controllers immediately after setup"
+
+requires() {
+	_have_program nvme &&
+	_have_modules nvme-loop nvmet &&
+	_have_configfs &&
+	_have_kernel_option NVME_TARGET_PASSTHRU
+}
+
+test_device() {
+	local subsys="blktests-subsystem-"
+	local iterations=10
+	local ctrldev
+	local port
+
+	echo "Running ${TEST_NAME}"
+
+	_setup_nvmet
+
+	for ((i = 0; i < iterations; i++)); do
+		port=$(_nvmet_passthru_target_setup "${subsys}$i")
+		_nvmet_passthru_target_connect "${subsys}$i" > /dev/null
+
+		_nvmet_passthru_target_disconnect "${subsys}$i"
+		_nvmet_passthru_target_cleanup "$port" "${subsys}$i"
+	done
+
+	echo "Test complete"
+}
diff --git a/tests/nvme/037.out b/tests/nvme/037.out
new file mode 100644
index 000000000000..eaf903d0520e
--- /dev/null
+++ b/tests/nvme/037.out
@@ -0,0 +1,2 @@
+Running nvme/037
+Test complete
-- 
2.20.1




More information about the Linux-nvme mailing list