From f69ff2486ae4672b0d437126f0627d5ae76df5ea Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 11 Jun 2007 16:05:06 +0000 Subject: 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 --- qpid/cpp/src/tests/daemon_test | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'qpid/cpp/src/tests') 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 -- cgit v1.2.1