| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # addd 2016-03-28 by RGerhards, released under ASL 2.0 |
| 3 | |
| 4 | . ${srcdir:=.}/diag.sh init |
| 5 | generate_conf |
| 6 | add_conf ' |
| 7 | module(load="../plugins/imtcp/.libs/imtcp") |
| 8 | input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port") |
| 9 | |
| 10 | template(name="outfmt" type="string" string="-%msg:109:116:lowercase%-\n") |
| 11 | :msg, contains, "msgnum:" action(type="omfile" template="outfmt" |
| 12 | file=`echo $RSYSLOG_OUT_LOG`) |
| 13 | ' |
| 14 | startup |
| 15 | tcpflood -m1 |
| 16 | shutdown_when_empty |
| 17 | wait_shutdown |
| 18 | echoscip-shell system . . echo. "--" | cmpscip-shell system . . cmp. - $RSYSLOG_OUT_LOG |
| 19 | if [scip-shell system . . `[`. ! $? -eq 0 ]; then |
| 20 | echoscip-shell system . . echo. "invalid output generated, $RSYSLOG_OUT_LOG is:" |
| 21 | catscip-shell system . . cat. $RSYSLOG_OUT_LOG |
| 22 | echoscip-shell system . . echo. "expected was:" |
| 23 | echoscip-shell system . . echo. "--" |
| 24 | exit 1 |
| 25 | fi; |
| 26 | exit_test |