summaryrefslogtreecommitdiff
path: root/cpp/src/tests/daemon_test
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-06-11 16:05:06 +0000
committerAlan Conway <aconway@apache.org>2007-06-11 16:05:06 +0000
commitb59a0092f12a07f925bc0b1c7f8cf4949dd374e7 (patch)
treec6c188962552bac59bb96b8b7b00d791ae9e4be1 /cpp/src/tests/daemon_test
parent4c88e1be1c96cf27b8418df2a60c3cbbefd92fcc (diff)
downloadqpid-python-b59a0092f12a07f925bc0b1c7f8cf4949dd374e7.tar.gz
QPID-504: Print bound port if --port 0 is specified. Not yet used by tests.
* qpidd.cpp: - With --port 0 print the bound port number to stdout. - Removed --ppid, --check now prints pid. * Daemon.cpp/h: Move pid-file generation to caller (qpidd.cpp) * Exception.cpp: Log a debug message in exception constructors. Helps to show what exceptions were thrown even if they aren't logged at a higher level. * daemon_test: Test new daemon options. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@546180 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/daemon_test')
-rwxr-xr-xcpp/src/tests/daemon_test27
1 files changed, 17 insertions, 10 deletions
diff --git a/cpp/src/tests/daemon_test b/cpp/src/tests/daemon_test
index ab87a2f848..6d1fc73923 100755
--- a/cpp/src/tests/daemon_test
+++ b/cpp/src/tests/daemon_test
@@ -4,21 +4,28 @@
#
TEMP=`mktemp`
-qpidd=../qpidd
+qpidd="../qpidd --log.output qpidd.log"
client_tests=./client_test
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
+# Start and stop daemon on default port.
+PID=`$qpidd --check` && fail $LINENO: qpidd already running pid=$PID
+$qpidd -d || fail $LINENO: $qpidd -d failed
+$qpidd -c >/dev/null || fail $LINENO: qpidd --check says qpidd did not 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.
+$qpidd -q || fail $LINENO: qpidd -q failed
+$qpidd -c >/dev/null && fail $LINENO: Still running after quit.
+
+# Start and stop daemon on dynamic port.
+export QPID_PORT=`$qpidd -dp0`
+# Note: QPID_PORT fom environment will be used below here:
+$qpidd -c >/dev/null || fail $LINENO: qpidd did not start. QPID_PORT=$QPID_PORT
+$qpidd -q || fail $LINENO: qpidd -q failed. QPID_PORT=$QPID_PORT
+$qpidd -c >/dev/null && fail $LINENO: Still running after start. QPID_PORT=$QPID_PORT
+
+# FIXME aconway 2007-06-11: run client test, needs a --port option.
+
true