]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/test/nvmf/multiconnection/multiconnection.sh
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / spdk / test / nvmf / multiconnection / multiconnection.sh
1 #!/usr/bin/env bash
2
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
7
8 MALLOC_BDEV_SIZE=128
9 MALLOC_BLOCK_SIZE=512
10
11 rpc_py="python $rootdir/scripts/rpc.py"
12
13 set -e
14
15 if ! rdma_nic_available; then
16 echo "no NIC for nvmf test"
17 exit 0
18 fi
19
20 timing_enter multiconnection
21
22 # Start up the NVMf target in another process
23 $rootdir/app/nvmf_tgt/nvmf_tgt -c $testdir/../nvmf.conf &
24 pid=$!
25
26 trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
27
28 waitforlisten $pid ${RPC_PORT}
29
30 modprobe -v nvme-rdma
31
32 for i in `seq 1 11`
33 do
34 bdevs="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
35 $rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode${i} "transport:RDMA traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" '' -s SPDK${i} -n "$bdevs"
36 done
37
38 for i in `seq 1 11`; do
39 nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
40 done
41
42 $testdir/../fio/nvmf_fio.py 262144 64 read 10
43 $testdir/../fio/nvmf_fio.py 262144 64 randwrite 10
44
45 sync
46 for i in `seq 1 11`; do
47 nvme disconnect -n "nqn.2016-06.io.spdk:cnode${i}" || true
48 $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode${i}
49 done
50
51 rm -f ./local-job0-0-verify.state
52
53 trap - SIGINT SIGTERM EXIT
54
55 nvmfcleanup
56 killprocess $pid
57 timing_exit multiconnection