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

Reviewed-on: https://review.gerrithub.io/423743
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Jim Harris 2018-08-28 11:12:40 -07:00 committed by Changpeng Liu
parent 02a794ef88
commit 8166215677

View File

@ -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