8e1ca3
From b6520bef2ef05dd87636d8b57e3247d451af81d8 Mon Sep 17 00:00:00 2001
8e1ca3
From: Florence Blanc-Renaud <flo@redhat.com>
8e1ca3
Date: Tue, 14 Dec 2021 16:33:29 +0100
8e1ca3
Subject: [PATCH] ipatests: Fix expected object classes
8e1ca3
8e1ca3
Because the sidgen plugin is a postop plugin, it is not
8e1ca3
always triggered before the result of an ADD is returned
8e1ca3
and the objectclasses of the user may / may not contain
8e1ca3
ipantuserattrs.
8e1ca3
Fix the expected object classes.
8e1ca3
8e1ca3
Related: https://pagure.io/freeipa/issue/9062
8e1ca3
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
8e1ca3
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
8e1ca3
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
8e1ca3
Reviewed-By: Stanislav Levin <slev@altlinux.org>
8e1ca3
---
8e1ca3
 ipatests/test_xmlrpc/test_user_plugin.py | 20 ++++++++++++++------
8e1ca3
 1 file changed, 14 insertions(+), 6 deletions(-)
8e1ca3
8e1ca3
diff --git a/ipatests/test_xmlrpc/test_user_plugin.py b/ipatests/test_xmlrpc/test_user_plugin.py
8e1ca3
index 74d78b0c6d75590640da1357da1f9f4570307878..c156a8793c5765df96029753f4a278e961d4e895 100644
8e1ca3
--- a/ipatests/test_xmlrpc/test_user_plugin.py
8e1ca3
+++ b/ipatests/test_xmlrpc/test_user_plugin.py
8e1ca3
@@ -125,7 +125,9 @@ def user_npg(request, group):
8e1ca3
     del tracker.attrs['mepmanagedentry']
8e1ca3
     tracker.attrs.update(
8e1ca3
         description=[], memberof_group=[group.cn],
8e1ca3
-        objectclass=objectclasses.user_base + [u'ipantuserattrs'],
8e1ca3
+        objectclass=fuzzy_set_optional_oc(
8e1ca3
+            objectclasses.user_base, 'ipantuserattrs'
8e1ca3
+        ),
8e1ca3
     )
8e1ca3
     return tracker.make_fixture(request)
8e1ca3
 
8e1ca3
@@ -139,7 +141,9 @@ def user_npg2(request, group):
8e1ca3
     del tracker.attrs['mepmanagedentry']
8e1ca3
     tracker.attrs.update(
8e1ca3
         gidnumber=[u'1000'], description=[], memberof_group=[group.cn],
8e1ca3
-        objectclass=objectclasses.user_base + [u'ipantuserattrs'],
8e1ca3
+        objectclass=fuzzy_set_optional_oc(
8e1ca3
+            objectclasses.user_base, 'ipantuserattrs'
8e1ca3
+        ),
8e1ca3
     )
8e1ca3
     return tracker.make_fixture(request)
8e1ca3
 
8e1ca3
@@ -151,8 +155,9 @@ def user_radius(request, xmlrpc_setup):
8e1ca3
                           sn=u'radiususer1',
8e1ca3
                           ipatokenradiususername=u'radiususer')
8e1ca3
     tracker.track_create()
8e1ca3
-    tracker.attrs.update(
8e1ca3
-        objectclass=objectclasses.user + [u'ipatokenradiusproxyuser']
8e1ca3
+    tracker.attrs.update(objectclass=fuzzy_set_optional_oc(
8e1ca3
+        objectclasses.user + [u'ipatokenradiusproxyuser'],
8e1ca3
+        'ipantuserattrs'),
8e1ca3
     )
8e1ca3
     return tracker.make_fixture(request)
8e1ca3
 
8e1ca3
@@ -647,7 +652,8 @@ class TestCreate(XMLRPC_test):
8e1ca3
         testuser.attrs.update(gidnumber=[u'1000'])
8e1ca3
         testuser.attrs.update(
8e1ca3
             description=[],
8e1ca3
-            objectclass=objectclasses.user_base + [u'ipantuserattrs']
8e1ca3
+            objectclass=fuzzy_set_optional_oc(
8e1ca3
+                objectclasses.user_base, 'ipantuserattrs'),
8e1ca3
         )
8e1ca3
         command = testuser.make_create_command()
8e1ca3
         result = command()
8e1ca3
@@ -865,7 +871,9 @@ class TestUserWithUPGDisabled(XMLRPC_test):
8e1ca3
         testuser.attrs.update(gidnumber=[u'1000'])
8e1ca3
         testuser.attrs.update(
8e1ca3
             description=[],
8e1ca3
-            objectclass=objectclasses.user_base + [u'ipantuserattrs'],
8e1ca3
+            objectclass=fuzzy_set_optional_oc(
8e1ca3
+                objectclasses.user_base, 'ipantuserattrs'
8e1ca3
+            ),
8e1ca3
         )
8e1ca3
         command = testuser.make_create_command()
8e1ca3
         result = command()
8e1ca3
-- 
8e1ca3
2.37.2
8e1ca3