summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-06-30 11:54:40 +0000
committerAlan Conway <aconway@apache.org>2011-06-30 11:54:40 +0000
commitf48c4890e25c3cd76b7534cfca56e40ee30eb7ca (patch)
tree634818c1622cb0d26595acb07f6babbb4d09c716 /cpp/src/tests
parent716aefd07695b84a869c40400b648bc1adf54cc4 (diff)
downloadqpid-python-f48c4890e25c3cd76b7534cfca56e40ee30eb7ca.tar.gz
QPID-3329: Configure C++ client connections to replace url-addresses rather than merging new addresses with old
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1141493 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/brokertest.py12
-rwxr-xr-xcpp/src/tests/cluster_tests.py10
2 files changed, 13 insertions, 9 deletions
diff --git a/cpp/src/tests/brokertest.py b/cpp/src/tests/brokertest.py
index 725bcaabaf..4a98c638a2 100644
--- a/cpp/src/tests/brokertest.py
+++ b/cpp/src/tests/brokertest.py
@@ -395,6 +395,8 @@ class Broker(Popen):
class Cluster:
"""A cluster of brokers in a test."""
+ # Client connection options for use in failover tests.
+ CONNECTION_OPTIONS = "reconnect:true,reconnect-timeout:10,reconnect-urls-replace:true"
_cluster_count = 0
@@ -538,7 +540,8 @@ class NumberedSender(Thread):
Thread to run a sender client and send numbered messages until stopped.
"""
- def __init__(self, broker, max_depth=None, queue="test-queue"):
+ def __init__(self, broker, max_depth=None, queue="test-queue",
+ connection_options=Cluster.CONNECTION_OPTIONS):
"""
max_depth: enable flow control, ensure sent - received <= max_depth.
Requires self.notify_received(n) to be called each time messages are received.
@@ -549,7 +552,7 @@ class NumberedSender(Thread):
"--broker", "localhost:%s"%broker.port(),
"--address", "%s;{create:always}"%queue,
"--failover-updates",
- "--connection-options", "{reconnect:true,reconnect-timeout:5}",
+ "--connection-options", "{%s}"%(connection_options),
"--content-stdin"
],
expect=EXPECT_RUNNING,
@@ -600,7 +603,8 @@ class NumberedReceiver(Thread):
Thread to run a receiver client and verify it receives
sequentially numbered messages.
"""
- def __init__(self, broker, sender = None, queue="test-queue"):
+ def __init__(self, broker, sender = None, queue="test-queue",
+ connection_options=Cluster.CONNECTION_OPTIONS):
"""
sender: enable flow control. Call sender.received(n) for each message received.
"""
@@ -611,7 +615,7 @@ class NumberedReceiver(Thread):
"--broker", "localhost:%s"%broker.port(),
"--address", "%s;{create:always}"%queue,
"--failover-updates",
- "--connection-options", "{reconnect:true,reconnect-timeout:5}",
+ "--connection-options", "{%s}"%(connection_options),
"--forever"
],
expect=EXPECT_RUNNING,
diff --git a/cpp/src/tests/cluster_tests.py b/cpp/src/tests/cluster_tests.py
index 97c53e3d97..bfc44abfef 100755
--- a/cpp/src/tests/cluster_tests.py
+++ b/cpp/src/tests/cluster_tests.py
@@ -314,7 +314,7 @@ acl allow all all
"--sequence=true",
"--send-eos=1",
"--messages=100000",
- "--connection-options={reconnect:true,reconnect-timeout:5}"
+ "--connection-options={%s}"%(Cluster.CONNECTION_OPTIONS)
])
self.receiver = self.popen(
["qpid-receive",
@@ -322,7 +322,7 @@ acl allow all all
"--address", queue,
"--ignore-duplicates",
"--check-redelivered",
- "--connection-options={reconnect:true,reconnect-timeout:5}",
+ "--connection-options={%s}"%(Cluster.CONNECTION_OPTIONS),
"--forever"
])
time.sleep(1)#give sender enough time to have some messages to replay
@@ -470,7 +470,7 @@ acl allow all all
"--content-size=%s" % self.size,
"--messages=%s" % self.count,
"--failover-updates",
- "--connection-options={reconnect:true,reconnect-timeout:5}",
+ "--connection-options={%s}"%(Cluster.CONNECTION_OPTIONS),
"--address=%s" % self.queue,
"--broker=%s" % self.broker.host_port()])
self.sender.wait()
@@ -502,7 +502,7 @@ acl allow all all
"--timeout=1",
"--print-content=no",
"--failover-updates",
- "--connection-options={reconnect:true,reconnect-timeout:5}",
+ "--connection-options={%s}"%(Cluster.CONNECTION_OPTIONS),
"--ack-frequency=1",
"--address=flq",
"--broker=%s" % cluster[1].host_port()])
@@ -527,7 +527,7 @@ acl allow all all
"--timeout=1",
"--print-content=no",
"--failover-updates",
- "--connection-options={reconnect:true,reconnect-timeout:5}",
+ "--connection-options={%s}"%(Cluster.CONNECTION_OPTIONS),
"--ack-frequency=1",
"--address=flq",
"--broker=%s" % cluster[2].host_port()])