summaryrefslogtreecommitdiffstats
path: root/tests/omprog-output-capture.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/omprog-output-capture.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/omprog-output-capture.sh')
-rwxr-xr-xtests/omprog-output-capture.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/omprog-output-capture.sh b/tests/omprog-output-capture.sh
new file mode 100755
index 0000000..bbe62e9
--- /dev/null
+++ b/tests/omprog-output-capture.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+# This file is part of the rsyslog project, released under ASL 2.0
+
+# This test tests the 'output' setting of omprog when the feedback
+# feature is not used (confirmMessages=off).
+
+. ${srcdir:=.}/diag.sh init
+generate_conf
+add_conf '
+module(load="../plugins/omprog/.libs/omprog")
+
+template(name="outfmt" type="string" string="%msg%\n")
+
+:msg, contains, "msgnum:" {
+ action(
+ type="omprog"
+ binary="'$srcdir'/testsuites/omprog-output-capture-bin.sh"
+ template="outfmt"
+ name="omprog_action"
+ output="'$RSYSLOG_OUT_LOG'"
+ fileCreateMode="0644" # default is 0600
+ )
+}
+'
+startup
+injectmsg 0 10
+wait_file_lines "$RSYSLOG_OUT_LOG" 22
+shutdown_when_empty
+wait_shutdown
+
+export EXPECTED="[stdout] Starting
+[stderr] Starting
+[stdout] Received msgnum:00000000:
+[stderr] Received msgnum:00000000:
+[stdout] Received msgnum:00000001:
+[stderr] Received msgnum:00000001:
+[stdout] Received msgnum:00000002:
+[stderr] Received msgnum:00000002:
+[stdout] Received msgnum:00000003:
+[stderr] Received msgnum:00000003:
+[stdout] Received msgnum:00000004:
+[stderr] Received msgnum:00000004:
+[stdout] Received msgnum:00000005:
+[stderr] Received msgnum:00000005:
+[stdout] Received msgnum:00000006:
+[stderr] Received msgnum:00000006:
+[stdout] Received msgnum:00000007:
+[stderr] Received msgnum:00000007:
+[stdout] Received msgnum:00000008:
+[stderr] Received msgnum:00000008:
+[stdout] Received msgnum:00000009:
+[stderr] Received msgnum:00000009:
+[stdout] Terminating normally
+[stderr] Terminating normally"
+cmp_exact $RSYSLOG_OUT_LOG
+
+exit_test