Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/tests/multihost/ipa/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import pytest
from sssd.testlib.common.utils import sssdTools
from sssd.testlib.common.exceptions import SSSDException
from sssd.testlib.common.ssh2_python import run_command_client


@pytest.mark.usefixtures('default_ipa_users', 'reset_password')
Expand Down Expand Up @@ -335,7 +334,7 @@ def test_authentication_indicators(multihost, backupsssdconf):
multihost.client[0].run_command(
f'su -l {user} -c "ipa sudorule-add-user testrule2 --users admin"',
raiseonerr=False)
run_command_client(multihost, user, test_password, "sudo -l")
multihost.client[0].run_command(f'su -l {user} -c "sudo -l"')
time.sleep(3)
search = multihost.client[0].run_command(
'fgrep gssapi_ /var/log/sssd/sssd_pam.log | tail -10')
Expand All @@ -347,8 +346,7 @@ def test_authentication_indicators(multihost, backupsssdconf):
multihost.client[0].run_command(
f'su -l {user} -c "kinit admin"', stdin_text=test_password,
raiseonerr=False)
run_command_client(multihost, user, test_password, "sudo -l")

multihost.client[0].run_command(f'su -l {user} -c "sudo -l"')
multihost.client[0].run_command(
f'su -l {user} -c "klist"', raiseonerr=False)
multihost.client[0].run_command(
Expand Down Expand Up @@ -423,9 +421,10 @@ def test_pass_krb5cname_to_pam(multihost,
multihost.client[0].run_command(
f'su -l {user} -c "sudo -S -l"', stdin_text=test_password,
raiseonerr=False)
result = run_command_client(multihost, user, test_password,
'echo -e "Secret123" | sudo -S /usr/sbin/sssctl domain-list')
assert domain_name in result
result = multihost.client[0].run_command(
f'su -l {user} -c "echo -e \"Secret123\" | sudo -S /usr/sbin/sssctl domain-list"'
)
assert domain_name in result.stdout_text

@staticmethod
def test_ssh_hash_knownhosts(multihost, reset_password, backupsssdconf):
Expand Down Expand Up @@ -606,7 +605,7 @@ def test_ssh_expiration_warning(multihost, reset_password, hbac_sshd_rule,

# Test result evaluation
assert ssh_cmd.returncode == 0, "Ssh login failed."
assert "Your password will expire in " in ssh_cmd.stdout_text,\
assert "Your password will expire in " in ssh_cmd.stdout_text, \
"The password expiration notice was not shown."

@staticmethod
Expand Down