@@ -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}"
@@ -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}" \
@@ -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
@@ -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}"
@@ -16,6 +16,7 @@ requires() {
test_device() {
echo "Running ${TEST_NAME}"
+
local ngdev=${TEST_DEV/nvme/ng}
local perm nsid
@@ -17,6 +17,7 @@ requires() {
test_device() {
echo "Running ${TEST_NAME}"
+
local ngdev=${TEST_DEV/nvme/ng}
local common_args=(
--size=1M
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(-)