diff mbox series

[v1,1/4] Acceptance test: add address as param

Message ID 20200214145235.4378-2-ovoshcha@redhat.com
State New
Headers show
Series Extension of migration tests | expand

Commit Message

Oksana Vohchana Feb. 14, 2020, 2:52 p.m. UTC
Provides param address in _get_free_port()
because by default it takes free port only on the localhost

Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
---
 tests/acceptance/migration.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Wainer dos Santos Moschetta Feb. 20, 2020, 6:54 p.m. UTC | #1
Hi Oksana,

On 2/14/20 12:52 PM, Oksana Vohchana wrote:
> Provides param address in _get_free_port()
> because by default it takes free port only on the localhost
>
> Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
> ---
>   tests/acceptance/migration.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> index a8367ca023..e4c39b85a1 100644
> --- a/tests/acceptance/migration.py
> +++ b/tests/acceptance/migration.py
> @@ -52,8 +52,8 @@ class Migration(Test):
>           source_vm.qmp('migrate', uri=src_uri)
>           self.assert_migration(source_vm, dest_vm)
>   
> -    def _get_free_port(self):
> -        port = network.find_free_port()
> +    def _get_free_port(self, address='localhost'):
> +        port = network.find_free_port(address=address)

Looks good to me, but:

- This patch is out of order, it should be followed by patches 03 and 04.

- You could have described in the cover letter (or in the commit) your 
intention with this change.

Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

Thanks!

- Wainer

>           if port is None:
>               self.cancel('Failed to find a free port')
>           return port
diff mbox series

Patch

diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index a8367ca023..e4c39b85a1 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -52,8 +52,8 @@  class Migration(Test):
         source_vm.qmp('migrate', uri=src_uri)
         self.assert_migration(source_vm, dest_vm)
 
-    def _get_free_port(self):
-        port = network.find_free_port()
+    def _get_free_port(self, address='localhost'):
+        port = network.find_free_port(address=address)
         if port is None:
             self.cancel('Failed to find a free port')
         return port