Skip to content

Commit

Permalink
testbench: all calls to diag.sh need to be sourced
Browse files Browse the repository at this point in the history
The commands are implemented in a way which assumes they have global
side effects (e.g. exit terminating the current test). Not sourcing
the script breaks this assumption.
  • Loading branch information
theinric committed Sep 1, 2015
1 parent 62fa275 commit 9d2d26e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/diag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,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 -C -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
$srcdir/diag.sh wait-startup $3 || . ./diag.sh error-exit $?
. $srcdir/diag.sh wait-startup $3 || . ./diag.sh error-exit $?
;;
'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 --log-fd=1 --error-exitcode=10 --malloc-fill=ff --free-fill=fe --leak-check=full ../tools/rsyslogd -C -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
$srcdir/diag.sh wait-startup $3 || . ./diag.sh error-exit $?
. $srcdir/diag.sh wait-startup $3 || . ./diag.sh error-exit $?
echo startup-vg still running
;;
'startup-vg-noleak') # same as startup-vg, except that --leak-check is set to "none". This
Expand All @@ -117,7 +117,7 @@ case $1 in
# they are platform-dependent. In that case, we can't test for leak checks
# (obviously), but we can check for access violations, what still is useful.
valgrind --log-fd=1 --error-exitcode=10 --malloc-fill=ff --free-fill=fe --leak-check=no ../tools/rsyslogd -C -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 &
$srcdir/diag.sh wait-startup $3 || . ./diag.sh error-exit $?
. $srcdir/diag.sh wait-startup $3 || . ./diag.sh error-exit $?
echo startup-vg still running
;;
'wait-startup') # wait for rsyslogd startup ($2 is the instance)
Expand Down Expand Up @@ -204,7 +204,7 @@ case $1 in
then
echo Shutting down instance 2
fi
$srcdir/diag.sh wait-queueempty $2 || exit $?
. $srcdir/diag.sh wait-queueempty $2 || exit $?
./msleep 1000 # wait a bit (think about slow testbench machines!)
kill `cat rsyslog$2.pid`
# note: we do not wait for the actual termination!
Expand Down

0 comments on commit 9d2d26e

Please sign in to comment.