summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests
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
commitf69ff2486ae4672b0d437126f0627d5ae76df5ea (patch)
tree6966df0d539ad73760662b2d4e203bcf765744e1 /qpid/cpp/src/tests
parent7a4e581876f8383c091990734c2b47a9e5d0a32a (diff)
downloadqpid-python-f69ff2486ae4672b0d437126f0627d5ae76df5ea.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@546180 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
-rwxr-xr-xqpid/cpp/src/tests/daemon_test27
1 files changed, 17 insertions, 10 deletions
diff --git a/qpid/cpp/src/tests/daemon_test b/qpid/cpp/src/tests/daemon_test
index ab87a2f848..6d1fc73923 100755
--- a/qpid/cpp/src/tests/daemon_test
+++ b/qpid/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