summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-03-08 18:58:28 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-03-08 18:58:28 +0100
commit1a0875865300472150c411afa8335e47a1722bae (patch)
tree150dda33ce8649fa75897558010995fd85bf6cb2 /tests
parentd50f1e711ffd479d1ddbc89342e9b28b8b9abba9 (diff)
downloadrsyslog-1a0875865300472150c411afa8335e47a1722bae.tar.gz
rsyslog-1a0875865300472150c411afa8335e47a1722bae.tar.xz
rsyslog-1a0875865300472150c411afa8335e47a1722bae.zip
further improved testbench
some cosmetic issues, plus a new valgrind-based test
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rwxr-xr-xtests/diag.sh7
-rwxr-xr-xtests/discard-rptdmsg-vg.sh13
-rwxr-xr-xtests/discard-rptdmsg.sh7
-rwxr-xr-xtests/tcp-msgreduc-vg.sh6
5 files changed, 23 insertions, 12 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c834ef6e..3e07e1c6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -49,6 +49,7 @@ TESTS = $(TESTRUNS) cfg.sh \
imuxsock_traillf_root.sh \
imuxsock_ccmiddle_root.sh \
discard-rptdmsg.sh \
+ discard-rptdmsg-vg.sh \
discard.sh \
queue-persist.sh
@@ -223,6 +224,7 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
discard.sh \
testsuites/discard.conf \
discard-rptdmsg.sh \
+ discard-rptdmsg-vg.sh \
testsuites/discard-rptdmsg.conf \
diag.sh \
testsuites/diag-common.conf \
diff --git a/tests/diag.sh b/tests/diag.sh
index 64b507e6..e8e3ce1c 100755
--- a/tests/diag.sh
+++ b/tests/diag.sh
@@ -75,6 +75,13 @@ case $1 in
exit 1
fi
;;
+ 'check-exit-vg') # wait for main message queue to be empty. $2 is the instance.
+ if [ "$RSYSLOGD_EXIT" -eq "10" ]
+ then
+ echo "valgrind run FAILED with exceptions - terminating"
+ exit 1
+ fi
+ ;;
'wait-queueempty') # wait for main message queue to be empty. $2 is the instance.
if [ "$2" == "2" ]
then
diff --git a/tests/discard-rptdmsg-vg.sh b/tests/discard-rptdmsg-vg.sh
new file mode 100755
index 00000000..f56ac597
--- /dev/null
+++ b/tests/discard-rptdmsg-vg.sh
@@ -0,0 +1,13 @@
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[discard-rptdmsg.sh\]: testing discard-rptdmsg functionality
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup-vg discard-rptdmsg.conf
+source $srcdir/diag.sh tcpflood -m10 -i1
+# we need to give rsyslog a little time to settle the receiver
+./msleep 1500
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown-vg
+source $srcdir/diag.sh check-exit-vg
+source $srcdir/diag.sh seq-check 2 10
+source $srcdir/diag.sh exit
diff --git a/tests/discard-rptdmsg.sh b/tests/discard-rptdmsg.sh
index a8b35c38..a8be110c 100755
--- a/tests/discard-rptdmsg.sh
+++ b/tests/discard-rptdmsg.sh
@@ -1,15 +1,8 @@
-# Test for discard-rptdmsg functionality
-# This test checks if discard-rptdmsg works. It is not a perfect test but
-# will find at least segfaults and obviously not discard-rptdmsged messages.
-# added 2009-07-30 by Rgerhards
# This file is part of the rsyslog project, released under GPLv3
-# uncomment for debugging support:
echo ===============================================================================
echo \[discard-rptdmsg.sh\]: testing discard-rptdmsg functionality
source $srcdir/diag.sh init
source $srcdir/diag.sh startup discard-rptdmsg.conf
-# 20000 messages should be enough - the disk test is slow enough ;)
-sleep 4
source $srcdir/diag.sh tcpflood -m10 -i1
source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
source $srcdir/diag.sh wait-shutdown
diff --git a/tests/tcp-msgreduc-vg.sh b/tests/tcp-msgreduc-vg.sh
index 82747f3b..7e388360 100755
--- a/tests/tcp-msgreduc-vg.sh
+++ b/tests/tcp-msgreduc-vg.sh
@@ -12,9 +12,5 @@ source $srcdir/diag.sh wait-startup
./msleep 1500
source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
source $srcdir/diag.sh wait-shutdown-vg
-if [ "$RSYSLOGD_EXIT" -eq "10" ]
-then
- echo "tcp-msgreduc-vg.sh FAILED"
- exit 1
-fi
+source $srcdir/diag.sh wait-shutdown-vg
source $srcdir/diag.sh exit