Daniel Verkamp 44ceff8c17 test/nvmf/shutdown: reduce number of subsystems
The setup.sh parameters we use in autotest don't allow for enough RAM
for 12 subsystems; reduce it slightly while still testing a large
number.

Change-Id: I595589db6e5199ad87ad9511bb0ad63b7b60211d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-02 09:55:05 -07:00

44 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/autotest_common.sh
source $rootdir/test/nvmf/common.sh
MALLOC_BDEV_SIZE=128
MALLOC_BLOCK_SIZE=512
rpc_py="python $rootdir/scripts/rpc.py"
set -e
if ! rdma_nic_available; then
echo "no NIC for nvmf test"
exit 0
fi
timing_enter shutdown
# Start up the NVMf target in another process
$rootdir/app/nvmf_tgt/nvmf_tgt -c $testdir/../nvmf.conf &
pid=$!
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $pid ${RPC_PORT}
# Create 10 subsystems
for i in `seq 1 10`
do
bdevs="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode${i} "transport:RDMA traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" '' -s SPDK${i} -n "$bdevs"
done
# Kill nvmf tgt without removing any subsystem to check whether it can shutdown correctly
rm -f ./local-job0-0-verify.state
trap - SIGINT SIGTERM EXIT
killprocess $pid
timing_exit shutdown