Commit 8cbbdf2d authored by Vitaliy Mysak's avatar Vitaliy Mysak Committed by Jim Harris
Browse files

test: fix nvmf connect/disconnect



Add missing wait in test/nvme/shutdown/shutdown.sh
Not waiting after connecting nvme device resulted in undefined behavior.

This patch uses new helper function - nvme_connect

Change-Id: Idb29c7f6b40ae4b3fa0eb68f7b8d5f86d9a4149f
Signed-off-by: default avatarVitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/428336


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent c7bb861a
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -198,3 +198,20 @@ function check_ip_is_soft_roce()
		return 1
	fi
}

function nvme_connect()
{
	local init_count=$(nvme list | wc -l)

	nvme connect $@
	if [ $? != 0 ]; then return $?; fi

	for i in $(seq 1 10); do
		if [ $(nvme list | wc -l) -gt $init_count ]; then
			return 0
		else
			sleep 1s
		fi
	done
	return 1
}
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ modprobe -v nvme-fabrics
for ((x=0; x<2;x++)); do
	# Connect kernel host to subsystems
	for i in `seq 1 $num_subsystems`; do
		nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
		nvme_connect -t rdma -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
	done
	# Disconnect the subsystems in reverse order
	for i in `seq $num_subsystems -1 1`; do