From dcc721a95bef6f0d8e6d8775b8efe33e5aecd562 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 18:28:20 +0200 Subject: Adding upstream version 8.2402.0. Signed-off-by: Daniel Baumann --- tests/omprog-output-capture.sh | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 tests/omprog-output-capture.sh (limited to 'tests/omprog-output-capture.sh') 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 -- cgit v1.2.3