diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-04-08 22:13:07 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-04-08 22:13:07 +0000 |
| commit | 1e75ae89fd4dfbb99f62d510d2693565ec9b9028 (patch) | |
| tree | 4f435a2654e9d119b132239c1b12999c252e5e07 /cpp/src/tests | |
| parent | 8565fcc8631ccfa36836fcde4e1aebac476022a8 (diff) | |
| download | qpid-python-1e75ae89fd4dfbb99f62d510d2693565ec9b9028.tar.gz | |
This adds test cases for QPID-2488
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@932152 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
| -rwxr-xr-x | cpp/src/tests/acl.py | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/cpp/src/tests/acl.py b/cpp/src/tests/acl.py index 34146c401e..75754625b2 100755 --- a/cpp/src/tests/acl.py +++ b/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 #===================================== |
