diff mbox series

[blktests,v1,1/2] nvme/rc: add reconnect-delay argument only for fabrics transports

Message ID 20240304161303.19681-2-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series extend nvme/045 to reconnect with invalid key | expand

Commit Message

Daniel Wagner March 4, 2024, 4:13 p.m. UTC
The loop transport is also considered a fabric transport. But not
connect options are supported, in particular the reconnect-delay option.

nvme-cli can't figure this out as the kernel reports the option support
for all transports (union). Thus, we have to filter out this option for
this loop transport in blktests.

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

Patch

diff --git a/tests/nvme/rc b/tests/nvme/rc
index 2d6ebeab2f6f..5facbe8f2d2f 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -122,13 +122,25 @@  _require_nvme_test_img_size() {
 	return 0
 }
 
-_require_nvme_trtype() {
+_is_nvme_trtype() {
 	local trtype
+
 	for trtype in "$@"; do
 		if [[ "${nvme_trtype}" == "$trtype" ]]; then
 			return 0
 		fi
 	done
+
+	return 1
+}
+
+_require_nvme_trtype() {
+	local trtype
+
+	if _is_nvme_trtype "$@"; then
+		return 0
+	fi
+
 	SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
 	return 1
 }
@@ -513,7 +525,8 @@  _nvme_connect_subsys() {
 	if [[ -n "${keep_alive_tmo}" ]]; then
 		ARGS+=(--keep-alive-tmo="${keep_alive_tmo}")
 	fi
-	if [[ -n "${reconnect_delay}" ]]; then
+	if ! _is_nvme_trtype loop &&
+	   [[ -n "${reconnect_delay}" ]]; then
 		ARGS+=(--reconnect-delay="${reconnect_delay}")
 	fi
 	if [[ -n "${ctrl_loss_tmo}" ]]; then