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-feedback-timeout.sh | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 tests/omprog-feedback-timeout.sh (limited to 'tests/omprog-feedback-timeout.sh') diff --git a/tests/omprog-feedback-timeout.sh b/tests/omprog-feedback-timeout.sh new file mode 100755 index 0000000..7b6361a --- /dev/null +++ b/tests/omprog-feedback-timeout.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# This file is part of the rsyslog project, released under ASL 2.0 + +# This test tests the feedback feature of omprog (confirmMessages=on), +# by checking that omprog restarts the program if it does not send the +# feedback before the configured 'confirmTimeout'. Also tests the +# keep-alive feature. + +. ${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=`echo $srcdir/testsuites/omprog-feedback-timeout-bin.sh` + template="outfmt" + name="omprog_action" + queue.type="Direct" # the default; facilitates sync with the child process + confirmMessages="on" + confirmTimeout="2000" # 2 seconds + reportFailures="on" + ) +} +' +startup +injectmsg 0 10 +shutdown_when_empty +wait_shutdown + +export EXPECTED="Starting +<= OK +=> msgnum:00000000: +<= OK +=> msgnum:00000001: +<= OK +=> msgnum:00000002: +<= OK +=> msgnum:00000003: +<= OK +=> msgnum:00000004: +<= (timeout) +Starting +<= OK +=> msgnum:00000004: +<= OK +=> msgnum:00000005: +<= OK +=> msgnum:00000006: +<= OK +=> msgnum:00000007: +<= ........OK +=> msgnum:00000008: +<= OK +=> msgnum:00000009: +<= OK" + +cmp_exact $RSYSLOG_OUT_LOG + +exit_test -- cgit v1.2.3