diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rwxr-xr-x | tests/diag.sh | 9 | ||||
-rwxr-xr-x | tests/imptcp_addtlframedelim.sh | 1 | ||||
-rwxr-xr-x | tests/imptcp_conndrop.sh | 3 | ||||
-rwxr-xr-x | tests/imptcp_large.sh | 1 | ||||
-rwxr-xr-x | tests/imtcp_addtlframedelim.sh | 1 | ||||
-rwxr-xr-x | tests/incltest_dir_empty_wildcard.sh | 13 | ||||
-rw-r--r-- | tests/testsuites/imptcp_addtlframedelim.conf | 1 | ||||
-rw-r--r-- | tests/testsuites/imptcp_conndrop.conf | 1 | ||||
-rw-r--r-- | tests/testsuites/imptcp_large.conf | 1 | ||||
-rw-r--r-- | tests/testsuites/imtcp_addtlframedelim.conf | 1 | ||||
-rw-r--r-- | tests/testsuites/incltest_dir_empty_wildcard.conf | 11 |
12 files changed, 34 insertions, 12 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index a673ef1e..e3226c6d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -76,6 +76,7 @@ TESTS += \ incltest.sh \ incltest_dir.sh \ incltest_dir_wildcard.sh \ + incltest_dir_empty_wildcard.sh \ linkedlistqueue.sh if HAVE_VALGRIND @@ -298,6 +299,8 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ testsuites/incltest.conf \ incltest_dir.sh \ testsuites/incltest_dir.conf \ + incltest_dir_empty_wildcard.sh \ + testsuites/incltest_dir_empty_wildcard.conf \ incltest_dir_wildcard.sh \ testsuites/incltest_dir_wildcard.conf \ testsuites/incltest.d/include.conf \ diff --git a/tests/diag.sh b/tests/diag.sh index 02b24c5b..2fdcbfb9 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -10,13 +10,12 @@ #valgrind="valgrind --tool=helgrind --log-fd=1" #valgrind="valgrind --tool=exp-ptrcheck --log-fd=1" #set -o xtrace -export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction nostdout" -export RSYSLOG_DEBUGLOG="log" +#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 cp $srcdir/testsuites/diag-common.conf diag-common.conf cp $srcdir/testsuites/diag-common2.conf diag-common2.conf - rm -f rsyslog.action.*.include rm -f rsyslogd.started work-*.conf rsyslog.random.data rm -f rsyslogd2.started work-*.conf rm -f work rsyslog.out.log rsyslog2.out.log rsyslog.out.log.save # common work files @@ -24,6 +23,10 @@ case $1 in rm -f rsyslog.out.*.log work-presort rsyslog.pipe rm -f rsyslog.input rsyslog.empty rm -f core.* vgcore.* + # Note: rsyslog.action.*.include must NOT be deleted, as it + # is used to setup some parameters BEFORE calling init. This + # happens in chained test scripts. Delete on exit is fine, + # though. mkdir test-spool ;; 'exit') rm -f rsyslogd.started work-*.conf diag-common.conf diff --git a/tests/imptcp_addtlframedelim.sh b/tests/imptcp_addtlframedelim.sh index b26fc85b..00276ab3 100755 --- a/tests/imptcp_addtlframedelim.sh +++ b/tests/imptcp_addtlframedelim.sh @@ -3,7 +3,6 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imptcp_addtlframedelim.sh\]: test imptcp additional frame delimiter -cat rsyslog.action.1.include source $srcdir/diag.sh init source $srcdir/diag.sh startup imptcp_addtlframedelim.conf source $srcdir/diag.sh tcpflood -m20000 -F0 -P129 diff --git a/tests/imptcp_conndrop.sh b/tests/imptcp_conndrop.sh index 684de6b5..0cf0ba5e 100755 --- a/tests/imptcp_conndrop.sh +++ b/tests/imptcp_conndrop.sh @@ -4,9 +4,8 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imptcp_conndrop.sh\]: test imptcp 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 imptcp_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... diff --git a/tests/imptcp_large.sh b/tests/imptcp_large.sh index b4d130bb..43027069 100755 --- a/tests/imptcp_large.sh +++ b/tests/imptcp_large.sh @@ -4,7 +4,6 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imptcp_large.sh\]: test imptcp with large-size messages -cat rsyslog.action.1.include source $srcdir/diag.sh init source $srcdir/diag.sh startup imptcp_large.conf # send 4000 messages of 10.000bytes plus header max, randomized diff --git a/tests/imtcp_addtlframedelim.sh b/tests/imtcp_addtlframedelim.sh index 8de7ca58..4c1fd9cb 100755 --- a/tests/imtcp_addtlframedelim.sh +++ b/tests/imtcp_addtlframedelim.sh @@ -3,7 +3,6 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imtcp_addtlframedelim.sh\]: test imtcp additional frame delimiter -cat rsyslog.action.1.include source $srcdir/diag.sh init source $srcdir/diag.sh startup imtcp_addtlframedelim.conf source $srcdir/diag.sh tcpflood -m20000 -F0 -P129 diff --git a/tests/incltest_dir_empty_wildcard.sh b/tests/incltest_dir_empty_wildcard.sh new file mode 100755 index 00000000..6cdb3b21 --- /dev/null +++ b/tests/incltest_dir_empty_wildcard.sh @@ -0,0 +1,13 @@ +# This test checks if an empty includeConfig directory causes problems. It +# should not, as this is a valid situation that by default exists on many +# distros. +echo =============================================================================== +echo \[incltest_dir_empty_wildcard.sh\]: test $IncludeConfig for \"empty\" wildcard +source $srcdir/diag.sh init +source $srcdir/diag.sh startup incltest_dir_empty_wildcard.conf +# 100 messages are enough - the question is if the include is read ;) +source $srcdir/diag.sh injectmsg 0 100 +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 99 +source $srcdir/diag.sh exit diff --git a/tests/testsuites/imptcp_addtlframedelim.conf b/tests/testsuites/imptcp_addtlframedelim.conf index eb7ed0c4..bf302fb4 100644 --- a/tests/testsuites/imptcp_addtlframedelim.conf +++ b/tests/testsuites/imptcp_addtlframedelim.conf @@ -9,5 +9,4 @@ $template outfmt,"%msg:F,58:2%\n" $OMFileFlushOnTXEnd off $OMFileFlushInterval 2 $OMFileIOBufferSize 256k -$IncludeConfig rsyslog.action.1.include local0.* ./rsyslog.out.log;outfmt diff --git a/tests/testsuites/imptcp_conndrop.conf b/tests/testsuites/imptcp_conndrop.conf index 677e33f6..77a5d79a 100644 --- a/tests/testsuites/imptcp_conndrop.conf +++ b/tests/testsuites/imptcp_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/imptcp_large.conf b/tests/testsuites/imptcp_large.conf index 677e33f6..77a5d79a 100644 --- a/tests/testsuites/imptcp_large.conf +++ b/tests/testsuites/imptcp_large.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/imtcp_addtlframedelim.conf b/tests/testsuites/imtcp_addtlframedelim.conf index 3b4759c5..6558c519 100644 --- a/tests/testsuites/imtcp_addtlframedelim.conf +++ b/tests/testsuites/imtcp_addtlframedelim.conf @@ -9,5 +9,4 @@ $template outfmt,"%msg:F,58:2%\n" $OMFileFlushOnTXEnd off $OMFileFlushInterval 2 $OMFileIOBufferSize 256k -$IncludeConfig rsyslog.action.1.include local0.* ./rsyslog.out.log;outfmt diff --git a/tests/testsuites/incltest_dir_empty_wildcard.conf b/tests/testsuites/incltest_dir_empty_wildcard.conf new file mode 100644 index 00000000..5e750c5b --- /dev/null +++ b/tests/testsuites/incltest_dir_empty_wildcard.conf @@ -0,0 +1,11 @@ +# see .sh file for description +# rgerhards, 2009-11-30 +$IncludeConfig diag-common.conf + +# the following include leads to no files actually being included +# but MUST NOT abort rsyslog's startup sequence. No files matching +# the wildcard is valid (as long as the path exists)! +$IncludeConfig testsuites/incltest.d/*.conf-not-there + +$template outfmt,"%msg:F,58:2%\n" +:msg, contains, "msgnum:" ./rsyslog.out.log;outfmt |