Skip to content

Commit f16c82a

Browse files
dwsusekawasaki
authored andcommitted
nvme/{003,004,005,013,046,049}: Group all variables declarations
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 <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent ec61ff7 commit f16c82a

6 files changed

Lines changed: 9 additions & 5 deletions

File tree

tests/nvme/003

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ test() {
2222

2323
_setup_nvmet
2424

25+
local loop_dev
2526
local port
27+
2628
port="$(_create_nvmet_port "${nvme_trtype}")"
2729

28-
local loop_dev
2930
loop_dev="$(losetup -f)"
3031

3132
_create_nvmet_subsystem "blktests-subsystem-1" "${loop_dev}"

tests/nvme/004

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ test() {
2323
_setup_nvmet
2424

2525
local port
26+
local loop_dev
27+
2628
port="$(_create_nvmet_port "${nvme_trtype}")"
2729

2830
truncate -s "${nvme_img_size}" "$TMPDIR/img"
2931

30-
local loop_dev
3132
loop_dev="$(losetup -f --show "$TMPDIR/img")"
3233

3334
_create_nvmet_subsystem "blktests-subsystem-1" "${loop_dev}" \

tests/nvme/005

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ test() {
2222
_setup_nvmet
2323

2424
local port
25+
local loop_dev
26+
local nvmedev
27+
2528
port="$(_create_nvmet_port "${nvme_trtype}")"
2629

2730
truncate -s "${nvme_img_size}" "$TMPDIR/img"
2831

29-
local loop_dev
3032
loop_dev="$(losetup -f --show "$TMPDIR/img")"
3133

3234
_create_nvmet_subsystem "blktests-subsystem-1" "${loop_dev}" \
@@ -35,7 +37,6 @@ test() {
3537

3638
_nvme_connect_subsys "${nvme_trtype}" blktests-subsystem-1
3739

38-
local nvmedev
3940
nvmedev=$(_find_nvme_dev "blktests-subsystem-1")
4041

4142
udevadm settle

tests/nvme/013

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ test() {
2626
local port
2727
local nvmedev
2828
local file_path="${TMPDIR}/img"
29-
3029
local subsys_name="blktests-subsystem-1"
3130

3231
truncate -s "${nvme_img_size}" "${file_path}"

tests/nvme/046

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ requires() {
1616

1717
test_device() {
1818
echo "Running ${TEST_NAME}"
19+
1920
local ngdev=${TEST_DEV/nvme/ng}
2021
local perm nsid
2122

tests/nvme/049

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ requires() {
1717

1818
test_device() {
1919
echo "Running ${TEST_NAME}"
20+
2021
local ngdev=${TEST_DEV/nvme/ng}
2122
local common_args=(
2223
--size=1M

0 commit comments

Comments
 (0)