3 testdir
=$
(readlink
-f $
(dirname $0))
4 rootdir
=$
(readlink
-f $testdir/..
/..
/..
)
5 source $rootdir/scripts
/autotest_common.sh
6 source $rootdir/test
/nvmf
/common.sh
11 rpc_py
="python $rootdir/scripts/rpc.py"
15 if ! rdma_nic_available
; then
16 echo "no NIC for nvmf test"
22 # Start up the NVMf target in another process
23 $rootdir/app
/nvmf_tgt
/nvmf_tgt
-c $testdir/..
/nvmf.conf
&
26 trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
28 waitforlisten
$nvmfpid ${RPC_PORT}
30 bdevs
="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
31 bdevs
="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
35 $rpc_py construct_nvmf_subsystem Direct nqn
.2016-06.io.spdk
:cnode1
'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -p "*"
36 $rpc_py construct_nvmf_subsystem Virtual nqn
.2016-06.io.spdk
:cnode2
'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -s SPDK00000000000001
-n "$bdevs"
38 nvme connect
-t rdma
-n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
39 nvme connect
-t rdma
-n "nqn.2016-06.io.spdk:cnode2" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
41 $testdir/nvmf_fio.py
4096 1 write 1 verify
42 $testdir/nvmf_fio.py
4096 1 randwrite
1 verify
43 $testdir/nvmf_fio.py
4096 128 write 1 verify
44 $testdir/nvmf_fio.py
4096 128 randwrite
1 verify
47 nvme disconnect
-n "nqn.2016-06.io.spdk:cnode1" || true
48 nvme disconnect
-n "nqn.2016-06.io.spdk:cnode2" || true
50 $rpc_py delete_nvmf_subsystem nqn
.2016-06.io.spdk
:cnode1
51 $rpc_py delete_nvmf_subsystem nqn
.2016-06.io.spdk
:cnode2
53 rm -f .
/local-job0-0-verify.state
54 rm -f .
/local-job1-1-verify.state
55 rm -f .
/local-job2-2-verify.state
57 trap - SIGINT SIGTERM EXIT