Skip to content

Commit

Permalink
tests: improve feature presence automation
Browse files Browse the repository at this point in the history
`files-provider` stopped being shipped in Fedora 40 in sssd-2.9. Thus,
the detection matrix need to be updated to take this into account.

In addition, the assertion messages weren't clear enough, so I've
improved them to understand them at a first glance.

Signed-off-by: Iker Pedrosa <[email protected]>
  • Loading branch information
ikerexxe committed Jan 8, 2025
1 parent 10c753e commit c3d7ee9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/tests/system/tests/test_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
("Red Hat Enterprise Linux", 9, 4, 2, 9, "passkey", True),
("Ubuntu", 23, 10, 2, 9, "passkey", True),
(None, None, None, 2, 10, "knownhosts", True),
("Fedora", 40, 0, 2, 10, "files-provider", False),
("Fedora", 40, 0, 2, 9, "files-provider", False),
("CentOS Stream", 10, 0, 2, 10, "files-provider", False),
("Red Hat Enterprise Linux", 10, 0, 2, 10, "files-provider", False),
(None, None, None, 2, 10, "ldap_use_ppolicy", True),
Expand Down Expand Up @@ -75,12 +75,14 @@ def test_feature__presence(
if sssd_version["major"] > sssd_major or (
sssd_version["major"] == sssd_major and sssd_version["minor"] >= sssd_minor
):
state = "" if presence else "not"
assert client.features[feature] == presence, (
f"Feature {feature} should be present in {distribution} {distro_major}.{distro_minor} with "
"sssd-{sssd_major}.{sssd_minor}"
f"Feature {feature} should {state} be present in {distribution} {distro_major}.{distro_minor} with "
f"sssd-{sssd_version["major"]}.{sssd_version["minor"]}"
)
else:
state = "not" if presence else ""
assert client.features[feature] != presence, (
f"Feature {feature} should not be present in {distribution} {distro_major}.{distro_minor} with "
"sssd-{sssd_major}.{sssd_minor}"
f"Feature {feature} should {state} be present in {distribution} {distro_major}.{distro_minor} with "
f"sssd-{sssd_version["major"]}.{sssd_version["minor"]}"
)

0 comments on commit c3d7ee9

Please sign in to comment.