summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-04-16 19:19:55 +0000
committerAlan Conway <aconway@apache.org>2012-04-16 19:19:55 +0000
commit67502dd834b2f4b4cd9666ccd09075f1132da602 (patch)
tree7808b810122c60383b2144ed02b90721f2c1bc23 /qpid/cpp/src/tests
parent76b22a0866d250ed46865c79d05321746e37cf05 (diff)
downloadqpid-python-67502dd834b2f4b4cd9666ccd09075f1132da602.tar.gz
QPID-3603: ha_tests.py: Suppress python WARNING messages during failover
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1326753 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
-rwxr-xr-xqpid/cpp/src/tests/ha_tests.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/qpid/cpp/src/tests/ha_tests.py b/qpid/cpp/src/tests/ha_tests.py
index a9771350aa..740b695278 100755
--- a/qpid/cpp/src/tests/ha_tests.py
+++ b/qpid/cpp/src/tests/ha_tests.py
@@ -26,7 +26,7 @@ from threading import Thread, Lock, Condition
from logging import getLogger, WARN, ERROR, DEBUG
from qpidtoollibs import BrokerAgent
-log = getLogger("qpid.ha-tests")
+log = getLogger(__name__)
class HaBroker(Broker):
def __init__(self, test, args=[], broker_url=None, ha_cluster=True,
@@ -44,6 +44,7 @@ class HaBroker(Broker):
Broker.__init__(self, test, args, **kwargs)
self.commands=os.getenv("PYTHON_COMMANDS")
assert os.path.isdir(self.commands)
+ getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
def promote(self):
assert os.system("%s/qpid-ha promote -b %s"%(self.commands, self.host_port())) == 0
@@ -145,8 +146,6 @@ class ReplicationTests(HaTest):
"""Test basic replication of configuration and messages before and
after backup has connected"""
- getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
-
def queue(name, replicate):
return "%s;{create:always,node:{x-declare:{arguments:{'qpid.replicate':%s}}}}"%(name, replicate)
@@ -256,7 +255,6 @@ class ReplicationTests(HaTest):
def test_send_receive(self):
"""Verify sequence numbers of messages sent by qpid-send"""
brokers = HaCluster(self, 3)
- getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
sender = self.popen(
["qpid-send",
"--broker", brokers[0].host_port(),
@@ -280,7 +278,6 @@ class ReplicationTests(HaTest):
def test_failover_python(self):
"""Verify that backups rejects connections and that fail-over works in python client"""
- getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
primary = HaBroker(self, name="primary", expect=EXPECT_EXIT_FAIL)
primary.promote()
backup = HaBroker(self, name="backup", broker_url=primary.host_port())
@@ -351,7 +348,6 @@ class ReplicationTests(HaTest):
def test_standalone_queue_replica(self):
"""Test replication of individual queues outside of cluster mode"""
- getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
primary = HaBroker(self, name="primary", ha_cluster=False)
pc = primary.connect()
ps = pc.session().sender("q;{create:always}")
@@ -378,7 +374,6 @@ class ReplicationTests(HaTest):
def test_queue_replica_failover(self):
"""Test individual queue replication from a cluster to a standalone backup broker, verify it fails over."""
- getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
cluster = HaCluster(self, 2)
primary = cluster[0]
pc = cluster.connect(0)
@@ -426,7 +421,6 @@ class ReplicationTests(HaTest):
def test_reject(self):
"""Test replication with the reject queue policy"""
- getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
primary = HaBroker(self, name="primary")
primary.promote()
backup = HaBroker(self, name="backup", broker_url=primary.host_port())