summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2022-08-29 14:19:39 +0200
committerThomas Huth <thuth@redhat.com>2022-08-30 07:55:43 +0200
commitda55be562ea2b082da5d55cc12730fe8fe118852 (patch)
tree297814672e8d052917c8b3a35df5d78e1ea72c06
parent146f39d7f3b08caa3a2a0645474465437cf085b8 (diff)
downloadfocaccia-qemu-da55be562ea2b082da5d55cc12730fe8fe118852.tar.gz
focaccia-qemu-da55be562ea2b082da5d55cc12730fe8fe118852.zip
tests/avocado/migration: Get find_free_port() from the ports
In upstream Avocado, the find_free_port() function is not available
from "network" anymore, but must be used via "ports", see:

 https://github.com/avocado-framework/avocado/commit/22fc98c6ff76cc55c48

To be able to update to a newer Avocado version later, let's use
the new way for accessing the find_free_port() function here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220829121939.209329-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/avocado/migration.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py
index 584d6ef53f..4b25680c50 100644
--- a/tests/avocado/migration.py
+++ b/tests/avocado/migration.py
@@ -14,7 +14,7 @@ import tempfile
 from avocado_qemu import QemuSystemTest
 from avocado import skipUnless
 
-from avocado.utils import network
+from avocado.utils.network import ports
 from avocado.utils import wait
 from avocado.utils.path import find_command
 
@@ -57,7 +57,7 @@ class Migration(QemuSystemTest):
         self.assert_migration(source_vm, dest_vm)
 
     def _get_free_port(self):
-        port = network.find_free_port()
+        port = ports.find_free_port()
         if port is None:
             self.cancel('Failed to find a free port')
         return port