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:
François Cami
2020-07-24 16:23:28 +02:00
parent 112386f76a
commit 326e13347c

View File

@@ -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"