summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/acl.py
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2010-04-08 22:13:07 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2010-04-08 22:13:07 +0000
commitd300d4b595a37f25905313d99b86d7fdc94db0f8 (patch)
tree53acf4d8f67a1654ed044ac7a19f8e8cf5d04e22 /qpid/cpp/src/tests/acl.py
parentcadb82303bd77134fe2b4f164284ddbabc38980c (diff)
downloadqpid-python-d300d4b595a37f25905313d99b86d7fdc94db0f8.tar.gz
This adds test cases for QPID-2488
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@932152 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/acl.py')
-rwxr-xr-xqpid/cpp/src/tests/acl.py75
1 files changed, 75 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py
index 34146c401e..75754625b2 100755
--- a/qpid/cpp/src/tests/acl.py
+++ b/qpid/cpp/src/tests/acl.py
@@ -211,7 +211,82 @@ class ACLTests(TestBase010):
if (result.text.find("Username 'bob' must contain a realm",0,len(result.text)) == -1):
self.fail(result)
+ #=====================================
+ # ACL validation tests
+ #=====================================
+
+ def test_illegal_queue_policy(self):
+ """
+ Test illegal queue policy
+ """
+
+ aclf = ACLFile()
+ aclf.write('acl deny bob@QPID create queue name=q2 exclusive=true policytype=ding\n')
+ aclf.write('acl allow all all')
+ aclf.close()
+
+ result = self.reload_acl()
+ expected = "ding is not a valid value for 'policytype', possible values are one of" \
+ " { 'ring' 'ring_strict' 'flow_to_disk' 'reject' }";
+ if (result.text != expected):
+ self.fail(result)
+
+ def test_illegal_queue_size(self):
+ """
+ Test illegal queue policy
+ """
+
+ aclf = ACLFile()
+ aclf.write('acl deny bob@QPID create queue name=q2 maxqueuesize=-1\n')
+ aclf.write('acl allow all all')
+ aclf.close()
+
+ result = self.reload_acl()
+ expected = "-1 is not a valid value for 'maxqueuesize', " \
+ "values should be between 0 and 9223372036854775807";
+ if (result.text != expected):
+ self.fail(result)
+
+ aclf = ACLFile()
+ aclf.write('acl deny bob@QPID create queue name=q2 maxqueuesize=9223372036854775808\n')
+ aclf.write('acl allow all all')
+ aclf.close()
+ result = self.reload_acl()
+ expected = "9223372036854775808 is not a valid value for 'maxqueuesize', " \
+ "values should be between 0 and 9223372036854775807";
+ if (result.text != expected):
+ self.fail(result)
+
+
+ def test_illegal_queue_count(self):
+ """
+ Test illegal queue policy
+ """
+
+ aclf = ACLFile()
+ aclf.write('acl deny bob@QPID create queue name=q2 maxqueuecount=-1\n')
+ aclf.write('acl allow all all')
+ aclf.close()
+
+ result = self.reload_acl()
+ expected = "-1 is not a valid value for 'maxqueuecount', " \
+ "values should be between 0 and 9223372036854775807";
+ if (result.text != expected):
+ self.fail(result)
+
+ aclf = ACLFile()
+ aclf.write('acl deny bob@QPID create queue name=q2 maxqueuecount=9223372036854775808\n')
+ aclf.write('acl allow all all')
+ aclf.close()
+
+ result = self.reload_acl()
+ expected = "9223372036854775808 is not a valid value for 'maxqueuecount', " \
+ "values should be between 0 and 9223372036854775807";
+ if (result.text != expected):
+ self.fail(result)
+
+
#=====================================
# ACL queue tests
#=====================================