From: Nilay Shroff <nilay@linux.ibm.com>
To: shinichiro.kawasaki@wdc.com, chaitanyak@nvidia.com
Cc: kbusch@kernel.org, sagi@grimberg.me, hch@lst.de,
linux-nvme@lists.infradead.org, venkat88@linux.vnet.ibm.com,
sachinp@linux.vnet.ibm.com, linux-block@vger.kernel.org,
gjoyce@linux.ibm.com, Nilay Shroff <nilay@linux.ibm.com>
Subject: [PATCHv2 blktests] nvme: add test for creating/deleting file-ns
Date: Wed, 19 Jun 2024 13:11:40 +0530 [thread overview]
Message-ID: <20240619074208.2900127-1-nilay@linux.ibm.com> (raw)
This is regression test for commit be647e2c76b2 (nvme: use srcu for
iterating namespace list)[1]. It is fixed in commit ff0ffe5b7c3c(nvme:
fix namespace removal list)[2].
This test uses a regular file backed loop device for creating and then
deleting an NVMe namespace in a loop.
[1] https://lore.kernel.org/all/2312e6c3-a069-4388-a863-df7e261b9d70@linux.vnet.ibm.com/
[2] https://lore.kernel.org/all/20240613164246.75205-1-kbusch@meta.com/
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
---
Changes from v1:
- Add nvme prefix in the subject line instead of loop (Chaitanya)
- Enrich the commit log with details including link to regression
discussion and fix commit (Chaitanya)
- Few other formatting cleanup (Chaitanya)
- Add fix commit information in the test header (Shinichiro)
- Instead of using default 1000 iteration for test,
set the test iteration count to 20 (Shinichiro)
- Update test case no. to nvme/052 (Shinichiro)
---
tests/nvme/052 | 69 ++++++++++++++++++++++++++++++++++++++++++++++
tests/nvme/052.out | 2 ++
2 files changed, 71 insertions(+)
create mode 100755 tests/nvme/052
create mode 100644 tests/nvme/052.out
diff --git a/tests/nvme/052 b/tests/nvme/052
new file mode 100755
index 0000000..9daed8f
--- /dev/null
+++ b/tests/nvme/052
@@ -0,0 +1,69 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Nilay Shroff
+#
+# Regression test for commit be647e2c76b2(nvme: use srcu for iterating
+# namespace list). This regression is resolved with commit ff0ffe5b7c3c
+# (nvme: fix namespace removal list)
+
+. tests/nvme/rc
+
+DESCRIPTION="Test file-ns creation/deletion under one subsystem"
+
+requires() {
+ _nvme_requires
+ _have_loop
+ _require_nvme_trtype_is_loop
+}
+
+set_conditions() {
+ _set_nvme_trtype "$@"
+}
+
+test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
+ local subsys="blktests-subsystem-1"
+ local iterations=20
+ local loop_dev
+ local port
+
+ truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path)"
+
+ loop_dev="$(losetup -f --show "$(_nvme_def_file_path)")"
+
+ port="$(_create_nvmet_port "${nvme_trtype}")"
+
+ _nvmet_target_setup --subsysnqn "${subsys}" --blkdev "${loop_dev}"
+
+ _nvme_connect_subsys --subsysnqn "${subsys}"
+
+ # start iteration from ns-id 2 because ns-id 1 is created
+ # by default when nvme target is setup. Also ns-id 1 is
+ # deleted when nvme target is cleaned up.
+ for ((i = 2; i <= iterations; i++)); do {
+ truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path).$i"
+ _create_nvmet_ns "${subsys}" "${i}" "$(_nvme_def_file_path).$i"
+
+ # allow async request to be processed
+ sleep 1
+
+ _remove_nvmet_ns "${subsys}" "${i}"
+ rm "$(_nvme_def_file_path).$i"
+ }
+ done
+
+ _nvme_disconnect_subsys --subsysnqn "${subsys}" >> "${FULL}" 2>&1
+
+ _nvmet_target_cleanup --subsysnqn "${subsys}" --blkdev "${loop_dev}"
+
+ _remove_nvmet_port "${port}"
+
+ losetup -d "$loop_dev"
+
+ rm "$(_nvme_def_file_path)"
+
+ echo "Test complete"
+}
diff --git a/tests/nvme/052.out b/tests/nvme/052.out
new file mode 100644
index 0000000..f2d186d
--- /dev/null
+++ b/tests/nvme/052.out
@@ -0,0 +1,2 @@
+Running nvme/052
+Test complete
--
2.45.1
reply other threads:[~2024-06-19 7:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240619074208.2900127-1-nilay@linux.ibm.com \
--to=nilay@linux.ibm.com \
--cc=chaitanyak@nvidia.com \
--cc=gjoyce@linux.ibm.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sachinp@linux.vnet.ibm.com \
--cc=sagi@grimberg.me \
--cc=shinichiro.kawasaki@wdc.com \
--cc=venkat88@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox