From d13cf5286bbf9e67d340af7b798f527db3448533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hellebrandt?= Date: Fri, 15 Sep 2023 15:59:54 +0200 Subject: [PATCH] Use sAMAccountName in AD LDAP, i.e. 'domain\username' (#12585) Use sAMAccountName in Ad LDAP, i.e. 'domain\username' (cherry picked from commit 05e8156907a9bab7b85037f7f75b2591b4a20e16) --- tests/foreman/api/test_role.py | 2 +- tests/foreman/api/test_user.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/foreman/api/test_role.py b/tests/foreman/api/test_role.py index e669dd9d19b..a7e67a6c2cf 100644 --- a/tests/foreman/api/test_role.py +++ b/tests/foreman/api/test_role.py @@ -186,7 +186,7 @@ def create_ldap(self, ad_data, target_sat, module_location, module_org): ldap_user_passwd=ad_data['ldap_user_passwd'], authsource=entities.AuthSourceLDAP( onthefly_register=True, - account=ad_data['ldap_user_name'], + account=fr"{ad_data['workgroup']}\{ad_data['ldap_user_name']}", account_password=ad_data['ldap_user_passwd'], base_dn=ad_data['base_dn'], groups_base=ad_data['group_base_dn'], diff --git a/tests/foreman/api/test_user.py b/tests/foreman/api/test_user.py index bc2dfe83c14..85531ae543a 100644 --- a/tests/foreman/api/test_user.py +++ b/tests/foreman/api/test_user.py @@ -666,7 +666,7 @@ def create_ldap(self, ad_data, module_target_sat): ldap_user_passwd=ad_data['ldap_user_passwd'], authsource=module_target_sat.api.AuthSourceLDAP( onthefly_register=True, - account=ad_data['ldap_user_name'], + account=fr"{ad_data['workgroup']}\{ad_data['ldap_user_name']}", account_password=ad_data['ldap_user_passwd'], base_dn=ad_data['base_dn'], groups_base=ad_data['group_base_dn'], @@ -741,7 +741,7 @@ def test_positive_access_entities_from_ldap_org_admin(self, create_ldap): :steps: - 1. Create Org Admin and assign taxonomies to it + 1. Create Org Admin role and assign taxonomies to it 2. Create LDAP user with same taxonomies as role above 3. Assign Org Admin role to user above 4. Login with LDAP user and attempt to access resources @@ -862,7 +862,7 @@ def test_positive_access_entities_from_ipa_org_admin(self, create_ldap): :steps: - 1. Create Org Admin and assign taxonomies to it + 1. Create Org Admin role and assign taxonomies to it 2. Create FreeIPA user with same taxonomies as role above 3. Assign Org Admin role to user above 4. Login with FreeIPA user and attempt to access resources