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"
43 devs
=`lsblk -l -o NAME | grep nvme`
47 parted
-s /dev
/$dev mklabel msdos mkpart primary
'0%' '100%'
51 for fstype
in "ext4" "btrfs" "xfs"; do
53 if [ $fstype = ext4
]; then
59 mkfs.
${fstype} $force /dev
/${dev}p1
61 mount
/dev
/${dev}p1
/mnt
/device
70 parted
-s /dev
/$dev rm 1
74 nvme disconnect
-n "nqn.2016-06.io.spdk:cnode1" || true
75 nvme disconnect
-n "nqn.2016-06.io.spdk:cnode2" || true
77 $rpc_py delete_nvmf_subsystem nqn
.2016-06.io.spdk
:cnode1
78 $rpc_py delete_nvmf_subsystem nqn
.2016-06.io.spdk
:cnode2
80 trap - SIGINT SIGTERM EXIT