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/diskq-rfc5424.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 '')
-rwxr-xr-x | tests/diskq-rfc5424.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/diskq-rfc5424.sh b/tests/diskq-rfc5424.sh new file mode 100755 index 0000000..6ba40ce --- /dev/null +++ b/tests/diskq-rfc5424.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# detect queue corruption based on invalid property bag ordering. +# Note: this mimics an issue actually seen in practice. +# Triggering condition: "json" property (message variables) are present +# and "structured-data" property is also present. Caused rsyslog to +# thrash the queue file, getting messages stuck in it and loosing all +# after the initial problem occurrence. +# add 2017-02-08 by Rainer Gerhards, released under ASL 2.0 + +uname +if [ $(uname) = "SunOS" ] ; then + echo "This test currently does not work on all flavors of Solaris." + exit 77 +fi + +. ${srcdir:=.}/diag.sh init +export NUMMESSAGES=10 +generate_conf +add_conf ' +module(load="../plugins/imtcp/.libs/imtcp") +input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port" ruleset="rs") + + +template(name="outfmt" type="string" string="%msg:F,58:2%\n") + +ruleset(name="rs2" queue.type="disk" queue.filename="rs2_q" + queue.spoolDirectory="'${RSYSLOG_DYNNAME}'.spool") { + set $!tmp=$msg; + action(type="omfile" file=`echo $RSYSLOG_OUT_LOG` template="outfmt") +} +ruleset(name="rs") { + set $!tmp=$msg; + call rs2 +} +' +startup +tcpflood -m$NUMMESSAGES -y +shutdown_when_empty +wait_shutdown +seq_check + +exit_test |