From: Willian Rampazzo Date: Mon, 20 Sep 2021 20:49:30 +0000 (-0300) Subject: avocado_qemu: tweak ssh connect method X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=22e82e0982a893074738cd9c6184c8eb1c012422;p=qemu.git avocado_qemu: tweak ssh connect method The current implementation will crash if the connection fails as the `time` module is not imported. Fix the import problem. While here, tweaks the connection to wait progressively when the connection fails. Signed-off-by: Willian Rampazzo Reviewed-by: Philippe Mathieu-Daudé [PMD: Reworded description] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210920204932.94132-5-willianr@redhat.com> --- diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index edb9ed7485..c3613f9262 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -13,6 +13,7 @@ import os import shutil import sys import tempfile +import time import uuid import avocado @@ -305,8 +306,7 @@ class LinuxSSHMixIn: self.ssh_session.connect() return except: - time.sleep(4) - pass + time.sleep(i) self.fail('ssh connection timeout') def ssh_command(self, command):