diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-11-09 12:12:17 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-11-09 12:12:17 +0100 |
commit | dc8f9b531c6c53af7a81a5a378ba1c1514f7a47c (patch) | |
tree | 67260a6aa41b605c0a5530dac6ffcf39ee177e51 /tests | |
parent | b05d4a6db4cc7a0e7a8f4efdb30c784f51b15f2e (diff) | |
download | rsyslog-dc8f9b531c6c53af7a81a5a378ba1c1514f7a47c.tar.gz rsyslog-dc8f9b531c6c53af7a81a5a378ba1c1514f7a47c.tar.bz2 rsyslog-dc8f9b531c6c53af7a81a5a378ba1c1514f7a47c.zip |
bugfix: $IncludeConfig did not correctly process directories
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=376
The testbench was also enhanced to check for these cases.
Thanks to Georgi Georgiev for the bug report.
Also minor bugfix: no error msg on unreadable $IncludeConfig path
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 10 | ||||
-rwxr-xr-x | tests/diag.sh | 4 | ||||
-rwxr-xr-x | tests/incltest.sh | 11 | ||||
-rwxr-xr-x | tests/incltest_dir.sh | 11 | ||||
-rwxr-xr-x | tests/incltest_dir_wildcard.sh | 11 | ||||
-rw-r--r-- | tests/testsuites/incltest.conf | 5 | ||||
-rw-r--r-- | tests/testsuites/incltest.d/include.conf | 2 | ||||
-rw-r--r-- | tests/testsuites/incltest_dir.conf | 5 | ||||
-rw-r--r-- | tests/testsuites/incltest_dir_wildcard.conf | 5 |
9 files changed, 62 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index a9369929..e7122653 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -65,6 +65,9 @@ TESTS += \ failover-no-basic.sh \ rcvr_fail_restore.sh \ rscript_contains.sh \ + incltest.sh \ + incltest_dir.sh \ + incltest_dir_wildcard.sh \ linkedlistqueue.sh if HAVE_VALGRIND @@ -267,6 +270,13 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ testsuites/arrayqueue.conf \ rscript_contains.sh \ testsuites/rscript_contains.conf \ + incltest.sh \ + testsuites/incltest.conf \ + incltest_dir.sh \ + testsuites/incltest_dir.conf \ + incltest_dir_wildcard.sh \ + testsuites/incltest_dir_wildcard.conf \ + testsuites/incltest.d/include.conf \ linkedlistqueue.sh \ testsuites/linkedlistqueue.conf \ da-mainmsg-q.sh \ diff --git a/tests/diag.sh b/tests/diag.sh index bd38b29d..02b24c5b 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -10,8 +10,8 @@ #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 diff --git a/tests/incltest.sh b/tests/incltest.sh new file mode 100755 index 00000000..8e3fe454 --- /dev/null +++ b/tests/incltest.sh @@ -0,0 +1,11 @@ +echo =============================================================================== +echo \[incltest.sh\]: test $IncludeConfig for specific file + +source $srcdir/diag.sh init +source $srcdir/diag.sh startup incltest.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/incltest_dir.sh b/tests/incltest_dir.sh new file mode 100755 index 00000000..3716a695 --- /dev/null +++ b/tests/incltest_dir.sh @@ -0,0 +1,11 @@ +echo =============================================================================== +echo \[incltest_dir.sh\]: test $IncludeConfig for directories + +source $srcdir/diag.sh init +source $srcdir/diag.sh startup incltest_dir.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/incltest_dir_wildcard.sh b/tests/incltest_dir_wildcard.sh new file mode 100755 index 00000000..0dcad34d --- /dev/null +++ b/tests/incltest_dir_wildcard.sh @@ -0,0 +1,11 @@ +echo =============================================================================== +echo \[incltest_dir_wildcard.sh\]: test $IncludeConfig for directories with wildcards + +source $srcdir/diag.sh init +source $srcdir/diag.sh startup incltest_dir_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/incltest.conf b/tests/testsuites/incltest.conf new file mode 100644 index 00000000..737018cd --- /dev/null +++ b/tests/testsuites/incltest.conf @@ -0,0 +1,5 @@ +# see .sh file for description +# rgerhards, 2009-11-30 +$IncludeConfig diag-common.conf + +$IncludeConfig testsuites/incltest.d/include.conf diff --git a/tests/testsuites/incltest.d/include.conf b/tests/testsuites/incltest.d/include.conf new file mode 100644 index 00000000..39a2ea70 --- /dev/null +++ b/tests/testsuites/incltest.d/include.conf @@ -0,0 +1,2 @@ +$template outfmt,"%msg:F,58:2%\n" +:msg, contains, "msgnum:" ./rsyslog.out.log;outfmt diff --git a/tests/testsuites/incltest_dir.conf b/tests/testsuites/incltest_dir.conf new file mode 100644 index 00000000..421349d2 --- /dev/null +++ b/tests/testsuites/incltest_dir.conf @@ -0,0 +1,5 @@ +# see .sh file for description +# rgerhards, 2009-11-30 +$IncludeConfig diag-common.conf + +$IncludeConfig testsuites/incltest.d/ diff --git a/tests/testsuites/incltest_dir_wildcard.conf b/tests/testsuites/incltest_dir_wildcard.conf new file mode 100644 index 00000000..0d7e6782 --- /dev/null +++ b/tests/testsuites/incltest_dir_wildcard.conf @@ -0,0 +1,5 @@ +# see .sh file for description +# rgerhards, 2009-11-30 +$IncludeConfig diag-common.conf + +$IncludeConfig testsuites/incltest.d/*.conf |