2019-02-01 21:44:13 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2019 Intel Corporation
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
2019-02-01 21:44:13 +00:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
source $rootdir/test/nvmf/common.sh
|
|
|
|
|
|
|
|
MALLOC_BDEV_SIZE=64
|
|
|
|
MALLOC_BLOCK_SIZE=512
|
|
|
|
|
|
|
|
# connect disconnect is geared towards ensuring that we are properly freeing resources after disconnecting qpairs.
|
2019-05-13 19:11:00 +00:00
|
|
|
nvmftestinit
|
2020-04-28 15:08:33 +00:00
|
|
|
nvmfappstart -m 0xF
|
2019-02-01 21:44:13 +00:00
|
|
|
|
2019-07-15 04:42:41 +00:00
|
|
|
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192 -c 0
|
2019-02-01 21:44:13 +00:00
|
|
|
|
2019-08-09 11:15:35 +00:00
|
|
|
bdev="$($rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
2019-02-01 21:44:13 +00:00
|
|
|
|
2019-12-19 14:17:49 +00:00
|
|
|
$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s $NVMF_SERIAL
|
2019-02-01 21:44:13 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 $bdev
|
2019-06-03 16:34:31 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
2019-02-01 21:44:13 +00:00
|
|
|
|
2019-02-26 15:13:07 +00:00
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
2022-05-12 13:06:58 +00:00
|
|
|
num_iterations=100
|
2022-11-22 12:48:37 +00:00
|
|
|
# Reduce number of IO queues to shorten connection time
|
|
|
|
NVME_CONNECT="nvme connect -i 8"
|
2019-02-01 21:44:13 +00:00
|
|
|
else
|
|
|
|
num_iterations=10
|
|
|
|
fi
|
|
|
|
|
2019-02-26 15:13:07 +00:00
|
|
|
set +x
|
2019-02-01 21:44:13 +00:00
|
|
|
for i in $(seq 1 $num_iterations); do
|
2022-11-22 12:48:37 +00:00
|
|
|
$NVME_CONNECT -t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
|
2019-12-19 14:17:49 +00:00
|
|
|
waitforserial "$NVMF_SERIAL"
|
2019-02-01 21:44:13 +00:00
|
|
|
nvme disconnect -n "nqn.2016-06.io.spdk:cnode1"
|
2019-12-19 14:17:49 +00:00
|
|
|
waitforserial_disconnect "$NVMF_SERIAL"
|
2019-02-01 21:44:13 +00:00
|
|
|
done
|
2019-02-26 15:13:07 +00:00
|
|
|
set -x
|
2019-02-01 21:44:13 +00:00
|
|
|
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
2019-05-16 19:38:53 +00:00
|
|
|
nvmftestfini
|