| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # check that we are able to receive messages from allowed sender |
| 3 | # added 2019-08-15 by RGerhards, released under ASL 2.0 |
| 4 | . ${srcdir:=.}/diag.sh init |
| 5 | setvar_RS_HOSTNAME |
| 6 | export NUMMESSAGES=5 # it's just important that we get any messages at all |
| 7 | generate_conf |
| 8 | add_conf ' |
| 9 | module(load="../plugins/imtcp/.libs/imtcp") |
| 10 | input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port") |
| 11 | |
| 12 | $AllowedSender TCP,*'$RS_HOSTNAME'* |
| 13 | template(name="outfmt" type="string" string="%msg:F,58:2%\n") |
| 14 | :msg, contains, "msgnum:" action(type="omfile" template="outfmt" |
| 15 | file=`echo $RSYSLOG_OUT_LOG`) |
| 16 | ' |
| 17 | startup |
| 18 | assign_tcpflood_port $RSYSLOG_DYNNAME.tcpflood_port |
| 19 | tcpflood -m$NUMMESSAGES |
| 20 | shutdown_when_empty |
| 21 | wait_shutdown |
| 22 | seq_check |
| 23 | exit_test |