diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-30 12:35:46 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-30 12:35:46 +0100 |
commit | 6598615e5bb4e69b9802cf47b1125ce822873ef8 (patch) | |
tree | 7f96c2719c55b22c2d3e0e00e34c2d0649046366 | |
parent | 8b9132bc3212b8e231edc979ffec77c88d96b044 (diff) | |
download | rsyslog-6598615e5bb4e69b9802cf47b1125ce822873ef8.tar.gz rsyslog-6598615e5bb4e69b9802cf47b1125ce822873ef8.tar.xz rsyslog-6598615e5bb4e69b9802cf47b1125ce822873ef8.zip |
extended testbench: tests for $CreateDirs
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rwxr-xr-x | tests/diag.sh | 4 | ||||
-rwxr-xr-x | tests/dircreate_dflt.sh | 20 | ||||
-rwxr-xr-x | tests/dircreate_off.sh | 20 | ||||
-rw-r--r-- | tests/testsuites/dircreate_dflt.conf | 11 | ||||
-rw-r--r-- | tests/testsuites/dircreate_off.conf | 12 |
7 files changed, 74 insertions, 2 deletions
@@ -1,5 +1,8 @@ --------------------------------------------------------------------------- Version 5.5.2 [DEVEL] (rgerhards), 2009-11-?? +- extended testbench +- bugfix: $CreateDirs variable not properly initialized, default thus + was random (but most often "on") [imported from v3] --------------------------------------------------------------------------- Version 5.5.1 [DEVEL] (rgerhards), 2009-11-27 - introduced the ablity for netstream drivers to utilize an epoll interface diff --git a/tests/Makefile.am b/tests/Makefile.am index 015a847d..1a7eba71 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,6 +20,8 @@ TESTS = $(TESTRUNS) cfg.sh \ queue-persist.sh \ pipeaction.sh \ execonlyonce.sh \ + dircreate_dflt.sh \ + dircreate_off.sh \ queue-persist.sh if ENABLE_OMUDPSPOOF @@ -202,6 +204,10 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ tabescape_off.sh \ testsuites/tabescape_off.conf \ testsuites/1.tabescape_off \ + dircreate_dflt.sh \ + testsuites/dircreate_dflt.conf \ + dircreate_off.sh \ + testsuites/dircreate_off.conf \ DiagTalker.java \ cfg.sh diff --git a/tests/diag.sh b/tests/diag.sh index 98228b12..1f410645 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -18,14 +18,14 @@ case $1 in rm -f rsyslogd.started work-*.conf rm -f rsyslogd2.started work-*.conf rm -f work rsyslog.out.log rsyslog.out.log.save # common work files - rm -rf test-spool + rm -rf test-spool test-logdir rm -f core.* vgcore.* mkdir test-spool ;; 'exit') rm -f rsyslogd.started work-*.conf diag-common.conf rm -f rsyslogd2.started diag-common2.conf rm -f work rsyslog.out.log rsyslog.out.log.save # common work files - rm -rf test-spool + rm -rf test-spool test-logdir echo ------------------------------------------------------------------------------- ;; 'startup') # start rsyslogd with default params. $2 is the config file name to use diff --git a/tests/dircreate_dflt.sh b/tests/dircreate_dflt.sh new file mode 100755 index 00000000..71a671f3 --- /dev/null +++ b/tests/dircreate_dflt.sh @@ -0,0 +1,20 @@ +# Test for automatic creation of dynafile directories +# note that we use the "test-spool" directory, because it is handled by diag.sh +# in any case, so we do not need to add any extra new test dir. +# added 2009-11-30 by Rgerhards +# This file is part of the rsyslog project, released under GPLv3 +# uncomment for debugging support: +echo =================================================================================== +echo \[dircreate_dflt_dflt.sh\]: testing automatic directory creation for dynafiles - default +source $srcdir/diag.sh init +source $srcdir/diag.sh startup dircreate_dflt.conf +source $srcdir/diag.sh injectmsg 0 1 # a single message is sufficient +source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages +source $srcdir/diag.sh wait-shutdown +if [ ! -e test-logdir/rsyslog.out.log ] +then + echo "test-logdir or logfile not created!" + exit 1 +fi +exit +source $srcdir/diag.sh exit diff --git a/tests/dircreate_off.sh b/tests/dircreate_off.sh new file mode 100755 index 00000000..92fdee01 --- /dev/null +++ b/tests/dircreate_off.sh @@ -0,0 +1,20 @@ +# Test for automatic creation of dynafile directories +# note that we use the "test-spool" directory, because it is handled by diag.sh +# in any case, so we do not need to add any extra new test dir. +# added 2009-11-30 by Rgerhards +# This file is part of the rsyslog project, released under GPLv3 +# uncomment for debugging support: +echo =================================================================================== +echo \[dircreate_off_off.sh\]: testing automatic directory creation for dynafiles - default +source $srcdir/diag.sh init +source $srcdir/diag.sh startup dircreate_off.conf +source $srcdir/diag.sh injectmsg 0 1 # a single message is sufficient +source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages +source $srcdir/diag.sh wait-shutdown +if [ -e test-logdir/rsyslog.out.log ] +then + echo "test-logdir or logfile WAS created where not permitted to!" + exit 1 +fi +exit +source $srcdir/diag.sh exit diff --git a/tests/testsuites/dircreate_dflt.conf b/tests/testsuites/dircreate_dflt.conf new file mode 100644 index 00000000..9b9aadb8 --- /dev/null +++ b/tests/testsuites/dircreate_dflt.conf @@ -0,0 +1,11 @@ +# see .sh file for description +# rgerhards, 2009-11-30 +$IncludeConfig diag-common.conf + +# set spool locations and switch queue to disk-only mode +$WorkDirectory test-spool +$MainMsgQueueFilename mainq +$MainMsgQueueType disk + +$template dynfile,"test-logdir/rsyslog.out.log" # trick to use relative path names! +*.* ?dynfile diff --git a/tests/testsuites/dircreate_off.conf b/tests/testsuites/dircreate_off.conf new file mode 100644 index 00000000..28ccbd8c --- /dev/null +++ b/tests/testsuites/dircreate_off.conf @@ -0,0 +1,12 @@ +# see .sh file for description +# rgerhards, 2009-11-30 +$IncludeConfig diag-common.conf + +# set spool locations and switch queue to disk-only mode +$WorkDirectory test-spool +$MainMsgQueueFilename mainq +$MainMsgQueueType disk + +$CreateDirs off +$template dynfile,"test-logdir/rsyslog.out.log" # trick to use relative path names! +*.* ?dynfile |