Fix ssh timeout issue
SSH client is using a socket timeout and an execution timeout. For
command execution, if the executed command did not generate output
within the channel timeout, test dies with TimeoutException. This is
misleading, because it wasn't the command that timed out, it just did
not generate output within channel timeout.
fixes bug 1215794
Change-Id: I90b9cb7c9cebcb78655b6c1a46f9fb09ff7deb5e
diff --git a/tempest/common/ssh.py b/tempest/common/ssh.py
index be350c8..2ed1057 100644
--- a/tempest/common/ssh.py
+++ b/tempest/common/ssh.py
@@ -114,9 +114,13 @@
err_data = []
poll = select.poll()
poll.register(channel, select.POLLIN)
+ start_time = time.time()
+
while True:
ready = poll.poll(self.channel_timeout)
if not any(ready):
+ if not self._is_timed_out(self.timeout, start_time):
+ continue
raise exceptions.TimeoutException(
"Command: '{0}' executed on host '{1}'.".format(
cmd, self.host))