Commit 713b4817 authored by Seth Howell's avatar Seth Howell Committed by Jim Harris
Browse files

test/nvmf: add waitforblk calls to rpc tests.



In newer versions of the kernel (tested on 4.17+), it doesn't always win
a race with itself between subsystem creation and deletion. This ensures
that we have completely connected before disconnecting in this test, and
makes running NVMe-oF tests on fedora 28 more teneble.

Change-Id: I6e09a4f8a23764ea53edfe7b23504a4772bf9297
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/426772


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 1e4f9974
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ trap "killprocess $pid; nvmfcleanup; exit 1" SIGINT SIGTERM EXIT
# Add the host NQN and verify that the connect succeeds
$rpc_py nvmf_subsystem_add_host nqn.2016-06.io.spdk:cnode1 nqn.2016-06.io.spdk:host1
nvme connect -t rdma -n nqn.2016-06.io.spdk:cnode1 -q nqn.2016-06.io.spdk:host1 -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
waitforblk "nvme0n1"
nvme disconnect -n nqn.2016-06.io.spdk:cnode1

# Remove the host and verify that the connect fails
@@ -71,6 +72,7 @@ $rpc_py nvmf_subsystem_remove_host nqn.2016-06.io.spdk:cnode1 nqn.2016-06.io.spd
# Allow any host and verify that the connect succeeds
$rpc_py nvmf_subsystem_allow_any_host -e nqn.2016-06.io.spdk:cnode1
nvme connect -t rdma -n nqn.2016-06.io.spdk:cnode1 -q nqn.2016-06.io.spdk:host1 -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
waitforblk "nvme0n1"
nvme disconnect -n nqn.2016-06.io.spdk:cnode1

$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
@@ -87,6 +89,7 @@ do
		nvme connect -t rdma -n nqn.2016-06.io.spdk:cnode$j -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
	done

	waitforblk "nvme0n1"
	n=$j
	for j in `seq 1 $n`
	do