diff mbox series

[REPOST,blktests,v2,9/9] nvme: Make the number iterations configurable

Message ID 20230421060505.10132-10-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series nvme testsuite runtime optimization | expand

Commit Message

Daniel Wagner April 21, 2023, 6:05 a.m. UTC
Some tests hard code high values of iterations. This makes them run
relatively long compared to the other tests. Introduce a new environment
variable nvme_num_iter to allow tune the runtime.

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

Comments

Hannes Reinecke April 21, 2023, 6:38 a.m. UTC | #1
On 4/21/23 08:05, Daniel Wagner wrote:
> Some tests hard code high values of iterations. This makes them run
> relatively long compared to the other tests. Introduce a new environment
> variable nvme_num_iter to allow tune the runtime.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>   tests/nvme/002 | 2 +-
>   tests/nvme/016 | 2 +-
>   tests/nvme/017 | 2 +-
>   tests/nvme/rc  | 1 +
>   4 files changed, 4 insertions(+), 3 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Shinichiro Kawasaki April 28, 2023, 4:12 a.m. UTC | #2
On Apr 21, 2023 / 08:05, Daniel Wagner wrote:
> Some tests hard code high values of iterations. This makes them run
> relatively long compared to the other tests. Introduce a new environment
> variable nvme_num_iter to allow tune the runtime.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>  tests/nvme/002 | 2 +-
>  tests/nvme/016 | 2 +-
>  tests/nvme/017 | 2 +-
>  tests/nvme/rc  | 1 +
>  4 files changed, 4 insertions(+), 3 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/rc b/tests/nvme/rc
> index 2aa34fb0c9b8..bb135502220a 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:-"350M"}
> +nvme_num_iter=${nvme_num_iter:-"100"}

The commit log of tests/nvme/002 says that "Test nvme discovery with many (1000)
subsystems so the discovery log page exceeds 4k.". Can we fulfill this test
purpose with the default value 100?

Also, nvme_num_iter will need description in Documentation/running-tests.md.

>  
>  _nvme_requires() {
>  	_have_program nvme
> -- 
> 2.40.0
>
Daniel Wagner May 2, 2023, 3:59 p.m. UTC | #3
On Fri, Apr 28, 2023 at 04:12:06AM +0000, Shinichiro Kawasaki wrote:
> >  nvme_img_size=${nvme_img_size:-"350M"}
> > +nvme_num_iter=${nvme_num_iter:-"100"}
> 
> The commit log of tests/nvme/002 says that "Test nvme discovery with many (1000)
> subsystems so the discovery log page exceeds 4k.". Can we fulfill this test
> purpose with the default value 100?

I am going to drop the nvme/002 change in this case and set the default of
nvme_num_iter to 1000.

> Also, nvme_num_iter will need description in Documentation/running-tests.md.

Sure.
diff mbox series

Patch

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/rc b/tests/nvme/rc
index 2aa34fb0c9b8..bb135502220a 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:-"350M"}
+nvme_num_iter=${nvme_num_iter:-"100"}
 
 _nvme_requires() {
 	_have_program nvme