summaryrefslogtreecommitdiff
path: root/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
commitc4620611bf18e268e746416387e6596047a72edb (patch)
treee5ffe0732179db9397a78eba8600d6baa256d07c /cpp/src/tests/cli_tests.py
parentc4a44a2e398f9dc1745bc7bbbd489a76b7250e9b (diff)
downloadqpid-python-c4620611bf18e268e746416387e6596047a72edb.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/qpid@1051700 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/cli_tests.py')
-rwxr-xr-xcpp/src/tests/cli_tests.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/cpp/src/tests/cli_tests.py b/cpp/src/tests/cli_tests.py
index b197b48193..4a7314a85c 100755
--- a/cpp/src/tests/cli_tests.py
+++ b/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)