diff options
author | Alan Conway <aconway@apache.org> | 2012-12-14 15:30:40 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2012-12-14 15:30:40 +0000 |
commit | 720214353e61cc171aadcc3e18c4edad9facfa9c (patch) | |
tree | 595494431ffe571a6880a5b11b806f91e533813d /qpid/cpp/src/tests/ha_tests.py | |
parent | 7ace74f35ce8d8b4788d7aa1545a541de04ad451 (diff) | |
download | qpid-python-720214353e61cc171aadcc3e18c4edad9facfa9c.tar.gz |
QPID-4506: Qpid HA's '--ha-public-url' option duplicates the '--known-hosts-url' option but cannot be disabled
Reverts the previous commit and simplifies the semantics of setting
--ha-public-url and --ha-brokers-url. There is no longer any over-riding or
implicit updating of values. That means you must set --ha-public-url as well as
--ha-brokers-url, it will not be defaulted. Likewise if you *dont* set
ha-public-url, it will remain empty, which is the use case in this bug.
The defaulting was adding complexity without adding much value.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1421934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ha_tests.py')
-rwxr-xr-x | qpid/cpp/src/tests/ha_tests.py | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/ha_tests.py b/qpid/cpp/src/tests/ha_tests.py index ccb75d9cfd..b29ff42627 100755 --- a/qpid/cpp/src/tests/ha_tests.py +++ b/qpid/cpp/src/tests/ha_tests.py @@ -782,9 +782,9 @@ acl deny all all cluster[1].wait_queue("q0") cluster[1].wait_queue("q1") cluster[0].kill() - cluster[1].wait_queue("q1") # Not timed out yet - cluster[1].wait_no_queue("q1", timeout=2) # Wait for timeout - cluster[1].wait_no_queue("q0", timeout=2) + cluster[1].wait_queue("q1") # Not timed out yet + cluster[1].wait_no_queue("q1") # Wait for timeout + cluster[1].wait_no_queue("q0") def test_alt_exchange_dup(self): """QPID-4349: if a queue has an alterante exchange and is deleted the @@ -1135,6 +1135,38 @@ class RecoveryTests(HaBrokerTest): cluster.bounce(0, promote_next=False) cluster[0].promote() + +class ConfigurationTests(HaBrokerTest): + """Tests for configuration settings.""" + + def test_client_broker_url(self): + """Check that setting of broker and public URLs obeys correct defaulting + and precedence""" + + def check(broker, brokers, public): + qmf = broker.qmf() + self.assertEqual(brokers, qmf.brokersUrl) + self.assertEqual(public, qmf.publicUrl) + + def start(brokers, public, known=None): + args=[] + if brokers: args.append("--ha-brokers-url="+brokers) + if public: args.append("--ha-public-url="+public) + if known: args.append("--known-hosts-url="+known) + return HaBroker(self, args=args) + + # Both set explictily, no defaulting + b = start("foo:123", "bar:456") + check(b, "amqp:tcp:foo:123", "amqp:tcp:bar:456") + b.set_brokers_url("foo:999") + check(b, "amqp:tcp:foo:999", "amqp:tcp:bar:456") + b.set_public_url("bar:999") + check(b, "amqp:tcp:foo:999", "amqp:tcp:bar:999") + + # Allow "none" to mean "not set" + b = start("none", "none") + check(b, "", "") + if __name__ == "__main__": shutil.rmtree("brokertest.tmp", True) qpid_ha = os.getenv("QPID_HA_EXEC") |