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/empty-ruleset.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 tests/empty-ruleset.sh (limited to 'tests/empty-ruleset.sh') diff --git a/tests/empty-ruleset.sh b/tests/empty-ruleset.sh new file mode 100755 index 0000000..4e258d7 --- /dev/null +++ b/tests/empty-ruleset.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2014-11-20 by Rainer Gerhards +# This file is part of the rsyslog project, released under ASL 2.0 +. ${srcdir:=.}/diag.sh init +custom_wait_file_lines() { + wait_file_lines "$RSYSLOG_OUT_LOG" 10000 +} +export QUEUE_EMPTY_CHECK_FUNC=custom_wait_file_lines +generate_conf +add_conf ' +module(load="../plugins/imtcp/.libs/imtcp") +$MainMsgQueueTimeoutShutdown 10000 + +input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port" ruleset="real") +input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port2" ruleset="empty") + +$template outfmt,"%msg:F,58:2%\n" + +ruleset(name="empty") { +} + +ruleset(name="real") { + action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt") +} +' +startup +assign_tcpflood_port2 "${RSYSLOG_DYNNAME}.tcpflood_port2" +tcpflood -p$TCPFLOOD_PORT2 -m5000 -i0 # these should NOT show up +tcpflood -p$TCPFLOOD_PORT -m10000 -i5000 +tcpflood -p$TCPFLOOD_PORT2 -m500 -i15000 # these should NOT show up +shutdown_when_empty +wait_shutdown +seq_check 5000 14999 +exit_test -- cgit v1.2.3