2016-06-07 15:49:44 +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-07 15:49:44 +00:00
|
|
|
source $rootdir/scripts/autotest_common.sh
|
2016-06-08 01:47:02 +00:00
|
|
|
source $rootdir/test/nvmf/common.sh
|
2016-06-07 15:49:44 +00:00
|
|
|
|
2016-07-08 21:06:26 +00:00
|
|
|
set -e
|
|
|
|
|
2016-07-08 21:19:11 +00:00
|
|
|
if ! rdma_nic_available; then
|
|
|
|
echo "no NIC for nvmf test"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-06-07 15:49:44 +00:00
|
|
|
timing_enter fio
|
|
|
|
|
|
|
|
# Start up the NVMf target in another process
|
2016-09-08 17:09:59 +00:00
|
|
|
$rootdir/app/nvmf_tgt/nvmf_tgt -c $testdir/../nvmf.conf &
|
2016-06-07 15:49:44 +00:00
|
|
|
nvmfpid=$!
|
|
|
|
|
2016-07-09 00:09:19 +00:00
|
|
|
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
2016-06-07 15:49:44 +00:00
|
|
|
|
2016-08-17 22:42:21 +00:00
|
|
|
waitforlisten $nvmfpid ${RPC_PORT}
|
2016-06-07 15:49:44 +00:00
|
|
|
|
|
|
|
modprobe -v nvme-rdma
|
|
|
|
|
|
|
|
if [ -e "/dev/nvme-fabrics" ]; then
|
|
|
|
chmod a+rw /dev/nvme-fabrics
|
|
|
|
fi
|
|
|
|
|
2016-08-17 22:46:53 +00:00
|
|
|
nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
|
2016-08-15 01:16:49 +00:00
|
|
|
nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode2" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
|
2016-06-07 15:49:44 +00:00
|
|
|
|
2016-07-21 22:57:46 +00:00
|
|
|
$testdir/nvmf_fio.py 4096 1 write 1 verify
|
|
|
|
$testdir/nvmf_fio.py 4096 1 randwrite 1 verify
|
|
|
|
$testdir/nvmf_fio.py 4096 128 write 1 verify
|
|
|
|
$testdir/nvmf_fio.py 4096 128 randwrite 1 verify
|
2016-06-07 15:49:44 +00:00
|
|
|
|
2016-07-25 15:20:11 +00:00
|
|
|
sync
|
|
|
|
nvme disconnect -n "nqn.2016-06.io.spdk:cnode1"
|
2016-08-15 01:16:49 +00:00
|
|
|
nvme disconnect -n "nqn.2016-06.io.spdk:cnode2"
|
2016-07-25 15:20:11 +00:00
|
|
|
|
2016-06-07 15:49:44 +00:00
|
|
|
rm -f ./local-job0-0-verify.state
|
2016-08-15 01:16:49 +00:00
|
|
|
rm -f ./local-job1-1-verify.state
|
|
|
|
rm -f ./local-job2-2-verify.state
|
2016-06-07 15:49:44 +00:00
|
|
|
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
nvmfcleanup
|
|
|
|
killprocess $nvmfpid
|
|
|
|
timing_exit fio
|