From: Daniel Wagner <dwagner@suse.de>
To: linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
Chaitanya Kulkarni <kch@nvidia.com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Sagi Grimberg <sagi@grimberg.me>, Hannes Reinecke <hare@suse.de>,
James Smart <jsmart2021@gmail.com>,
Daniel Wagner <dwagner@suse.de>
Subject: [PATCH blktests v3 3/3] nvme/{041,042,043,044,045,048}: Use default hostnqn and hostid
Date: Mon, 3 Jul 2023 11:16:47 +0200 [thread overview]
Message-ID: <20230703091647.800-4-dwagner@suse.de> (raw)
In-Reply-To: <20230703091647.800-1-dwagner@suse.de>
The host might have enabled the udev/systemd auto connect feature.
This disturbs the blktests for the fc transport. nvme-cli is able
to distinguish between the different invocations via the --context
option.
Instead creating random generated IDs or reuse the hostnqn, it's safer
to always use the same hostnqn to reduce the risk that the matching
logic doesn't work.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
tests/nvme/041 | 8 ++------
tests/nvme/042 | 8 ++------
tests/nvme/043 | 8 ++------
tests/nvme/044 | 8 ++------
tests/nvme/045 | 8 ++------
tests/nvme/048 | 8 ++------
tests/nvme/rc | 19 ++-----------------
7 files changed, 14 insertions(+), 53 deletions(-)
diff --git a/tests/nvme/041 b/tests/nvme/041
index 308655dd6090..5b04b99b128e 100755
--- a/tests/nvme/041
+++ b/tests/nvme/041
@@ -30,12 +30,8 @@ test() {
echo "Running ${TEST_NAME}"
- hostid="$(uuidgen)"
- if [ -z "$hostid" ] ; then
- echo "uuidgen failed"
- return 1
- fi
- hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
+ hostid="${def_hostid}"
+ hostnqn="${def_hostnqn}"
hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)"
if [ -z "$hostkey" ] ; then
echo "nvme gen-dhchap-key failed"
diff --git a/tests/nvme/042 b/tests/nvme/042
index fed2efead013..8df5ed37aacc 100755
--- a/tests/nvme/042
+++ b/tests/nvme/042
@@ -32,12 +32,8 @@ test() {
echo "Running ${TEST_NAME}"
- hostid="$(uuidgen)"
- if [ -z "$hostid" ] ; then
- echo "uuidgen failed"
- return 1
- fi
- hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
+ hostid="${def_hostid}"
+ hostnqn="${def_hostnqn}"
_setup_nvmet
diff --git a/tests/nvme/043 b/tests/nvme/043
index a030884aa4ed..b591e39d0706 100755
--- a/tests/nvme/043
+++ b/tests/nvme/043
@@ -33,12 +33,8 @@ test() {
echo "Running ${TEST_NAME}"
- hostid="$(uuidgen)"
- if [ -z "$hostid" ] ; then
- echo "uuidgen failed"
- return 1
- fi
- hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
+ hostid="${def_hostid}"
+ hostnqn="${def_hostnqn}"
_setup_nvmet
diff --git a/tests/nvme/044 b/tests/nvme/044
index 9928bcc55397..fca0897af27b 100755
--- a/tests/nvme/044
+++ b/tests/nvme/044
@@ -32,12 +32,8 @@ test() {
echo "Running ${TEST_NAME}"
- hostid="$(uuidgen)"
- if [ -z "$hostid" ] ; then
- echo "uuidgen failed"
- return 1
- fi
- hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
+ hostid="${def_hostid}"
+ hostnqn="${def_hostnqn}"
hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)"
if [ -z "$hostkey" ] ; then
diff --git a/tests/nvme/045 b/tests/nvme/045
index 26a55335a92c..eca629a18691 100755
--- a/tests/nvme/045
+++ b/tests/nvme/045
@@ -36,12 +36,8 @@ test() {
echo "Running ${TEST_NAME}"
- hostid="$(uuidgen)"
- if [ -z "$hostid" ] ; then
- echo "uuidgen failed"
- return 1
- fi
- hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
+ hostid="${def_hostid}"
+ hostnqn="${def_hostnqn}"
hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)"
if [ -z "$hostkey" ] ; then
diff --git a/tests/nvme/048 b/tests/nvme/048
index bbfb9873b5e8..a6ebb8927865 100755
--- a/tests/nvme/048
+++ b/tests/nvme/048
@@ -93,12 +93,8 @@ test() {
_setup_nvmet
- hostid="$(uuidgen)"
- if [ -z "$hostid" ] ; then
- echo "uuidgen failed"
- return 1
- fi
- hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
+ hostid="${def_hostid}"
+ hostnqn="${def_hostnqn}"
truncate -s "${nvme_img_size}" "${file_path}"
diff --git a/tests/nvme/rc b/tests/nvme/rc
index 9b5442b2c07b..4f3a994d75ce 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -14,23 +14,8 @@ def_remote_wwnn="0x10001100aa000001"
def_remote_wwpn="0x20001100aa000001"
def_local_wwnn="0x10001100aa000002"
def_local_wwpn="0x20001100aa000002"
-
-if [ -f "/etc/nvme/hostid" ]; then
- def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)"
-else
- def_hostid="$(uuidgen)"
-fi
-if [ -z "$def_hostid" ] ; then
- def_hostid="0f01fb42-9f7f-4856-b0b3-51e60b8de349"
-fi
-
-if [ -f "/etc/nvme/hostnqn" ]; then
- def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)"
-fi
-if [ -z "$def_hostnqn" ] ; then
- def_hostnqn="nqn.2014-08.org.nvmexpress:uuid:${def_hostid}"
-fi
-
+def_hostid="0f01fb42-9f7f-4856-b0b3-51e60b8de349"
+def_hostnqn="nqn.2014-08.org.nvmexpress:uuid:${def_hostid}"
nvme_trtype=${nvme_trtype:-"loop"}
nvme_img_size=${nvme_img_size:-"1G"}
nvme_num_iter=${nvme_num_iter:-"1000"}
--
2.41.0
next prev parent reply other threads:[~2023-07-03 9:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 9:16 [PATCH blktests v3 0/3] More fixes for FC enabling Daniel Wagner
2023-07-03 9:16 ` [PATCH blktests v3 1/3] nvme/048: Check for queue count check directly Daniel Wagner
2023-07-03 9:16 ` [PATCH blktests v3 2/3] nvme/rc: Avoid triggering host nvme-cli autoconnect Daniel Wagner
2023-07-03 9:16 ` Daniel Wagner [this message]
2023-07-04 7:08 ` [PATCH blktests v3 0/3] More fixes for FC enabling Shinichiro Kawasaki
2023-07-06 6:51 ` Chaitanya Kulkarni
2023-07-10 3:52 ` Shinichiro Kawasaki
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=20230703091647.800-4-dwagner@suse.de \
--to=dwagner@suse.de \
--cc=hare@suse.de \
--cc=jsmart2021@gmail.com \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox