Solve the reboot race condition
It's seems like there is small time window which can trick
reconnect() method to think that machine already finished reboot.
This commit adds some wait time before reconnect loop will
try to check if sshd really run.
@@ -12,6 +12,8 @@ import tmt
# Timeout in seconds of waiting for a connection
CONNECTION_TIMEOUT = 60 * 4
+# Wait time when reboot happens in seconds
+SSH_INITIAL_WAIT_TIME = 5
class Provision(tmt.steps.Step):
@@ -524,6 +526,8 @@ class Guest(tmt.utils.Common):
def reconnect(self):
""" Ensure the connection to the guest is working after reboot """
+ # Try to wait for machine to really shutdown sshd
+ time.sleep(SSH_INITIAL_WAIT_TIME)
self.debug("Wait for a connection to the guest.")
for attempt in range(1, CONNECTION_TIMEOUT):
try:
