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 $rootdir/app
/nvmf_tgt
/nvmf_tgt
-c $testdir/..
/nvmf.conf
&
25 trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
27 waitforlisten
$nvmfpid ${RPC_PORT}
29 bdevs
="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
30 bdevs
="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
34 $rpc_py construct_nvmf_subsystem Direct nqn
.2016-06.io.spdk
:cnode1
'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -p "*"
35 $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"
37 nvme connect
-t rdma
-n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
38 nvme connect
-t rdma
-n "nqn.2016-06.io.spdk:cnode2" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
42 for ctrl
in /dev
/nvme?
; do
47 for ns
in /dev
/nvme?n
*; do
51 nvme disconnect
-n "nqn.2016-06.io.spdk:cnode1" || true
52 nvme disconnect
-n "nqn.2016-06.io.spdk:cnode2" || true
54 $rpc_py delete_nvmf_subsystem nqn
.2016-06.io.spdk
:cnode1
55 $rpc_py delete_nvmf_subsystem nqn
.2016-06.io.spdk
:cnode2
57 trap - SIGINT SIGTERM EXIT