From 70a57924c8e265df1e97b7f0be1adf8da802fbfd Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 18 Oct 2010 14:53:32 -0400 Subject: Allow RDN changes for users, groups, rolegroups and taskgroups. To do a change right now you have to perform a setattr like: ipa user-mod --setattr uid=newuser olduser The RDN change is performed before the rest of the mods. If the RDN change is the only change done then the EmptyModlist that update_entry() throws is ignored. ticket 323 --- tests/test_xmlrpc/test_taskgroup_plugin.py | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'tests/test_xmlrpc/test_taskgroup_plugin.py') diff --git a/tests/test_xmlrpc/test_taskgroup_plugin.py b/tests/test_xmlrpc/test_taskgroup_plugin.py index 8401fbdc3..ce3166020 100644 --- a/tests/test_xmlrpc/test_taskgroup_plugin.py +++ b/tests/test_xmlrpc/test_taskgroup_plugin.py @@ -32,6 +32,7 @@ taskgroup1 = u'test-taskgroup-1' taskgroup1_dn = u'cn=%s,cn=taskgroups,cn=accounts,%s' % ( taskgroup1, api.env.basedn ) +renamedtaskgroup1 = u'test-taskgroup1' taskgroup2 = u'test-taskgroup-2' taskgroup2_dn = u'cn=%s,cn=taskgroups,cn=accounts,%s' % ( @@ -79,6 +80,13 @@ class test_taskgroup(Declarative): ), + dict( + desc='Try to rename non-existent %r' % taskgroup1, + command=('taskgroup_del', [taskgroup1], dict(setattr=u'cn=%s' % renamedtaskgroup1)), + expected=errors.NotFound(reason='no such entry'), + ), + + dict( desc='Search for non-existent %r' % taskgroup1, command=('taskgroup_find', [taskgroup1], {}), @@ -361,6 +369,36 @@ class test_taskgroup(Declarative): ), + dict( + desc='Rename %r' % taskgroup1, + command=('taskgroup_mod', [taskgroup1], dict(setattr=u'cn=%s' % renamedtaskgroup1)), + expected=dict( + value=taskgroup1, + result=dict( + cn=[renamedtaskgroup1], + description=[u'New desc 1'], + member_rolegroup=[u'test-rolegroup-1'], + ), + summary=u'Modified taskgroup "%s"' % taskgroup1 + ) + ), + + + dict( + desc='Rename %r back' % renamedtaskgroup1, + command=('taskgroup_mod', [renamedtaskgroup1], dict(setattr=u'cn=%s' % taskgroup1)), + expected=dict( + value=renamedtaskgroup1, + result=dict( + cn=[taskgroup1], + description=[u'New desc 1'], + member_rolegroup=[u'test-rolegroup-1'], + ), + summary=u'Modified taskgroup "%s"' % renamedtaskgroup1 + ) + ), + + dict( desc='Delete %r' % taskgroup1, command=('taskgroup_del', [taskgroup1], {}), -- cgit