]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/test/nvmf/fio/fio.sh
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / spdk / test / nvmf / fio / fio.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=64
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 fio
21
22 # Start up the NVMf target in another process
23 $rootdir/app/nvmf_tgt/nvmf_tgt -c $testdir/../nvmf.conf &
24 nvmfpid=$!
25
26 trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
27
28 waitforlisten $nvmfpid ${RPC_PORT}
29
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)"
32
33 modprobe -v nvme-rdma
34
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"
37
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"
40
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
45
46 sync
47 nvme disconnect -n "nqn.2016-06.io.spdk:cnode1" || true
48 nvme disconnect -n "nqn.2016-06.io.spdk:cnode2" || true
49
50 $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
51 $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode2
52
53 rm -f ./local-job0-0-verify.state
54 rm -f ./local-job1-1-verify.state
55 rm -f ./local-job2-2-verify.state
56
57 trap - SIGINT SIGTERM EXIT
58
59 nvmfcleanup
60 killprocess $nvmfpid
61 timing_exit fio