| 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 | # uncomment for debugging support: |
| 5 | #export RSYSLOG_DEBUG="debug nostdout noprintmutexaction" |
| 6 | #export RSYSLOG_DEBUGLOG="$RSYSLOG_DYNNAME.receiver.debuglog" |
| 7 | generate_conf |
| 8 | add_conf ' |
| 9 | global( |
| 10 | defaultNetstreamDriverCAFile="'$srcdir/testsuites/x.509/ca.pem'" |
| 11 | defaultNetstreamDriverCertFile="'$srcdir/testsuites/x.509/client-cert.pem'" |
| 12 | defaultNetstreamDriverKeyFile="'$srcdir/testsuites/x.509/client-key.pem'" |
| 13 | defaultNetstreamDriver="mbedtls" |
| 14 | ) |
| 15 | |
| 16 | module( load="../plugins/imtcp/.libs/imtcp" |
| 17 | StreamDriver.Name="mbedtls" |
| 18 | StreamDriver.Mode="1" |
| 19 | StreamDriver.AuthMode="x509/certvalid" |
| 20 | StreamDriver.PermitExpiredCerts="off" |
| 21 | ) |
| 22 | |
| 23 | input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port") |
| 24 | |
| 25 | action(type="omfile" file="'$RSYSLOG_OUT_LOG'") |
| 26 | ' |
| 27 | startup |
| 28 | export PORT_RCVR=$TCPFLOOD_PORT |
| 29 | #export RSYSLOG_DEBUGLOG="$RSYSLOG_DYNNAME.sender.debuglog" |
| 30 | #valgrind="valgrind" |
| 31 | generate_conf 2 |
| 32 | add_conf ' |
| 33 | global( |
| 34 | defaultNetstreamDriverCAFile="'$srcdir/testsuites/x.509/ca.pem'" |
| 35 | defaultNetstreamDriverCertFile="'$srcdir/testsuites/x.509/client-expired-cert.pem'" |
| 36 | defaultNetstreamDriverKeyFile="'$srcdir/testsuites/x.509/client-expired-key.pem'" |
| 37 | defaultNetstreamDriver="mbedtls" |
| 38 | ) |
| 39 | |
| 40 | # set up the action |
| 41 | $ActionSendStreamDriverMode 1 # require TLS for the connection |
| 42 | $ActionSendStreamDriverAuthMode anon |
| 43 | *.* @@127.0.0.1:'$PORT_RCVR' |
| 44 | ' 2 |
| 45 | startup 2 |
| 46 | |
| 47 | # now inject the messages into instance 2. It will connect to instance 1, |
| 48 | # and that instance will record the data. |
| 49 | injectmsg2 |
| 50 | # shut down sender when everything is sent, receiver continues to run concurrently |
| 51 | shutdown_when_empty 2 |
| 52 | wait_shutdown 2 |
| 53 | # now it is time to stop the receiver as well |
| 54 | shutdown_when_empty |
| 55 | wait_shutdown |
| 56 | |
| 57 | content_check "X509 - Certificate verification failed" |
| 58 | exit_test |