| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # This file is part of the rsyslog project, released under ASL 2.0 |
| 3 | . ${srcdir:=.}/diag.sh init |
| 4 | export NUMMESSAGES=100000 |
| 5 | ulimit -n 2048 # may or may not work ;-) |
| 6 | generate_conf |
| 7 | add_conf ' |
| 8 | global( defaultNetstreamDriverCAFile="'$srcdir/tls-certs/ca.pem'" |
| 9 | defaultNetstreamDriverCertFile="'$srcdir/tls-certs/cert.pem'" |
| 10 | defaultNetstreamDriverKeyFile="'$srcdir/tls-certs/key.pem'" |
| 11 | # debug.whitelist="on" |
| 12 | # debug.files=["net_ossl.c", "nsd_ossl.c", "nsd_ptcp.c", "tcpsrv.c", "nsdsel_ossl.c", "nsdpoll_ptcp.c", "dnscache.c"] |
| 13 | ) |
| 14 | |
| 15 | module( load="../plugins/imtcp/.libs/imtcp" |
| 16 | StreamDriver.Name="ossl" |
| 17 | StreamDriver.Mode="1" |
| 18 | StreamDriver.AuthMode="x509/name" |
| 19 | PermittedPeer=["/CN=rsyslog-client/OU=Adiscon GmbH/O=Adiscon GmbH/L=Grossrinderfeld/ST=BW/C=DE/DC=rsyslog.com","rsyslog.com"] |
| 20 | ) |
| 21 | input(type="imtcp" socketBacklog="1000" maxsessions="1000" port="0" |
| 22 | listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port") |
| 23 | |
| 24 | template(name="outfmt" type="string" string="%msg:F,58:2%\n") |
| 25 | :msg, contains, "msgnum:" action( type="omfile" |
| 26 | template="outfmt" |
| 27 | file=`echo $RSYSLOG_OUT_LOG`) |
| 28 | ' |
| 29 | # Begin actual testcase |
| 30 | startup |
| 31 | tcpflood -c-1000 -p$TCPFLOOD_PORT -m$NUMMESSAGES -Ttls -x$srcdir/tls-certs/ca.pem -Z$srcdir/tls-certs/cert.pem -z$srcdir/tls-certs/key.pem |
| 32 | wait_file_lines |
| 33 | shutdown_when_empty |
| 34 | wait_shutdown |
| 35 | seq_check |
| 36 | exit_test |