[PATCH blktests v2 4/4] nvme: Make the number iterations configurable

Daniel Wagner
2023-04-20T18:31:39Z

The test hard code the number of iterations certain test should run.
Make this variable via the newly introduced nvme_num_iter environment
variable.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
tests/nvme/002 | 2 +-
tests/nvme/016 | 2 +-
tests/nvme/017 | 2 +-
tests/nvme/031 | 2 +-
tests/nvme/037 | 2 +-
tests/nvme/rc | 1 +
6 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/nvme/002 b/tests/nvme/002
index 6b8484844b4d..c28035483514 100755
--- a/tests/nvme/002
+++ b/tests/nvme/002
@@ -20,7 +20,7 @@ test() {

_setup_nvmet

- local iterations=1000
+ local iterations="${nvme_num_iter}"
local port
port="$(_create_nvmet_port "${nvme_trtype}")"

diff --git a/tests/nvme/016 b/tests/nvme/016
index 4eba30223a08..c0c31a55b190 100755
--- a/tests/nvme/016
+++ b/tests/nvme/016
@@ -17,7 +17,7 @@ test() {
echo "Running ${TEST_NAME}"

local port
- local iterations=1000
+ local iterations="${nvme_num_iter}"
local loop_dev
local subsys_nqn="blktests-subsystem-1"

diff --git a/tests/nvme/017 b/tests/nvme/017
index 0248aee9bc41..e1674508f654 100755
--- a/tests/nvme/017
+++ b/tests/nvme/017
@@ -18,7 +18,7 @@ test() {

local port
local file_path
- local iterations=1000
+ local iterations="${nvme_num_iter}"
local subsys_name="blktests-subsystem-1"

_setup_nvmet
diff --git a/tests/nvme/031 b/tests/nvme/031
index e70898819a86..9b08ec1f6989 100755
--- a/tests/nvme/031
+++ b/tests/nvme/031
@@ -25,7 +25,7 @@ requires() {

test() {
local subsys="blktests-subsystem-"
- local iterations=10
+ local iterations="${nvme_num_iter}"
local loop_dev
local port

diff --git a/tests/nvme/037 b/tests/nvme/037
index fc6c21343652..de9765af194b 100755
--- a/tests/nvme/037
+++ b/tests/nvme/037
@@ -14,7 +14,7 @@ requires() {

test_device() {
local subsys="blktests-subsystem-"
- local iterations=10
+ local iterations="${nvme_num_iter}"
local ctrldev
local port

diff --git a/tests/nvme/rc b/tests/nvme/rc
index 8cd89af703bb..03b66100423b 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -18,6 +18,7 @@ def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)"
def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)"
nvme_trtype=${nvme_trtype:-"loop"}
nvme_img_size=${nvme_img_size:-"64M"}
+nvme_num_iter=${nvme_num_iter:-"100"}

_nvme_requires() {
_have_program nvme
--
2.40.0