summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-01-23 13:33:59 +0100
committerPetr Viktorin <pviktori@redhat.com>2014-02-10 10:37:26 +0100
commit01a0249a40784d15e5ffc217c7626242e0a0045f (patch)
treee12c333165733321f52a046979a6ca6775e27288
parent033c3547099d87629bea3be3f429d1aa8109cbb3 (diff)
downloadfreeipa-01a0249a40784d15e5ffc217c7626242e0a0045f.zip
freeipa-01a0249a40784d15e5ffc217c7626242e0a0045f.tar.gz
freeipa-01a0249a40784d15e5ffc217c7626242e0a0045f.tar.xz
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>
-rw-r--r--ipatests/test_integration/tasks.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index e13070a..7a7fd4b 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -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()))