summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-10-25 18:00:34 +0000
committerAlan Conway <aconway@apache.org>2010-10-25 18:00:34 +0000
commitf27a733f9a4cca3ad2a42acb35ab4620a47e320d (patch)
treea4d7d7a34a6cf42e1241e998f7da012ee37b109f /python
parent2c422462dc717e667c13aa74bbc552c8507e3f83 (diff)
downloadqpid-python-f27a733f9a4cca3ad2a42acb35ab4620a47e320d.tar.gz
New cluster: core framework and initial implementation of enqueue logic.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1027210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/brokertest.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/python/qpid/brokertest.py b/python/qpid/brokertest.py
index 4571712ca6..5a0fe269f4 100644
--- a/python/qpid/brokertest.py
+++ b/python/qpid/brokertest.py
@@ -409,17 +409,25 @@ class Cluster:
_cluster_count = 0
- def __init__(self, test, count=0, args=[], expect=EXPECT_RUNNING, wait=True):
+ def __init__(self, test, count=0, args=[], expect=EXPECT_RUNNING, wait=True,
+ cluster2=False):
+ if cluster2:
+ cluster_name = "--cluster2-name"
+ cluster_lib = BrokerTest.cluster2_lib
+ else:
+ cluster_name = "--cluster-name"
+ cluster_lib = BrokerTest.cluster_lib
self.test = test
self._brokers=[]
self.name = "cluster%d" % Cluster._cluster_count
Cluster._cluster_count += 1
# Use unique cluster name
self.args = copy(args)
- self.args += [ "--cluster-name", "%s-%s:%d" % (self.name, socket.gethostname(), os.getpid()) ]
+ self.args += [ cluster_name,
+ "%s-%s:%d" % (self.name, socket.gethostname(), os.getpid()) ]
self.args += [ "--log-enable=info+", "--log-enable=debug+:cluster"]
- assert BrokerTest.cluster_lib, "Cannot locate cluster plug-in"
- self.args += [ "--load-module", BrokerTest.cluster_lib ]
+ assert cluster_lib, "Cannot locate cluster plug-in"
+ self.args += [ "--load-module", cluster_lib ]
self.start_n(count, expect=expect, wait=wait)
def start(self, name=None, expect=EXPECT_RUNNING, wait=True, args=[], port=0):
@@ -445,6 +453,7 @@ class BrokerTest(TestCase):
# Environment settings.
qpidd_exec = checkenv("QPIDD_EXEC")
cluster_lib = os.getenv("CLUSTER_LIB")
+ cluster2_lib = os.getenv("CLUSTER2_LIB")
xml_lib = os.getenv("XML_LIB")
qpid_config_exec = os.getenv("QPID_CONFIG_EXEC")
qpid_route_exec = os.getenv("QPID_ROUTE_EXEC")
@@ -491,9 +500,9 @@ class BrokerTest(TestCase):
raise RethrownException("Failed to start broker %s(%s): %s" % (b.name, b.log, e))
return b
- def cluster(self, count=0, args=[], expect=EXPECT_RUNNING, wait=True):
+ def cluster(self, count=0, args=[], expect=EXPECT_RUNNING, wait=True, cluster2=False):
"""Create and return a cluster ready for use"""
- cluster = Cluster(self, count, args, expect=expect, wait=wait)
+ cluster = Cluster(self, count, args, expect=expect, wait=wait, cluster2=cluster2)
return cluster
class RethrownException(Exception):