Commit 81662156 authored by Jim Harris's avatar Jim Harris Committed by Changpeng Liu
Browse files

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: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I03b659844c8cfb301b734586eb84b18fc665dc01

Reviewed-on: https://review.gerrithub.io/423743


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 02a794ef
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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