summaryrefslogtreecommitdiffstats
path: root/tests/diag.sh
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-03-01 16:00:22 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-03-01 16:00:22 +0100
commitc130eb20215d5f4ed4fc23c4bf0223b77176617b (patch)
treecf00632ac5c70f2e4aa70be76938127e4fa5d054 /tests/diag.sh
parent74a71e798efd58e20cc150b04de2613bf518eed4 (diff)
downloadrsyslog-c130eb20215d5f4ed4fc23c4bf0223b77176617b.tar.gz
rsyslog-c130eb20215d5f4ed4fc23c4bf0223b77176617b.tar.xz
rsyslog-c130eb20215d5f4ed4fc23c4bf0223b77176617b.zip
improved testbench
- added valgrind-based test (the first one ever ;)) - fixed memory leak in imdiag (guess how this was detected...)
Diffstat (limited to 'tests/diag.sh')
-rwxr-xr-xtests/diag.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/diag.sh b/tests/diag.sh
index 2f307750..64b507e6 100755
--- a/tests/diag.sh
+++ b/tests/diag.sh
@@ -34,7 +34,12 @@ case $1 in
;;
'startup') # start rsyslogd with default params. $2 is the config file name to use
# returns only after successful startup, $3 is the instance (blank or 2!)
- $valgrind ../tools/rsyslogd -c4 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
+ $valgrind ../tools/rsyslogd -c6 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
+ $srcdir/diag.sh wait-startup $3
+ ;;
+ 'startup-vg') # start rsyslogd with default params under valgrind control. $2 is the config file name to use
+ # returns only after successful startup, $3 is the instance (blank or 2!)
+ valgrind --error-exitcode=10 --malloc-fill=ff --free-fill=fe --leak-check=full ../tools/rsyslogd -c6 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
$srcdir/diag.sh wait-startup $3
;;
'wait-startup') # wait for rsyslogd startup ($2 is the instance)
@@ -58,6 +63,18 @@ case $1 in
exit 1
fi
;;
+ 'wait-shutdown-vg') # actually, we wait for rsyslog.pid to be deleted. $2 is the
+ # instance
+ wait `cat rsyslog.pid`
+ export RSYSLOGD_EXIT=$?
+ echo rsyslogd run exited with $RSYSLOGD_EXIT
+ if [ -e core.* ]
+ then
+ echo "ABORT! core file exists, starting interactive shell"
+ bash
+ exit 1
+ fi
+ ;;
'wait-queueempty') # wait for main message queue to be empty. $2 is the instance.
if [ "$2" == "2" ]
then