diff options
Diffstat (limited to 'cpp/tests/daemon_test')
-rwxr-xr-x | cpp/tests/daemon_test | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cpp/tests/daemon_test b/cpp/tests/daemon_test new file mode 100755 index 0000000000..23f7f7d687 --- /dev/null +++ b/cpp/tests/daemon_test @@ -0,0 +1,22 @@ +#!/bin/sh +# Without arguments run all daemon tests, exit status is number of failures. +# With arguments run just the test named by $1. +# + +TEMP=`mktemp` +trap 'rm -f $TEMP' 0 + +fail() { echo FAIL: $0:$* 1>&2; exit 1; } + +# Start and stop daemon. +PID=`qpidd --check --ppid` && fail $LINENO: qpidd already running $PID +qpidd -d || $LINENO: qpidd -d failed +qpidd --check || fail $LINENO: qpidd --check says qpidd didnt start +client_test > $TEMP || fail $LINENO: client_test: `cat $TEMP` +qpidd -q || fail $LINENO: qpidd -q failed +qpidd -d || fail $LINENO: restart after quit failed. +qpidd -k || fail $LINENO: qpidd -k failed +# Supress expected message re. cleanup of old PID file. +PID=`qpidd --check --ppid 2>/dev/null` && fail $LINENO: $PID still running after kill. + +true |