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/glbl-oversizeMsg-split.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/glbl-oversizeMsg-split.sh')
-rwxr-xr-x | tests/glbl-oversizeMsg-split.sh | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/glbl-oversizeMsg-split.sh b/tests/glbl-oversizeMsg-split.sh new file mode 100755 index 0000000..010ab21 --- /dev/null +++ b/tests/glbl-oversizeMsg-split.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# add 2018-05-03 by PascalWithopf, released under ASL 2.0 +. ${srcdir:=.}/diag.sh init +./have_relpSrvSetOversizeMode +if [ $? -eq 1 ]; then + echo "imrelp parameter oversizeMode not available. Test stopped" + exit 77 +fi; +generate_conf +add_conf ' +module(load="../plugins/imrelp/.libs/imrelp") +global(maxMessageSize="230" + oversizemsg.input.mode="split") + + +input(type="imrelp" port="'$TCPFLOOD_PORT'" maxdatasize="300") + +template(name="outfmt" type="string" string="%rawmsg%\n") +action(type="omfile" template="outfmt" + file=`echo $RSYSLOG_OUT_LOG`) +' +# TODO: add tcpflood option to specific EXACT test message size! +startup +tcpflood -Trelp-plain -p'$TCPFLOOD_PORT' -m1 -d 240 +shutdown_when_empty # shut down rsyslogd when done processing messages +wait_shutdown + +# We need the ^-sign to symbolize the beginning and the $-sign to symbolize the end +# because otherwise we won't know if it was truncated at the right length. +#First part of message is checked +grep "^<167>Mar 1 01:00:00 172.20.245.8 tag msgnum:00000000:240:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$" $RSYSLOG_OUT_LOG > /dev/null +if [ $? -ne 0 ]; then + echo + echo "FAIL: expected message not found. $RSYSLOG_OUT_LOG is:" + cat $RSYSLOG_OUT_LOG + error_exit 1 +fi +#Split part of message is checked +grep "^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$" $RSYSLOG_OUT_LOG > /dev/null +if [ $? -ne 0 ]; then + echo + echo "FAIL: expected message not found. $RSYSLOG_OUT_LOG is:" + cat $RSYSLOG_OUT_LOG + error_exit 1 +fi +#Error message is checked +grep "message too long.*begin of message is:" $RSYSLOG_OUT_LOG > /dev/null +if [ $? -ne 0 ]; then + echo + echo "FAIL: expected message not found. $RSYSLOG_OUT_LOG is:" + cat $RSYSLOG_OUT_LOG + error_exit 1 +fi + + +exit_test |