From 6697ff02f9ed3697700fe3d66cd012e54bda0bbd Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 22 Jul 2016 15:40:48 -0700 Subject: [PATCH] nvmf: test nvme cli over NVMf Change-Id: I2d71945edc9596775092b59f70ca108c775b322e Signed-off-by: Daniel Verkamp --- autotest.sh | 1 + test/nvmf/nvme_cli/nvme_cli.sh | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 test/nvmf/nvme_cli/nvme_cli.sh diff --git a/autotest.sh b/autotest.sh index 8a0f4c9ee..ecc0497e8 100755 --- a/autotest.sh +++ b/autotest.sh @@ -87,6 +87,7 @@ timing_enter nvmf time test/nvmf/fio/fio.sh time test/nvmf/filesystem/filesystem.sh time test/nvmf/discovery/discovery.sh +time test/nvmf/nvme_cli/nvme_cli.sh timing_exit nvmf diff --git a/test/nvmf/nvme_cli/nvme_cli.sh b/test/nvmf/nvme_cli/nvme_cli.sh new file mode 100755 index 000000000..f5e8fde01 --- /dev/null +++ b/test/nvmf/nvme_cli/nvme_cli.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +testdir=$(readlink -f $(dirname $0)) +rootdir=$(readlink -f $testdir/../../..) +source $rootdir/scripts/autotest_common.sh +source $rootdir/test/nvmf/common.sh + +set -e + +if ! rdma_nic_available; then + echo "no NIC for nvmf test" + exit 0 +fi + +timing_enter nvme_cli + +$rootdir/app/nvmf_tgt/nvmf_tgt -c $testdir/../nvmf.conf & +nvmfpid=$! + +trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT + +sleep 5 + +modprobe -v nvme-rdma + +if [ -e "/dev/nvme-fabrics" ]; then + chmod a+rw /dev/nvme-fabrics +fi + +echo 'traddr='$NVMF_FIRST_TARGET_IP',transport=rdma,nr_io_queues=1,trsvcid='$NVMF_PORT',nqn=nqn.2016-06.io.spdk:cnode1' > /dev/nvme-fabrics + +nvme list +nvme id-ctrl /dev/nvme0 +nvme id-ns /dev/nvme0n1 +nvme smart-log /dev/nvme0 + +nvme disconnect -n "nqn.2016-06.io.spdk:cnode1" + +trap - SIGINT SIGTERM EXIT + +nvmfcleanup +killprocess $nvmfpid +timing_exit nvme_cli