Commit eebbda78 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis Committed by Ilias Tsitsimpis
Browse files

burnin: Wait for the sshd service to come up

Retry '_check_file_through_ssh' if ssh connection fails with
'ECONNREFUSED' (probably because the sshd service has not come up yet).
parent 2ac203c0
......@@ -22,6 +22,7 @@ had grown too much.
import time
import IPy
import errno
import base64
import socket
import random
......@@ -470,7 +471,9 @@ class CycladesTests(BurninTests):
def _check_file_through_ssh(self, hostip, username, password,
remotepath, content):
"""Fetch file from server and compare contents""""Fetching file %s from remote server", remotepath)
def check_fun():
"""Fetch file"""
transport = paramiko.Transport((hostip, 22))
transport.connect(username=username, password=password)
with tempfile.NamedTemporaryFile() as ftmp:
......@@ -481,6 +484,14 @@ class CycladesTests(BurninTests):"Comparing file contents")
remote_content = base64.b64encode(
self.assertEqual(content, remote_content)
except socket.error as (err_no, err_str):
if err_no == errno.ECONNREFUSED:
raise Retry()
opmsg = "Fetching file %s from remote server" % remotepath
self._try_until_timeout_expires(opmsg, check_fun)
# ----------------------------------
# Networks
......@@ -17,9 +17,9 @@
This is the burnin class that tests the Snapshots functionality
import random
import stat
import base64
import random
from synnefo_tools.burnin.common import Proper, QPITHOS, QADD, QREMOVE, GB
from synnefo_tools.burnin.cyclades_common import CycladesTests
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment