Skip to content

Commit

Permalink
tests: converting all the ldb cache tests to use one provider
Browse files Browse the repository at this point in the history
There is minimal benefit to run these tests against all providers.
  • Loading branch information
Dan Lavu committed Oct 21, 2024
1 parent e623b04 commit ac1f101
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions src/tests/system/tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Negative cache (ncache)
* In-memory cache (memcache): test_memcache.py
Note: There is not added benefit to test against all topologies, the cache tests are tested against LDAP.
:requirement: Cache
"""

Expand All @@ -16,15 +18,14 @@

import pytest
from sssd_test_framework.roles.client import Client
from sssd_test_framework.roles.generic import GenericProvider
from sssd_test_framework.roles.ldap import LDAP
from sssd_test_framework.topology import KnownTopology, KnownTopologyGroup
from sssd_test_framework.topology import KnownTopology


@pytest.mark.integration
@pytest.mark.importance("low")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_cache__entries_are_refreshed_as_configured(client: Client, provider: GenericProvider):
@pytest.mark.topology(KnownTopology.LDAP)
def test_cache__entries_are_refreshed_as_configured(client: Client, provider: LDAP):
"""
:title: Ensuring LDB cache refreshes at configured intervals
:setup:
Expand Down Expand Up @@ -90,8 +91,8 @@ def test_cache__entries_are_refreshed_as_configured(client: Client, provider: Ge

@pytest.mark.integration
@pytest.mark.importance("low")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_cache__writes_to_both_database_files(client: Client, provider: GenericProvider):
@pytest.mark.topology(KnownTopology.LDAP)
def test_cache__writes_to_both_database_files(client: Client, provider: LDAP):
"""
:title: Search for user in the following ldb databases, cache_*.ldb and timestamp_*.ldb
:setup:
Expand Down Expand Up @@ -125,10 +126,8 @@ def test_cache__writes_to_both_database_files(client: Client, provider: GenericP

@pytest.mark.integration
@pytest.mark.importance("low")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_cache__writes_to_both_database_files_when_using_fully_qualified_names(
client: Client, provider: GenericProvider
):
@pytest.mark.topology(KnownTopology.LDAP)
def test_cache__writes_to_both_database_files_when_using_fully_qualified_names(client: Client, provider: LDAP):
"""
:title: Search for user using fully qualified name in the following ldb databases, cache_*.ldb and timestamp_*.ldb
:setup:
Expand Down Expand Up @@ -160,10 +159,8 @@ def test_cache__writes_to_both_database_files_when_using_fully_qualified_names(


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_cache__user_entries_contains_latest_changes_when_modified_and_deleted(
client: Client, provider: GenericProvider
):
@pytest.mark.topology(KnownTopology.LDAP)
def test_cache__user_entries_contains_latest_changes_when_modified_and_deleted(client: Client, provider: LDAP):
"""
:title: Checks user changes are reflected when modified and deleted
:setup:
Expand Down Expand Up @@ -207,10 +204,10 @@ def test_cache__user_entries_contains_latest_changes_when_modified_and_deleted(


@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
@pytest.mark.topology(KnownTopology.LDAP)
def test_cache__group_entries_contains_latest_changes_when_modified_and_deleted(
client: Client,
provider: GenericProvider,
provider: LDAP,
):
"""
:title: Check latest group changes are reflected when modified and deleted
Expand Down Expand Up @@ -315,8 +312,8 @@ def test_cache__invalidate_entries_in_domain_and_timestamps_caches(

@pytest.mark.integration
@pytest.mark.importance("low")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_cache__extra_attributes_are_stored(client: Client, provider: GenericProvider):
@pytest.mark.topology(KnownTopology.LDAP)
def test_cache__extra_attributes_are_stored(client: Client, provider: LDAP):
"""
:title: Extra attributes are cached
:setup:
Expand Down Expand Up @@ -356,8 +353,8 @@ def test_cache__extra_attributes_are_stored(client: Client, provider: GenericPro

@pytest.mark.integration
@pytest.mark.importance("low")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_cache__extra_attributes_with_empty_values_are_ignored(client: Client, provider: GenericProvider):
@pytest.mark.topology(KnownTopology.LDAP)
def test_cache__extra_attributes_with_empty_values_are_ignored(client: Client, provider: LDAP):
"""
:title: When extra attribute of user is added but not assigned, it is neither cached nor displayed
:setup:
Expand Down

0 comments on commit ac1f101

Please sign in to comment.