summaryrefslogtreecommitdiffstats
path: root/tests/diag.sh
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-04-12 10:47:09 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-04-12 10:47:09 +0200
commit3dbbb21e71b53572d0e5eae106906c161309a3fe (patch)
tree54b96b77725635ad64880ea5cba4187b50c8a3e6 /tests/diag.sh
parentd5def0d553961eac571e8ca5b6fab5733c851b9f (diff)
parent9348c80744b29fb5f91b5d8edd3f9070f0d0347b (diff)
downloadrsyslog-3dbbb21e71b53572d0e5eae106906c161309a3fe.tar.gz
rsyslog-3dbbb21e71b53572d0e5eae106906c161309a3fe.tar.xz
rsyslog-3dbbb21e71b53572d0e5eae106906c161309a3fe.zip
Merge branch 'v5-beta' into v5-stable
plus bump to new v5-stable Conflicts: ChangeLog configure.ac doc/manual.html
Diffstat (limited to 'tests/diag.sh')
-rwxr-xr-xtests/diag.sh40
1 files changed, 38 insertions, 2 deletions
diff --git a/tests/diag.sh b/tests/diag.sh
index 3075aa57..d1242fb1 100755
--- a/tests/diag.sh
+++ b/tests/diag.sh
@@ -36,7 +36,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)
@@ -60,15 +65,46 @@ 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
+ ;;
+ '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
+ ;;
+ 'get-mainqueuesize') # show the current main queue size
+ if [ "$2" == "2" ]
+ then
+ echo getmainmsgqueuesize | ./diagtalker -p13501
+ else
+ echo getmainmsgqueuesize | ./diagtalker
+ fi
+ ;;
'wait-queueempty') # wait for main message queue to be empty. $2 is the instance.
if [ "$2" == "2" ]
then
- echo WaitMainQueueEmpty | ./diagtalker
+ echo WaitMainQueueEmpty | ./diagtalker -p13501
else
echo WaitMainQueueEmpty | ./diagtalker
fi
;;
'shutdown-when-empty') # shut rsyslogd down when main queue is empty. $2 is the instance.
+ if [ "$2" == "2" ]
+ then
+ echo Shutting down instance 2
+ fi
$srcdir/diag.sh wait-queueempty $2
kill `cat rsyslog$2.pid`
# note: we do not wait for the actual termination!