summaryrefslogtreecommitdiff
path: root/cpp/tests/daemon_test
blob: 23f7f7d68768034e467af9ee27fdd17f61353fce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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