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>,
Max Gurtovoy <mgurtovoy@nvidia.com>,
Hannes Reinecke <hare@suse.de>, Sagi Grimberg <sagi@grimberg.me>,
James Smart <jsmart2021@gmail.com>,
Bart Van Assche <bvanassche@acm.org>,
Daniel Wagner <dwagner@suse.de>
Subject: [PATCH blktests v3 01/13] nvme/{003,004,005,013,046,049}: Group all variables declarations
Date: Fri, 11 Aug 2023 11:36:02 +0200 [thread overview]
Message-ID: <20230811093614.28005-2-dwagner@suse.de> (raw)
In-Reply-To: <20230811093614.28005-1-dwagner@suse.de>
Group all variable declarations together at the beginning of the
function. Many of the nvme tests do this but not all. Thus make these
tests use the same style. This allows to spot the odd balls in the
refactoring of the tests.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
tests/nvme/003 | 3 ++-
tests/nvme/004 | 3 ++-
tests/nvme/005 | 5 +++--
tests/nvme/013 | 1 -
tests/nvme/046 | 1 +
tests/nvme/049 | 1 +
6 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/tests/nvme/003 b/tests/nvme/003
index 6604012d2068..aa26abf8d8b3 100755
--- a/tests/nvme/003
+++ b/tests/nvme/003
@@ -22,10 +22,11 @@ test() {
_setup_nvmet
+ local loop_dev
local port
+
port="$(_create_nvmet_port "${nvme_trtype}")"
- local loop_dev
loop_dev="$(losetup -f)"
_create_nvmet_subsystem "blktests-subsystem-1" "${loop_dev}"
diff --git a/tests/nvme/004 b/tests/nvme/004
index cab98ff44326..1e5c2b8b3e87 100755
--- a/tests/nvme/004
+++ b/tests/nvme/004
@@ -23,11 +23,12 @@ test() {
_setup_nvmet
local port
+ local loop_dev
+
port="$(_create_nvmet_port "${nvme_trtype}")"
truncate -s "${nvme_img_size}" "$TMPDIR/img"
- local loop_dev
loop_dev="$(losetup -f --show "$TMPDIR/img")"
_create_nvmet_subsystem "blktests-subsystem-1" "${loop_dev}" \
diff --git a/tests/nvme/005 b/tests/nvme/005
index 8e15a13f3794..836854086822 100755
--- a/tests/nvme/005
+++ b/tests/nvme/005
@@ -22,11 +22,13 @@ test() {
_setup_nvmet
local port
+ local loop_dev
+ local nvmedev
+
port="$(_create_nvmet_port "${nvme_trtype}")"
truncate -s "${nvme_img_size}" "$TMPDIR/img"
- local loop_dev
loop_dev="$(losetup -f --show "$TMPDIR/img")"
_create_nvmet_subsystem "blktests-subsystem-1" "${loop_dev}" \
@@ -35,7 +37,6 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" blktests-subsystem-1
- local nvmedev
nvmedev=$(_find_nvme_dev "blktests-subsystem-1")
udevadm settle
diff --git a/tests/nvme/013 b/tests/nvme/013
index 14e646a19c47..2be8681616d1 100755
--- a/tests/nvme/013
+++ b/tests/nvme/013
@@ -26,7 +26,6 @@ test() {
local port
local nvmedev
local file_path="${TMPDIR}/img"
-
local subsys_name="blktests-subsystem-1"
truncate -s "${nvme_img_size}" "${file_path}"
diff --git a/tests/nvme/046 b/tests/nvme/046
index b37b9e98a559..942f25206c17 100755
--- a/tests/nvme/046
+++ b/tests/nvme/046
@@ -16,6 +16,7 @@ requires() {
test_device() {
echo "Running ${TEST_NAME}"
+
local ngdev=${TEST_DEV/nvme/ng}
local perm nsid
diff --git a/tests/nvme/049 b/tests/nvme/049
index f72862c6426d..599ab58d7a29 100755
--- a/tests/nvme/049
+++ b/tests/nvme/049
@@ -17,6 +17,7 @@ requires() {
test_device() {
echo "Running ${TEST_NAME}"
+
local ngdev=${TEST_DEV/nvme/ng}
local common_args=(
--size=1M
--
2.41.0
next prev parent reply other threads:[~2023-08-11 9:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 9:36 [PATCH blktests v3 00/13] Switch to allowed_host Daniel Wagner
2023-08-11 9:36 ` Daniel Wagner [this message]
2023-08-11 9:36 ` [PATCH blktests v3 02/13] nvme: Reorganize test preamble code section Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 03/13] nvme/043: Use hostnqn to generate DHCAP key Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 04/13] nvme/rc: Add common subsystem nqn define Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 05/13] nvme: Use def_subsysnqn variable instead local variable Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 06/13] nvme/{041,042,043,044,045,048}: Remove local variable hostnqn and hostid Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 07/13] nvme/rc: Add common file_path name define Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 08/13] nvme: Use def_file_path variable instead local variable Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 09/13] nvme/rc: Add common def_subsys_uuid define Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 10/13] nvme: Use def_subsys_uuid variable Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 11/13] nvme/rc: Add helper for adding/removing to allow list Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 12/13] nvme: Add explicitly host to allow_host list Daniel Wagner
2023-08-11 9:36 ` [PATCH blktests v3 13/13] nvme: Introduce nvmet_target_{setup/cleanup} common code Daniel Wagner
2023-08-13 14:55 ` Sagi Grimberg
2023-08-16 9:28 ` Daniel Wagner
2023-08-17 8:33 ` Sagi Grimberg
2023-08-11 10:29 ` [PATCH blktests v3 00/13] Switch to allowed_host Hannes Reinecke
2023-08-13 14:59 ` Sagi Grimberg
2023-08-16 9:31 ` Daniel Wagner
2023-08-16 12:18 ` Shinichiro Kawasaki
2023-08-17 2:58 ` Shinichiro Kawasaki
2023-08-17 8:25 ` 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=20230811093614.28005-2-dwagner@suse.de \
--to=dwagner@suse.de \
--cc=bvanassche@acm.org \
--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=mgurtovoy@nvidia.com \
--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