3 testdir
=$
(readlink
-f $
(dirname $0))
4 rootdir
=$
(readlink
-f $testdir/..
/..
/..
)
5 source $rootdir/test
/common
/autotest_common.sh
6 source $rootdir/test
/nvmf
/common.sh
11 rpc_py
="$rootdir/scripts/rpc.py"
19 NVMF_SECOND_TARGET_IP
=$
(echo "$RDMA_IP_LIST" |
sed -n 2p
)
21 $rpc_py nvmf_create_transport
-t $TEST_TRANSPORT -u 8192
24 $rpc_py construct_malloc_bdev
$MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc0
25 $rpc_py nvmf_subsystem_create nqn
.2016-06.io.spdk
:cnode1
-a -s SPDK1
26 $rpc_py nvmf_subsystem_add_ns nqn
.2016-06.io.spdk
:cnode1 Malloc0
27 $rpc_py nvmf_subsystem_add_listener nqn
.2016-06.io.spdk
:cnode1
-t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s "$NVMF_PORT"
29 echo "test case1: single bdev can't be used in multiple subsystems"
31 $rpc_py nvmf_subsystem_create nqn
.2016-06.io.spdk
:cnode2
-a -s SPDK2
32 $rpc_py nvmf_subsystem_add_listener nqn
.2016-06.io.spdk
:cnode2
-t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s "$NVMF_PORT"
33 $rpc_py nvmf_subsystem_add_ns nqn
.2016-06.io.spdk
:cnode2 Malloc0
36 if [ $nmic_status -eq 0 ]; then
37 echo " Adding namespace passed - failure expected."
42 echo " Adding namespace failed - expected result."
46 echo "test case2: host connect to nvmf target in multiple paths"
47 if [ ! -z $NVMF_SECOND_TARGET_IP ]; then
48 $rpc_py nvmf_subsystem_add_listener nqn
.2016-06.io.spdk
:cnode1
-t $TEST_TRANSPORT -a $NVMF_SECOND_TARGET_IP -s $NVMF_PORT
50 nvme connect
-t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
51 nvme connect
-t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_SECOND_TARGET_IP" -s "$NVMF_PORT"
55 $rootdir/scripts
/fio.py
-p nvmf
-i 4096 -d 1 -t write -r 1 -v
58 nvme disconnect
-n "nqn.2016-06.io.spdk:cnode1" || true
60 trap - SIGINT SIGTERM EXIT