diff --git a/src/tests/system/tests/test_ldap.py b/src/tests/system/tests/test_ldap.py index 251663e5f6..7eef107c29 100644 --- a/src/tests/system/tests/test_ldap.py +++ b/src/tests/system/tests/test_ldap.py @@ -502,3 +502,37 @@ def test_ldap__password_change_no_grace_logins_left( rc, _, _, _ = client.auth.parametrize(method).password_with_output("user1", "Secret123") assert rc == expected, err_msg + + +@pytest.mark.importance("low") +@pytest.mark.topology(KnownTopology.LDAP) +def test_ldap__empty_attribute(client: Client, ldap: LDAP): + """ + :title: SSSD fails to store users if any of the requested attribute is empty + :setup: + 1. Disable Syntax Checking + 2. Add a User + 3. Make home attribute of user empty + 4. Create an Organizational Unit + 5. Add Groups + 6. Start SSSD + :steps: + 1. The user can be queried (id command) + 2. Groups are resolved properly using the getent group command + :expectedresults: + 1. Id look up should success + 2. Group look up should success + :customerscenario: True + """ + ldap.ldap.modify("cn=config", replace={"nsslapd-syntaxcheck": "off"}) + user = ldap.user("emp_user").add() + user.modify(home = "") + + ldap.group("Group_1").add().add_member(member=user) + ldap.group("Group_2").add().add_member(member=user) + + client.sssd.start() + + assert client.tools.id("emp_user") is not None + assert client.tools.getent.group("Group_1") is not None + assert client.tools.getent.group("Group_2") is not None