diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
commit | dcc721a95bef6f0d8e6d8775b8efe33e5aecd562 (patch) | |
tree | 66a2774cd0ee294d019efd71d2544c70f42b2842 /tests/externalstate-failed-rcvr.sh | |
parent | Initial commit. (diff) | |
download | rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.tar.xz rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.zip |
Adding upstream version 8.2402.0.upstream/8.2402.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/externalstate-failed-rcvr.sh')
-rwxr-xr-x | tests/externalstate-failed-rcvr.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/externalstate-failed-rcvr.sh b/tests/externalstate-failed-rcvr.sh new file mode 100755 index 0000000..b3f23ca --- /dev/null +++ b/tests/externalstate-failed-rcvr.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# This tests the action suspension via a file and ensure that it does +# NOT override actual target suspension state. +# This file is part of the rsyslog project, released under ASL 2.0 +# Written 2019-01-08 by Rainer Gerhards +. ${srcdir:=.}/diag.sh init +export NUMMESSAGES=2500 +export QUEUE_EMPTY_CHECK_FUNC=wait_seq_check + +# IMPORTANT: nothing permitted to listen on $TCPFLOOD_PORT! +# mimic some good state in external statefile: +printf "%s" "READY" > $RSYSLOG_DYNNAME.STATE + +generate_conf +add_conf ' +$template outfmt,"%msg:F,58:2%\n" + +:msg, contains, "msgnum:" { + action(name="primary" type="omfwd" target="localhost" port="'$TCPFLOOD_PORT'" + protocol="tcp" action.externalstate.file="'$RSYSLOG_DYNNAME'.STATE") + action(name="failover" type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt" + action.execOnlyWhenPreviousIsSuspended="on") +} +' +startup +injectmsg +shutdown_when_empty +wait_shutdown +# note: we do NOT need to do a check_seq as this was already done as part of the +# queue empty predicate check +exit_test |