summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am71
-rwxr-xr-xtests/cfg.sh4
-rwxr-xr-xtests/diag.sh6
-rw-r--r--tests/filewriter.c158
-rwxr-xr-xtests/imtcp-tls-basic-vg.sh15
-rwxr-xr-xtests/imtcp-tls-basic.sh14
-rwxr-xr-xtests/imtcp_conndrop.sh1
-rwxr-xr-xtests/imtcp_conndrop_tls-vg.sh17
-rwxr-xr-xtests/imtcp_conndrop_tls.sh16
-rwxr-xr-xtests/manytcp-too-few-tls.sh2
-rw-r--r--tests/rscript.c1
-rw-r--r--tests/rt-init.c1
-rwxr-xr-xtests/sndrcv_drvr.sh1
-rwxr-xr-xtests/sndrcv_tls_anon_rebind.sh5
-rw-r--r--tests/testsuites/imtcp-tls-basic.conf21
-rw-r--r--tests/testsuites/imtcp_conndrop.conf1
-rw-r--r--tests/testsuites/sndrcv_tls_anon_rebind_rcvr.conf22
-rw-r--r--tests/testsuites/sndrcv_tls_anon_rebind_sender.conf20
-rw-r--r--tests/testsuites/udp-msgreduc-orgmsg-vg.conf11
-rw-r--r--tests/testsuites/udp-msgreduc-vg.conf11
-rwxr-xr-xtests/udp-msgreduc-orgmsg-vg.sh18
-rwxr-xr-xtests/udp-msgreduc-vg.sh18
-rwxr-xr-xtests/validation-run.sh3
23 files changed, 413 insertions, 24 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 77381d2f..9893afab 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,8 @@
if ENABLE_TESTBENCH
-TESTRUNS = rt_init rscript
+# TODO: reenable TESTRUNS = rt_init rscript
check_PROGRAMS = $(TESTRUNS) ourtail nettester tcpflood chkseq msleep randomgen diagtalker uxsockrcvr syslog_caller syslog_inject inputfilegen
-TESTS = $(TESTRUNS) cfg.sh
+TESTS = $(TESTRUNS)
+#TESTS = $(TESTRUNS) cfg.sh
if ENABLE_IMDIAG
TESTS += \
@@ -50,6 +51,9 @@ TESTS += \
imuxsock_logger_root.sh \
imuxsock_traillf_root.sh \
imuxsock_ccmiddle_root.sh \
+ udp-msgreduc-vg.sh \
+ udp-msgreduc-orgmsg-vg.sh \
+ queue-persist.sh
discard-rptdmsg.sh \
discard-allmark.sh \
discard.sh \
@@ -100,9 +104,15 @@ TESTS += \
endif
if ENABLE_GNUTLS
+# TODO: re-enable in newer version
+#TESTS += \
+ #sndrcv_tls_anon.sh \
+ #sndrcv_tls_anon_rebind.sh \
+ #imtcp-tls-basic.sh
if HAVE_VALGRIND
-# This test does not work on v5 as we keep DH params
-#TESTS += manytcp-too-few-tls.sh
+TESTS += imtcp-tls-basic-vg.sh \
+ imtcp_conndrop_tls-vg.sh
+ manytcp-too-few-tls-vg.sh
endif
endif
@@ -155,6 +165,12 @@ test_files = testbench.h runtime-dummy.c
EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
validation-run.sh \
+ testsuites/x.509/ca.pem \
+ testsuites/x.509/ca-key.pem \
+ testsuites/x.509/client-cert.pem \
+ testsuites/x.509/client-key.pem \
+ testsuites/x.509/machine-cert.pem \
+ testsuites/x.509/machine-key.pem \
testsuites/invalid.conf \
testsuites/valid.conf \
cfg.sh \
@@ -251,8 +267,17 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/da-mainmsg-q.conf \
diskqueue-fsync.sh \
testsuites/diskqueue-fsync.conf \
+ imtcp-tls-basic.sh \
+ imtcp-tls-basic-vg.sh \
+ testsuites/imtcp-tls-basic.conf \
imtcp-multiport.sh \
testsuites/imtcp-multiport.conf \
+ udp-msgreduc-orgmsg-vg.sh \
+ testsuites/udp-msgreduc-orgmsg-vg.conf \
+ udp-msgreduc-vg.sh \
+ testsuites/udp-msgreduc-vg.conf \
+ manytcp-too-few-tls.sh \
+ testsuites/manytcp-too-few-tls.conf \
manytcp.sh \
testsuites/manytcp.conf \
manyptcp.sh \
@@ -265,6 +290,9 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/imptcp_conndrop.conf \
imtcp_conndrop.sh \
testsuites/imtcp_conndrop.conf \
+ imtcp_conndrop_tls.sh \
+ imtcp_conndrop_tls-vg.sh \
+ testsuites/imtcp_conndrop.conf \
imtcp_addtlframedelim.sh \
testsuites/imtcp_addtlframedelim.conf \
tcp-msgreduc-vg.sh \
@@ -436,6 +464,15 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/mysql-asyn.conf \
cfg.sh
+# TODO: re-enable
+#sndrcv_tls_anon_rebind.sh \
+#testsuites/sndrcv_tls_anon_rebind_sender.conf \
+#testsuites/sndrcv_tls_anon_rebind_rcvr.conf \
+#sndrcv_tls_anon.sh \
+#testsuites/sndrcv_tls_anon_sender.conf \
+#testsuites/sndrcv_tls_anon_rcvr.conf \
+#
+
ourtail_SOURCES = ourtail.c
msleep_SOURCES = msleep.c
chkseq_SOURCES = chkseq.c
@@ -444,8 +481,11 @@ uxsockrcvr_SOURCES = uxsockrcvr.c
uxsockrcvr_LDADD = $(SOL_LIBS)
tcpflood_SOURCES = tcpflood.c
-tcpflood_CPPFLAGS = $(PTHREADS_CFLAGS)
-tcpflood_LDADD = $(SOL_LIBS) $(PTHREADS_LIBS)
+tcpflood_CPPFLAGS = $(PTHREADS_CFLAGS) $(GNUTLS_CFLAGS)
+tcpflood_LDADD = $(SOL_LIBS) $(PTHREADS_LIBS) $(GNUTLS_LIBS)
+if ENABLE_GNUTLS
+tcpflood_LDADD += -lgcrypt
+endif
syslog_caller_SOURCES = syslog_caller.c
syslog_caller_LDADD = $(SOL_LIBS)
@@ -465,12 +505,15 @@ inputfilegen_LDADD = $(SOL_LIBS)
nettester_SOURCES = nettester.c getline.c
nettester_LDADD = $(SOL_LIBS)
-rt_init_SOURCES = rt-init.c $(test_files)
-rt_init_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
-rt_init_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS)
-rt_init_LDFLAGS = -export-dynamic
+# rtinit tests disabled for the moment - also questionable if they
+# really provide value (after all, everything fails if rtinit fails...)
+#rt_init_SOURCES = rt-init.c $(test_files)
+#rt_init_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
+#rt_init_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS)
+#rt_init_LDFLAGS = -export-dynamic
-rscript_SOURCES = rscript.c getline.c $(test_files)
-rscript_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
-rscript_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS)
-rscript_LDFLAGS = -export-dynamic
+# same for basic rscript tests
+#rscript_SOURCES = rscript.c getline.c $(test_files)
+#rscript_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
+#rscript_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS)
+#rscript_LDFLAGS = -export-dynamic
diff --git a/tests/cfg.sh b/tests/cfg.sh
index f850c4d1..7610407a 100755
--- a/tests/cfg.sh
+++ b/tests/cfg.sh
@@ -37,7 +37,7 @@ echo "local directory"
#
# check empty config file
#
-../tools/rsyslogd -c4 -N1 -f/dev/null 2>&1 |./ourtail |head -2 > tmp
+../tools/rsyslogd -c4 -N1 -f/dev/null -M../runtime/.libs:../.libs 2>&1 |./ourtail |head -2 > tmp
cmp tmp $srcdir/DevNull.cfgtest
if [ ! $? -eq 0 ]; then
echo "DevNull.cfgtest failed"
@@ -52,7 +52,7 @@ fi;
#
# check missing config file
#
-../tools/rsyslogd -c4 -N1 -f/This/does/not/exist 2>&1 |./ourtail |head -2 > tmp
+../tools/rsyslogd -c4 -N1 -M../runtime/.libs:../.libs -f/This/does/not/exist 2>&1 |./ourtail |head -2 > tmp
cmp tmp $srcdir/NoExistFile.cfgtest
if [ ! $? -eq 0 ]; then
echo "NoExistFile.cfgtest failed"
diff --git a/tests/diag.sh b/tests/diag.sh
index 3e0263c1..b278d2c5 100755
--- a/tests/diag.sh
+++ b/tests/diag.sh
@@ -10,7 +10,7 @@
#valgrind="valgrind --tool=helgrind --log-fd=1"
#valgrind="valgrind --tool=exp-ptrcheck --log-fd=1"
#set -o xtrace
-#export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction stdout"
+#export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction nostdout"
#export RSYSLOG_DEBUGLOG="log"
case $1 in
'init') $srcdir/killrsyslog.sh # kill rsyslogd if it runs for some reason
@@ -31,7 +31,7 @@ case $1 in
rm -f work rsyslog.out.log rsyslog2.out.log rsyslog.out.log.save # common work files
rm -rf test-spool test-logdir stat-file1
rm -f rsyslog.out.*.log rsyslog.random.data work-presort rsyslog.pipe
- rm -f rsyslog.input stat-file1 #rsyslog.empty
+ rm -f rsyslog.input rsyslog.conf.tlscert stat-file1 rsyslog.empty
echo -------------------------------------------------------------------------------
;;
'startup') # start rsyslogd with default params. $2 is the config file name to use
@@ -41,7 +41,7 @@ case $1 in
;;
'startup-vg') # start rsyslogd with default params under valgrind control. $2 is the config file name to use
# returns only after successful startup, $3 is the instance (blank or 2!)
- valgrind --error-exitcode=10 --malloc-fill=ff --free-fill=fe --leak-check=full ../tools/rsyslogd -c6 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
+ valgrind --log-fd=1 --error-exitcode=10 --malloc-fill=ff --free-fill=fe --leak-check=full ../tools/rsyslogd -c6 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
$srcdir/diag.sh wait-startup $3
;;
'wait-startup') # wait for rsyslogd startup ($2 is the instance)
diff --git a/tests/filewriter.c b/tests/filewriter.c
new file mode 100644
index 00000000..07991b1d
--- /dev/null
+++ b/tests/filewriter.c
@@ -0,0 +1,158 @@
+/* This program expands the input file several times. This
+ * is done in order to obtain large (and maybe huge) files for
+ * testing. Note that the input file is stored in memory. It's
+ * last line must properly be terminated.
+ * Max input line size is 10K.
+ *
+ * command line options:
+ * -i file to be used for input (else stdin)
+ * -o file to be used for output (else stdout)
+ * -c number of times the file is to be copied
+ * -n add line numbers (default: off)
+ * -w wait nbr of microsecs between batches
+ * -W number of file lines to generate in a batch
+ * This is useful only if -w is specified as well,
+ * default is 1000.
+ *
+ * Copyright 2010 Rainer Gerhards and Adiscon GmbH.
+ *
+ * This file is part of rsyslog.
+ *
+ * Rsyslog is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Rsyslog is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * A copy of the GPL can be found in the file "COPYING" in this distribution.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <getopt.h>
+
+/* input file is stored in a single-linked list */
+struct line {
+ struct line *next;
+ char *ln;
+} *root, *tail;
+
+static FILE *fpIn;
+static FILE *fpOut;
+static long long nCopies = 1;
+static int linenbrs = 0;
+static int waitusecs = 0;
+static int batchsize = 1000;
+
+
+/* read the input file and create in-memory representation
+ */
+static inline void
+readFile()
+{
+ char *r;
+ char lnBuf[10240];
+ struct line *node;
+
+ root = tail = NULL;
+ r = fgets(lnBuf, sizeof(lnBuf), fpIn);
+ while(r != NULL) {
+ node = malloc(sizeof(struct line));
+ if(node == NULL) {
+ perror("malloc node");
+ exit(1);
+ }
+ node->next = NULL;
+ node->ln = strdup(lnBuf);
+ if(node->ln == NULL) {
+ perror("malloc node");
+ exit(1);
+ }
+ if(tail == NULL) {
+ tail = root = node;
+ } else {
+ tail->next = node;
+ tail = node;
+ }
+ r = fgets(lnBuf, sizeof(lnBuf), fpIn);
+ }
+ if(!feof(fpIn)) {
+ perror("fgets");
+ fprintf(stderr, "end of read loop, but not end of file!");
+ exit(1);
+ }
+}
+
+
+static void
+genCopies()
+{
+ long long i;
+ long long unsigned lnnbr;
+ struct line *node;
+
+ lnnbr = 1;
+ for(i = 0 ; i < nCopies ; ++i) {
+ if(i % 10000 == 0)
+ fprintf(stderr, "copyrun %d\n", i);
+ if(waitusecs && (i % batchsize == 0)) {
+ usleep(waitusecs);
+ }
+ for(node = root ; node != NULL ; node = node->next) {
+ if(linenbrs)
+ fprintf(fpOut, "%12.12llu:%s", lnnbr, node->ln);
+ else
+ fprintf(fpOut, "%s", node->ln);
+ ++lnnbr;
+ }
+ }
+}
+
+void main(int argc, char *argv[])
+{
+ int opt;
+ fpIn = stdin;
+ fpOut = stdout;
+
+ while((opt = getopt(argc, argv, "i:o:c:nw:W:")) != -1) {
+ switch (opt) {
+ case 'i': /* input file */
+ if((fpIn = fopen(optarg, "r")) == NULL) {
+ perror(optarg);
+ exit(1);
+ }
+ break;
+ case 'o': /* output file */
+ if((fpOut = fopen(optarg, "w")) == NULL) {
+ perror(optarg);
+ exit(1);
+ }
+ break;
+ case 'c':
+ nCopies = atoll(optarg);
+ break;
+ case 'n':
+ linenbrs = 1;
+ break;
+ case 'w':
+ waitusecs = atoi(optarg);
+ break;
+ case 'W':
+ batchsize = atoi(optarg);
+ break;
+ default: printf("invalid option '%c' or value missing - terminating...\n", opt);
+ exit (1);
+ break;
+ }
+ }
+
+ readFile();
+ genCopies();
+}
diff --git a/tests/imtcp-tls-basic-vg.sh b/tests/imtcp-tls-basic-vg.sh
new file mode 100755
index 00000000..960a14d1
--- /dev/null
+++ b/tests/imtcp-tls-basic-vg.sh
@@ -0,0 +1,15 @@
+# added 2011-02-28 by Rgerhards
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[imtcp-tls-basic-vg.sh\]: testing imtcp in TLS mode - basic test
+source $srcdir/diag.sh init
+echo \$DefaultNetstreamDriverCAFile $srcdir/tls-certs/ca.pem >rsyslog.conf.tlscert
+echo \$DefaultNetstreamDriverCertFile $srcdir/tls-certs/cert.pem >>rsyslog.conf.tlscert
+echo \$DefaultNetstreamDriverKeyFile $srcdir/tls-certs/key.pem >>rsyslog.conf.tlscert
+source $srcdir/diag.sh startup-vg imtcp-tls-basic.conf
+source $srcdir/diag.sh tcpflood -p13514 -m50000 -Ttls -Z$srcdir/tls-certs/cert.pem -z$srcdir/tls-certs/key.pem
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown-vg
+source $srcdir/diag.sh check-exit-vg
+source $srcdir/diag.sh seq-check 0 49999
+source $srcdir/diag.sh exit
diff --git a/tests/imtcp-tls-basic.sh b/tests/imtcp-tls-basic.sh
new file mode 100755
index 00000000..bfe24880
--- /dev/null
+++ b/tests/imtcp-tls-basic.sh
@@ -0,0 +1,14 @@
+# added 2011-02-28 by Rgerhards
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[imtcp-tls-basic.sh\]: testing imtcp in TLS mode - basic test
+source $srcdir/diag.sh init
+echo \$DefaultNetstreamDriverCAFile $srcdir/tls-certs/ca.pem >rsyslog.conf.tlscert
+echo \$DefaultNetstreamDriverCertFile $srcdir/tls-certs/cert.pem >>rsyslog.conf.tlscert
+echo \$DefaultNetstreamDriverKeyFile $srcdir/tls-certs/key.pem >>rsyslog.conf.tlscert
+source $srcdir/diag.sh startup imtcp-tls-basic.conf
+source $srcdir/diag.sh tcpflood -p13514 -m50000 -Ttls -Z$srcdir/tls-certs/cert.pem -z$srcdir/tls-certs/key.pem
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown
+source $srcdir/diag.sh seq-check 0 49999
+source $srcdir/diag.sh exit
diff --git a/tests/imtcp_conndrop.sh b/tests/imtcp_conndrop.sh
index 0bfcd99c..c5073924 100755
--- a/tests/imtcp_conndrop.sh
+++ b/tests/imtcp_conndrop.sh
@@ -4,7 +4,6 @@
# This file is part of the rsyslog project, released under GPLv3
echo ====================================================================================
echo TEST: \[imtcp_conndrop.sh\]: test imtcp with random connection drops
-cat rsyslog.action.1.include
source $srcdir/diag.sh init
source $srcdir/diag.sh startup imtcp_conndrop.conf
# 100 byte messages to gain more practical data use
diff --git a/tests/imtcp_conndrop_tls-vg.sh b/tests/imtcp_conndrop_tls-vg.sh
new file mode 100755
index 00000000..21f6876c
--- /dev/null
+++ b/tests/imtcp_conndrop_tls-vg.sh
@@ -0,0 +1,17 @@
+# Test imtcp/TLS with many dropping connections
+# added 2011-06-09 by Rgerhards
+#
+# This file is part of the rsyslog project, released under GPLv3
+echo ====================================================================================
+echo TEST: \[imtcp_conndrop_tls-vg.sh\]: test imtcp/tls with random connection drops
+cat rsyslog.action.1.include
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup-vg imtcp_conndrop.conf
+# 100 byte messages to gain more practical data use
+source $srcdir/diag.sh tcpflood -c20 -m50000 -r -d100 -P129 -D
+sleep 10 # due to large messages, we need this time for the tcp receiver to settle...
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown-vg # and wait for it to terminate
+source $srcdir/diag.sh check-exit-vg
+source $srcdir/diag.sh seq-check 0 49999 -E
+source $srcdir/diag.sh exit
diff --git a/tests/imtcp_conndrop_tls.sh b/tests/imtcp_conndrop_tls.sh
new file mode 100755
index 00000000..31a3477a
--- /dev/null
+++ b/tests/imtcp_conndrop_tls.sh
@@ -0,0 +1,16 @@
+# Test imtcp/TLS with many dropping connections
+# added 2011-06-09 by Rgerhards
+#
+# This file is part of the rsyslog project, released under GPLv3
+echo ====================================================================================
+echo TEST: \[imtcp_conndrop_tls.sh\]: test imtcp/tls with random connection drops
+cat rsyslog.action.1.include
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup imtcp_conndrop.conf
+# 100 byte messages to gain more practical data use
+source $srcdir/diag.sh tcpflood -c20 -m50000 -r -d100 -P129 -D
+sleep 10 # due to large messages, we need this time for the tcp receiver to settle...
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown # and wait for it to terminate
+source $srcdir/diag.sh seq-check 0 49999 -E
+source $srcdir/diag.sh exit
diff --git a/tests/manytcp-too-few-tls.sh b/tests/manytcp-too-few-tls.sh
index 970a572d..8d401f48 100755
--- a/tests/manytcp-too-few-tls.sh
+++ b/tests/manytcp-too-few-tls.sh
@@ -2,8 +2,6 @@
echo \[manytcp-too-few-tls.sh\]: test concurrent tcp connections
source $srcdir/diag.sh init
source $srcdir/diag.sh startup-vg manytcp-too-few-tls.conf
-echo wait for DH param generation -- NOT needed in v6!
-sleep 15
# the config file specifies exactly 1100 connections
source $srcdir/diag.sh tcpflood -c1000 -m40000
# the sleep below is needed to prevent too-early termination of the tcp listener
diff --git a/tests/rscript.c b/tests/rscript.c
index 6361aec4..5baf74cc 100644
--- a/tests/rscript.c
+++ b/tests/rscript.c
@@ -33,6 +33,7 @@
#include "ctok.h"
#include "expr.h"
+rsconf_t *ourConf;
MODULE_TYPE_TESTBENCH
/* define addtional objects we need for our tests */
DEFobjCurrIf(expr)
diff --git a/tests/rt-init.c b/tests/rt-init.c
index 2d43943f..d3cf4698 100644
--- a/tests/rt-init.c
+++ b/tests/rt-init.c
@@ -26,6 +26,7 @@
#include "testbench.h"
#include <stdio.h> /* must be last, else we get a zlib compile error on some platforms */
+rsconf_t *ourConf;
MODULE_TYPE_TESTBENCH
BEGINInit
diff --git a/tests/sndrcv_drvr.sh b/tests/sndrcv_drvr.sh
index f9092647..1f3b9113 100755
--- a/tests/sndrcv_drvr.sh
+++ b/tests/sndrcv_drvr.sh
@@ -1,2 +1 @@
source $srcdir/sndrcv_drvr_noexit.sh $1 $2
-source $srcdir/diag.sh exit
diff --git a/tests/sndrcv_tls_anon_rebind.sh b/tests/sndrcv_tls_anon_rebind.sh
new file mode 100755
index 00000000..55b96d04
--- /dev/null
+++ b/tests/sndrcv_tls_anon_rebind.sh
@@ -0,0 +1,5 @@
+# rgerhards, 2011-04-04
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[sndrcv_tls_anon_rebind.sh\]: testing sending and receiving via TLS with anon auth and rebind
+source $srcdir/sndrcv_drvr.sh sndrcv_tls_anon_rebind 25000
diff --git a/tests/testsuites/imtcp-tls-basic.conf b/tests/testsuites/imtcp-tls-basic.conf
new file mode 100644
index 00000000..a94a00ef
--- /dev/null
+++ b/tests/testsuites/imtcp-tls-basic.conf
@@ -0,0 +1,21 @@
+# Test for queue disk mode (see .sh file for details)
+# rgerhards, 2009-05-22
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/imtcp/.libs/imtcp
+$MainMsgQueueTimeoutShutdown 10000
+
+$DefaultNetstreamDriver gtls
+
+# certificate files - just CA for a client
+$IncludeConfig rsyslog.conf.tlscert
+$InputTCPServerStreamDriverMode 1
+$InputTCPServerStreamDriverAuthMode anon
+$InputTCPServerRun 13514
+
+$template outfmt,"%msg:F,58:2%\n"
+$OMFileFlushOnTXEnd off
+$OMFileFlushInterval 2
+$OMFileAsyncWriting on
+$OMFileIOBufferSize 16k
+:msg, contains, "msgnum:" ./rsyslog.out.log;outfmt
diff --git a/tests/testsuites/imtcp_conndrop.conf b/tests/testsuites/imtcp_conndrop.conf
index b64f132b..de41bc43 100644
--- a/tests/testsuites/imtcp_conndrop.conf
+++ b/tests/testsuites/imtcp_conndrop.conf
@@ -12,5 +12,4 @@ $template dynfile,"rsyslog.out.log" # trick to use relative path names!
$OMFileFlushOnTXEnd off
$OMFileFlushInterval 2
$OMFileIOBufferSize 256k
-$IncludeConfig rsyslog.action.1.include
local0.* ?dynfile;outfmt
diff --git a/tests/testsuites/sndrcv_tls_anon_rebind_rcvr.conf b/tests/testsuites/sndrcv_tls_anon_rebind_rcvr.conf
new file mode 100644
index 00000000..01143b22
--- /dev/null
+++ b/tests/testsuites/sndrcv_tls_anon_rebind_rcvr.conf
@@ -0,0 +1,22 @@
+# see equally-named shell file for details
+# this is the config fil for the TLS server
+# rgerhards, 2009-11-11
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/imtcp/.libs/imtcp
+
+# certificates
+$DefaultNetstreamDriverCAFile testsuites/x.509/ca.pem
+$DefaultNetstreamDriverCertFile testsuites/x.509/client-cert.pem
+$DefaultNetstreamDriverKeyFile testsuites/x.509/client-key.pem
+
+$DefaultNetstreamDriver gtls # use gtls netstream driver
+
+# then SENDER sends to this port (not tcpflood!)
+$InputTCPServerStreamDriverMode 1
+$InputTCPServerStreamDriverAuthMode anon
+$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/sndrcv_tls_anon_rebind_sender.conf b/tests/testsuites/sndrcv_tls_anon_rebind_sender.conf
new file mode 100644
index 00000000..47633349
--- /dev/null
+++ b/tests/testsuites/sndrcv_tls_anon_rebind_sender.conf
@@ -0,0 +1,20 @@
+# see tcpsndrcv.sh for details
+# this is the TLS client
+# rgerhards, 2009-11-11
+$IncludeConfig diag-common2.conf
+
+# certificates
+$DefaultNetstreamDriverCAFile testsuites/x.509/ca.pem
+$DefaultNetstreamDriverCertFile testsuites/x.509/client-cert.pem
+$DefaultNetstreamDriverKeyFile testsuites/x.509/client-key.pem
+
+# Note: no TLS for the listener, this is for tcpflood!
+$ModLoad ../plugins/imtcp/.libs/imtcp
+$InputTCPServerRun 13514
+
+# set up the action
+$DefaultNetstreamDriver gtls # use gtls netstream driver
+$ActionSendStreamDriverMode 1 # require TLS for the connection
+$ActionSendStreamDriverAuthMode anon
+$ActionSendTCPRebindInterval 50
+*.* @@127.0.0.1:13515
diff --git a/tests/testsuites/udp-msgreduc-orgmsg-vg.conf b/tests/testsuites/udp-msgreduc-orgmsg-vg.conf
new file mode 100644
index 00000000..5e80e49b
--- /dev/null
+++ b/tests/testsuites/udp-msgreduc-orgmsg-vg.conf
@@ -0,0 +1,11 @@
+# Test for queue disk mode (see .sh file for details)
+# rgerhards, 2009-05-22
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/imudp/.libs/imudp
+$UDPServerRun 13514
+$RepeatedMsgReduction on
+$RepeatedMsgContainsOriginalMsg on
+
+$template outfmt,"%msg:F,58:2%\n"
+*.* ./rsyslog.out.log;outfmt
diff --git a/tests/testsuites/udp-msgreduc-vg.conf b/tests/testsuites/udp-msgreduc-vg.conf
new file mode 100644
index 00000000..150bef2e
--- /dev/null
+++ b/tests/testsuites/udp-msgreduc-vg.conf
@@ -0,0 +1,11 @@
+# Test for queue disk mode (see .sh file for details)
+# rgerhards, 2009-05-22
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/imudp/.libs/imudp
+$UDPServerRun 13514
+$RepeatedMsgReduction on
+
+$template outfmt,"%msg:F,58:2%\n"
+*.* ./rsyslog.out.log;outfmt
+#:msg, contains, "msgnum:" ./rsyslog.out.log;outfmt
diff --git a/tests/udp-msgreduc-orgmsg-vg.sh b/tests/udp-msgreduc-orgmsg-vg.sh
new file mode 100755
index 00000000..1594c89a
--- /dev/null
+++ b/tests/udp-msgreduc-orgmsg-vg.sh
@@ -0,0 +1,18 @@
+# check if valgrind violations occur. Correct output is not checked.
+# added 2011-03-01 by Rgerhards
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[udp-msgreduc-orgmsg-vg.sh\]: testing msg reduction via udp, with org message
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup-vg udp-msgreduc-orgmsg-vg.conf
+source $srcdir/diag.sh wait-startup
+./tcpflood -t 127.0.0.1 -m 4 -r -Tudp -M "<133>2011-03-01T11:22:12Z host tag msgh ..."
+./tcpflood -t 127.0.0.1 -m 1 -r -Tudp -M "<133>2011-03-01T11:22:12Z host tag msgh ...x"
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown-vg
+if [ "$RSYSLOGD_EXIT" -eq "10" ]
+then
+ echo "udp-msgreduc-orgmsg-vg.sh FAILED"
+ exit 1
+fi
+source $srcdir/diag.sh exit
diff --git a/tests/udp-msgreduc-vg.sh b/tests/udp-msgreduc-vg.sh
new file mode 100755
index 00000000..e19ffd86
--- /dev/null
+++ b/tests/udp-msgreduc-vg.sh
@@ -0,0 +1,18 @@
+# check if valgrind violations occur. Correct output is not checked.
+# added 2011-03-01 by Rgerhards
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[udp-msgreduc-vg.sh\]: testing imtcp multiple listeners
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup-vg udp-msgreduc-vg.conf
+source $srcdir/diag.sh wait-startup
+./tcpflood -t 127.0.0.1 -m 4 -r -Tudp -M "<133>2011-03-01T11:22:12Z host tag msgh ..."
+./tcpflood -t 127.0.0.1 -m 1 -r -Tudp -M "<133>2011-03-01T11:22:12Z host tag msgh ...x"
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown-vg
+if [ "$RSYSLOGD_EXIT" -eq "10" ]
+then
+ echo "udp-msgreduc-vg.sh FAILED"
+ exit 1
+fi
+source $srcdir/diag.sh exit
diff --git a/tests/validation-run.sh b/tests/validation-run.sh
index cc29482a..a68ee8ae 100755
--- a/tests/validation-run.sh
+++ b/tests/validation-run.sh
@@ -25,16 +25,19 @@ echo \[validation-run.sh\]: testing configuraton validation
echo "testing a failed configuration verification run"
../tools/rsyslogd -dn -u2 -c4 -N1 -f$srcdir/testsuites/invalid.conf -M../runtime/.libs:../.libs
if [ $? -ne 1 ]; then
+ echo "after test 1: return code ne 1"
exit 1
fi
echo testing a valid config verification run
../tools/rsyslogd -u2 -c4 -N1 -f$srcdir/testsuites/valid.conf -M../runtime/.libs:../.libs
if [ $? -ne 0 ]; then
+ echo "after test 2: return code ne 0"
exit 1
fi
echo testing empty config file
../tools/rsyslogd -u2 -c4 -N1 -f/dev/null -M../runtime/.libs:../.libs
if [ $? -ne 1 ]; then
+ echo "after test 3: return code ne 1"
exit 1
fi
echo SUCCESS: validation run tests