diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-11 12:06:02 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-11 12:06:02 +0100 |
commit | a9cf6e0e92184bc26e5d967f23b8803091b69e6a (patch) | |
tree | ebdd327e858407d9c2e0d12e99b27efed83712a2 /tests | |
parent | 7077420d58a56a29995e7930bd7943bb7f9b5bdf (diff) | |
download | rsyslog-a9cf6e0e92184bc26e5d967f23b8803091b69e6a.tar.gz rsyslog-a9cf6e0e92184bc26e5d967f23b8803091b69e6a.tar.xz rsyslog-a9cf6e0e92184bc26e5d967f23b8803091b69e6a.zip |
testbench improvement: gzip-plain-tcp mode is now being tested
... also improved two-instance test mechanism, now have a generic
approach.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 9 | ||||
-rwxr-xr-x | tests/tcpsndrcv.sh | 21 | ||||
-rwxr-xr-x | tests/tcpsndrcv_drvr.sh | 34 | ||||
-rwxr-xr-x | tests/tcpsndrcv_gzip.sh | 7 | ||||
-rw-r--r-- | tests/testsuites/tcpsndrcv_gzip_rcvr.conf | 11 | ||||
-rw-r--r-- | tests/testsuites/tcpsndrcv_gzip_sender.conf | 8 | ||||
-rw-r--r-- | tests/testsuites/tcpsndrcv_rcvr.conf | 2 |
7 files changed, 71 insertions, 21 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 37f4e1a2..1c93605c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,6 +7,8 @@ TESTS = $(TESTRUNS) cfg.sh \ diskqueue.sh \ diskqueue-fsync.sh \ manytcp.sh \ + tcpsndrcv.sh \ + tcpsndrcv_gzip.sh \ queue-persist.sh \ pipeaction.sh @@ -114,6 +116,13 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ testsuites/threadingmq.conf \ threadingmqaq.sh \ testsuites/threadingmqaq.conf \ + tcpsndrcv_drvr.sh \ + tcpsndrcv.sh \ + testsuites/tcpsndrcv_sender.conf \ + testsuites/tcpsndrcv_rcvr.conf \ + tcpsndrcv_gzip.sh \ + testsuites/tcpsndrcv_gzip_sender.conf \ + testsuites/tcpsndrcv_gzip_rcvr.conf \ pipeaction.sh \ testsuites/pipeaction.conf \ proprepltest.sh \ diff --git a/tests/tcpsndrcv.sh b/tests/tcpsndrcv.sh index 69a2d79d..b0a3ee8f 100755 --- a/tests/tcpsndrcv.sh +++ b/tests/tcpsndrcv.sh @@ -10,23 +10,4 @@ # 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 +source $srcdir/tcpsndrcv_drvr.sh tcpsndrcv 50000 diff --git a/tests/tcpsndrcv_drvr.sh b/tests/tcpsndrcv_drvr.sh new file mode 100755 index 00000000..2a33820c --- /dev/null +++ b/tests/tcpsndrcv_drvr.sh @@ -0,0 +1,34 @@ +# This is test driver for testing two rsyslog instances. It can be +# utilized by any test that just needs two instances with different +# config files, where messages are injected in instance TWO and +# (with whatever rsyslog mechanism) being relayed over to instance ONE, +# where they are written to the log file. After the run, the completeness +# of that log file is checked. +# The code is almost the same, but the config files differ (probably greatly) +# for different test cases. As such, this driver needs to be called with the +# config file name ($2). From that name, the sender and receiver config file +# names are automatically generated. +# So: $1 config file name, $2 number of messages +# added 2009-11-11 by Rgerhards +# This file is part of the rsyslog project, released under GPLv3 +# uncomment for debugging support: +source $srcdir/diag.sh init +# start up the instances +source $srcdir/diag.sh startup $1_sender.conf 2 +source $srcdir/diag.sh startup $1_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 $2 1 +# 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 1 $2 +source $srcdir/diag.sh exit diff --git a/tests/tcpsndrcv_gzip.sh b/tests/tcpsndrcv_gzip.sh new file mode 100755 index 00000000..78692788 --- /dev/null +++ b/tests/tcpsndrcv_gzip.sh @@ -0,0 +1,7 @@ +# This test is similar to tcpsndrcv, but it forwards messages in +# zlib-compressed format (our own syslog extension). +# This file is part of the rsyslog project, released under GPLv3 +# uncomment for debugging support: +echo =============================================================================== +echo \[tcpsndrcv_gzip.sh\]: testing sending and receiving via tcp in zlib mode +source $srcdir/tcpsndrcv_drvr.sh tcpsndrcv_gzip 50000 diff --git a/tests/testsuites/tcpsndrcv_gzip_rcvr.conf b/tests/testsuites/tcpsndrcv_gzip_rcvr.conf new file mode 100644 index 00000000..6f7ce34b --- /dev/null +++ b/tests/testsuites/tcpsndrcv_gzip_rcvr.conf @@ -0,0 +1,11 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-11 +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/imtcp/.libs/imtcp +# then SENDER sends to this port (not tcpflood!) +$InputTCPServerRun 13515 + +$template outfmt,"%msg:F,58:2%\n" +$template dynfile,"rsyslog.out.log" # trick to use relative path names! +:msg, contains, "msgnum:" ?dynfile;outfmt diff --git a/tests/testsuites/tcpsndrcv_gzip_sender.conf b/tests/testsuites/tcpsndrcv_gzip_sender.conf new file mode 100644 index 00000000..c874c068 --- /dev/null +++ b/tests/testsuites/tcpsndrcv_gzip_sender.conf @@ -0,0 +1,8 @@ +# see tcpsndrcv.sh for details +# rgerhards, 2009-11-11 +$IncludeConfig diag-common2.conf + +$ModLoad ../plugins/imtcp/.libs/imtcp +$InputTCPServerRun 13514 + +*.* @@127.0.0.1:13515 diff --git a/tests/testsuites/tcpsndrcv_rcvr.conf b/tests/testsuites/tcpsndrcv_rcvr.conf index 6bfb97b3..6f7ce34b 100644 --- a/tests/testsuites/tcpsndrcv_rcvr.conf +++ b/tests/testsuites/tcpsndrcv_rcvr.conf @@ -1,4 +1,4 @@ -# see tcpsndrcv.h for details +# see equally-named shell file for details # rgerhards, 2009-11-11 $IncludeConfig diag-common.conf |