mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
ipatests: Perform a connection test before preparing the client
When the host is down, the preparation of the host fails. This produces misleading errors, since the test framework reports that the actual command being executed failed, when in fact (in case of SSHTransport), the cause of failure was unability to establish a SSH session. https://fedorahosted.org/freeipa/ticket/4132 Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
This commit is contained in:
parent
033c354709
commit
01a0249a40
@ -42,6 +42,10 @@ log = log_mgr.get_logger(__name__)
|
||||
def prepare_host(host):
|
||||
if isinstance(host, Host):
|
||||
env_filename = os.path.join(host.config.test_dir, 'env.sh')
|
||||
|
||||
# First we try to run simple echo command to test the connection
|
||||
host.run_command(['true'], set_env=False)
|
||||
|
||||
host.collect_log(env_filename)
|
||||
host.transport.mkdir_recursive(host.config.test_dir)
|
||||
host.put_file_contents(env_filename, env_to_script(host.to_env()))
|
||||
|
Loading…
Reference in New Issue
Block a user