Author: aconway
Date: Thu Aug 14 13:49:39 2008
New Revision: 686035

URL: http://svn.apache.org/viewvc?rev=686035&view=rev
Log:
Add option to run singleton cluster on default port.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster?rev=686035&r1=686034&r2=686035&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster Thu Aug 14 13:49:39 
2008
@@ -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 @@
 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
 
- 


Reply via email to