Skip to content

Commit

Permalink
tests: consolidation, refactoring and organizing, renaming of some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Lavu committed Aug 25, 2023
1 parent b085533 commit be68a48
Show file tree
Hide file tree
Showing 10 changed files with 224 additions and 243 deletions.
92 changes: 46 additions & 46 deletions src/tests/intg/test_memory_cache.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class TestSssctlConfigCheck(object):
@pytest.mark.converted('test_sssctl_config_check.py', 'test_sssctl_config_check__typo_option_name')
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_typo_option_name')
def test_verify_typo_option_name(self, multihost):
"""
:title: sssctl: Verify typos in option name (not value)
Expand Down Expand Up @@ -44,7 +44,7 @@ def test_verify_typo_option_name(self, multihost):
multihost.master[0].run_command(['/bin/cp', '-a', cfgput, cfgget],
raiseonerr=False)

@pytest.mark.converted('test_sssctl_config_check.py', 'test_sssctl_config_check__typo_domain_name')
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_typo_domain_name')
def test_verify_typo_domain_name(self, multihost):
"""
:title: sssctl: Verify typos in domain name of configuration file
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_verify_typo_domain_name(self, multihost):
multihost.master[0].run_command(['/bin/cp', '-a', cfgput, cfgget],
raiseonerr=False)

