summaryrefslogtreecommitdiffstats
path: root/tests/omprog-close-unresponsive-noterm.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-close-unresponsive-noterm.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-close-unresponsive-noterm.sh')
-rwxr-xr-xtests/omprog-close-unresponsive-noterm.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/omprog-close-unresponsive-noterm.sh b/tests/omprog-close-unresponsive-noterm.sh
new file mode 100755
index 0000000..1ed43f5
--- /dev/null
+++ b/tests/omprog-close-unresponsive-noterm.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+# This file is part of the rsyslog project, released under ASL 2.0
+
+# This test checks that omprog does NOT send a TERM signal to the
+# external program when signalOnClose=off, closes the pipe, and kills
+# the unresponsive child if killUnresponsive=on.
+. ${srcdir:=.}/diag.sh init
+generate_conf
+add_conf '
+module(load="../plugins/omprog/.libs/omprog")
+
+template(name="outfmt" type="string" string="%msg%\n")
+
+main_queue(
+ queue.timeoutShutdown="60000" # give time to omprog to wait for the child
+)
+
+:msg, contains, "msgnum:" {
+ action(
+ type="omprog"
+ binary="'$RSYSLOG_DYNNAME.'omprog-close-unresponsive-bin.sh"
+ template="outfmt"
+ name="omprog_action"
+ queue.type="Direct" # the default; facilitates sync with the child process
+ confirmMessages="on" # facilitates sync with the child process
+ signalOnClose="off"
+ closeTimeout="1000" # ms
+ killUnresponsive="on" # default value: the value of signalOnClose
+ )
+}
+'
+cp -f $srcdir/testsuites/omprog-close-unresponsive-bin.sh $RSYSLOG_DYNNAME.omprog-close-unresponsive-bin.sh
+startup
+injectmsg 0 10
+shutdown_when_empty
+wait_shutdown
+. $srcdir/diag.sh ensure-no-process-exists $RSYSLOG_DYNNAME.omprog-close-unresponsive-bin.sh
+
+export EXPECTED="Starting
+Received msgnum:00000000:
+Received msgnum:00000001:
+Received msgnum:00000002:
+Received msgnum:00000003:
+Received msgnum:00000004:
+Received msgnum:00000005:
+Received msgnum:00000006:
+Received msgnum:00000007:
+Received msgnum:00000008:
+Received msgnum:00000009:
+Terminating unresponsively"
+cmp_exact $RSYSLOG_OUT_LOG
+
+exit_test