[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/6] avocado_qemu: tweak ssh connect method
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 4/6] avocado_qemu: tweak ssh connect method |
Date: |
Mon, 27 Sep 2021 16:12:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
On 9/20/21 22:49, Willian Rampazzo wrote:
> The current implementation will crash if the connection fails as the
> `time` module is not imported. This fixes the import problem and tweaks
> the connection to wait progressively when the connection fails.
>
> Signed-off-by: Willian Rampazzo <willianr@redhat.com>
> ---
> tests/acceptance/avocado_qemu/__init__.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> 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 shutil
> import sys
> import tempfile
> +import time
> import uuid
>
> import avocado
> @@ -305,8 +306,7 @@ def ssh_connect(self, username, credential,
> credential_is_key=True):
> self.ssh_session.connect()
> return
> except:
> - time.sleep(4)
10 * 4 = 40
> - pass
> + time.sleep(i)
sum([0..10[) = 45
The described tweak. Almost the same, OK.
> self.fail('ssh connection timeout')
>
> def ssh_command(self, command):
>
- [PATCH 0/6] avocado_qemu: small fixes and tweaks, Willian Rampazzo, 2021/09/20
- [PATCH 2/6] avocado_qemu: standardize supper() call following PEP3135, Willian Rampazzo, 2021/09/20
- [PATCH 1/6] Acceptance Tests: add standard clean up at test tearDown(), Willian Rampazzo, 2021/09/20
- [PATCH 3/6] avocado_qemu: fix import module based on isort, Willian Rampazzo, 2021/09/20
- [PATCH 4/6] avocado_qemu: tweak ssh connect method, Willian Rampazzo, 2021/09/20
- Re: [PATCH 4/6] avocado_qemu: tweak ssh connect method,
Philippe Mathieu-Daudé <=
- [PATCH 5/6] avocado_qemu: explicitly return None to avoid R1710, Willian Rampazzo, 2021/09/20
- [PATCH 6/6] avocado_qemu: fix inheritance order on LinuxTest class, Willian Rampazzo, 2021/09/20
- Re: [PATCH 0/6] avocado_qemu: small fixes and tweaks, Philippe Mathieu-Daudé, 2021/09/27
- Re: [PATCH 0/6] avocado_qemu: small fixes and tweaks, Philippe Mathieu-Daudé, 2021/09/27