diff options
| author | Gordon Sim <gsim@apache.org> | 2013-10-31 14:09:29 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-10-31 14:09:29 +0000 |
| commit | cea778d8dd139bc9d254c85032eafdadf8538f9e (patch) | |
| tree | 27a159ad62d227d7f3785c7600d770afe532c767 /qpid/tests | |
| parent | 842d81011fc505fb9b070fb02e11fac2713788cd (diff) | |
| download | qpid-python-cea778d8dd139bc9d254c85032eafdadf8538f9e.tar.gz | |
QPID-5280: prevent bind/unbind of someone elses exclusive queue
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1537498 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tests')
| -rw-r--r-- | qpid/tests/src/py/qpid_tests/broker_0_10/queue.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/qpid/tests/src/py/qpid_tests/broker_0_10/queue.py b/qpid/tests/src/py/qpid_tests/broker_0_10/queue.py index c62a1ae0c1..7e8218d092 100644 --- a/qpid/tests/src/py/qpid_tests/broker_0_10/queue.py +++ b/qpid/tests/src/py/qpid_tests/broker_0_10/queue.py @@ -92,6 +92,7 @@ class QueueTests(TestBase010): #declare an exclusive queue: s1.queue_declare(queue="exclusive-queue", exclusive=True, auto_delete=True) + s1.exchange_bind(exchange="amq.fanout", queue="exclusive-queue") try: #other connection should not be allowed to declare this: s2.queue_declare(queue="exclusive-queue", exclusive=True, auto_delete=True) @@ -115,6 +116,22 @@ class QueueTests(TestBase010): except SessionException, e: self.assertEquals(405, e.args[0].error_code) + s5 = self.conn.session("binder") + try: + #other connection should not be allowed to declare this: + s5.exchange_bind(exchange="amq.direct", queue="exclusive-queue", binding_key="abc") + self.fail("Expected exchange_bind on an exclusive queue to raise an exception") + except SessionException, e: + self.assertEquals(405, e.args[0].error_code) + + s6 = self.conn.session("unbinder") + try: + #other connection should not be allowed to declare this: + s6.exchange_unbind(exchange="amq.fanout", queue="exclusive-queue") + self.fail("Expected exchange_unbind on an exclusive queue to raise an exception") + except SessionException, e: + self.assertEquals(405, e.args[0].error_code) + def test_declare_passive(self): """ Test that the passive field is honoured in queue.declare |
