summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-