Skip to content

Commit

Permalink
t_server_null: persist test log files
Browse files Browse the repository at this point in the history
The goal is to help debug issues with t_server_null. The immediate goal
is to be able to debug server startup issues encountered on some of the
*BSD platforms.

Change-Id: I49f1e7d25edb62bf202ffceb45dedc213f2eafdd
Signed-off-by: Samuli Seppänen <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/search?l=mid&[email protected]
URL: https://gerrit.openvpn.net/c/openvpn/+/776
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
mattock authored and cron2 committed Oct 24, 2024
1 parent 5861274 commit a3a4844
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions tests/t_server_null.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ else
fi

srcdir="${srcdir:-.}"
export t_server_null_logdir=t_server_null-`hostname`-`date +%Y%m%d-%H%M%S`

# Create directory for server and client logs
mkdir $t_server_null_logdir

"${srcdir}/t_server_null_server.sh" &
"${srcdir}/t_server_null_client.sh"
Expand Down
4 changes: 2 additions & 2 deletions tests/t_server_null_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ launch_client() {
$client_conf \
--writepid "${pid}" \
--setenv pid $pid \
--log "${log}" &
--log "${t_server_null_logdir}/${log}" &
}

wait_for_results() {
Expand Down Expand Up @@ -44,7 +44,7 @@ get_client_test_result() {
should_pass=$2
log="${test_name}.log"

grep "Initialization Sequence Completed" "${log}" > /dev/null
grep "Initialization Sequence Completed" "${t_server_null_logdir}/${log}" > /dev/null
exit_code=$?

if [ $exit_code -eq 0 ] && [ "${should_pass}" = "yes" ]; then
Expand Down
4 changes: 1 addition & 3 deletions tests/t_server_null_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ launch_server() {
server_name=$1
server_exec=$2
server_conf=$3
log="${server_name}.log"
log="${t_server_null_logdir}/${server_name}.log"
status="${server_name}.status"
pid="${server_name}.pid"

if [ -z "${RUN_SUDO}" ]; then
rm -f "${status}" "${log}" "${pid}"
"${server_exec}" \
$server_conf \
--status "${status}" 1 \
--log "${log}" \
--writepid "${pid}" \
--explicit-exit-notify 3
else
$RUN_SUDO rm -f "${status}" "${log}" "${pid}"
$RUN_SUDO "${server_exec}" \
$server_conf \
--status "${status}" 1 \
Expand Down

0 comments on commit a3a4844

Please sign in to comment.