Skip to content

Commit

Permalink
tests: Skip tests dependend on ldap_use_ppolicy when not available.
Browse files Browse the repository at this point in the history
Reviewed-by: Scott Poore <[email protected]>
  • Loading branch information
jakub-vavra-cz committed Jul 3, 2024
1 parent 252f365 commit 4e95d6f
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/tests/system/tests/test_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
@pytest.mark.parametrize("use_ppolicy", ["true", "false"])
@pytest.mark.topology(KnownTopology.LDAP)
@pytest.mark.parametrize("sssd_service_user", ("root", "sssd"))
@pytest.mark.require(
lambda client, sssd_service_user: ((sssd_service_user == "root") or client.features["non-privileged"]),
"SSSD was built without support for running under non-root",
@pytest.mark.skipif(
bool(lambda client, sssd_service_user: ((sssd_service_user != "root") and not client.features["non-privileged"])),
reason="SSSD was built without support for running under non-root",
)
@pytest.mark.skipif(
bool(lambda client: not client.features["ldap_use_ppolicy"]),
reason="SSSD is missing support for ldap_use_ppolicy.",
)
def test_ldap__password_change(client: Client, ldap: LDAP, modify_mode: str, use_ppolicy: str, sssd_service_user: str):
"""
Expand Down Expand Up @@ -69,6 +73,10 @@ def test_ldap__password_change(client: Client, ldap: LDAP, modify_mode: str, use
@pytest.mark.parametrize("modify_mode", ["exop", "ldap_modify"])
@pytest.mark.parametrize("use_ppolicy", ["true", "false"])
@pytest.mark.topology(KnownTopology.LDAP)
@pytest.mark.skipif(
bool(lambda client: not client.features["ldap_use_ppolicy"]),
reason="SSSD is missing support for ldap_use_ppolicy.",
)
def test_ldap__password_change_new_passwords_do_not_match(
client: Client, ldap: LDAP, modify_mode: str, use_ppolicy: str
):
Expand Down Expand Up @@ -101,6 +109,10 @@ def test_ldap__password_change_new_passwords_do_not_match(
@pytest.mark.parametrize("modify_mode", ["exop", "ldap_modify"])
@pytest.mark.parametrize("use_ppolicy", ["true", "false"])
@pytest.mark.topology(KnownTopology.LDAP)
@pytest.mark.skipif(
bool(lambda client: not client.features["ldap_use_ppolicy"]),
reason="SSSD is missing support for ldap_use_ppolicy.",
)
def test_ldap__password_change_new_password_does_not_meet_complexity_requirements(
client: Client, ldap: LDAP, modify_mode: str, use_ppolicy: str
):
Expand Down Expand Up @@ -142,6 +154,10 @@ def test_ldap__password_change_new_password_does_not_meet_complexity_requirement
@pytest.mark.parametrize("modify_mode", ["exop", "ldap_modify"])
@pytest.mark.parametrize("use_ppolicy", ["true", "false"])
@pytest.mark.topology(KnownTopology.LDAP)
@pytest.mark.skipif(
bool(lambda client: not client.features["ldap_use_ppolicy"]),
reason="SSSD is missing support for ldap_use_ppolicy.",
)
def test_ldap__password_change_failed_current_password(client: Client, ldap: LDAP, modify_mode: str, use_ppolicy: str):
"""
:title: Password change failed because an incorrect password was used
Expand Down

0 comments on commit 4e95d6f

Please sign in to comment.