diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/diag.sh | 5 | ||||
-rwxr-xr-x | tests/pipe_noreader.sh | 22 | ||||
-rw-r--r-- | tests/testsuites/pipe_noreader.conf | 10 |
3 files changed, 34 insertions, 3 deletions
diff --git a/tests/diag.sh b/tests/diag.sh index 0bcb34ce..5b74a6dc 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -21,8 +21,7 @@ case $1 in rm -f rsyslogd2.started work-*.conf rm -f work rsyslog.out.log rsyslog.out.log.save # common work files rm -rf test-spool test-logdir - rm -f rsyslog.out.*.log work-presort - rm -f rsyslog.out.*.log work-presort + rm -f rsyslog.out.*.log work-presort rsyslog.pipe rm -f core.* vgcore.* mkdir test-spool ;; @@ -30,7 +29,7 @@ case $1 in rm -f rsyslogd2.started diag-common2.conf rsyslog.action.*.include rm -f work rsyslog.out.log rsyslog.out.log.save # common work files rm -rf test-spool test-logdir - rm -f rsyslog.out.*.log rsyslog.random.data work-presort + rm -f rsyslog.out.*.log rsyslog.random.data work-presort rsyslog.pipe echo ------------------------------------------------------------------------------- ;; 'startup') # start rsyslogd with default params. $2 is the config file name to use diff --git a/tests/pipe_noreader.sh b/tests/pipe_noreader.sh new file mode 100755 index 00000000..c80aaf3f --- /dev/null +++ b/tests/pipe_noreader.sh @@ -0,0 +1,22 @@ +# This is test driver for a pipe that has no reader. This mimics a usual +# real-world scenario, the /dev/xconsole pipe. Some versions of rsyslog +# were known to hang or loop on this pipe, thus we added this scenario +# as a permanent testcase. For some details, please see bug tracker +# http://bugzilla.adiscon.com/show_bug.cgi?id=186 +# +# added 2010-04-26 by Rgerhards +# This file is part of the rsyslog project, released under GPLv3 +echo =============================================================================== +echo TEST: \[pipe_noreader.sh\]: test for pipe writing without reader +# uncomment for debugging support: +export RSYSLOG_DEBUG="debug nostdout noprintmutexaction" +export RSYSLOG_DEBUGLOG="log" +source $srcdir/diag.sh init +mkfifo ./rsyslog.pipe +source $srcdir/diag.sh startup pipe_noreader.conf +# we need to emit ~ 128K of data according to bug report +source $srcdir/diag.sh tcpflood -m1000 -d500 +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 999 +source $srcdir/diag.sh exit diff --git a/tests/testsuites/pipe_noreader.conf b/tests/testsuites/pipe_noreader.conf new file mode 100644 index 00000000..63997760 --- /dev/null +++ b/tests/testsuites/pipe_noreader.conf @@ -0,0 +1,10 @@ +# simple async writing test +# rgerhards, 2010-03-09 +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/imtcp/.libs/imtcp +$MainMsgQueueTimeoutShutdown 10000 +$InputTCPServerRun 13514 + +$template outfmt,"%msg:F,58:2%\n" +:msg, contains, "msgnum:" |./rsyslog.pipe |