summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/Makefile.am7
-rwxr-xr-xtests/arrayqueue.sh26
-rwxr-xr-xtests/linkedlistqueue.sh26
-rw-r--r--tests/testsuites/arrayqueue.conf14
-rw-r--r--tests/testsuites/linkedlistqueue.conf14
5 files changed, 86 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 88f6a200..a7736312 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,7 @@
TESTRUNS = rt_init rscript
check_PROGRAMS = $(TESTRUNS) ourtail nettester tcpflood chkseq
-TESTS = $(TESTRUNS) cfg.sh fieldtest.sh da-mainmsg-q.sh diskqueue.sh manytcp.sh
+TESTS = $(TESTRUNS) cfg.sh fieldtest.sh arrayqueue.sh linkedlistqueue.sh da-mainmsg-q.sh \
+ diskqueue.sh manytcp.sh
if ENABLE_OMSTDOUT
TESTS += omod-if-array.sh parsertest.sh
endif
@@ -42,6 +43,10 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
fieldtest.sh \
diskqueue.sh \
testsuites/diskqueue.conf \
+ arrayqueue.sh \
+ testsuites/arrayqueue.conf \
+ linkedlistqueue.sh \
+ testsuites/linkedlistqueue.conf \
da-mainmsg-q.sh \
testsuites/da-mainmsg-q.conf \
manytcp.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
diff --git a/tests/linkedlistqueue.sh b/tests/linkedlistqueue.sh
new file mode 100755
index 00000000..aac1abb6
--- /dev/null
+++ b/tests/linkedlistqueue.sh
@@ -0,0 +1,26 @@
+# Test for Linkedlist queue mode
+# added 2009-05-20 by rgerhards
+# This file is part of the rsyslog project, released under GPLv3
+echo testing queue Linkedlist 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
diff --git a/tests/testsuites/arrayqueue.conf b/tests/testsuites/arrayqueue.conf
new file mode 100644
index 00000000..7fdbc79b
--- /dev/null
+++ b/tests/testsuites/arrayqueue.conf
@@ -0,0 +1,14 @@
+# Test for queue fixedArray mode (see .sh file for details)
+# rgerhards, 2009-04-17
+$ModLoad ../plugins/imtcp/.libs/imtcp
+$MainMsgQueueTimeoutShutdown 10000
+$InputTCPServerRun 13514
+
+$ErrorMessagesToStderr off
+
+# set spool locations and switch queue to disk-only mode
+$MainMsgQueueType FixedArray
+
+$template outfmt,"%msg:F,58:2%\n"
+$template dynfile,"rsyslog.out.log" # trick to use relative path names!
+:msg, contains, "msgnum:" ?dynfile;outfmt
diff --git a/tests/testsuites/linkedlistqueue.conf b/tests/testsuites/linkedlistqueue.conf
new file mode 100644
index 00000000..ecfc7a26
--- /dev/null
+++ b/tests/testsuites/linkedlistqueue.conf
@@ -0,0 +1,14 @@
+# Test for queue LinkedList mode (see .sh file for details)
+# rgerhards, 2009-04-17
+$ModLoad ../plugins/imtcp/.libs/imtcp
+$MainMsgQueueTimeoutShutdown 10000
+$InputTCPServerRun 13514
+
+$ErrorMessagesToStderr off
+
+# set spool locations and switch queue to disk-only mode
+$MainMsgQueueType LinkedList
+
+$template outfmt,"%msg:F,58:2%\n"
+$template dynfile,"rsyslog.out.log" # trick to use relative path names!
+:msg, contains, "msgnum:" ?dynfile;outfmt