Skip to content

Commit

Permalink
nvme/052: do not create namespace when setting up the target
Browse files Browse the repository at this point in the history
Simplify the testcase by not creating a namespace when setting up
the target and have to loop iterating over all namespaces.

[Shin'ichiro: use for loop instead of seq per style guideline]

Signed-off-by: Hannes Reinecke <hare@suse.de>
[Shin'ichiro: resolved conflicts]
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
  • Loading branch information
hreinecke authored and kawasaki committed Nov 19, 2024
1 parent fba5c33 commit 67e25d7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/nvme/052
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,14 @@ test() {

_setup_nvmet

local iterations=20
local i iterations=20
local uuid nsid filepath

_nvmet_target_setup
_nvmet_target_setup --blkdev none

_nvme_connect_subsys

# start iteration from def_nsid+1 because def_nsid is created
# by default when nvme target is setup. Also def_nsid is
# deleted when nvme target is cleaned up.
for ((i = 2; i <= iterations; i++)); do {
for ((i = 1; i <= iterations; i++)); do
nsid=$((def_nsid + i - 1))
filepath="$(_nvme_def_file_path).${nsid}"
truncate -s "${NVME_IMG_SIZE}" "$filepath"
Expand All @@ -84,7 +81,6 @@ test() {
fi

rm "$filepath"
}
done

_nvme_disconnect_subsys >> "${FULL}" 2>&1
Expand Down

0 comments on commit 67e25d7

Please sign in to comment.