Skip to content

Commit

Permalink
tests: adding group and importance markers
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Lavu committed Sep 1, 2023
1 parent 41427f9 commit ddf1745
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/tests/system/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
addopts = --strict-markers
testpaths = tests
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
authentication: marks authentication test
authorization: marks authorization test
cache: marks any cache related test
contains_workaround_for(gh=...,bz=...): test requires workaround for an existing bug
identity: marks identity, lookups test
schema: marks schema test
slow: marks tests as slow (deselect with '-m "not slow"')
tools: marks cli tool test
ticket_tools = bz,gh,jira
4 changes: 4 additions & 0 deletions src/tests/system/tests/test_autofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from sssd_test_framework.topology import KnownTopologyGroup


@pytest.mark.importance("critical")
@pytest.mark.ticket(gh=6739)
@pytest.mark.parametrize("cache_first", [False, True])
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
Expand Down Expand Up @@ -60,6 +61,7 @@ def test_autofs__cache_first(client: Client, nfs: NFS, provider: GenericProvider
}


@pytest.mark.importance("medium")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_autofs__propagate_offline__single_domain(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -97,6 +99,7 @@ def test_autofs__propagate_offline__single_domain(client: Client, provider: Gene
assert offline_status_propagated


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_autofs__propagate_offline__multi_domain(client: Client):
"""
Expand Down Expand Up @@ -144,6 +147,7 @@ def test_autofs__propagate_offline__multi_domain(client: Client):
assert offline_status_propagated


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_autofs__offline_domains(client: Client, nfs: NFS, provider: GenericProvider):
"""
Expand Down
5 changes: 5 additions & 0 deletions src/tests/system/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from sssd_test_framework.topology import KnownTopologyGroup


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_config__change_config_while_sssd_running(client: Client):
"""
Expand Down Expand Up @@ -46,6 +47,8 @@ def test_config__change_config_while_sssd_running(client: Client):
assert result["cn=pam,cn=config"]["debug_level"] == ["1"]


@pytest.mark.importance("critical")
@pytest.mark.config
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_config__genconf_particular_section(client: Client):
"""
Expand Down Expand Up @@ -91,6 +94,7 @@ def test_config__genconf_particular_section(client: Client):
assert result["cn=nss,cn=config"]["debug_level"] == ["9"]


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_config__add_remove_section(client: Client):
"""
Expand Down Expand Up @@ -149,6 +153,7 @@ def test_config__add_remove_section(client: Client):
assert result["cn=new_section,cn=config"]["key"] != ["value"]


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_config__genconf_no_such_section(client: Client):
"""
Expand Down
12 changes: 12 additions & 0 deletions src/tests/system/tests/test_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from sssd_test_framework.topology import KnownTopologyGroup


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__getpwnam(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -44,6 +45,7 @@ def test_id__getpwnam(client: Client, provider: GenericProvider):
assert result.user.id == uid, f"User id {result.user.id} is incorrect, {uid} expected"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__getpwuid(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -76,6 +78,7 @@ def test_id__getpwuid(client: Client, provider: GenericProvider):
assert result.user.id == uid, f"User id {result.user.id} is incorrect, {uid} expected"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__getgrnam(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -108,6 +111,7 @@ def test_id__getgrnam(client: Client, provider: GenericProvider):
assert result.gid == gid, f"Group gid {result.gid} is incorrect, {gid} expected"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__getgrgid(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -140,6 +144,7 @@ def test_id__getgrgid(client: Client, provider: GenericProvider):
assert result.gid == gid, f"Group gid {result.gid} is incorrect, {gid} expected"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__getent_passwd(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -181,6 +186,7 @@ def test_id__getent_passwd(client: Client, provider: GenericProvider):
assert result.uid == uid, f"User id {result.uid} is incorrect, {uid} expected"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__getent_group(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -220,6 +226,7 @@ def test_id__getent_group(client: Client, provider: GenericProvider):
assert result.gid == id, f"Group gid {result.gid} is incorrect, {id} expected"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__membership_by_group_name(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -252,6 +259,7 @@ def test_id__membership_by_group_name(client: Client, provider: GenericProvider)
assert result.memberof(groups), f"User {name} is member of wrong groups"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__membership_by_group_id(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -285,6 +293,7 @@ def test_id__membership_by_group_id(client: Client, provider: GenericProvider):
assert result.memberof(gids), f"User {name} is member of wrong groups"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__initgroups(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -323,6 +332,7 @@ def test_id__initgroups(client: Client, provider: GenericProvider):
assert result.memberof([10001, 10002, 10003]), f"User {name} is member of wrong groups"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__getpwnam_fully_qualified_names(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -365,6 +375,7 @@ def test_id__getpwnam_fully_qualified_names(client: Client, provider: GenericPro
assert result.user.id == 10002, f"User id {result.user.id} is incorrect, 10002 expected"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__case_insensitive(client: Client, provider: GenericProvider):
"""
Expand Down Expand Up @@ -409,6 +420,7 @@ def test_id__case_insensitive(client: Client, provider: GenericProvider):
assert result.user.id == uid, f"User id {result.user.id} is incorrect, {uid} expected"


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__fq_names_case_insensitive(client: Client, provider: GenericProvider):
"""
Expand Down
12 changes: 12 additions & 0 deletions src/tests/system/tests/test_kcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from sssd_test_framework.topology import KnownTopology


@pytest.mark.importance("critical")
@pytest.mark.authentication
@pytest.mark.topology(KnownTopology.Client)
@pytest.mark.parametrize("ccache_storage", ["memory", "secdb"])
def test_kcm__kinit_overwrite(client: Client, kdc: KDC, ccache_storage: str):
Expand Down Expand Up @@ -60,6 +62,8 @@ def test_kcm__kinit_overwrite(client: Client, kdc: KDC, ccache_storage: str):
assert krb.cache_count() == 1


@pytest.mark.importance("critical")
@pytest.mark.authentication
@pytest.mark.topology(KnownTopology.Client)
@pytest.mark.parametrize("ccache_storage", ["memory", "secdb"])
def test_kcm__kinit_collection(client: Client, kdc: KDC, ccache_storage: str):
Expand Down Expand Up @@ -149,6 +153,8 @@ def test_kcm__kinit_collection(client: Client, kdc: KDC, ccache_storage: str):
assert krb.cache_count() == 0


@pytest.mark.importance("critical")
@pytest.mark.authentication
@pytest.mark.topology(KnownTopology.Client)
@pytest.mark.parametrize("ccache_storage", ["memory", "secdb"])
def test_kcm__kswitch(client: Client, kdc: KDC, ccache_storage: str):
Expand Down Expand Up @@ -217,6 +223,8 @@ def test_kcm__kswitch(client: Client, kdc: KDC, ccache_storage: str):
assert krb.has_tickets("bob", kdc.realm, [kdc.tgt, kdc.qualify("host/bob")])


@pytest.mark.importance("critical")
@pytest.mark.authentication
@pytest.mark.topology(KnownTopology.Client)
@pytest.mark.parametrize("ccache_storage", ["memory", "secdb"])
def test_kcm__subsidiaries(client: Client, kdc: KDC, ccache_storage: str):
Expand Down Expand Up @@ -292,6 +300,8 @@ def test_kcm__subsidiaries(client: Client, kdc: KDC, ccache_storage: str):
assert principals[kdc.qualify("bob")] == expected[kdc.qualify("bob")]


@pytest.mark.importance("critical")
@pytest.mark.authentication
@pytest.mark.topology(KnownTopology.Client)
@pytest.mark.parametrize("ccache_storage", ["memory", "secdb"])
def test_kcm__kdestroy_nocache(client: Client, kdc: KDC, ccache_storage: str):
Expand Down Expand Up @@ -326,6 +336,8 @@ def test_kcm__kdestroy_nocache(client: Client, kdc: KDC, ccache_storage: str):
assert False, f"kdestroy raised an error: {e}"


@pytest.mark.importance("critical")
@pytest.mark.authentication
@pytest.mark.topology(KnownTopology.Client)
def test_kcm__tgt_renewal(client: Client, kdc: KDC):
"""
Expand Down
2 changes: 2 additions & 0 deletions src/tests/system/tests/test_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from sssd_test_framework.topology import KnownTopology


@pytest.mark.importance("critical")
@pytest.mark.authentication
@pytest.mark.parametrize("modify_mode", ["exop", "ldap_modify"])
@pytest.mark.topology(KnownTopology.LDAP)
def test_ldap__change_password(client: Client, ldap: LDAP, modify_mode: str):
Expand Down
2 changes: 2 additions & 0 deletions src/tests/system/tests/test_ldap_extra_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from sssd_test_framework.topology import KnownTopologyGroup


@pytest.mark.importance("high")
@pytest.mark.schema
@pytest.mark.ticket(gh=4153, bz=1362023)
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
@pytest.mark.parametrize("attrs", ["mail, firstname:givenname, lastname:sn", "given_email:mail"])
Expand Down
Loading

0 comments on commit ddf1745

Please sign in to comment.