[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/22] tests/acceptance/virtiofs_submounts.py: standardize po
From: |
Beraldo Leal |
Subject: |
Re: [PATCH 08/22] tests/acceptance/virtiofs_submounts.py: standardize port as integer |
Date: |
Thu, 4 Feb 2021 08:14:57 -0300 |
On Wed, Feb 03, 2021 at 12:23:43PM -0500, Cleber Rosa wrote:
> Instead of having to cast it whenever it's going to be used, let's
> standardize it as an integer, which is the data type that will be
> used most often.
>
> Given that the regex will only match digits, it's safe that we'll
> end up getting a integer, but, it could as well be a zero.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
> tests/acceptance/virtiofs_submounts.py | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/acceptance/virtiofs_submounts.py
> b/tests/acceptance/virtiofs_submounts.py
> index f25a386a19..227a3cf1ee 100644
> --- a/tests/acceptance/virtiofs_submounts.py
> +++ b/tests/acceptance/virtiofs_submounts.py
> @@ -86,17 +86,18 @@ class VirtiofsSubmountsTest(BootLinux):
> re.search(r'TCP.HOST_FORWARD.*127\.0\.0\.1\s*(\d+)\s+10\.',
> line)
> if match is not None:
> - port = match[1]
> + port = int(match[1])
> break
>
> self.assertIsNotNone(port)
> - self.log.debug('sshd listening on port: ' + port)
> + self.assertGreater(port, 0)
> + self.log.debug('sshd listening on port: %d', port)
> return port
>
> def ssh_connect(self, username, keyfile):
> self.ssh_logger = logging.getLogger('ssh')
> port = self.get_portfwd()
> - self.ssh_session = ssh.Session('127.0.0.1', port=int(port),
> + self.ssh_session = ssh.Session('127.0.0.1', port=port,
> user=username, key=keyfile)
> for i in range(10):
> try:
> --
> 2.25.4
>
Reviewed-by: Beraldo Leal <bleal@redhat.com>
- [PATCH 21/22] Acceptance Tests: introduce CPU hotplug test, (continued)
- [PATCH 21/22] Acceptance Tests: introduce CPU hotplug test, Cleber Rosa, 2021/02/03
- [PATCH 22/22] [NOTFORMERGE] Bump Avocado version to latest master, Cleber Rosa, 2021/02/03
- [PATCH 01/22] tests/acceptance/boot_linux.py: fix typo on cloudinit error message, Cleber Rosa, 2021/02/03
- [PATCH 08/22] tests/acceptance/virtiofs_submounts.py: standardize port as integer, Cleber Rosa, 2021/02/03
- Re: [PATCH 08/22] tests/acceptance/virtiofs_submounts.py: standardize port as integer,
Beraldo Leal <=
- [PATCH 11/22] tests/acceptance/linux_ssh_mips_malta.py: standardize port as integer, Cleber Rosa, 2021/02/03
- [PATCH 12/22] Acceptance tests: clarify ssh connection failure reason, Cleber Rosa, 2021/02/03
- [PATCH 13/22] tests/acceptance/virtiofs_submounts.py: add missing accel tag, Cleber Rosa, 2021/02/03