From 326e13347c89f2a3287209e95e2b7cd00aa3d80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= Date: Fri, 24 Jul 2020 16:23:28 +0200 Subject: [PATCH] ipatests: test_commands: test_login_wrong_password: Paramiko=>OpenSSH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Mohammad Rizwan Reviewed-By: Michal Polovka --- ipatests/test_integration/test_commands.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py index d5269ce21..fa6abd81e 100644 --- a/ipatests/test_integration/test_commands.py +++ b/ipatests/test_integration/test_commands.py @@ -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"