summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-08-14 20:49:39 +0000
committerAlan Conway <aconway@apache.org>2008-08-14 20:49:39 +0000
commit55a7da18fc6a4933677efd26a9fa634dce2dda26 (patch)
tree7e411d0ee56f833fb297968127acae48a13323be
parenta35b9deddd25ed62823539926a24929fc71d0cf2 (diff)
downloadqpid-python-55a7da18fc6a4933677efd26a9fa634dce2dda26.tar.gz
Add option to run singleton cluster on default port.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@686035 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xqpid/cpp/src/tests/start_cluster16
1 files changed, 9 insertions, 7 deletions
diff --git a/qpid/cpp/src/tests/start_cluster b/qpid/cpp/src/tests/start_cluster
index 524490f057..9698a512c9 100755
--- a/qpid/cpp/src/tests/start_cluster
+++ b/qpid/cpp/src/tests/start_cluster
@@ -1,7 +1,6 @@
#!/bin/sh
# Start a cluster of brokers on local host, put the list of ports for cluster members in cluster.ports
#
-echo $1 | grep '^[0-9][0-9]*$' > /dev/null || { echo "Usage: $0 cluster-size [options]"; exit 1; }
# Execute command with the ais group set.
with_ais_group() {
@@ -13,11 +12,14 @@ test -f cluster.ports && { echo "cluster.ports file already exists" ; exit 1; }
rm -f cluster*.log
SIZE=$1; shift
CLUSTER=`pwd` # Cluster name=pwd, avoid clashes.
+OPTS="-d --load-module ../.libs/libqpidcluster.so --cluster-name=$CLUSTER --no-data-dir --auth=no $*"
-for (( i=0; i<SIZE; ++i )); do
- OPTS="--load-module ../.libs/libqpidcluster.so -dp0 --log-output=cluster$i.log --cluster-name=$CLUSTER --no-data-dir --auth=no $*"
- PORT=`with_ais_group ../qpidd $OPTS` || exit 1
- echo $PORT >> cluster.ports
-done
+if test "$SIZE" = "one"; then # Special case of singleton cluster, use default port.
+ with_ais_group ../qpidd $OPTS || exit 1
+else
+ for (( i=0; i<SIZE; ++i )); do
+ PORT=`with_ais_group ../qpidd -p0 --log-output=cluster$i.log $OPTS` || exit 1
+ echo $PORT >> cluster.ports
+ done
+fi
-