From 713b481796764207bb7aa2aa9260106c69fa1dd9 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Tue, 25 Sep 2018 14:39:39 -0700 Subject: [PATCH] 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: Seth Howell Reviewed-on: https://review.gerrithub.io/426772 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris --- test/nvmf/rpc/rpc.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/nvmf/rpc/rpc.sh b/test/nvmf/rpc/rpc.sh index db743ac3c..fc02dde10 100755 --- a/test/nvmf/rpc/rpc.sh +++ b/test/nvmf/rpc/rpc.sh @@ -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