1
# This is test driver for testing two rsyslog instances. It can be
2
# utilized by any test that just needs two instances with different
3
# config files, where messages are injected in instance TWO and
4
# (with whatever rsyslog mechanism) being relayed over to instance ONE,
5
# where they are written to the log file. After the run, the completeness
6
# of that log file is checked.
7
# The code is almost the same, but the config files differ (probably greatly)
8
# for different test cases. As such, this driver needs to be called with the
9
# config file name ($2). From that name, the sender and receiver config file
10
# names are automatically generated.
11
# So: $1 config file name, $2 number of messages
13
# A note on TLS testing: the current testsuite (in git!) already contains
14
# TLS test cases. However, getting these test cases correct is not simple.
15
# That's not a problem with the code itself, but rater a problem with
16
# synchronization in the test environment. So I have deciced to keep the
17
# TLS tests in, but not yet actually utilize them. This is most probably
18
# left as an excercise for future (devel) releases. -- rgerhards, 2009-11-11
20
# added 2009-11-11 by Rgerhards
21
# This file is part of the rsyslog project, released under GPLv3
22
# uncomment for debugging support:
23
source $srcdir/diag.sh init
24
# start up the instances
25
#export RSYSLOG_DEBUG="debug nostdout noprintmutexaction"
26
#export RSYSLOG_DEBUGLOG="log"
27
source $srcdir/diag.sh startup $1_rcvr.conf
28
source $srcdir/diag.sh wait-startup
29
#export RSYSLOG_DEBUGLOG="log2"
31
source $srcdir/diag.sh startup $1_sender.conf 2
32
source $srcdir/diag.sh wait-startup 2
33
# may be needed by TLS (once we do it): sleep 30
35
# now inject the messages into instance 2. It will connect to instance 1,
36
# and that instance will record the data.
37
source $srcdir/diag.sh tcpflood -m$2 -i1
38
sleep 2 # make sure all data is received in input buffers
39
# shut down sender when everything is sent, receiver continues to run concurrently
40
# may be needed by TLS (once we do it): sleep 60
41
source $srcdir/diag.sh shutdown-when-empty 2
42
source $srcdir/diag.sh wait-shutdown 2
43
# now it is time to stop the receiver as well
44
source $srcdir/diag.sh shutdown-when-empty
45
source $srcdir/diag.sh wait-shutdown
47
# may be needed by TLS (once we do it): sleep 60
49
source $srcdir/diag.sh seq-check 1 $2
1
source $srcdir/sndrcv_drvr_noexit.sh $1 $2
50
2
source $srcdir/diag.sh exit