]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | #!/usr/bin/env bash |
2 | ||
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 | |
7 | ||
8 | MALLOC_BDEV_SIZE=64 | |
9 | MALLOC_BLOCK_SIZE=512 | |
10 | ||
11 | rpc_py="$rootdir/scripts/rpc.py" | |
12 | ||
9f95a23c | 13 | # connect disconnect is geared towards ensuring that we are properly freeing resources after disconnecting qpairs. |
9f95a23c | 14 | nvmftestinit |
f67539c2 | 15 | nvmfappstart -m 0xF |
9f95a23c | 16 | |
f67539c2 | 17 | $rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 -c 0 |
9f95a23c | 18 | |
f67539c2 | 19 | bdev="$($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 | ||
25 | if [ $RUN_NIGHTLY -eq 1 ]; then | |
26 | num_iterations=200 | |
f67539c2 | 27 | IO_QUEUES="-i 8" |
9f95a23c TL |
28 | else |
29 | num_iterations=10 | |
30 | fi | |
31 | ||
32 | set +x | |
33 | for 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 |
38 | done |
39 | set -x | |
40 | ||
41 | trap - SIGINT SIGTERM EXIT | |
42 | ||
9f95a23c | 43 | nvmftestfini |