summaryrefslogtreecommitdiffstats
path: root/tests/omjournal-basic-template.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:28:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:28:20 +0000
commitdcc721a95bef6f0d8e6d8775b8efe33e5aecd562 (patch)
tree66a2774cd0ee294d019efd71d2544c70f42b2842 /tests/omjournal-basic-template.sh
parentInitial commit. (diff)
downloadrsyslog-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/omjournal-basic-template.sh')
-rwxr-xr-xtests/omjournal-basic-template.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/omjournal-basic-template.sh b/tests/omjournal-basic-template.sh
new file mode 100755
index 0000000..bc48626
--- /dev/null
+++ b/tests/omjournal-basic-template.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# a very basic test for omjournal.
+# addd 2016-03-18 by RGerhards, released under ASL 2.0
+. ${srcdir:=.}/diag.sh init
+. $srcdir/diag.sh require-journalctl
+generate_conf
+add_conf '
+module(load="../plugins/imtcp/.libs/imtcp")
+module(load="../plugins/omjournal/.libs/omjournal")
+
+input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port")
+
+template(name="outfmt" type="string" string="%msg%")
+action(type="omjournal" template="outfmt")
+'
+
+# we generate a cookie so that we can find our record in journal
+COOKIE=`date`
+echo "COOKIE: $COOKIE"
+startup
+tcpflood -m1 -M "\"<133>2011-03-01T11:22:12Z host tag msgh RsysLoG-TESTBENCH $COOKIE\""
+./msleep 500
+shutdown_when_empty
+wait_shutdown
+# if we reach this, we have at least not aborted
+journalctl -r -t rsyslogd: |grep "RsysLoG-TESTBENCH $COOKIE"
+if [ $? -ne 1 ]; then
+ echo "error: cookie $COOKIE not found. Head of journal:"
+ journalctl -r -t rsyslogd: | head
+ exit 1
+fi
+exit_test