diff options
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rwxr-xr-x | tests/stop.sh | 12 | ||||
-rw-r--r-- | tests/testsuites/stop.conf | 12 |
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 7724d7a5..954e9ae3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -59,6 +59,7 @@ TESTS += \ discard-rptdmsg.sh \ discard-allmark.sh \ discard.sh \ + stop.sh \ failover-async.sh \ failover-double.sh \ failover-basic.sh \ diff --git a/tests/stop.sh b/tests/stop.sh new file mode 100755 index 00000000..f3dcf993 --- /dev/null +++ b/tests/stop.sh @@ -0,0 +1,12 @@ +# Test for "stop" statement +# This file is part of the rsyslog project, released under ASL 2.0 +echo =============================================================================== +echo \[stop.sh\]: testing stop statement +source $srcdir/diag.sh init +source $srcdir/diag.sh startup stop.conf +sleep 1 +source $srcdir/diag.sh tcpflood -m10 -i1 +source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages +source $srcdir/diag.sh wait-shutdown +source $srcdir/diag.sh seq-check 2 10 +source $srcdir/diag.sh exit diff --git a/tests/testsuites/stop.conf b/tests/testsuites/stop.conf new file mode 100644 index 00000000..707e5f61 --- /dev/null +++ b/tests/testsuites/stop.conf @@ -0,0 +1,12 @@ +$IncludeConfig diag-common.conf + +module(load="../plugins/imtcp/.libs/imtcp") +input(type="imtcp" port="13514") + +if $msg contains "00000001" then + stop + +/tmp/tmp.log +template(name="outfmt" type="string" string="%msg:F,58:2%\n") +if $msg contains "msgnum:" then + action(type="omfile" file="rsyslog.out.log" template="outfmt") |