From 9e82faab313bab906dc1e6e2dda02b4db9dbf993 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 27 May 2010 20:02:41 +0000 Subject: Fixed: authentication with bad credentials causes cluster broker to exit. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@948969 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/brokertest.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'python') diff --git a/python/qpid/brokertest.py b/python/qpid/brokertest.py index 2242dcb88c..1debabf3df 100644 --- a/python/qpid/brokertest.py +++ b/python/qpid/brokertest.py @@ -272,7 +272,8 @@ class Broker(Popen): self.test = test self._port=port - cmd = [BrokerTest.qpidd_exec, "--port", port, "--no-module-dir", "--auth=no"] + args + cmd = [BrokerTest.qpidd_exec, "--port", port, "--no-module-dir"] + args + if not "--auth" in args: cmd.append("--auth=no") if name: self.name = name else: self.name = "broker%d" % Broker._broker_count @@ -304,10 +305,9 @@ class Broker(Popen): def unexpected(self,msg): raise BadProcessStatus("%s: %s (%s)" % (msg, self.name, self.pname)) - def connect(self): + def connect(self, **kwargs): """New API connection to the broker.""" - return messaging.Connection.establish(host=self.host(), - port=self.port()) + return messaging.Connection.establish(self.host_port(), **kwargs) def connect_old(self): """Old API connection to the broker.""" @@ -376,13 +376,13 @@ class Broker(Popen): return False finally: f.close() - def ready(self): + def ready(self, **kwargs): """Wait till broker is ready to serve clients""" # First make sure the broker is listening by checking the log. if not retry(self.log_ready): raise Exception("Timed out waiting for broker %s" % self.name) # Make a connection, this will wait for extended cluster init to finish. - try: self.connect().close() + try: self.connect(**kwargs).close() except: raise RethrownException("Broker %s failed ready test"%self.name) def store_state(self): @@ -485,10 +485,6 @@ class BrokerTest(TestCase): cluster = Cluster(self, count, args, expect=expect, wait=wait) return cluster -# def wait(self): -# """Wait for all brokers in the cluster to be ready""" -# for b in _brokers: b.connect().close() - class RethrownException(Exception): """Captures the stack trace of the current exception to be thrown later""" def __init__(self, msg=""): -- cgit v1.2.1