ipatests: fix host name for ssh connection from controller to master

Use master.external_hostname instead of master.hostname for ssh connection
from controller machine to master. If hostname and external_hostname in
test_config.yml do no match then trying to establish ssh connection
was failing with "[Errno -2] Name or service not known".

Fixes https://pagure.io/freeipa/issue/7874

Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
Sergey Orlov 2019-03-01 18:16:56 +01:00 committed by Florence Blanc-Renaud
parent a65c12d042
commit 24c77bc4f7

View File

@ -289,7 +289,8 @@ class TestIPACommand(IntegrationTest):
"""
test_user = 'test-ssh'
master = self.master.hostname
external_master_hostname = \
self.master.external_hostname # pylint: disable=no-member
pub_keys = []
@ -319,13 +320,13 @@ class TestIPACommand(IntegrationTest):
# first connection attempt is a workaround for
# https://pagure.io/SSSD/sssd/issue/3669
try:
sshcon.connect(master, username=test_user,
sshcon.connect(external_master_hostname, username=test_user,
key_filename=first_priv_key_path, timeout=1)
except (paramiko.AuthenticationException, paramiko.SSHException):
pass
try:
sshcon.connect(master, username=test_user,
sshcon.connect(external_master_hostname, username=test_user,
key_filename=first_priv_key_path, timeout=1)
except (paramiko.AuthenticationException,
paramiko.SSHException) as e: