@@ -18,12 +18,12 @@ requires() {
test() {
echo "Running ${TEST_NAME}"
+ _setup_nvmet
+
local port
local loop_dev
local subsys_name="blktests-subsystem-1"
- _setup_nvmet
-
truncate -s "${nvme_img_size}" "$TMPDIR/img"
loop_dev="$(losetup -f --show "$TMPDIR/img")"
@@ -17,12 +17,12 @@ requires() {
test() {
echo "Running ${TEST_NAME}"
+ _setup_nvmet
+
local port
local file_path
local subsys_name="blktests-subsystem-1"
- _setup_nvmet
-
file_path="${TMPDIR}/img"
truncate -s "${nvme_img_size}" "${file_path}"
@@ -16,13 +16,13 @@ requires() {
test() {
echo "Running ${TEST_NAME}"
+ _setup_nvmet
+
local port
local iterations="${nvme_num_iter}"
local loop_dev
local subsys_nqn="blktests-subsystem-1"
- _setup_nvmet
-
loop_dev="$(losetup -f)"
local genctr=1
@@ -16,13 +16,13 @@ requires() {
test() {
echo "Running ${TEST_NAME}"
+ _setup_nvmet
+
local port
local file_path
local iterations="${nvme_num_iter}"
local subsys_name="blktests-subsystem-1"
- _setup_nvmet
-
file_path="${TMPDIR}/img"
truncate -s "${nvme_img_size}" "${file_path}"
@@ -16,14 +16,14 @@ requires() {
}
test() {
- local port
- local genctr
- local subsys="blktests-subsystem-"
-
echo "Running ${TEST_NAME}"
_setup_nvmet
+ local port
+ local genctr
+ local subsys="blktests-subsystem-"
+
port="$(_create_nvmet_port "${nvme_trtype}")"
_create_nvmet_subsystem "${subsys}1" "$(losetup -f)"
@@ -24,15 +24,15 @@ requires() {
}
test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local subsys="blktests-subsystem-"
local iterations=10
local loop_dev
local port
- echo "Running ${TEST_NAME}"
-
- _setup_nvmet
-
truncate -s "${nvme_img_size}" "$TMPDIR/img"
loop_dev="$(losetup -f --show "$TMPDIR/img")"
@@ -45,13 +45,14 @@ compare_dev_info() {
}
test_device() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local subsys="blktests-subsystem-1"
local nsdev
local port
- echo "Running ${TEST_NAME}"
-
- _setup_nvmet
port=$(_nvmet_passthru_target_setup "${subsys}")
nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}")
@@ -15,14 +15,15 @@ requires() {
}
test_device() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local subsys="blktests-subsystem-1"
local ctrldev
local nsdev
local port
- echo "Running ${TEST_NAME}"
-
- _setup_nvmet
port=$(_nvmet_passthru_target_setup "${subsys}")
nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}")
@@ -21,14 +21,15 @@ device_requires() {
}
test_device() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local subsys="blktests-subsystem-1"
local ctrldev
local nsdev
local port
- echo "Running ${TEST_NAME}"
-
- _setup_nvmet
port=$(_nvmet_passthru_target_setup "${subsys}")
nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}")
@@ -14,13 +14,14 @@ requires() {
}
test_device() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local subsys="blktests-subsystem-1"
local ctrldev
local port
- echo "Running ${TEST_NAME}"
-
- _setup_nvmet
port=$(_nvmet_passthru_target_setup "${subsys}")
nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}")
@@ -13,15 +13,15 @@ requires() {
}
test_device() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local subsys="blktests-subsystem-"
local iterations=10
local ctrldev
local port
- echo "Running ${TEST_NAME}"
-
- _setup_nvmet
-
for ((i = 0; i < iterations; i++)); do
port=$(_nvmet_passthru_target_setup "${subsys}${i}")
nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" \
@@ -19,13 +19,13 @@ requires() {
}
test() {
- local subsys_path="${NVMET_CFS}/subsystems/blktests-subsystem-1"
- local port
-
echo "Running ${TEST_NAME}"
_setup_nvmet
+ local subsys_path="${NVMET_CFS}/subsystems/blktests-subsystem-1"
+ local port
+
mkdir -p "${subsys_path}"
rmdir "${subsys_path}"
@@ -131,12 +131,12 @@ inject_invalid_admin_cmd()
}
test_device() {
+ echo "Running ${TEST_NAME}"
+
local nvme_verbose_errors
local ns_dev
local ctrl_dev
- echo "Running ${TEST_NAME}"
-
if _check_kernel_option NVME_VERBOSE_ERRORS; then
nvme_verbose_errors=true
else
@@ -17,6 +17,10 @@ requires() {
}
test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local subsys="blktests-subsystem-1"
local file_path="${TMPDIR}/img"
local port
@@ -24,9 +28,6 @@ test() {
local nvmedev
local fio_pid
- echo "Running ${TEST_NAME}"
-
- _setup_nvmet
truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -20,6 +20,10 @@ requires() {
test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local port
local subsys_name="blktests-subsystem-1"
local hostid
@@ -28,8 +32,6 @@ test() {
local hostkey
local ctrldev
- echo "Running ${TEST_NAME}"
-
hostid="${def_hostid}"
hostnqn="${def_hostnqn}"
hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)"
@@ -38,8 +40,6 @@ test() {
return 1
fi
- _setup_nvmet
-
truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
@@ -20,6 +20,10 @@ requires() {
test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local port
local subsys_name="blktests-subsystem-1"
local hostid
@@ -30,13 +34,9 @@ test() {
local hostkey
local ctrldev
- echo "Running ${TEST_NAME}"
-
hostid="${def_hostid}"
hostnqn="${def_hostnqn}"
- _setup_nvmet
-
truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}"
@@ -21,6 +21,10 @@ requires() {
test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local port
local subsys_name="blktests-subsystem-1"
local hostid
@@ -31,8 +35,6 @@ test() {
local hostkey
local ctrldev
- echo "Running ${TEST_NAME}"
-
hostid="${def_hostid}"
hostnqn="${def_hostnqn}"
hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)"
@@ -41,8 +43,6 @@ test() {
return 1
fi
- _setup_nvmet
-
truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}"
@@ -21,6 +21,10 @@ requires() {
test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local port
local subsys_name="blktests-subsystem-1"
local hostid
@@ -30,8 +34,6 @@ test() {
local ctrlkey
local ctrldev
- echo "Running ${TEST_NAME}"
-
hostid="${def_hostid}"
hostnqn="${def_hostnqn}"
@@ -47,8 +49,6 @@ test() {
return 1
fi
- _setup_nvmet
-
truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}"
@@ -22,6 +22,10 @@ requires() {
test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local port
local subsys_name="blktests-subsystem-1"
local hostid
@@ -34,8 +38,6 @@ test() {
local ctrldev
local rand_io_size
- echo "Running ${TEST_NAME}"
-
hostid="${def_hostid}"
hostnqn="${def_hostnqn}"
@@ -51,8 +53,6 @@ test() {
return 1
fi
- _setup_nvmet
-
truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}"
@@ -81,6 +81,10 @@ set_qid_max() {
}
test() {
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
local subsys_name="blktests-subsystem-1"
local cfs_path="${NVMET_CFS}/subsystems/${subsys_name}"
local file_path="${TMPDIR}/img"
@@ -89,10 +93,6 @@ test() {
local hostid
local port
- echo "Running ${TEST_NAME}"
-
- _setup_nvmet
-
hostid="${def_hostid}"
hostnqn="${def_hostnqn}"
This unifies all the tests preamble code section. Reorganize all tests to start with printing the test name, then the setting nvmet and finally followed by the variable declarations. Signed-off-by: Daniel Wagner <dwagner@suse.de> --- tests/nvme/006 | 4 ++-- tests/nvme/007 | 4 ++-- tests/nvme/016 | 4 ++-- tests/nvme/017 | 4 ++-- tests/nvme/030 | 8 ++++---- tests/nvme/031 | 8 ++++---- tests/nvme/033 | 7 ++++--- tests/nvme/034 | 7 ++++--- tests/nvme/035 | 7 ++++--- tests/nvme/036 | 7 ++++--- tests/nvme/037 | 8 ++++---- tests/nvme/038 | 6 +++--- tests/nvme/039 | 4 ++-- tests/nvme/040 | 7 ++++--- tests/nvme/041 | 8 ++++---- tests/nvme/042 | 8 ++++---- tests/nvme/043 | 8 ++++---- tests/nvme/044 | 8 ++++---- tests/nvme/045 | 8 ++++---- tests/nvme/048 | 8 ++++---- 20 files changed, 69 insertions(+), 64 deletions(-)