Re: [Freeipa-devel] [PATCH] 0007 test group: remove group from protected group
On 07/28/2014 06:41 PM, Petr Viktorin wrote: On 07/24/2014 03:11 PM, David Kupka wrote: Simple test scenario from ticket #4448. Last test will fail until patch freeipa-dkupka-0006 gets accepted. Thanks! These look fine, but since the new tests don't require that the rest of `test_group` is run first, I encourage you to put them in a separate class. Put to separate class, as suggested. Looks better now. This would ensure we don't add new inderdependencies between old and new tests in the future, making future test refactoring more straightforward. Also, you can select to run just a single test class from a module, so testing a targeted fix is faster. (And you can reuse group1, since the other test cleans it up) See test_permission_plugin for an example. The test still fails on current master but works fine with patch freeipa-dkupka-0006-2. -- David Kupka From 9e3c1bc8a83fc466a6e160842ab37c8e65e66229 Mon Sep 17 00:00:00 2001 From: David Kupka dku...@redhat.com Date: Tue, 29 Jul 2014 08:40:36 +0200 Subject: [PATCH] test group: remove group from protected group. Related to https://fedorahosted.org/freeipa/ticket/4448 --- ipatests/test_xmlrpc/test_group_plugin.py | 67 +++ 1 file changed, 67 insertions(+) diff --git a/ipatests/test_xmlrpc/test_group_plugin.py b/ipatests/test_xmlrpc/test_group_plugin.py index 71172893beb97d3373b0b9299f2bfa7bb642dba6..26d71c4fae1a312709f6f27e0397ef3315cba33f 100644 --- a/ipatests/test_xmlrpc/test_group_plugin.py +++ b/ipatests/test_xmlrpc/test_group_plugin.py @@ -1009,5 +1009,72 @@ class test_group(Declarative): value=[user1], ), ), +] + +class test_group_remove_group_from_protected_group(Declarative): +cleanup_commands = [ +('group_del', [group1], {}), +] +tests = [ +# Test scenario from ticket #4448 +# https://fedorahosted.org/freeipa/ticket/4448 +dict( +desc='Add group %s' % group1, +command=('group_add', [group1], dict(description=u'Test desc 1')), +expected=dict( +value=group1, +summary=u'Added group %s' % group1, +result=dict( +cn=[group1], +description=[u'Test desc 1'], +objectclass=objectclasses.posixgroup, +gidnumber=[fuzzy_digits], +ipauniqueid=[fuzzy_uuid], +dn=get_group_dn(group1), +), +), +), + +dict( +desc='Add %s group to admins group' % group1, +command=('group_add_member', [u'admins'], dict(group=group1)), +expected=dict( +completed=1, +failed=dict( +member=dict( +group=tuple(), +user=tuple(), +), +), +result=dict( +dn=get_group_dn('admins'), +member_user=[u'admin'], +member_group=[group1], +gidnumber=[fuzzy_digits], +cn=[u'admins'], +description=[u'Account administrators group'], +), +), +), +dict( +desc='Remove %s group from admins group' % group1, +command=('group_remove_member', [u'admins'], dict(group=group1)), +expected=dict( +completed=1, +failed=dict( +member=dict( +group=tuple(), +user=tuple(), +), +), +result=dict( +dn=get_group_dn(u'admins'), +cn=[u'admins'], +gidnumber=[fuzzy_digits], +member_user=[u'admin'], +description=[u'Account administrators group'], +), +), +), ] -- 1.9.3 ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH] 0007 test group: remove group from protected group
On 07/29/2014 12:58 PM, David Kupka wrote: On 07/28/2014 06:41 PM, Petr Viktorin wrote: On 07/24/2014 03:11 PM, David Kupka wrote: Simple test scenario from ticket #4448. Last test will fail until patch freeipa-dkupka-0006 gets accepted. Thanks! These look fine, but since the new tests don't require that the rest of `test_group` is run first, I encourage you to put them in a separate class. Put to separate class, as suggested. Looks better now. This would ensure we don't add new inderdependencies between old and new tests in the future, making future test refactoring more straightforward. Also, you can select to run just a single test class from a module, so testing a targeted fix is faster. (And you can reuse group1, since the other test cleans it up) See test_permission_plugin for an example. The test still fails on current master but works fine with patch freeipa-dkupka-0006-2. Thanks! ACK, pushed to: master: f7e00b9ad626e48a3e78a5ff68512642312a6d3d ipa-4-1: f7e00b9ad626e48a3e78a5ff68512642312a6d3d ipa-4-0: 19dd0c67bba41cd76fb1600a3d5f0293ec6f7c75 -- PetrĀ³ ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH] 0007 test group: remove group from protected group
On 07/24/2014 03:11 PM, David Kupka wrote: Simple test scenario from ticket #4448. Last test will fail until patch freeipa-dkupka-0006 gets accepted. Thanks! These look fine, but since the new tests don't require that the rest of `test_group` is run first, I encourage you to put them in a separate class. This would ensure we don't add new inderdependencies between old and new tests in the future, making future test refactoring more straightforward. Also, you can select to run just a single test class from a module, so testing a targeted fix is faster. (And you can reuse group1, since the other test cleans it up) See test_permission_plugin for an example. -- PetrĀ³ ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
[Freeipa-devel] [PATCH] 0007 test group: remove group from protected group
Simple test scenario from ticket #4448. Last test will fail until patch freeipa-dkupka-0006 gets accepted. -- David Kupka From 240f48865ebb93a9a4d71250f3bcef1c48c453bb Mon Sep 17 00:00:00 2001 From: David Kupka dku...@redhat.com Date: Thu, 24 Jul 2014 14:45:50 +0200 Subject: [PATCH] test group: remove group from protected group. Related to https://fedorahosted.org/freeipa/ticket/4448 --- ipatests/test_xmlrpc/test_group_plugin.py | 63 +++ 1 file changed, 63 insertions(+) diff --git a/ipatests/test_xmlrpc/test_group_plugin.py b/ipatests/test_xmlrpc/test_group_plugin.py index 71172893beb97d3373b0b9299f2bfa7bb642dba6..cc526277cfeca1a5122a704d72afb88b7d6250d7 100644 --- a/ipatests/test_xmlrpc/test_group_plugin.py +++ b/ipatests/test_xmlrpc/test_group_plugin.py @@ -31,6 +31,7 @@ from ipatests.test_xmlrpc.test_user_plugin import get_user_result group1 = u'testgroup1' group2 = u'testgroup2' group3 = u'testgroup3' +group4 = u'testgroup4' renamedgroup1 = u'testgroup' user1 = u'tuser1' @@ -50,6 +51,7 @@ class test_group(Declarative): ('group_del', [group1], {}), ('group_del', [group2], {}), ('group_del', [group3], {}), +('group_del', [group4], {}), ('group_del', [renamedgroup1], {}), ('user_del', [user1], {}), ] @@ -1010,4 +1012,65 @@ class test_group(Declarative): ), ), +# Test scenario from ticket #4448 +# https://fedorahosted.org/freeipa/ticket/4448 +dict( +desc='Add group %s' % group4, +command=('group_add', [group4], dict(description=u'Test desc 4')), +expected=dict( +value=group4, +summary=u'Added group %s' % group4, +result=dict( +cn=[group4], +description=[u'Test desc 4'], +objectclass=objectclasses.posixgroup, +gidnumber=[fuzzy_digits], +ipauniqueid=[fuzzy_uuid], +dn=get_group_dn(group4), +), +), +), + +dict( +desc='Add %s group to admins group' % group4, +command=('group_add_member', [u'admins'], dict(group=group4)), +expected=dict( +completed=1, +failed=dict( +member=dict( +group=tuple(), +user=tuple(), +), +), +result=dict( +dn=get_group_dn('admins'), +member_user=[u'admin'], +member_group=[group4], +gidnumber=[fuzzy_digits], +cn=[u'admins'], +description=[u'Account administrators group'], +), +), +), + +dict( +desc='Remove %s group from admins group' % group4, +command=('group_remove_member', [u'admins'], dict(group=group4)), +expected=dict( +completed=1, +failed=dict( +member=dict( +group=tuple(), +user=tuple(), +), +), +result=dict( +dn=get_group_dn(u'admins'), +cn=[u'admins'], +gidnumber=[fuzzy_digits], +member_user=[u'admin'], +description=[u'Account administrators group'], +), +), +), ] -- 1.9.3 ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel