openvpn/tests/t_server_null_stress.sh
Samuli Seppänen f8f4771398 t_server_null: multiple improvements and fixes
- exit after a timeout if unable to kill servers
- use sudo or equivalent only for server stop/start
- use /bin/sh directly instead of through /usr/bin/env
- simplify sudo call in the sample rc file
- remove misleading and outdated documentation
- make it work on OpenBSD 7.5
- make it work on NetBSD 10.0
- make server logs readable by normal users

Change-Id: I2cce8ad4e0d262e1404ab1eb6ff673d8590b6b3a
Signed-off-by: Samuli Seppänen <samuli.seppanen@gmail.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20240704133337.26595-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28871.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2024-07-04 22:26:32 +02:00

34 lines
846 B
Bash
Executable File

#!/bin/sh
#
# Run this stress test as root to avoid sudo authorization from timing out.
ITERATIONS="${1:-100}"
. ./t_server_null_default.rc
export pid_files=""
for SUF in $TEST_SERVER_LIST
do
eval server_name=\"\$SERVER_NAME_$SUF\"
pid_files="${pid_files} ./${server_name}.pid"
done
LOG_BASEDIR="make-check"
mkdir -p "${LOG_BASEDIR}"
count=0
while [ $count -lt $ITERATIONS ]; do
count=$(( count + 1 ))
make check TESTS=t_server_null.sh SUBDIRS= > /dev/null 2>&1
retval=$?
echo "Iteration ${count}: return value ${retval}" >> "${LOG_BASEDIR}/make-check.log"
if [ $retval -ne 0 ]; then
DIR="${LOG_BASEDIR}/make-check-${count}"
mkdir -p "${DIR}"
cp t_server_null*.log "${DIR}/"
cp test-suite.log "${DIR}/"
ps aux|grep openvpn|grep -vE '(suppress|grep)' > "${DIR}/psaux"
fi
done