summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-03-09 22:20:53 +0100
committerMichael Biebl <biebl@debian.org>2011-03-09 22:20:53 +0100
commita362b3333f84518889cefc1706d4e6adaa92888c (patch)
treec680c3dec25c9b987bcb3ddb2caa34f68fe00944 /tests
parent4f45cc34384973b3643148c21a5ede489ab05f86 (diff)
downloadrsyslog-a362b3333f84518889cefc1706d4e6adaa92888c.tar.gz
Imported Upstream version 5.7.8upstream/5.7.8
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am28
-rw-r--r--tests/Makefile.in113
-rwxr-xr-xtests/arrayqueue.sh18
-rwxr-xr-xtests/diag.sh26
-rwxr-xr-xtests/discard-rptdmsg-vg.sh13
-rwxr-xr-xtests/discard-rptdmsg.sh10
-rwxr-xr-xtests/imtcp_conndrop.sh4
-rwxr-xr-xtests/linkedlistqueue.sh17
-rw-r--r--tests/rt-init.c1
-rwxr-xr-xtests/tcp-msgreduc-vg.sh16
-rw-r--r--tests/testsuites/discard-rptdmsg.conf15
-rw-r--r--tests/testsuites/samples.parse-nodate2
-rw-r--r--tests/testsuites/samples.snare_ccoff_udp2
-rw-r--r--tests/testsuites/samples.snare_ccoff_udp28
-rw-r--r--tests/testsuites/tcp-msgreduc-vg.conf10
-rw-r--r--tests/testsuites/weird.parse18
16 files changed, 196 insertions, 95 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 694b28a..a720c0c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,10 @@
if ENABLE_TESTBENCH
TESTRUNS = rt_init rscript
check_PROGRAMS = $(TESTRUNS) ourtail nettester tcpflood chkseq msleep randomgen diagtalker uxsockrcvr syslog_caller syslog_inject
-TESTS = $(TESTRUNS) cfg.sh \
+TESTS = $(TESTRUNS) cfg.sh
+
+if ENABLE_IMDIAG
+TESTS += \
arrayqueue.sh \
linkedlistqueue.sh \
da-mainmsg-q.sh \
@@ -47,7 +50,18 @@ TESTS = $(TESTRUNS) cfg.sh \
imuxsock_logger_root.sh \
imuxsock_traillf_root.sh \
imuxsock_ccmiddle_root.sh \
- queue-persist.sh
+ discard-rptdmsg.sh \
+ discard.sh \
+ queue-persist.sh \
+ arrayqueue.sh \
+ linkedlistqueue.sh
+endif
+
+if HAVE_VALGRIND
+TESTS += \
+ discard-rptdmsg-vg.sh \
+ tcp-msgreduc-vg.sh
+endif
if ENABLE_IMPTCP
TESTS += \
@@ -74,7 +88,6 @@ TESTS += omod-if-array.sh \
inputname.sh \
threadingmq.sh \
threadingmqaq.sh \
- discard.sh \
badqi.sh \
tabescape_dflt.sh \
tabescape_off.sh \
@@ -82,9 +95,11 @@ TESTS += omod-if-array.sh \
endif
if ENABLE_OMRULESET
+if ENABLE_IMDIAG
TESTS += omruleset.sh \
omruleset-queue.sh
endif
+endif
if ENABLE_EXTENDED_TESTS
TESTS += random.sh
@@ -186,9 +201,7 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/rsf_getenv.conf \
diskqueue.sh \
testsuites/diskqueue.conf \
- arrayqueue.sh \
testsuites/arrayqueue.conf \
- linkedlistqueue.sh \
testsuites/linkedlistqueue.conf \
da-mainmsg-q.sh \
testsuites/da-mainmsg-q.conf \
@@ -210,6 +223,8 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/imtcp_conndrop.conf \
imtcp_addtlframedelim.sh \
testsuites/imtcp_addtlframedelim.conf \
+ tcp-msgreduc-vg.sh \
+ testsuites/./tcp-msgreduc-vg.conf \
inputname.sh \
testsuites/inputname_imtcp.conf \
testsuites/1.inputname_imtcp_12514 \
@@ -218,6 +233,9 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
omod-if-array.sh \
discard.sh \
testsuites/discard.conf \
+ discard-rptdmsg.sh \
+ discard-rptdmsg-vg.sh \
+ testsuites/discard-rptdmsg.conf \
diag.sh \
testsuites/diag-common.conf \
testsuites/diag-common2.conf \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 503b686..c168707 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -40,66 +40,93 @@ host_triplet = @host@
@ENABLE_TESTBENCH_TRUE@ diagtalker$(EXEEXT) uxsockrcvr$(EXEEXT) \
@ENABLE_TESTBENCH_TRUE@ syslog_caller$(EXEEXT) \
@ENABLE_TESTBENCH_TRUE@ syslog_inject$(EXEEXT)
-@ENABLE_TESTBENCH_TRUE@TESTS = $(am__EXEEXT_1) cfg.sh arrayqueue.sh \
-@ENABLE_TESTBENCH_TRUE@ linkedlistqueue.sh da-mainmsg-q.sh \
-@ENABLE_TESTBENCH_TRUE@ validation-run.sh imtcp-multiport.sh \
-@ENABLE_TESTBENCH_TRUE@ daqueue-persist.sh diskqueue.sh \
-@ENABLE_TESTBENCH_TRUE@ diskqueue-fsync.sh rulesetmultiqueue.sh \
-@ENABLE_TESTBENCH_TRUE@ manytcp.sh rsf_getenv.sh \
-@ENABLE_TESTBENCH_TRUE@ imtcp_conndrop.sh \
-@ENABLE_TESTBENCH_TRUE@ imtcp_addtlframedelim.sh sndrcv.sh \
-@ENABLE_TESTBENCH_TRUE@ sndrcv_gzip.sh sndrcv_udp.sh \
-@ENABLE_TESTBENCH_TRUE@ sndrcv_udp_nonstdpt.sh asynwr_simple.sh \
-@ENABLE_TESTBENCH_TRUE@ asynwr_timeout.sh asynwr_small.sh \
-@ENABLE_TESTBENCH_TRUE@ asynwr_tinybuf.sh wr_large_async.sh \
-@ENABLE_TESTBENCH_TRUE@ wr_large_sync.sh asynwr_deadlock.sh \
-@ENABLE_TESTBENCH_TRUE@ asynwr_deadlock2.sh asynwr_deadlock4.sh \
-@ENABLE_TESTBENCH_TRUE@ gzipwr_large.sh gzipwr_large_dynfile.sh \
-@ENABLE_TESTBENCH_TRUE@ dynfile_invld_async.sh \
-@ENABLE_TESTBENCH_TRUE@ dynfile_invld_sync.sh \
-@ENABLE_TESTBENCH_TRUE@ dynfile_invalid2.sh complex1.sh \
-@ENABLE_TESTBENCH_TRUE@ queue-persist.sh pipeaction.sh \
-@ENABLE_TESTBENCH_TRUE@ execonlyonce.sh \
-@ENABLE_TESTBENCH_TRUE@ execonlywhenprevsuspended.sh \
-@ENABLE_TESTBENCH_TRUE@ execonlywhenprevsuspended2.sh \
-@ENABLE_TESTBENCH_TRUE@ execonlywhenprevsuspended3.sh \
-@ENABLE_TESTBENCH_TRUE@ execonlywhenprevsuspended4.sh \
-@ENABLE_TESTBENCH_TRUE@ pipe_noreader.sh dircreate_dflt.sh \
-@ENABLE_TESTBENCH_TRUE@ dircreate_off.sh \
-@ENABLE_TESTBENCH_TRUE@ imuxsock_logger_root.sh \
-@ENABLE_TESTBENCH_TRUE@ imuxsock_traillf_root.sh \
-@ENABLE_TESTBENCH_TRUE@ imuxsock_ccmiddle_root.sh \
-@ENABLE_TESTBENCH_TRUE@ queue-persist.sh $(am__append_1) \
+@ENABLE_TESTBENCH_TRUE@TESTS = $(am__EXEEXT_1) cfg.sh $(am__append_1) \
@ENABLE_TESTBENCH_TRUE@ $(am__append_2) $(am__append_3) \
@ENABLE_TESTBENCH_TRUE@ $(am__append_4) $(am__append_5) \
-@ENABLE_TESTBENCH_TRUE@ $(am__append_6)
-@ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_1 = \
+@ENABLE_TESTBENCH_TRUE@ $(am__append_6) $(am__append_7) \
+@ENABLE_TESTBENCH_TRUE@ $(am__append_8)
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_1 = \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ arrayqueue.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ linkedlistqueue.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ da-mainmsg-q.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ validation-run.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imtcp-multiport.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ daqueue-persist.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ diskqueue.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ diskqueue-fsync.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rulesetmultiqueue.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ manytcp.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rsf_getenv.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imtcp_conndrop.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imtcp_addtlframedelim.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ sndrcv.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ sndrcv_gzip.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ sndrcv_udp.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ sndrcv_udp_nonstdpt.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ asynwr_simple.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ asynwr_timeout.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ asynwr_small.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ asynwr_tinybuf.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ wr_large_async.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ wr_large_sync.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ asynwr_deadlock.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ asynwr_deadlock2.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ asynwr_deadlock4.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ gzipwr_large.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ gzipwr_large_dynfile.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ dynfile_invld_async.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ dynfile_invld_sync.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ dynfile_invalid2.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ complex1.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ queue-persist.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ pipeaction.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ execonlyonce.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ execonlywhenprevsuspended.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ execonlywhenprevsuspended2.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ execonlywhenprevsuspended3.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ execonlywhenprevsuspended4.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ pipe_noreader.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ dircreate_dflt.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ dircreate_off.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imuxsock_logger_root.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imuxsock_traillf_root.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imuxsock_ccmiddle_root.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ discard-rptdmsg.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ discard.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ queue-persist.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ arrayqueue.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ linkedlistqueue.sh
+
+@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_2 = \
+@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ discard-rptdmsg-vg.sh \
+@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ tcp-msgreduc-vg.sh
+
+@ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_3 = \
@ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@ manyptcp.sh \
@ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@ imptcp_large.sh \
@ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@ imptcp_addtlframedelim.sh \
@ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@ imptcp_conndrop.sh
-@ENABLE_OMUXSOCK_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_2 = uxsock_simple.sh
-@ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_3 = sndrcv_omudpspoof.sh \
+@ENABLE_OMUXSOCK_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_4 = uxsock_simple.sh
+@ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_5 = sndrcv_omudpspoof.sh \
@ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@ sndrcv_omudpspoof_nonstdpt.sh
-@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_4 = omod-if-array.sh \
+@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_6 = omod-if-array.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ proprepltest.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ parsertest.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ timestamp.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ inputname.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ threadingmq.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ threadingmqaq.sh \
-@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ discard.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ badqi.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ tabescape_dflt.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ tabescape_off.sh \
@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ fieldtest.sh
-@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_5 = omruleset.sh \
-@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@ omruleset-queue.sh
+@ENABLE_IMDIAG_TRUE@@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_7 = omruleset.sh \
+@ENABLE_IMDIAG_TRUE@@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@ omruleset-queue.sh
-@ENABLE_EXTENDED_TESTS_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_6 = random.sh
+@ENABLE_EXTENDED_TESTS_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_8 = random.sh
subdir = tests
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
INSTALL
@@ -325,6 +352,7 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+have_valgrind = @have_valgrind@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -450,9 +478,7 @@ EXTRA_DIST = 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/rsf_getenv.conf \
diskqueue.sh \
testsuites/diskqueue.conf \
- arrayqueue.sh \
testsuites/arrayqueue.conf \
- linkedlistqueue.sh \
testsuites/linkedlistqueue.conf \
da-mainmsg-q.sh \
testsuites/da-mainmsg-q.conf \
@@ -474,6 +500,8 @@ EXTRA_DIST = 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/imtcp_conndrop.conf \
imtcp_addtlframedelim.sh \
testsuites/imtcp_addtlframedelim.conf \
+ tcp-msgreduc-vg.sh \
+ testsuites/./tcp-msgreduc-vg.conf \
inputname.sh \
testsuites/inputname_imtcp.conf \
testsuites/1.inputname_imtcp_12514 \
@@ -482,6 +510,9 @@ EXTRA_DIST = 1.rstest 2.rstest 3.rstest err1.rstest \
omod-if-array.sh \
discard.sh \
testsuites/discard.conf \
+ discard-rptdmsg.sh \
+ discard-rptdmsg-vg.sh \
+ testsuites/discard-rptdmsg.conf \
diag.sh \
testsuites/diag-common.conf \
testsuites/diag-common2.conf \
diff --git a/tests/arrayqueue.sh b/tests/arrayqueue.sh
deleted file mode 100755
index 71e1cc2..0000000
--- a/tests/arrayqueue.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-# Test for fixedArray queue mode
-# added 2009-05-20 by rgerhards
-# This file is part of the rsyslog project, released under GPLv3
-echo ===============================================================================
-echo \[arrayqueue.sh\]: testing queue fixedArray queue mode
-source $srcdir/diag.sh init
-source $srcdir/diag.sh startup arrayqueue.conf
-
-# 40000 messages should be enough
-source $srcdir/diag.sh injectmsg 0 40000
-
-# terminate *now* (don't wait for queue to drain!)
-kill `cat rsyslog.pid`
-
-# now wait until rsyslog.pid is gone (and the process finished)
-source $srcdir/diag.sh wait-shutdown
-source $srcdir/diag.sh seq-check 0 39999
-source $srcdir/diag.sh exit
diff --git a/tests/diag.sh b/tests/diag.sh
index 2f30775..e8e3ce1 100755
--- a/tests/diag.sh
+++ b/tests/diag.sh
@@ -34,7 +34,12 @@ case $1 in
;;
'startup') # start rsyslogd with default params. $2 is the config file name to use
# returns only after successful startup, $3 is the instance (blank or 2!)
- $valgrind ../tools/rsyslogd -c4 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
+ $valgrind ../tools/rsyslogd -c6 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
+ $srcdir/diag.sh wait-startup $3
+ ;;
+ '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 &
$srcdir/diag.sh wait-startup $3
;;
'wait-startup') # wait for rsyslogd startup ($2 is the instance)
@@ -58,6 +63,25 @@ case $1 in
exit 1
fi
;;
+ 'wait-shutdown-vg') # actually, we wait for rsyslog.pid to be deleted. $2 is the
+ # instance
+ wait `cat rsyslog.pid`
+ export RSYSLOGD_EXIT=$?
+ echo rsyslogd run exited with $RSYSLOGD_EXIT
+ if [ -e core.* ]
+ then
+ echo "ABORT! core file exists, starting interactive shell"
+ bash
+ exit 1
+ fi
+ ;;
+ 'check-exit-vg') # wait for main message queue to be empty. $2 is the instance.
+ if [ "$RSYSLOGD_EXIT" -eq "10" ]
+ then
+ echo "valgrind run FAILED with exceptions - terminating"
+ exit 1
+ fi
+ ;;
'wait-queueempty') # wait for main message queue to be empty. $2 is the instance.
if [ "$2" == "2" ]
then
diff --git a/tests/discard-rptdmsg-vg.sh b/tests/discard-rptdmsg-vg.sh
new file mode 100755
index 0000000..f56ac59
--- /dev/null
+++ b/tests/discard-rptdmsg-vg.sh
@@ -0,0 +1,13 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[discard-rptdmsg.sh\]: testing discard-rptdmsg functionality
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup-vg discard-rptdmsg.conf
+source $srcdir/diag.sh tcpflood -m10 -i1
+# we need to give rsyslog a little time to settle the receiver
+./msleep 1500
+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 2 10
+source $srcdir/diag.sh exit
diff --git a/tests/discard-rptdmsg.sh b/tests/discard-rptdmsg.sh
new file mode 100755
index 0000000..a8be110
--- /dev/null
+++ b/tests/discard-rptdmsg.sh
@@ -0,0 +1,10 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[discard-rptdmsg.sh\]: testing discard-rptdmsg functionality
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup discard-rptdmsg.conf
+source $srcdir/diag.sh tcpflood -m10 -i1
+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 2 10
+source $srcdir/diag.sh exit
diff --git a/tests/imtcp_conndrop.sh b/tests/imtcp_conndrop.sh
index 2caa0ce..0bfcd99 100755
--- a/tests/imtcp_conndrop.sh
+++ b/tests/imtcp_conndrop.sh
@@ -6,10 +6,10 @@ 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 imptcp_large.conf
+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 4 # due to large messages, we need this time for the tcp receiver to settle...
+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
diff --git a/tests/linkedlistqueue.sh b/tests/linkedlistqueue.sh
deleted file mode 100755
index e6d48a6..0000000
--- a/tests/linkedlistqueue.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Test for Linkedlist queue mode
-# added 2009-05-20 by rgerhards
-# This file is part of the rsyslog project, released under GPLv3
-echo \[linkedlistqueue.sh\]: testing queue Linkedlist queue mode
-source $srcdir/diag.sh init
-source $srcdir/diag.sh startup linkedlistqueue.conf
-
-# 40000 messages should be enough
-source $srcdir/diag.sh injectmsg 0 40000
-
-# terminate *now* (don't wait for queue to drain)
-kill `cat rsyslog.pid`
-
-# now wait until rsyslog.pid is gone (and the process finished)
-source $srcdir/diag.sh wait-shutdown
-source $srcdir/diag.sh seq-check 0 39999
-source $srcdir/diag.sh exit
diff --git a/tests/rt-init.c b/tests/rt-init.c
index dbe94b4..2d43943 100644
--- a/tests/rt-init.c
+++ b/tests/rt-init.c
@@ -28,7 +28,6 @@
MODULE_TYPE_TESTBENCH
-
BEGINInit
CODESTARTInit
ENDInit
diff --git a/tests/tcp-msgreduc-vg.sh b/tests/tcp-msgreduc-vg.sh
new file mode 100755
index 0000000..7e38836
--- /dev/null
+++ b/tests/tcp-msgreduc-vg.sh
@@ -0,0 +1,16 @@
+# 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 \[tcp-msgreduc-vg.sh\]: testing msg reduction via UDP
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup-vg tcp-msgreduc-vg.conf
+source $srcdir/diag.sh wait-startup
+./tcpflood -t 127.0.0.1 -m 4 -r -M "<133>2011-03-01T11:22:12Z host tag msgh ..."
+./tcpflood -t 127.0.0.1 -m 1 -r -M "<133>2011-03-01T11:22:12Z host tag msgh ...x"
+# we need to give rsyslog a little time to settle the receiver
+./msleep 1500
+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 wait-shutdown-vg
+source $srcdir/diag.sh exit
diff --git a/tests/testsuites/discard-rptdmsg.conf b/tests/testsuites/discard-rptdmsg.conf
new file mode 100644
index 0000000..74060e3
--- /dev/null
+++ b/tests/testsuites/discard-rptdmsg.conf
@@ -0,0 +1,15 @@
+# Test for discard functionality
+# rgerhards, 2009-07-30
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/imtcp/.libs/imtcp
+$MainMsgQueueTimeoutShutdown 10000
+$InputTCPServerRun 13514
+
+$RepeatedMsgReduction on
+
+:msg, contains, "00000001" ~
+
+$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/samples.parse-nodate b/tests/testsuites/samples.parse-nodate
index 7f16181..5432bca 100644
--- a/tests/testsuites/samples.parse-nodate
+++ b/tests/testsuites/samples.parse-nodate
@@ -1,5 +1,5 @@
<27>xapi: [error|xen3|15|Guest liveness monitor D:bca30ab3f1c1|master_connection] Connection to master died. I will continue to retry indefinitely (supressing future logging of this message)
-27,daemon,err,localhost,xapi,xapi:, [error|xen3|15|Guest liveness monitor D:bca30ab3f1c1|master_connection] Connection to master died. I will continue to retry indefinitely (supressing future logging of this message)
+27,daemon,err,localhost.localdomain,xapi,xapi:, [error|xen3|15|Guest liveness monitor D:bca30ab3f1c1|master_connection] Connection to master died. I will continue to retry indefinitely (supressing future logging of this message)
# a message with just text (as permitted by rfc 3164)
# it is questionable if the current sample result is really correct as of 3164!
This is a message!
diff --git a/tests/testsuites/samples.snare_ccoff_udp b/tests/testsuites/samples.snare_ccoff_udp
index 010e44d..1ae7e8b 100644
--- a/tests/testsuites/samples.snare_ccoff_udp
+++ b/tests/testsuites/samples.snare_ccoff_udp
@@ -3,7 +3,7 @@
# *real* cases (just mangled to anonymize them...)
# Sample 1 - note the absence of PRI!
windowsserver MSWinEventLog 1 Security 1167 Fri Mar 19 15:33:30 2010 540 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Successful Network Logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Logon Type: 3 Logon Process: Kerberos Authentication Package: Kerberos Workstation Name: Logon GUID: {79b6eb79-7bcc-8a2e-7dad-953c51dc00fd} Caller User Name: - Caller Domain: - Caller Logon ID: - Caller Process ID: - Transited Services: - Source Network Address: 10.11.11.3 Source Port: 3306 733\n
-13,user,notice,localhost,windowsserver,windowsserver MSWinEventLog 1 Security 1167 Fri, Mar 19 15:33:30 2010 540 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Successful Network Logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Logon Type: 3 Logon Process: Kerberos Authentication Package: Kerberos Workstation Name: Logon GUID: {79b6eb79-7bcc-8a2e-7dad-953c51dc00fd} Caller User Name: - Caller Domain: - Caller Logon ID: - Caller Process ID: - Transited Services: - Source Network Address: 10.11.11.3 Source Port: 3306 733
+13,user,notice,localhost.localdomain,windowsserver,windowsserver MSWinEventLog 1 Security 1167 Fri, Mar 19 15:33:30 2010 540 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Successful Network Logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Logon Type: 3 Logon Process: Kerberos Authentication Package: Kerberos Workstation Name: Logon GUID: {79b6eb79-7bcc-8a2e-7dad-953c51dc00fd} Caller User Name: - Caller Domain: - Caller Logon ID: - Caller Process ID: - Transited Services: - Source Network Address: 10.11.11.3 Source Port: 3306 733
# Sample 2
# the samples below need to be disabled for the "workaround patch" for the message
# parser to work. They need to be re-enabled once a final solution has been crafted
diff --git a/tests/testsuites/samples.snare_ccoff_udp2 b/tests/testsuites/samples.snare_ccoff_udp2
index 337cd97..da3a2b1 100644
--- a/tests/testsuites/samples.snare_ccoff_udp2
+++ b/tests/testsuites/samples.snare_ccoff_udp2
@@ -14,13 +14,13 @@ test
insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('', 1, 'test',5, '20100321185328', '20100321185328', 1, '')
# and yet another one we have seen in practice
UX=Abcd-efg-hij-klmno; XXXXX=1111111111, Z123=192.12.231.245:11111, S1234=123456789, XXXXXX=111111111
-insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' XXXXX=1111111111, Z123=192.12.231.245:11111, S1234=123456789, XXXXXX=111111111', 1, 'localhost',5, '20100321185328', '20100321185328', 1, 'UX=Abcd-efg-hij-klmno;')
+insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' XXXXX=1111111111, Z123=192.12.231.245:11111, S1234=123456789, XXXXXX=111111111', 1, 'localhost.localdomain',5, '20100321185328', '20100321185328', 1, 'UX=Abcd-efg-hij-klmno;')
# Sample 1 - note the absence of PRI!
windowsserver MSWinEventLog 1 Security 1167 Fri Mar 19 15:33:30 2010 540 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Successful Network Logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Logon Type: 3 Logon Process: Kerberos Authentication Package: Kerberos Workstation Name: Logon GUID: {79b6eb79-7bcc-8a2e-7dad-953c51dc00fd} Caller User Name: - Caller Domain: - Caller Logon ID: - Caller Process ID: - Transited Services: - Source Network Address: 10.11.11.3 Source Port: 3306 733\n
-insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' Mar 19 15:33:30 2010 540 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Successful Network Logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Logon Type: 3 Logon Process: Kerberos Authentication Package: Kerberos Workstation Name: Logon GUID: {79b6eb79-7bcc-8a2e-7dad-953c51dc00fd} Caller User Name: - Caller Domain: - Caller Logon ID: - Caller Process ID: - Transited Services: - Source Network Address: 10.11.11.3 Source Port: 3306 733', 1, 'localhost',5, '20100321185328', '20100321185328', 1, 'windowsserver MSWinEventLog 1 Security 1167 Fri')
+insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' Mar 19 15:33:30 2010 540 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Successful Network Logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Logon Type: 3 Logon Process: Kerberos Authentication Package: Kerberos Workstation Name: Logon GUID: {79b6eb79-7bcc-8a2e-7dad-953c51dc00fd} Caller User Name: - Caller Domain: - Caller Logon ID: - Caller Process ID: - Transited Services: - Source Network Address: 10.11.11.3 Source Port: 3306 733', 1, 'localhost.localdomain',5, '20100321185328', '20100321185328', 1, 'windowsserver MSWinEventLog 1 Security 1167 Fri')
# Sample 2
windowsserver MSWinEventLog 1 Security 1166 Fri Mar 19 15:33:30 2010 576 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Special privileges assigned to new logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Privileges: SeSecurityPrivilege SeBackupPrivilege SeRestorePrivilege SeTakeOwnershipPrivilege SeDebugPrivilege SeSystemEnvironmentPrivilege SeLoadDriverPrivilege SeImpersonatePrivilege SeEnableDelegationPrivilege 732\n
-insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' Mar 19 15:33:30 2010 576 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Special privileges assigned to new logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Privileges: SeSecurityPrivilege SeBackupPrivilege SeRestorePrivilege SeTakeOwnershipPrivilege SeDebugPrivilege SeSystemEnvironmentPrivilege SeLoadDriverPrivilege SeImpersonatePrivilege SeEnableDelegationPrivilege 732', 1, 'localhost',5, '20100321185328', '20100321185328', 1, 'windowsserver MSWinEventLog 1 Security 1166 Fri')
+insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' Mar 19 15:33:30 2010 576 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff Special privileges assigned to new logon: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF88396) Privileges: SeSecurityPrivilege SeBackupPrivilege SeRestorePrivilege SeTakeOwnershipPrivilege SeDebugPrivilege SeSystemEnvironmentPrivilege SeLoadDriverPrivilege SeImpersonatePrivilege SeEnableDelegationPrivilege 732', 1, 'localhost.localdomain',5, '20100321185328', '20100321185328', 1, 'windowsserver MSWinEventLog 1 Security 1166 Fri')
# Sample 3
windowsserver MSWinEventLog 1 Security 1165 Fri Mar 19 15:33:30 2010 538 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff User Logoff: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF8830B) Logon Type: 3 731\n
-insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' Mar 19 15:33:30 2010 538 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff User Logoff: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF8830B) Logon Type: 3 731', 1, 'localhost',5, '20100321185328', '20100321185328', 1, 'windowsserver MSWinEventLog 1 Security 1165 Fri')
+insert into windows (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' Mar 19 15:33:30 2010 538 Security SYSTEM User Success Audit WINDOWSSERVER Logon/Logoff User Logoff: User Name: WINDOWSSERVER$ Domain: DOMX Logon ID: (0x0,0xF8830B) Logon Type: 3 731', 1, 'localhost.localdomain',5, '20100321185328', '20100321185328', 1, 'windowsserver MSWinEventLog 1 Security 1165 Fri')
diff --git a/tests/testsuites/tcp-msgreduc-vg.conf b/tests/testsuites/tcp-msgreduc-vg.conf
new file mode 100644
index 0000000..72420f0
--- /dev/null
+++ b/tests/testsuites/tcp-msgreduc-vg.conf
@@ -0,0 +1,10 @@
+# Test for queue disk mode (see .sh file for details)
+# rgerhards, 2009-05-22
+$IncludeConfig diag-common.conf
+
+$ModLoad ../plugins/imtcp/.libs/imtcp
+$InputTCPServerRun 13514
+$RepeatedMsgReduction on
+
+$template outfmt,"%msg:F,58:2%\n"
+*.* ./rsyslog.out.log;outfmt
diff --git a/tests/testsuites/weird.parse1 b/tests/testsuites/weird.parse1
index e8b90c7..907198a 100644
--- a/tests/testsuites/weird.parse1
+++ b/tests/testsuites/weird.parse1
@@ -11,10 +11,10 @@
14,user,info,Aug 30 23:00:05,X4711,,,
# there is a SP at the end of the line
<14>Aug 30 23:00:05
-14,user,info,Aug 30 23:00:05,localhost,,,
+14,user,info,Aug 30 23:00:05,localhost.localdomain,,,
# and here is no SP at the end of the line
<14>Aug 30 23:00:05
-14,user,info,Aug 30 23:00:05,localhost,,,
+14,user,info,Aug 30 23:00:05,localhost.localdomain,,,
# unfortunately, I can not test missing dates with this test suite, because
# we would have the current date in the response, which we can not check against
#
@@ -31,7 +31,7 @@
14,user,info,Aug 30 23:00:05,X4711,,,
# there is a SP at the end of the line
<14>2010-08-30T23:00:05Z
-14,user,info,Aug 30 23:00:05,localhost,,,
+14,user,info,Aug 30 23:00:05,localhost.localdomain,,,
# and here is no SP at the end of the line
<14>2010-08-30T23:00:05Z
-14,user,info,Aug 30 23:00:05,localhost,,,
+14,user,info,Aug 30 23:00:05,localhost.localdomain,,,