Skip to content

Commit

Permalink
Tests: SSSD fails to store users if any of the requested attribute is…
Browse files Browse the repository at this point in the history
… empty

SSSD fails to store users if any of the requested attribute is empty
  • Loading branch information
aborah-sudo committed Nov 25, 2024
1 parent 21c6280 commit 6280e6e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/tests/system/tests/test_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6280e6e

Please sign in to comment.