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