]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/test/nvmf/host/bdevperf.sh
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / test / nvmf / host / bdevperf.sh
CommitLineData
11fdf7f2
TL
1#!/usr/bin/env bash
2
3testdir=$(readlink -f $(dirname $0))
4rootdir=$(readlink -f $testdir/../../..)
5source $rootdir/test/common/autotest_common.sh
6source $rootdir/test/nvmf/common.sh
7
8MALLOC_BDEV_SIZE=64
9MALLOC_BLOCK_SIZE=512
10
11rpc_py="$rootdir/scripts/rpc.py"
12
13set -e
14
9f95a23c 15nvmftestinit
11fdf7f2
TL
16
17timing_enter bdevperf
18timing_enter start_nvmf_tgt
19
20$NVMF_APP -m 0xF &
21nvmfpid=$!
22
9f95a23c 23trap "process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1" SIGINT SIGTERM EXIT
11fdf7f2
TL
24
25waitforlisten $nvmfpid
9f95a23c 26$rpc_py nvmf_create_transport -t $TEST_TRANSPORT -u 8192
11fdf7f2
TL
27timing_exit start_nvmf_tgt
28
9f95a23c 29$rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc0
11fdf7f2 30$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
9f95a23c
TL
31$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0
32$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
11fdf7f2
TL
33
34echo "[Nvme]" > $testdir/bdevperf.conf
9f95a23c 35echo " TransportID \"trtype:$TEST_TRANSPORT adrfam:IPv4 subnqn:nqn.2016-06.io.spdk:cnode1 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT\" Nvme0" >> $testdir/bdevperf.conf
11fdf7f2
TL
36$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w verify -t 1
37sync
38rm -rf $testdir/bdevperf.conf
39$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
40
41trap - SIGINT SIGTERM EXIT
42
9f95a23c 43nvmftestfini
11fdf7f2 44timing_exit bdevperf