mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: test_commands: test_login_wrong_password: Paramiko=>OpenSSH
Paramiko is not compatible with FIPS. Migrate test_login_wrong_password to the OpenSSH CLI SSH(1). Rationale: this is exactly what clients use. Fixes: https://pagure.io/freeipa/issue/8129 Signed-off-by: François Cami <fcami@redhat.com> Reviewed-By: Mohammad Rizwan <myusuf@redhat.com> Reviewed-By: Michal Polovka <mpolovka@redhat.com>
This commit is contained in:
@@ -15,7 +15,6 @@ import ssl
|
||||
from itertools import chain, repeat
|
||||
import textwrap
|
||||
import time
|
||||
import paramiko
|
||||
import pytest
|
||||
from subprocess import CalledProcessError
|
||||
|
||||
@@ -1183,21 +1182,19 @@ class TestIPACommand(IntegrationTest):
|
||||
pytest.xfail('Fix is part of sssd 2.3.0 and is'
|
||||
' available from fedora32 onwards')
|
||||
|
||||
sshconn = paramiko.SSHClient()
|
||||
sshconn.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
# start to look at logs a bit before "now"
|
||||
# https://pagure.io/freeipa/issue/8432
|
||||
since = time.strftime(
|
||||
'%H:%M:%S', (datetime.now() - timedelta(seconds=10)).timetuple()
|
||||
)
|
||||
try:
|
||||
sshconn.connect(self.master.hostname,
|
||||
username=self.testuser,
|
||||
password='WrongPassword')
|
||||
except paramiko.AuthenticationException:
|
||||
pass
|
||||
|
||||
sshconn.close()
|
||||
password = 'WrongPassword'
|
||||
|
||||
tasks.run_ssh_cmd(
|
||||
to_host=self.master.external_hostname, username=self.testuser,
|
||||
auth_method="password", password=password,
|
||||
expect_auth_failure=True
|
||||
)
|
||||
|
||||
# check if proper message logged
|
||||
exp_msg = ("pam_sss(sshd:auth): received for user {}: 7"
|
||||
|
||||
Reference in New Issue
Block a user