From a84e866fcf2d3cd1e7750953c613040302eada03 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 25 Oct 2010 18:00:34 +0000 Subject: New cluster: core framework and initial implementation of enqueue logic. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1027210 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/qpid/brokertest.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'qpid/python') diff --git a/qpid/python/qpid/brokertest.py b/qpid/python/qpid/brokertest.py index 4571712ca6..5a0fe269f4 100644 --- a/qpid/python/qpid/brokertest.py +++ b/qpid/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): -- cgit v1.2.1