[PATCH blktests v2] nvmeof-mp/001: Set expected count properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux