]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
avocado_qemu: tweak ssh connect method
authorWillian Rampazzo <willianr@redhat.com>
Mon, 20 Sep 2021 20:49:30 +0000 (17:49 -0300)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 27 Sep 2021 17:06:30 +0000 (19:06 +0200)
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 <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[PMD: Reworded description]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210920204932.94132-5-willianr@redhat.com>

tests/acceptance/avocado_qemu/__init__.py

index edb9ed748523626913c279c295f6b191822915d0..c3613f926204b9935a4cf7f711840678ea96782c 100644 (file)
@@ -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):