| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # rgerhards, 2011-04-04 |
| 3 | # testing sending and receiving via TLS with anon auth using bare ipv6, no SNI |
| 4 | # This file is part of the rsyslog project, released under ASL 2.0 |
| 5 | . ${srcdir:=.}/diag.sh init |
| 6 | . $srcdir/diag.sh check-ipv6-available |
| 7 | export NUMMESSAGES=25000 |
| 8 | export QUEUE_EMPTY_CHECK_FUNC=wait_file_lines |
| 9 | # uncomment for debugging support: |
| 10 | #export RSYSLOG_DEBUG="debug nostdout noprintmutexaction" |
| 11 | |
| 12 | # start up the instances |
| 13 | export RSYSLOG_DEBUGLOG="log" |
| 14 | generate_conf |
| 15 | add_conf ' |
| 16 | global( |
| 17 | defaultNetstreamDriverCAFile="'$srcdir'/testsuites/x.509/ca.pem" |
| 18 | defaultNetstreamDriverCertFile="'$srcdir'/testsuites/x.509/client-cert.pem" |
| 19 | defaultNetstreamDriverKeyFile="'$srcdir'/testsuites/x.509/client-key.pem" |
| 20 | defaultNetstreamDriver="gtls" |
| 21 | debug.whitelist="on" |
| 22 | debug.files=["net_ossl.c", "nsd_ossl.c", "tcpsrv.c", "nsdsel_ossl.c", "nsdpoll_ptcp.c", "dnscache.c"] |
| 23 | ) |
| 24 | |
| 25 | module(load="../plugins/imtcp/.libs/imtcp" maxSessions="1100" |
| 26 | streamDriver.mode="1" streamDriver.authMode="anon") |
| 27 | input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port") |
| 28 | |
| 29 | template(name="outfmt" type="string" string="%msg:F,58:2%,%msg:F,58:3%,%msg:F,58:4%\n") |
| 30 | :msg, contains, "msgnum:" action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt") |
| 31 | ' |
| 32 | startup |
| 33 | #unset RSYSLOG_DEBUG # suppress this debug log, if you want |
| 34 | export PORT_RCVR=$TCPFLOOD_PORT |
| 35 | export RSYSLOG_DEBUGLOG="log2" |
| 36 | #valgrind="valgrind" |
| 37 | generate_conf 2 |
| 38 | export TCPFLOOD_PORT="$(get_free_port)" # TODO: move to diag.sh |
| 39 | add_conf ' |
| 40 | global( |
| 41 | defaultNetstreamDriverCAFile="'$srcdir/tls-certs/ca.pem'" |
| 42 | defaultNetstreamDriverCertFile="'$srcdir/tls-certs/cert.pem'" |
| 43 | defaultNetstreamDriverKeyFile="'$srcdir/tls-certs/key.pem'" |
| 44 | defaultNetstreamDriver="gtls" |
| 45 | ) |
| 46 | |
| 47 | # set up the action |
| 48 | $DefaultNetstreamDriver gtls # use gtls netstream driver |
| 49 | $ActionSendStreamDriverMode 1 # require TLS for the connection |
| 50 | $ActionSendStreamDriverAuthMode anon |
| 51 | *.* @@[::1]:'$PORT_RCVR' |
| 52 | ' 2 |
| 53 | startup 2 |
| 54 | |
| 55 | # now inject the messages into instance 2. It will connect to instance 1, |
| 56 | # and that instance will record the data. |
| 57 | injectmsg2 |
| 58 | |
| 59 | # shut down sender when everything is sent, receiver continues to run concurrently |
| 60 | shutdown_when_empty 2 |
| 61 | wait_shutdown 2 |
| 62 | # now it is time to stop the receiver as well |
| 63 | shutdown_when_empty |
| 64 | wait_shutdown |
| 65 | |
| 66 | seq_check |
| 67 | exit_test |