Skip to content

Commit

Permalink
Tests: convert multihost/alltests/test_cache_testing to system/memory…
Browse files Browse the repository at this point in the history
…_cache
  • Loading branch information
patriki01 committed Dec 21, 2023
1 parent c4e8094 commit e4034f9
Show file tree
Hide file tree
Showing 2 changed files with 380 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tests/multihost/alltests/test_cache_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class TestCacheTesting():
Test for correct cache presence in case of variety of SSSD Configurations.
Test for correct cache presence in case of modification & deletion of user entries.
"""
@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__verify_timestamp_cache')
@staticmethod
def test_0001_Verify_Timestamp_Cache_Exists(multihost):
"""
Expand All @@ -64,6 +65,7 @@ def test_0001_Verify_Timestamp_Cache_Exists(multihost):
cmd = multihost.client[0].run_command(list_cmd, raiseonerr=False)
assert cmd.returncode == 0, f"Could not find timestamp cache file {file}"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__verify_timestamp_cache')
@staticmethod
def test_0002_Verify_Cache_on_User_Lookup(multihost):
"""
Expand All @@ -85,6 +87,7 @@ def test_0002_Verify_Cache_on_User_Lookup(multihost):
assert cmd.returncode == 0, f'{ldb_cmd} did not execute successfully'
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__expire_cache_verify_updates')
@staticmethod
def test_0003_Expire_User_Entries_and_Verify_Updates(multihost):
"""
Expand Down Expand Up @@ -115,6 +118,7 @@ def test_0003_Expire_User_Entries_and_Verify_Updates(multihost):
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'
assert "dataExpireTimestamp: 1\n" in cmd2_output, "dataExpireTimestamp not found in /tmp/file_ldb2"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__refresh_user_entries')
@staticmethod
def test_0004_Refresh_User_Entries_After_Expiry(multihost):
"""
Expand Down Expand Up @@ -145,6 +149,7 @@ def test_0004_Refresh_User_Entries_After_Expiry(multihost):
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'
assert "dataExpireTimestamp: 1\n" not in cmd2_output, "dataExpireTimestamp found in /tmp/file_ldb2"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__user_auth_after_cache_expiration')
@staticmethod
def test_0005_Expire_User_Entries_ans_Run_User_Auth(multihost):
"""
Expand Down Expand Up @@ -179,6 +184,7 @@ def test_0005_Expire_User_Entries_ans_Run_User_Auth(multihost):
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'
assert "dataExpireTimestamp: 1\n" not in cmd2_output, "dataExpireTimestamp found in /tmp/file_ldb2"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__check_refresh_expired_interval_40_user')
@staticmethod
def test_0006_Set_refresh_expired_interval_to_40(multihost, backupsssdconf):
"""
Expand Down Expand Up @@ -224,6 +230,7 @@ def test_0006_Set_refresh_expired_interval_to_40(multihost, backupsssdconf):
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'
assert "dataExpireTimestamp: 1\n" not in cmd2_output, "dataExpireTimestamp found in /tmp/file_ldb2"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__check_timestamps_fully_qualified_names')
@staticmethod
def test_0007_Set_use_fully_qualified_names_to_true(multihost, backupsssdconf):
"""
Expand Down Expand Up @@ -256,6 +263,7 @@ def test_0007_Set_use_fully_qualified_names_to_true(multihost, backupsssdconf):
assert cmd.returncode == 0, f'{ldb_cmd} did not execute successfully'
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__check_timestamps_false_case_sensitive')
@staticmethod
def test_0008_Set_case_sensitive_to_false(multihost, backupsssdconf):
"""
Expand Down Expand Up @@ -287,6 +295,7 @@ def test_0008_Set_case_sensitive_to_false(multihost, backupsssdconf):
assert cmd.returncode == 0, f'{ldb_cmd} did not execute successfully'
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__verify_group_timestamp_cache')
@staticmethod
def test_0009_Verify_ldb_cache_updates_on_group_lookup(multihost):
"""
Expand All @@ -312,6 +321,7 @@ def test_0009_Verify_ldb_cache_updates_on_group_lookup(multihost):
assert cmd.returncode == 0, f'{ldb_cmd} did not execute successfully'
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__verify_group_timestamp_cache')
@staticmethod
def test_0010_Expire_group_record_in_cache(multihost):
"""
Expand Down Expand Up @@ -342,6 +352,7 @@ def test_0010_Expire_group_record_in_cache(multihost):
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'
assert "dataExpireTimestamp: 1\n" in cmd2_output, "dataExpireTimestamp not found in /tmp/file_ldb2"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__refresh_group_entries')
@staticmethod
def test_0011_Refresh_group_record_after_expiry(multihost):
"""
Expand Down Expand Up @@ -372,6 +383,7 @@ def test_0011_Refresh_group_record_after_expiry(multihost):
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'
assert "dataExpireTimestamp: 1\n" not in cmd2_output, "dataExpireTimestamp found in /tmp/file_ldb2"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__check_refresh_expired_interval_40_group')
@staticmethod
def test_0012_Set_refresh_expired_interval_to_40(multihost, backupsssdconf):
"""
Expand Down Expand Up @@ -417,6 +429,7 @@ def test_0012_Set_refresh_expired_interval_to_40(multihost, backupsssdconf):
assert cmd2.returncode == 0, f'{ldb_cmd2} did not execute successfully'
assert "dataExpireTimestamp: 1\n" not in cmd2_output, "dataExpireTimestamp found in /tmp/file_ldb2"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__modify_user_invalidate_cache')
@staticmethod
def test_0013_Modify_User_Attribute(multihost):
"""
Expand Down Expand Up @@ -465,6 +478,7 @@ def test_0013_Modify_User_Attribute(multihost):
assert cmd4.returncode == 0, f'{ldb_cmd2} did not execute successfully'
assert "dataExpireTimestamp: 1\n" not in cmd4_output, "dataExpireTimestamp found in /tmp/file_ldb2"

@pytest.mark.converted('test_memory_cache.py', 'test_memory_cache__delete_user_updates_cache')
@staticmethod
def test_0014_Delete_an_existing_user(multihost):
"""
Expand Down
Loading

0 comments on commit e4034f9

Please sign in to comment.