All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH blktests v2] nvmeof-mp/001: Set expected count properly
@ 2022-05-21 12:30 Xiao Yang
  2022-05-23  1:09 ` Shinichiro Kawasaki
  2022-05-26  7:36 ` Shinichiro Kawasaki
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Yang @ 2022-05-21 12:30 UTC (permalink / raw)
  To: osandov, yi.zhang, bvanassche, shinichiro.kawasaki; +Cc: linux-block, Xiao Yang

The number of block devices will increase according
to the number of RDMA-capable NICs.
For example, nvmeof-mp/001 with two RDMA-capable NICs
got the following error:
-------------------------------------
    Configured NVMe target driver
    -count_devices(): 1 <> 1
    +count_devices(): 2 <> 1
    Passed
-------------------------------------

Set expected count properly by calculating the number
of RDMA-capable NICs.

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 tests/nvmeof-mp/001     | 11 +++++++----
 tests/nvmeof-mp/001.out |  1 -
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/nvmeof-mp/001 b/tests/nvmeof-mp/001
index f3e6394..70a4455 100755
--- a/tests/nvmeof-mp/001
+++ b/tests/nvmeof-mp/001
@@ -18,17 +18,20 @@ count_devices() {
 }
 
 wait_for_devices() {
-	local expected=1 i devices
+	local expected=0 i devices
+
+	for i in $(rdma_network_interfaces); do
+		((expected++))
+	done
 
 	use_blk_mq y || return $?
 	for ((i=0;i<100;i++)); do
 		devices=$(count_devices)
-		[ "$devices" -ge $expected ] && break
+		[ "$devices" -ge "$expected" ] && break
 		sleep .1
 	done
 	echo "count_devices(): $devices <> $expected" >>"$FULL"
-	echo "count_devices(): $devices <> $expected"
-	[ "$devices" -ge $expected ]
+	[ "$devices" -ge "$expected" ]
 }
 
 test() {
diff --git a/tests/nvmeof-mp/001.out b/tests/nvmeof-mp/001.out
index 2ce8d17..a7d4cb9 100644
--- a/tests/nvmeof-mp/001.out
+++ b/tests/nvmeof-mp/001.out
@@ -1,3 +1,2 @@
 Configured NVMe target driver
-count_devices(): 1 <> 1
 Passed
-- 
2.34.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH blktests v2] nvmeof-mp/001: Set expected count properly
  2022-05-21 12:30 [PATCH blktests v2] nvmeof-mp/001: Set expected count properly Xiao Yang
@ 2022-05-23  1:09 ` Shinichiro Kawasaki
  2022-05-26  7:36 ` Shinichiro Kawasaki
  1 sibling, 0 replies; 3+ messages in thread
From: Shinichiro Kawasaki @ 2022-05-23  1:09 UTC (permalink / raw)
  To: Xiao Yang; +Cc: osandov, yi.zhang, bvanassche, linux-block

On May 21, 2022 / 20:30, Xiao Yang wrote:
> The number of block devices will increase according
> to the number of RDMA-capable NICs.
> For example, nvmeof-mp/001 with two RDMA-capable NICs
> got the following error:
> -------------------------------------
>     Configured NVMe target driver
>     -count_devices(): 1 <> 1
>     +count_devices(): 2 <> 1
>     Passed
> -------------------------------------
> 
> Set expected count properly by calculating the number
> of RDMA-capable NICs.
> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>

Hi Xiao, thanks for the fix. Looks good to me.

Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

-- 
Best Regards,
Shin'ichiro Kawasaki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH blktests v2] nvmeof-mp/001: Set expected count properly
  2022-05-21 12:30 [PATCH blktests v2] nvmeof-mp/001: Set expected count properly Xiao Yang
  2022-05-23  1:09 ` Shinichiro Kawasaki
@ 2022-05-26  7:36 ` Shinichiro Kawasaki
  1 sibling, 0 replies; 3+ messages in thread
From: Shinichiro Kawasaki @ 2022-05-26  7:36 UTC (permalink / raw)
  To: Xiao Yang; +Cc: osandov, yi.zhang, bvanassche, linux-block

On May 21, 2022 / 20:30, Xiao Yang wrote:
> The number of block devices will increase according
> to the number of RDMA-capable NICs.
> For example, nvmeof-mp/001 with two RDMA-capable NICs
> got the following error:
> -------------------------------------
>     Configured NVMe target driver
>     -count_devices(): 1 <> 1
>     +count_devices(): 2 <> 1
>     Passed
> -------------------------------------
> 
> Set expected count properly by calculating the number
> of RDMA-capable NICs.
> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>

Thanks, applied.

-- 
Shin'ichiro Kawasaki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-26  7:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-21 12:30 [PATCH blktests v2] nvmeof-mp/001: Set expected count properly Xiao Yang
2022-05-23  1:09 ` Shinichiro Kawasaki
2022-05-26  7:36 ` Shinichiro Kawasaki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.