Skip to content

Commit

Permalink
tests: multihost/basic/test_kcm converted
Browse files Browse the repository at this point in the history
  • Loading branch information
patriki01 committed Oct 26, 2023
1 parent 5a211ec commit 83d3564
Show file tree
Hide file tree
Showing 2 changed files with 400 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tests/multihost/basic/test_kcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"""
import os
import re

import pytest
from pexpect import pxssh
from utils_config import set_param

from sssd.testlib.common.utils import sssdTools


Expand Down Expand Up @@ -51,6 +53,7 @@ def _remove_secret_db(self, multihost):
'rm -f /var/lib/sss/secrets/secrets.ldb')
self._restart_kcm(multihost)

@pytest.mark.converted('test_kcm.py', 'test_kcm__kinit_kcm_krb5ccname')
@pytest.mark.usefixtures("enable_kcm")
def test_kinit_kcm(self, multihost):
"""
Expand All @@ -70,6 +73,7 @@ def test_kinit_kcm(self, multihost):
assert cmd2.returncode == 0, "klist failed!"
assert 'Ticket cache: KCM:14583103' in cmd2.stdout_text

@pytest.mark.converted('test_kcm.py', 'test_kcm__ssh_login_with_kcm')
@staticmethod
@pytest.mark.usefixtures("enable_kcm")
def test_ssh_login_kcm(multihost):
Expand All @@ -85,6 +89,7 @@ def test_ssh_login_kcm(multihost):
'journalctl -u sssd -n 50 --no-pager')
assert ssh0, "Authentication Failed as user foo4"

@pytest.mark.converted('test_kcm.py', 'test_kcm__debug_enabled')
@pytest.mark.usefixtures("enable_kcm")
def test_kcm_debug_level_set(self, multihost):
"""
Expand Down Expand Up @@ -133,6 +138,7 @@ def test_kcm_debug_level_set(self, multihost):
log_lines_debug = self._kcm_log_length(multihost)
assert log_lines_debug > log_lines_pre + 100

@pytest.mark.converted('test_kcm.py', 'test_kcm__kdestroy_nocache')
@staticmethod
@pytest.mark.usefixtures("enable_kcm")
def test_kdestroy_retval(multihost):
Expand All @@ -157,6 +163,7 @@ def test_kdestroy_retval(multihost):
f'su -l {user} -c "kdestroy"', raiseonerr=False)
assert kd2.returncode == 0, "Second kdestroy failed!"

@pytest.mark.converted('test_kcm.py', 'test_kcm__forward_credentials')
@staticmethod
@pytest.mark.usefixtures("enable_kcm")
def test_ssh_forward_creds(multihost):
Expand Down Expand Up @@ -191,6 +198,7 @@ def test_ssh_forward_creds(multihost):
assert 'KCM:14583103' in klist, "kinit did not work!"
assert 'KCM:14583109' in ssh_output, "Ticket not forwarded!"

@pytest.mark.converted('test_kcm.py', 'test_kcm__display_correct_kvno')
@staticmethod
@pytest.mark.usefixtures("enable_kcm")
def test_kvno_display(multihost):
Expand All @@ -216,6 +224,7 @@ def test_kvno_display(multihost):
else:
pytest.fail("kvno display was improper")

@pytest.mark.converted('test_kcm.py', 'test_kcm__per_uid_quota')
@pytest.mark.usefixtures("enable_kcm", "create_many_user_principals")
def test_kcm_peruid_quota(self, multihost):
"""
Expand Down Expand Up @@ -268,6 +277,7 @@ def test_kcm_peruid_quota(self, multihost):
multihost.master[0].run_command(
'su -l foo3 -c "kdestroy -A"', raiseonerr=False)

@pytest.mark.converted('test_kcm.py', 'test_kcm__per_uid_quota_increase')
@pytest.mark.usefixtures("enable_kcm", "create_many_user_principals")
def test_kcm_peruid_quota_increase(self, multihost):
"""
Expand Down Expand Up @@ -310,6 +320,7 @@ def test_kcm_peruid_quota_increase(self, multihost):
multihost.master[0].run_command(
f'su -l {user} -c "kdestroy -A"', raiseonerr=False)

@pytest.mark.converted('test_kcm.py', 'test_kcm__low_per_uid_quota')
@pytest.mark.usefixtures("enable_kcm")
def test_kcm_payload_low_quota(self, multihost):
"""
Expand Down
Loading

0 comments on commit 83d3564

Please sign in to comment.