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