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/pmnull-withparams.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/pmnull-withparams.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/pmnull-withparams.sh b/tests/pmnull-withparams.sh new file mode 100755 index 0000000..95a48ee --- /dev/null +++ b/tests/pmnull-withparams.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# add 2016-12-08 by Pascal Withopf, released under ASL 2.0 +. ${srcdir:=.}/diag.sh init +generate_conf +add_conf ' +module(load="../plugins/imtcp/.libs/imtcp") +module(load="../plugins/pmnull/.libs/pmnull") +input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port" ruleset="ruleset") +parser(name="custom.pmnull" type="pmnull" tag="mytag" syslogfacility="3" syslogseverity="1") +template(name="test" type="string" string="tag: %syslogtag%, pri: %pri%, syslogfacility: %syslogfacility%, syslogseverity: %syslogseverity% msg: %msg%\n") +ruleset(name="ruleset" parser=["custom.pmnull", "rsyslog.pmnull"]) { + action(type="omfile" file=`echo $RSYSLOG_OUT_LOG` template="test") +} +' +startup +tcpflood -m1 -M "\"<189>16261: May 28 16:09:56.185: %SYS-5-CONFIG_I: Configured from console by adminsepp on vty0 (10.23.214.226)\"" +shutdown_when_empty +wait_shutdown +echo 'tag: mytag, pri: 25, syslogfacility: 3, syslogseverity: 1 msg: <189>16261: May 28 16:09:56.185: %SYS-5-CONFIG_I: Configured from console by adminsepp on vty0 (10.23.214.226)' | cmp - $RSYSLOG_OUT_LOG +if [ ! $? -eq 0 ]; then + echo "invalid response generated, $RSYSLOG_OUT_LOG is:" + cat $RSYSLOG_OUT_LOG + error_exit 1 +fi; + +exit_test |