diff options
author | Rob Crittenden <rcritten@redhat.com> | 2012-08-15 17:21:19 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-08-16 12:52:38 +0200 |
commit | b5d0a9fcb24c5154919f1b83b2fa2f5999f48ba9 (patch) | |
tree | 653800b3517fb97679640dfb68ff4e96f658bae5 /tests | |
parent | bb5788fc7e1278d7d342e403248f7ccc58dfd6ed (diff) | |
download | freeipa.git-b5d0a9fcb24c5154919f1b83b2fa2f5999f48ba9.tar.gz freeipa.git-b5d0a9fcb24c5154919f1b83b2fa2f5999f48ba9.tar.xz freeipa.git-b5d0a9fcb24c5154919f1b83b2fa2f5999f48ba9.zip |
Validate default user in ordered list when using setattr, require MLS
The MLS was optional in the format, it should be required.
https://fedorahosted.org/freeipa/ticket/2984
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_xmlrpc/test_selinuxusermap_plugin.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/test_xmlrpc/test_selinuxusermap_plugin.py b/tests/test_xmlrpc/test_selinuxusermap_plugin.py index c1bee54d..06ad751a 100644 --- a/tests/test_xmlrpc/test_selinuxusermap_plugin.py +++ b/tests/test_xmlrpc/test_selinuxusermap_plugin.py @@ -605,9 +605,9 @@ class test_selinuxusermap(Declarative): dict( desc='Create rule with unknown user %r' % rule1, command=( - 'selinuxusermap_add', [rule1], dict(ipaselinuxuser=u'notfound') + 'selinuxusermap_add', [rule1], dict(ipaselinuxuser=u'notfound:s0:c0') ), - expected=errors.NotFound(reason=u'SELinux user notfound not ' + + expected=errors.NotFound(reason=u'SELinux user notfound:s0:c0 not ' + u'found in ordering list (in config)'), ), @@ -642,4 +642,14 @@ class test_selinuxusermap(Declarative): u'and/or c[0-1023]-c[0-c0123]'), ), + + dict( + desc='Create rule with invalid user via setattr', + command=( + 'selinuxusermap_mod', [rule1], dict(setattr=u'ipaselinuxuser=deny') + ), + expected=errors.ValidationError(name='ipaselinuxuser', + error=u'Invalid MLS value, must match s[0-15](-s[0-15])'), + ), + ] |