2016-06-22 23:23:36 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
2016-07-06 16:56:03 +00:00
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
2016-06-22 23:23:36 +00:00
|
|
|
source $rootdir/scripts/autotest_common.sh
|
|
|
|
source $rootdir/test/nvmf/common.sh
|
|
|
|
|
|
|
|
if ! hash nvme; then
|
|
|
|
echo "nvme command not found; skipping discovery test"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
rdma_device_init
|
|
|
|
|
2016-07-08 21:06:26 +00:00
|
|
|
set -e
|
|
|
|
|
2016-06-22 23:23:36 +00:00
|
|
|
timing_enter discovery
|
|
|
|
|
|
|
|
# Start up the NVMf target in another process
|
|
|
|
$rootdir/app/nvmf_tgt/nvmf_tgt -c $testdir/../nvmf.conf -t nvmf -t rdma &
|
|
|
|
nvmfpid=$!
|
|
|
|
|
|
|
|
trap "process_core; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
sleep 10
|
|
|
|
|
|
|
|
modprobe -v nvme-rdma
|
|
|
|
|
|
|
|
if [ -e "/dev/nvme-fabrics" ]; then
|
|
|
|
chmod a+rw /dev/nvme-fabrics
|
|
|
|
fi
|
|
|
|
|
|
|
|
nvme discover -t rdma -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
|
|
|
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
nvmfcleanup
|
|
|
|
killprocess $nvmfpid
|
|
|
|
timing_exit discovery
|