summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/cli_tests.py
diff options
context:
space:
mode:
authorJonathan Robie <jonathan@apache.org>2010-12-21 23:46:42 +0000
committerJonathan Robie <jonathan@apache.org>2010-12-21 23:46:42 +0000
commit4365a8b0b4a55892262896d52676794d13e2e4b3 (patch)
tree14761fe7b9f5f70bfc61358564bccc8826e14762 /qpid/cpp/src/tests/cli_tests.py
parent4e887a13cfba1309c0e3105b00691850558cb162 (diff)
downloadqpid-python-4365a8b0b4a55892262896d52676794d13e2e4b3.tar.gz
Allow command line utilities to require a given SASL mechanism.
Useful if the client's most secure mechanism is suspect, e.g. if Kerberos configuration problems may exist. Also useful in a variety of test scenarios. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1051700 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/cli_tests.py')
-rwxr-xr-xqpid/cpp/src/tests/cli_tests.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/cli_tests.py b/qpid/cpp/src/tests/cli_tests.py
index b197b48193..4a7314a85c 100755
--- a/qpid/cpp/src/tests/cli_tests.py
+++ b/qpid/cpp/src/tests/cli_tests.py
@@ -177,6 +177,24 @@ class CliTests(TestBase010):
found = True
self.assertEqual(found, False)
+
+ def test_qpid_config_sasl_plain_expect_succeed(self):
+ self.startQmf();
+ qmf = self.qmf
+ qname = "test_qpid_config_sasl_plain_expect_succeed"
+ cmd = " --sasl-mechanism PLAIN -a guest/guest@localhost:"+str(self.broker.port) + " add queue " + qname
+ ret = self.qpid_config_api(cmd)
+ self.assertEqual(ret, 0)
+
+ def test_qpid_config_sasl_plain_expect_fail(self):
+ """Fails because no user name and password is supplied"""
+ self.startQmf();
+ qmf = self.qmf
+ qname = "test_qpid_config_sasl_plain_expect_succeed"
+ cmd = " --sasl-mechanism PLAIN -a localhost:"+str(self.broker.port) + " add queue " + qname
+ ret = self.qpid_config_api(cmd)
+ assert ret != 0
+
# helpers for some of the test methods
def helper_find_exchange(self, xchgname, typ, expected=True):
xchgs = self.qmf.getObjects(_class = "exchange")
@@ -382,6 +400,37 @@ class CliTests(TestBase010):
self.assertEqual(found, True)
+ def test_qpid_route_api(self):
+ self.startQmf();
+ qmf = self.qmf
+
+ ret = self.qpid_route_api("dynamic add "
+ + " --sasl-mechanism PLAIN "
+ + "guest/guest@localhost:"+str(self.broker.port) + " "
+ + str(self.remote_host())+":"+str(self.remote_port()) + " "
+ +"amq.direct")
+
+ self.assertEqual(ret, 0)
+
+ links = qmf.getObjects(_class="link")
+ found = False
+ for link in links:
+ if link.port == self.remote_port():
+ found = True
+ self.assertEqual(found, True)
+
+ def test_qpid_route_api_expect_fail(self):
+ self.startQmf();
+ qmf = self.qmf
+
+ ret = self.qpid_route_api("dynamic add "
+ + " --sasl-mechanism PLAIN "
+ + "localhost:"+str(self.broker.port) + " "
+ + str(self.remote_host())+":"+str(self.remote_port()) + " "
+ +"amq.direct")
+ assert ret != 0
+
+
def getProperty(self, msg, name):
for h in msg.headers:
if hasattr(h, name): return getattr(h, name)