diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-05-12 18:39:24 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-05-12 18:39:24 +0000 |
commit | 1d329b62c2dc4d8ccc41d5689f75389aa6a4fb6d (patch) | |
tree | 47488d13daac10ee5f4e8041439cc1359dfbed8d /cpp/src | |
parent | 84cd6faf2c13f0a9a8b45a52e52fbaa4ad4775af (diff) | |
download | qpid-python-1d329b62c2dc4d8ccc41d5689f75389aa6a4fb6d.tar.gz |
Added a few more test cases for acl file format.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@943624 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/tests/acl.py | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/cpp/src/tests/acl.py b/cpp/src/tests/acl.py index a7725b36a6..2d6a5b489d 100755 --- a/cpp/src/tests/acl.py +++ b/cpp/src/tests/acl.py @@ -168,8 +168,23 @@ class ACLTests(TestBase010): if (result.text.find("Non-continuation line must start with \"group\" or \"acl\"",0,len(result.text)) == -1): self.fail(result) + def test_llegal_extension_lines(self): + """ + Test proper extention lines + """ + aclf = ACLFile() + aclf.write('group test1 joe@EXAMPLE.com \\ \n') # should be allowed + aclf.write(' jack@EXAMPLE.com \\ \n') # should be allowed + aclf.write('jill@TEST.COM \\ \n') # should be allowed + aclf.write('host/123.example.com@TEST.COM\n') # should be allowed + aclf.write('acl allow all all') + aclf.close() + + result = self.reload_acl() + if (result.text.find("ACL format error",0,len(result.text)) != -1): + self.fail(result) - def test_user_domain(self): + def test_user_realm(self): """ Test a user defined without a realm Ex. group admin rajith @@ -191,8 +206,7 @@ class ACLTests(TestBase010): """ aclf = ACLFile() aclf.write('group test1 joe@EXAMPLE.com\n') # should be allowed - aclf.write('group test2 jack-jill@EXAMPLE.com\n') # should be allowed - aclf.write('group test3 jack_jill@EXAMPLE.com\n') # should be allowed + aclf.write('group test2 jack_123-jill@EXAMPLE.com\n') # should be allowed aclf.write('group test4 host/somemachine.example.com@EXAMPLE.COM\n') # should be allowed aclf.write('acl allow all all') aclf.close() @@ -201,6 +215,15 @@ class ACLTests(TestBase010): if (result.text.find("ACL format error",0,len(result.text)) != -1): self.fail(result) + aclf = ACLFile() + aclf.write('group test1 joe$H@EXAMPLE.com\n') # shouldn't be allowed + aclf.write('acl allow all all') + aclf.close() + + result = self.reload_acl() + if (result.text.find("Username \"joe$H@EXAMPLE.com\" contains illegal characters",0,len(result.text)) == -1): + self.fail(result) + #===================================== # ACL validation tests #===================================== |