On 08/22/2012 05:15 PM, Rob Crittenden wrote:
Tomas Babej wrote:
Hi,

Both commands now produce the same output regarding
the attributelevelrights.

https://fedorahosted.org/freeipa/ticket/2875

I think some unit tests would be helpful so we don't regress and we know which other commands this fixes.

rob

I ran the tests for the permission plugin (test_permission_plugin.py) and all of them passed. Tested on clean VM with newly built IPA from the master, so there should be no regression. Results themselves attached.

Tomas
[tbabej@vm-083 freeipa]$ sudo service httpd restart
Redirecting to /bin/systemctl restart  httpd.service
[tbabej@vm-083 freeipa]$ python make-test tests/test_xmlrpc/test_permission_plugin.py 
/usr/bin/nosetests -v --with-doctest --doctest-tests --exclude=plugins tests/test_xmlrpc/test_permission_plugin.py
test_permission pre-cleanup[0]: ('permission_del', [u'testperm'], {}) ... ok
test_permission pre-cleanup[1]: ('permission_del', [u'testperm2'], {}) ... ok
test_permission pre-cleanup[2]: ('privilege_del', [u'testpriv1'], {}) ... ok
test_permission[0]: permission_show: Try to retrieve non-existent u'testperm' ... ok
test_permission[1]: permission_mod: Try to update non-existent u'testperm' ... ok
test_permission[2]: permission_del: Try to delete non-existent u'testperm' ... ok
test_permission[3]: permission_find: Search for non-existent u'testperm' ... ok
test_permission[4]: permission_add: Create u'testperm' ... ok
test_permission[5]: permission_add: Try to create duplicate u'testperm' ... ok
test_permission[6]: privilege_add: Create u'testpriv1' ... ok
test_permission[7]: privilege_add_permission: Add permission u'testperm' to privilege u'testpriv1' ... ok
test_permission[8]: permission_show: Retrieve u'testperm' ... ok
test_permission[9]: permission_show: Retrieve u'testperm' with --raw ... ok
test_permission[10]: permission_find: Search for u'testperm' ... ok
test_permission[11]: permission_find: Search for u'testperm' using --name ... ok
test_permission[12]: permission_find: Search for non-existence permission using --name ... ok
test_permission[13]: permission_find: Search for u'testpriv1' ... ok
test_permission[14]: permission_find: Search for u'testperm' with --raw ... ok
test_permission[15]: permission_add: Create u'testperm2' ... ok
test_permission[16]: permission_find: Search for u'testperm' ... ok
test_permission[17]: permission_find: Search for u'testperm' with --pkey-only ... ok
test_permission[18]: permission_find: Search by ACI attribute with --pkey-only ... ok
test_permission[19]: privilege_find: Search for u'testpriv1' ... ok
test_permission[20]: permission_find: Search for u'testperm' with a limit of 1 (truncated) ... ok
test_permission[21]: permission_find: Search for u'testperm' with a limit of 2 ... ok
test_permission[22]: permission_find: Search for permissions by attr with a limit of 1 (truncated) ... ok
test_permission[23]: permission_mod: Update u'testperm' ... ok
test_permission[24]: permission_show: Retrieve u'testperm' to verify update ... ok
test_permission[25]: permission_mod: Try to rename u'testperm' to existing permission u'testperm2' ... ok
test_permission[26]: permission_mod: Try to rename u'testperm' to empty name ... ok
test_permission[27]: permission_show: Check integrity of original permission u'testperm' ... ok
test_permission[28]: permission_mod: Rename u'testperm' to permission u'testperm1_rn' ... ok
test_permission[29]: permission_mod: Rename u'testperm1_rn' to permission u'Testperm_RN' ... ok
test_permission[30]: permission_mod: Change u'Testperm_RN' to a subtree type ... ok
test_permission[31]: permission_find: Search for u'testperm' using --subtree ... ok
test_permission[32]: permission_find: Search using nonexistent --subtree ... ok
test_permission[33]: permission_del: Delete u'Testperm_RN' ... ok
test_permission[34]: permission_del: Try to delete non-existent u'testperm' ... ok
test_permission[35]: permission_show: Try to retrieve non-existent u'testperm' ... ok
test_permission[36]: permission_mod: Try to update non-existent u'testperm' ... ok
test_permission[37]: permission_del: Delete u'testperm2' ... ok
test_permission[38]: permission_find: Search for u'testperm' ... ok
test_permission[39]: privilege_del: Delete u'testpriv1' ... ok
test_permission[40]: permission_add: Try to create permission u'testperm' with non-existing memberof ... ok
test_permission[41]: permission_add: Create memberof permission u'testperm' ... ok
test_permission[42]: permission_mod: Try to update non-existent memberof of u'testperm' ... ok
test_permission[43]: permission_mod: Update memberof permission u'testperm' ... ok
test_permission[44]: permission_mod: Unset memberof of permission u'testperm' ... ok
test_permission[45]: permission_del: Delete u'testperm' ... ok
test_permission[46]: permission_add: Create targetgroup permission u'testperm' ... ok
test_permission[47]: permission_add: Try to create invalid u'bad;perm' ... ok
test_permission post-cleanup[0]: ('permission_del', [u'testperm'], {}) ... ok
test_permission post-cleanup[1]: ('permission_del', [u'testperm2'], {}) ... ok
test_permission post-cleanup[2]: ('privilege_del', [u'testpriv1'], {}) ... ok

----------------------------------------------------------------------
Ran 54 tests in 30.851s

OK
======================================================================
passed under '/usr/bin/python2.7'

** pass **
[tbabej@vm-083 freeipa]$ fgrep \'rights\' ipalib/plugins/permission.py
        common_options = filter_options(options, ['all', 'raw', 'rights'])
        if options.get('rights', False) and options.get('all', False):
[tbabej@vm-083 freeipa]$ fgrep \'rights\' /usr/lib/python2.7/site-packages/ipalib/plugins/permission.py
        common_options = filter_options(options, ['all', 'raw', 'rights'])
        if options.get('rights', False) and options.get('all', False):

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to