From: Daniel Wagner <wagi@kernel.org>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: Chaitanya Kulkarni <kch@nvidia.com>,
linux-block@vger.kernel.org, Daniel Wagner <wagi@kernel.org>
Subject: [PATCH blktests v2 4/4] nvme/061: add test teardown and setup fabrics target during I/O
Date: Tue, 08 Apr 2025 18:26:00 +0200 [thread overview]
Message-ID: <20250408-test-target-v2-4-e9e2512586f8@kernel.org> (raw)
In-Reply-To: <20250408-test-target-v2-0-e9e2512586f8@kernel.org>
Add a new test case which forcefully removes the target and setup it
again.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
tests/nvme/061 | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/nvme/061.out | 21 +++++++++++++++++
2 files changed, 87 insertions(+)
diff --git a/tests/nvme/061 b/tests/nvme/061
new file mode 100755
index 0000000000000000000000000000000000000000..3b59d7137932258d06c3d64166db493df176ba4e
--- /dev/null
+++ b/tests/nvme/061
@@ -0,0 +1,66 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2025 Daniel Wagner, SUSE Labs
+#
+# Test if the host keeps running IO when the target is forcefully removed and
+# added back.
+
+. tests/nvme/rc
+
+DESCRIPTION="test fabric target teardown and setup during I/O"
+TIMED=1
+
+requires() {
+ _nvme_requires
+ _have_loop
+ _have_fio
+ _require_nvme_trtype_is_fabrics
+}
+
+set_conditions() {
+ _set_nvme_trtype "$@"
+}
+
+test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
+ local ns
+
+ _nvmet_target_setup
+
+ _nvme_connect_subsys --keep-alive-tmo 1 --reconnect-delay 1
+
+ ns=$(_find_nvme_ns "${def_subsys_uuid}")
+
+ _run_fio_rand_io --filename="/dev/${ns}" \
+ --group_reporting \
+ --time_based --runtime=1d &> /dev/null &
+ fio_pid=$!
+ sleep 1
+
+ nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
+ state_file="/sys/class/nvme-fabrics/ctl/${nvmedev}/state"
+ for ((i = 0; i <= 5; i++)); do
+ echo "iteration $i"
+
+ _nvmet_target_cleanup
+
+ _nvmf_wait_for_state "${def_subsysnqn}" "connecting" || return 1
+ echo "state: $(cat ${state_file})"
+
+ _nvmet_target_setup
+
+ _nvmf_wait_for_state "${def_subsysnqn}" "live" || return 1
+ echo "state: $(cat ${state_file})"
+ done
+
+ { kill "${fio_pid}"; wait; } &> /dev/null
+
+ _nvme_disconnect_subsys
+
+ _nvmet_target_cleanup
+
+ echo "Test complete"
+}
diff --git a/tests/nvme/061.out b/tests/nvme/061.out
new file mode 100644
index 0000000000000000000000000000000000000000..75516abdac005854c2be165005c076ef8891c518
--- /dev/null
+++ b/tests/nvme/061.out
@@ -0,0 +1,21 @@
+Running nvme/061
+iteration 0
+state: connecting
+state: live
+iteration 1
+state: connecting
+state: live
+iteration 2
+state: connecting
+state: live
+iteration 3
+state: connecting
+state: live
+iteration 4
+state: connecting
+state: live
+iteration 5
+state: connecting
+state: live
+disconnected 1 controller(s)
+Test complete
--
2.49.0
next prev parent reply other threads:[~2025-04-08 16:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 16:25 [PATCH blktests v2 0/4] blktests: add target test cases Daniel Wagner
2025-04-08 16:25 ` [PATCH blktests v2 1/4] common/nvme: add debug nvmet path variable Daniel Wagner
2025-04-08 16:25 ` [PATCH blktests v2 2/4] common/nvme: move nvmf_wait_for_state to common code Daniel Wagner
2025-04-08 16:25 ` [PATCH blktests v2 3/4] nvme/060: add test nvme fabrics target resetting during I/O Daniel Wagner
2025-04-09 17:59 ` Daniel Wagner
2025-04-14 12:10 ` Shinichiro Kawasaki
2025-04-08 16:26 ` Daniel Wagner [this message]
2025-04-14 12:18 ` [PATCH blktests v2 4/4] nvme/061: add test teardown and setup fabrics target " Shinichiro Kawasaki
2025-04-14 13:27 ` Daniel Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250408-test-target-v2-4-e9e2512586f8@kernel.org \
--to=wagi@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.