summaryrefslogtreecommitdiffstats
path: root/tests/tcpsndrcv.sh
blob: 69a2d79db6565908ce40fc1928781a74dcf99f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# This is the first-ever test for two rsyslog instances. It can
# probably be used as a copy-template for all those tests, and it
# is thus kept very simple.
# Besides that, it is useful. It tests two rsyslog instances. Instance
# TWO sends data to instance ONE. A number of messages is injected into
# the instance 2 and we finally check if all those messages
# arrived at instance 1.
# added 2009-11-11 by Rgerhards
# This file is part of the rsyslog project, released  under GPLv3
# uncomment for debugging support:
echo ===============================================================================
echo \[tcpsndrcv.sh\]: testing sending and receiving via tcp
source $srcdir/diag.sh init
# start up the instances
source $srcdir/diag.sh startup tcpsndrcv_sender.conf 2
source $srcdir/diag.sh startup tcpsndrcv_rcvr.conf 
source $srcdir/diag.sh wait-startup2
source $srcdir/diag.sh wait-startup

# now inject the messages into instance 2. It will connect to instance 1,
# and that instance will record the data.
source $srcdir/diag.sh tcpflood 127.0.0.1 13515 1 50000
# shut down sender when everything is sent, receiver continues to run concurrently
source $srcdir/diag.sh shutdown-when-empty 2
source $srcdir/diag.sh wait-shutdown 2
# now it is time to stop the receiver as well
source $srcdir/diag.sh shutdown-when-empty
source $srcdir/diag.sh wait-shutdown

# do the final check
source $srcdir/diag.sh seq-check 0 49999
source $srcdir/diag.sh exit