rsyslog/tests/failover-no-rptd-vg.sh
Rainer Gerhards 69ef6e329b fix bad bash coding style and disable shellcheck false positives
Also now permit interactivly running tests without explicitly setting
$srcdir. This now works if we are inside ./tests and fails, as before,
when we are in a different directory.

Detected by shellcheck via CodeFactor.io
2018-10-23 13:27:37 +02:00

27 lines
681 B
Bash
Executable File

#!/bin/bash
# rptd test for failover functionality - no failover
# This file is part of the rsyslog project, released under GPLv3
. ${srcdir:=.}/diag.sh init
generate_conf
add_conf '
$RepeatedMsgReduction on
# second action should never execute
:msg, contains, "msgnum:" /dev/null
$ActionExecOnlyWhenPreviousIsSuspended on
& ./'"${RSYSLOG_OUT_LOG}"'
'
startup_vg
injectmsg 0 5000
shutdown_when_empty
wait_shutdown_vg
check_exit_vg
# now we need our custom logic to see if the result file is empty
# (what it should be!)
if [ -f $RSYSLOG_OUT_LOG -a "$(cat $RSYSLOG_OUT_LOG)" != "" ]; then
echo "ERROR, output file not empty"
cat -n "$RSYSLOG_OUT_LOG"
error_exit 1
fi
exit_test