]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/test/nvmf/target/connect_disconnect.sh
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / test / nvmf / target / connect_disconnect.sh
CommitLineData
9f95a23c
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
9f95a23c 13# connect disconnect is geared towards ensuring that we are properly freeing resources after disconnecting qpairs.
9f95a23c 14nvmftestinit
f67539c2 15nvmfappstart -m 0xF
9f95a23c 16
f67539c2 17$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 -c 0
9f95a23c 18
f67539c2 19bdev="$($rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
9f95a23c 20
f67539c2 21$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s $NVMF_SERIAL
9f95a23c
TL
22$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 $bdev
23$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
24
25if [ $RUN_NIGHTLY -eq 1 ]; then
26 num_iterations=200
f67539c2 27 IO_QUEUES="-i 8"
9f95a23c
TL
28else
29 num_iterations=10
30fi
31
32set +x
33for i in $(seq 1 $num_iterations); do
f67539c2
TL
34 nvme connect -t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" $IO_QUEUES
35 waitforserial "$NVMF_SERIAL"
9f95a23c 36 nvme disconnect -n "nqn.2016-06.io.spdk:cnode1"
f67539c2 37 waitforserial_disconnect "$NVMF_SERIAL"
9f95a23c
TL
38done
39set -x
40
41trap - SIGINT SIGTERM EXIT
42
9f95a23c 43nvmftestfini