Skip to content

Commit 7ee4677

Browse files
committed
qa/workunits/nvmeof/basic_tests.sh: Assert number of devices
Check number of devices connected after connect-all. It should be equal to number of namespaces created. Signed-off-by: Vallari Agrawal <[email protected]>
1 parent 2030411 commit 7ee4677

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

qa/workunits/nvmeof/basic_tests.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ disconnect_all() {
3838
connect_all() {
3939
sudo nvme connect-all --traddr=$NVMEOF_DEFAULT_GATEWAY_IP_ADDRESS --transport=tcp -l 3600
4040
sleep 5
41-
output=$(sudo nvme list --output-format=json)
42-
if ! echo "$output" | grep -q "$SPDK_CONTROLLER"; then
41+
expected_devices_count=$1
42+
actual_devices=$(sudo nvme list --output-format=json | grep -o "$SPDK_CONTROLLER" | wc -l)
43+
if [ "$actual_devices" -ne "$expected_devices_count" ]; then
44+
sudo nvme list --output-format=json
4345
return 1
4446
fi
4547
}
@@ -72,11 +74,13 @@ test_run connect
7274
test_run list_subsys 1
7375
test_run disconnect_all
7476
test_run list_subsys 0
75-
test_run connect_all
77+
devices_count=$(( $NVMEOF_NAMESPACES_COUNT * $NVMEOF_SUBSYSTEMS_COUNT))
78+
test_run connect_all $devices_count
7679
gateways_count=$(( $(echo "$NVMEOF_GATEWAY_IP_ADDRESSES" | tr -cd ',' | wc -c) + 1 ))
7780
multipath_count=$(( $gateways_count * $NVMEOF_SUBSYSTEMS_COUNT))
7881
test_run list_subsys $multipath_count
7982

8083

84+
8185
echo "-------------Test Summary-------------"
8286
echo "[nvmeof] All nvmeof basic tests passed!"

0 commit comments

Comments
 (0)