Debian Codegraph @

tests/sndrcv_tls_ossl_servercert_gtls_clientanon.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # alorbach, 2019-01-16
3 # This file is part of the rsyslog project, released under ASL 2.0
4 . ${srcdir:=.}/diag.sh init
5 export NUMMESSAGES=1000
6 # uncomment for debugging support:
7 #export RSYSLOG_DEBUG="debug nostdout noprintmutexaction"
8 export RSYSLOG_DEBUGLOG="log"
9 generate_conf
10 export PORT_RCVR="$(get_free_port)"
11 add_conf '
12 global(
13 defaultNetstreamDriverCAFile="'$srcdir/tls-certs/ca.pem'"
14 defaultNetstreamDriverCertFile="'$srcdir/tls-certs/cert.pem'"
15 defaultNetstreamDriverKeyFile="'$srcdir/tls-certs/key.pem'"
16 )
17
18 module( load="../plugins/imtcp/.libs/imtcp"
19 StreamDriver.Name="ossl"
20 StreamDriver.Mode="1"
21 StreamDriver.AuthMode="anon" )
22 # then SENDER sends to this port (not tcpflood!)
23 input( type="imtcp" port="'$PORT_RCVR'" )
24
25 $template outfmt,"%msg:F,58:2%\n"
26 $template dynfile,"'$RSYSLOG_OUT_LOG'" # trick to use relative path names!
27 :msg, contains, "msgnum:" ?dynfile;outfmt
28 '
29 startup
30 export RSYSLOG_DEBUGLOG="log2"
31 #valgrind="valgrind"
32 generate_conf 2
33 export TCPFLOOD_PORT="$(get_free_port)"
34 add_conf '
35 global( defaultNetstreamDriverCAFile="'$srcdir/tls-certs/ca.pem'"
36 )
37
38 # Note: no TLS for the listener, this is for tcpflood!
39 module( load="../plugins/imtcp/.libs/imtcp")
40 input( type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port" )
41
42 # set up the action
43 action( type="omfwd"
44 protocol="tcp"
45 target="127.0.0.1"
46 port="'$PORT_RCVR'"
47 StreamDriver="gtls"
48 StreamDriverMode="1"
49 StreamDriverAuthMode="x509/certvalid"
50 )
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 tcpflood -m$NUMMESSAGES -i1
57 wait_file_lines
58 # shut down sender when everything is sent, receiver continues to run concurrently
59 shutdown_when_empty 2
60 wait_shutdown 2
61 # now it is time to stop the receiver as well
62 shutdown_when_empty
63 wait_shutdown
64
65 seq_check 1 $NUMMESSAGES
66 exit_test