From cc8a0bc24c50abfb609bc3767b4a550e1f72e1f6 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Thu, 21 Oct 2021 15:22:25 +0200 Subject: [PATCH] ipatests: update the expected output of user-add cmd The SID is not expected to be returned by ipa user-add. Related: https://pagure.io/freeipa/issue/8995 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Christian Heimes Reviewed-By: Rob Crittenden Reviewed-By: Alexander Bokovoy --- ipatests/test_xmlrpc/test_idviews_plugin.py | 6 ++++-- ipatests/test_xmlrpc/test_range_plugin.py | 1 - ipatests/test_xmlrpc/test_user_plugin.py | 3 +++ ipatests/test_xmlrpc/tracker/user_plugin.py | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ipatests/test_xmlrpc/test_idviews_plugin.py b/ipatests/test_xmlrpc/test_idviews_plugin.py index fa535af7a..9b31f5d13 100644 --- a/ipatests/test_xmlrpc/test_idviews_plugin.py +++ b/ipatests/test_xmlrpc/test_idviews_plugin.py @@ -217,7 +217,8 @@ class test_idviews(Declarative): u'Test', u'User1', 'add', - objectclass=objectclasses.user, + objectclass=fuzzy_set_optional_oc( + objectclasses.user, 'ipantuserattrs'), ), ), ), @@ -1623,7 +1624,8 @@ class test_idviews(Declarative): u'Removed', u'User', 'add', - objectclass=objectclasses.user, + objectclass=fuzzy_set_optional_oc( + objectclasses.user, 'ipantuserattrs'), ), ), ), diff --git a/ipatests/test_xmlrpc/test_range_plugin.py b/ipatests/test_xmlrpc/test_range_plugin.py index 387e0ed9f..f912e0474 100644 --- a/ipatests/test_xmlrpc/test_range_plugin.py +++ b/ipatests/test_xmlrpc/test_range_plugin.py @@ -503,7 +503,6 @@ class test_range(Declarative): uidnumber=[unicode(user1_uid)], gidnumber=[unicode(user1_uid)], objectclass=objectclasses.user_base + [u'mepOriginEntry'], - omit=['ipantsecurityidentifier'], ), ), ), diff --git a/ipatests/test_xmlrpc/test_user_plugin.py b/ipatests/test_xmlrpc/test_user_plugin.py index c2b8f79c8..b093a9f2b 100644 --- a/ipatests/test_xmlrpc/test_user_plugin.py +++ b/ipatests/test_xmlrpc/test_user_plugin.py @@ -1182,6 +1182,9 @@ def get_user_result(uid, givenname, sn, operation='show', omit=[], objectclass=objectclasses.user, krbprincipalname=[u'%s@%s' % (uid, api.env.realm)], krbcanonicalname=[u'%s@%s' % (uid, api.env.realm)], + ) + if operation == 'show-all': + result.update( ipantsecurityidentifier=[fuzzy_user_or_group_sid], ) if operation in ('show', 'show-all', 'find', 'mod'): diff --git a/ipatests/test_xmlrpc/tracker/user_plugin.py b/ipatests/test_xmlrpc/tracker/user_plugin.py index 9adbe8d92..6cfb9518f 100644 --- a/ipatests/test_xmlrpc/tracker/user_plugin.py +++ b/ipatests/test_xmlrpc/tracker/user_plugin.py @@ -11,6 +11,7 @@ import six from ipatests.util import assert_deepequal, get_group_dn from ipatests.test_xmlrpc import objectclasses from ipatests.test_xmlrpc.xmlrpc_test import ( + fuzzy_set_optional_oc, fuzzy_digits, fuzzy_uuid, fuzzy_user_or_group_sid, raises_exact) from ipatests.test_xmlrpc.tracker.base import Tracker from ipatests.test_xmlrpc.tracker.kerberos_aliases import KerberosAliasMixin @@ -51,6 +52,7 @@ class UserTracker(CertmapdataMixin, KerberosAliasMixin, Tracker): u'krbextradata', u'krbpasswordexpiration', u'krblastpwdchange', u'krbprincipalkey', u'userpassword', u'randompassword'} create_keys = create_keys - {u'nsaccountlock'} + create_keys = create_keys - {'ipantsecurityidentifier'} update_keys = retrieve_keys - {u'dn'} activate_keys = retrieve_keys @@ -175,7 +177,8 @@ class UserTracker(CertmapdataMixin, KerberosAliasMixin, Tracker): displayname=[u'%s %s' % (self.givenname, self.sn)], cn=[u'%s %s' % (self.givenname, self.sn)], initials=[u'%s%s' % (self.givenname[0], self.sn[0])], - objectclass=objectclasses.user, + objectclass=fuzzy_set_optional_oc( + objectclasses.user, 'ipantuserattrs'), description=[u'__no_upg__'], ipauniqueid=[fuzzy_uuid], uidnumber=[fuzzy_digits],