From 8166215677ca26b85cbb91b79107314df31a832b Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 28 Aug 2018 11:12:40 -0700 Subject: [PATCH] test/nvmf: fix test/nvmf/nvme_cli/nvme_cli.sh We need to sleep for a small amount of time after the ./nvme connect since the connection will not appear immediately. Remove unnecessary sed commands - this script did not modify spdk.conf before running these tests, so it shouldn't be modifying spdk.conf afterwards. "kill SIGINT" is not valid - a process ID must be specified. Just exit with error instead. Also clean up a typo. Signed-off-by: Jim Harris Change-Id: I03b659844c8cfb301b734586eb84b18fc665dc01 Reviewed-on: https://review.gerrithub.io/423743 Reviewed-by: Ben Walker Reviewed-by: Seth Howell Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System --- test/nvmf/nvme_cli/nvme_cli.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/nvmf/nvme_cli/nvme_cli.sh b/test/nvmf/nvme_cli/nvme_cli.sh index 9d272a7ad..140fcf15a 100755 --- a/test/nvmf/nvme_cli/nvme_cli.sh +++ b/test/nvmf/nvme_cli/nvme_cli.sh @@ -70,18 +70,17 @@ nvme disconnect -n "nqn.2016-06.io.spdk:cnode1" || true nvme disconnect -n "nqn.2016-06.io.spdk:cnode2" || true if [ -d $spdk_nvme_cli ]; then - # Test spdk/nvme-cli NVMe-oF commands: discover, connect and disconnet + # Test spdk/nvme-cli NVMe-oF commands: discover, connect and disconnect cd $spdk_nvme_cli ./nvme discover -t rdma -a $NVMF_FIRST_TARGET_IP -s "$NVMF_PORT" nvme_num_before_connection=$(nvme list |grep "/dev/nvme*"|awk '{print $1}'|wc -l) ./nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" + sleep 1 nvme_num=$(nvme list |grep "/dev/nvme*"|awk '{print $1}'|wc -l) ./nvme disconnect -n "nqn.2016-06.io.spdk:cnode1" - sed -i 's/spdk=1/spdk=0/g' spdk.conf - sed -i 's/shm_id=0/shm_id=1/g' spdk.conf if [ $nvme_num -le $nvme_num_before_connection ]; then echo "spdk/nvme-cli connect target devices failed" - kill SIGINT + exit 1 fi fi