ipatests: test_commands: test_ssh_from_controller: Paramiko=>OpenSSH

Paramiko is not compatible with FIPS.
Migrate test_ssh_from_controller 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 15:18:29 +02:00
parent 27ed8260ba
commit 112386f76a

View File

@ -893,8 +893,6 @@ class TestIPACommand(IntegrationTest):
3. add an ipa user 3. add an ipa user
4. ssh from controller to master using the user created in step 3 4. ssh from controller to master using the user created in step 3
""" """
if self.master.is_fips_mode: # pylint: disable=no-member
pytest.skip("paramiko is not compatible with FIPS mode")
cmd = self.master.run_command(['sssd', '--version']) cmd = self.master.run_command(['sssd', '--version'])
sssd_version = platform_tasks.parse_ipa_version( sssd_version = platform_tasks.parse_ipa_version(
@ -926,12 +924,11 @@ class TestIPACommand(IntegrationTest):
) )
tasks.kdestroy_all(self.master) tasks.kdestroy_all(self.master)
client = paramiko.SSHClient() tasks.run_ssh_cmd(
client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) to_host=self.master.external_hostname, username=test_user,
client.connect(self.master.hostname, auth_method="password", password=password
username=test_user, )
password=password)
client.close()
finally: finally:
sssd_conf_backup.restore() sssd_conf_backup.restore()
self.master.run_command(['systemctl', 'restart', 'sssd.service']) self.master.run_command(['systemctl', 'restart', 'sssd.service'])