From 8088f9b01a8344c63e7874836721c79d94a01d25 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 May 2009 16:08:23 +0200 Subject: added explicit (base) test for linkedList and FixedArray queue modes --- tests/arrayqueue.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 tests/arrayqueue.sh (limited to 'tests/arrayqueue.sh') diff --git a/tests/arrayqueue.sh b/tests/arrayqueue.sh new file mode 100755 index 00000000..5b8ebb5f --- /dev/null +++ b/tests/arrayqueue.sh @@ -0,0 +1,26 @@ +# Test for fixedArray queue mode +# added 2009-05-20 by rgerhards +# This file is part of the rsyslog project, released under GPLv3 +echo testing queue fixedArray queue mode +rm -f work rsyslog.out.log +# enable this, if you need debug output: export RSYSLOG_DEBUG="debug" +../tools/rsyslogd -c4 -u2 -n -irsyslog.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/arrayqueue.conf & +sleep 1 +echo "rsyslogd started with pid " `cat rsyslog.pid` +# 40000 messages should be enough +./tcpflood 127.0.0.1 13514 1 40000 +if [ "$?" -ne "0" ]; then + echo "error during tcpflood! see rsyslog.out.log.save for what was written" + cp rsyslog.out.log rsyslog.out.log.save +fi +sleep 4 # we need this so that rsyslogd can receive all outstanding messages +kill `cat rsyslog.pid` +rm -f work +sort < rsyslog.out.log > work +./chkseq work 0 39999 +if [ "$?" -ne "0" ]; then + # rm -f work rsyslog.out.log + echo "sequence error detected" + exit 1 +fi +rm -f work rsyslog.out.log -- cgit v1.2.3 From aa9426f683fa6af9280bc63050ee0187ba4c57e1 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 26 May 2009 12:43:43 +0200 Subject: solved design issue with queue termination ... and also improved the test suite. There is a design issue in the v3 queue engine that manifested to some serious problems with the new processing mode. However, in v3 shutdown may take eternally if a queue runs in DA mode, is configured to preserve data AND the action fails and retries immediately. There is no cure available for v3, it would require doing much of the work we have done on the new engine. The window of exposure, as one might guess from the description, is very small. That is probably the reason why we have not seen it in practice. --- tests/arrayqueue.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/arrayqueue.sh') diff --git a/tests/arrayqueue.sh b/tests/arrayqueue.sh index 5b8ebb5f..7791ed57 100755 --- a/tests/arrayqueue.sh +++ b/tests/arrayqueue.sh @@ -17,7 +17,7 @@ sleep 4 # we need this so that rsyslogd can receive all outstanding messages kill `cat rsyslog.pid` rm -f work sort < rsyslog.out.log > work -./chkseq work 0 39999 +./chkseq -fwork -e 39999 if [ "$?" -ne "0" ]; then # rm -f work rsyslog.out.log echo "sequence error detected" -- cgit v1.2.3 From affa217cc2d22fa8037a50b8d40d3372694ff855 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 27 May 2009 12:52:28 +0200 Subject: adapted testbench to new capabilities ... and now make check fails again, we have obviously found some new bugs thanks to the additional cases --- tests/arrayqueue.sh | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'tests/arrayqueue.sh') diff --git a/tests/arrayqueue.sh b/tests/arrayqueue.sh index 7791ed57..01fc133b 100755 --- a/tests/arrayqueue.sh +++ b/tests/arrayqueue.sh @@ -2,25 +2,13 @@ # added 2009-05-20 by rgerhards # This file is part of the rsyslog project, released under GPLv3 echo testing queue fixedArray queue mode -rm -f work rsyslog.out.log -# enable this, if you need debug output: export RSYSLOG_DEBUG="debug" -../tools/rsyslogd -c4 -u2 -n -irsyslog.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/arrayqueue.conf & -sleep 1 -echo "rsyslogd started with pid " `cat rsyslog.pid` +source $srcdir/diag.sh init +source $srcdir/diag.sh startup arrayqueue.conf + # 40000 messages should be enough -./tcpflood 127.0.0.1 13514 1 40000 -if [ "$?" -ne "0" ]; then - echo "error during tcpflood! see rsyslog.out.log.save for what was written" - cp rsyslog.out.log rsyslog.out.log.save -fi -sleep 4 # we need this so that rsyslogd can receive all outstanding messages +source $srcdir/diag.sh injectmsg 0 40000 + +# terminate *now* (don't wait for queue to drain!) kill `cat rsyslog.pid` -rm -f work -sort < rsyslog.out.log > work -./chkseq -fwork -e 39999 -if [ "$?" -ne "0" ]; then - # rm -f work rsyslog.out.log - echo "sequence error detected" - exit 1 -fi -rm -f work rsyslog.out.log +source $srcdir/diag.sh seq-check 0 39999 +source $srcdir/diag.sh exit -- cgit v1.2.3