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
commit6c462aa1a0fefc5d85f8f44240b12ec57e188683 (patch)
tree0d855869b5f53158a33b99bffbac53722cffd03c
parent4c975be252e229a8de51eca68a60eec28c1c3447 (diff)
downloadqpid-python-6c462aa1a0fefc5d85f8f44240b12ec57e188683.tar.gz
Add option to run singleton cluster on default port.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@686035 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xcpp/src/tests/start_cluster16
1 files changed, 9 insertions, 7 deletions
diff --git a/cpp/src/tests/start_cluster b/cpp/src/tests/start_cluster
index 524490f057..9698a512c9 100755
--- a/cpp/src/tests/start_cluster
+++ b/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
-