@pytest.mark.converted('test_sssctl_config_check.py', 'test_sssctl_config_check__misplaced_option')
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__misplaced_option')
def test_misplaced_option(self, multihost):
"""
:title: sssctl: Verify misplace options in default configuration file
Expand Down
1 change: 1 addition & 0 deletions src/tests/system/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ markers =
krb: marks krb test
ldap: marks ldap test
logging: marks logging test
netgroup: marks netgroup test
pki: marks pki test
performance: marks performance test
referrals: marks referral test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__getpwnam(client: Client, provider: GenericProvider):
def test_cache__getpwnam(client: Client, provider: GenericProvider):
"""
:title: Lookup user by name uses memory cache when SSSD is stopped
:setup:
Expand Down Expand Up @@ -56,7 +56,7 @@ def check(users):
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__getgrnam(client: Client, provider: GenericProvider):
def test_cache__getgrnam(client: Client, provider: GenericProvider):
"""
:title: Lookup group by groupname uses memory cache when SSSD is stopped
:setup:
Expand Down Expand Up @@ -97,7 +97,7 @@ def check(groups):
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__disabled_passwd_getgrnam(client: Client, provider: GenericProvider):
def test_cache__disabled_passwd_getgrnam(client: Client, provider: GenericProvider):
"""
:title: Lookup group by groupname uses memory cache when SSSD is stopped and 'memcache_size_passwd' = 0
:setup:
Expand Down Expand Up @@ -140,7 +140,7 @@ def check(groups):
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__disabled_passwd_getpwnam(client: Client, provider: GenericProvider):
def test_cache__disabled_passwd_getpwnam(client: Client, provider: GenericProvider):
"""
:title: Lookup user by name when SSSD is stopped and 'memcache_size_passwd' = 0
uses memory cache therefore user is not found
Expand Down Expand Up @@ -187,7 +187,7 @@ def test_memory_cache__disabled_passwd_getpwnam(client: Client, provider: Generi
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__disabled_intitgroups_getgrnam(client: Client, provider: GenericProvider):
def test_cache__disabled_intitgroups_getgrnam(client: Client, provider: GenericProvider):
"""
:title: Lookup group by groupname when SSSD is stopped and 'memcache_size_initgroups' = 0 uses memory cache
:setup:
Expand Down Expand Up @@ -230,7 +230,7 @@ def check(groups):
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__disabled_intitgroups_getpwnam(client: Client, provider: GenericProvider):
def test_cache__disabled_intitgroups_getpwnam(client: Client, provider: GenericProvider):
"""
:title: Lookup user by name and id when SSSD is stopped and 'memcache_size_initgroups' = 0 uses memory cache
:setup:
Expand Down Expand Up @@ -285,7 +285,7 @@ def check(ids):
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__disabled_group(client: Client, provider: GenericProvider):
def test_cache__disabled_group(client: Client, provider: GenericProvider):
"""
:title: Lookup user by name and id when SSSD is stopped and 'memcache_size_group' = 0 uses memory cache,
but lookup groups is not possible
Expand Down Expand Up @@ -359,7 +359,7 @@ def check(users):
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__disabled_cache(client: Client, provider: GenericProvider):
def test_cache__disabled_cache(client: Client, provider: GenericProvider):
"""
:title: Lookup user and group when SSSD is stopped and whole cache disabled
uses memory cache and therefore it is not possible
Expand Down Expand Up @@ -436,7 +436,7 @@ def test_memory_cache__disabled_cache(client: Client, provider: GenericProvider)
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__membership_by_group_name(client: Client, provider: GenericProvider):
def test_cache__membership_by_group_name(client: Client, provider: GenericProvider):
"""
:title: Lookup user by name and test membership by name use memory cache when SSSD is stopped
:setup:
Expand Down Expand Up @@ -489,7 +489,7 @@ def check():
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__membership_by_group_id(client: Client, provider: GenericProvider):
def test_cache__membership_by_group_id(client: Client, provider: GenericProvider):
"""
:title: Lookup user by name and test membership by gid use memory cache when SSSD is stopped
:setup:
Expand Down Expand Up @@ -545,7 +545,7 @@ def check():
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__user_gids(client: Client, provider: GenericProvider):
def test_cache__user_gids(client: Client, provider: GenericProvider):
"""
:title: Lookup user by id and test membership by gid use memory cache when SSSD is stopped
:setup:
Expand Down Expand Up @@ -601,7 +601,7 @@ def check():
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__getpwnam_fully_qualified_names(client: Client, provider: GenericProvider):
def test_cache__getpwnam_fully_qualified_names(client: Client, provider: GenericProvider):
"""
:title: Lookup user by full name when 'use_fully_qualified_names' is 'true'
uses memory cache when sssd is stopped
Expand Down Expand Up @@ -654,7 +654,7 @@ def check():
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__case_insensitive(client: Client, provider: GenericProvider):
def test_cache__case_insensitive(client: Client, provider: GenericProvider):
"""
:title: Lookup user by case insensitive name when 'case_sensitive' is 'false'
uses memory cache when SSSD is stopped
Expand Down Expand Up @@ -717,7 +717,7 @@ def test_memory_cache__case_insensitive(client: Client, provider: GenericProvide
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__fq_names_case_insensitive(client: Client, provider: GenericProvider):
def test_cache__fq_names_case_insensitive(client: Client, provider: GenericProvider):
"""
:title: Lookup user by case insensitive fully qualified name when 'case_sensitive' is 'false'
and 'use_fully_qualified_names' is 'true' uses memory cache when SSSD is stopped
Expand Down Expand Up @@ -777,7 +777,7 @@ def test_memory_cache__fq_names_case_insensitive(client: Client, provider: Gener
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidation_of_gids_after_initgroups(client: Client, provider: GenericProvider):
def test_cache__invalidation_of_gids_after_initgroups(client: Client, provider: GenericProvider):
"""
:title: Invalidate groups after initgroups call when SSSD is stopped
:setup:
Expand Down Expand Up @@ -857,7 +857,7 @@ def check_group(name, gid):
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__initgroups_without_change_in_membership(client: Client, provider: GenericProvider):
def test_cache__initgroups_without_change_in_membership(client: Client, provider: GenericProvider):
"""
:title: Invalidated cache, after refresh and stopped SSSD, has everything loaded in memory
:setup:
Expand Down Expand Up @@ -942,10 +942,11 @@ def check():
client.sssd.stop()
check()


@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_user_before_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_user_before_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate user cache before SSSD is stopped
:setup:
Expand Down Expand Up @@ -1001,7 +1002,7 @@ def test_memory_cache__invalidate_user_before_stop(client: Client, provider: Gen
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_user_after_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_user_after_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate user cache after SSSD is stopped
:setup:
Expand Down Expand Up @@ -1057,7 +1058,7 @@ def test_memory_cache__invalidate_user_after_stop(client: Client, provider: Gene
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_users_before_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_users_before_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate users cache before SSSD is stopped
:setup:
Expand Down Expand Up @@ -1121,7 +1122,7 @@ def test_memory_cache__invalidate_users_before_stop(client: Client, provider: Ge
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_users_after_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_users_after_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate users cache after SSSD is stopped
:setup:
Expand Down Expand Up @@ -1185,7 +1186,7 @@ def test_memory_cache__invalidate_users_after_stop(client: Client, provider: Gen
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_group_before_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_group_before_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate group cache before SSSD is stopped
:setup:
Expand Down Expand Up @@ -1228,7 +1229,7 @@ def test_memory_cache__invalidate_group_before_stop(client: Client, provider: Ge
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_group_after_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_group_after_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate group cache after SSSD is stopped
:setup:
Expand Down Expand Up @@ -1271,7 +1272,7 @@ def test_memory_cache__invalidate_group_after_stop(client: Client, provider: Gen
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_groups_before_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_groups_before_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate groups cache before SSSD is stopped
:setup:
Expand Down Expand Up @@ -1318,7 +1319,7 @@ def test_memory_cache__invalidate_groups_before_stop(client: Client, provider: G
@pytest.mark.importance("high")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_groups_after_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_groups_after_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate groups cache after SSSD is stopped
:setup:
Expand Down Expand Up @@ -1365,7 +1366,7 @@ def test_memory_cache__invalidate_groups_after_stop(client: Client, provider: Ge
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_everything_before_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_everything_before_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate all parts of cache before SSSD is stopped
:setup:
Expand Down Expand Up @@ -1436,7 +1437,7 @@ def test_memory_cache__invalidate_everything_before_stop(client: Client, provide
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__invalidate_everything_after_stop(client: Client, provider: GenericProvider):
def test_cache__invalidate_everything_after_stop(client: Client, provider: GenericProvider):
"""
:title: Invalidate all parts of cache after SSSD is stopped
:setup:
Expand Down Expand Up @@ -1507,7 +1508,7 @@ def test_memory_cache__invalidate_everything_after_stop(client: Client, provider
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__memcache_timeout_zero(client: Client, provider: GenericProvider):
def test_cache__memcache_timeout_zero(client: Client, provider: GenericProvider):
"""
:title: Cache is not created at all when 'memcache_timeout' set to '0'
:setup:
Expand Down Expand Up @@ -1567,7 +1568,7 @@ def test_memory_cache__memcache_timeout_zero(client: Client, provider: GenericPr
@pytest.mark.importance("critical")
@pytest.mark.cache
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_memory_cache__removed_cache_without_invalidation(client: Client, provider: GenericProvider):
def test_cache__removed_cache_without_invalidation(client: Client, provider: GenericProvider):
"""
:title: SSSD is stopped, cache removed then users and groups cannot be lookedup
:setup:
Expand Down
Loading

0 comments on commit be68a48

Please sign in to comment.