[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/9] Avocado migration test: adapt to "utils.network" API namespa
From: |
Cleber Rosa |
Subject: |
[PATCH 3/9] Avocado migration test: adapt to "utils.network" API namespace change |
Date: |
Fri, 25 Feb 2022 16:01:50 -0500 |
Since Avocado 94.0[1], the "avocado.utils.network" dropped a lot of
previously deprecated API names, having the new names into a finer
grained structure.
This simply uses the new API names for the network port utility
module.
[1] -
https://avocado-framework.readthedocs.io/en/latest/releases/94_0.html#utility-apis
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
tests/avocado/avocado_qemu/__init__.py | 5 +++--
tests/avocado/migration.py | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/avocado/avocado_qemu/__init__.py
b/tests/avocado/avocado_qemu/__init__.py
index 88cec83e5c..3f15c8a222 100644
--- a/tests/avocado/avocado_qemu/__init__.py
+++ b/tests/avocado/avocado_qemu/__init__.py
@@ -17,7 +17,8 @@
import uuid
import avocado
-from avocado.utils import cloudinit, datadrainer, network, process, ssh,
vmimage
+from avocado.utils import cloudinit, datadrainer, process, ssh, vmimage
+from avocado.utils.network import ports
from avocado.utils.path import find_command
#: The QEMU build root directory. It may also be the source directory
@@ -601,7 +602,7 @@ def prepare_cloudinit(self, ssh_pubkey=None):
self.log.info('Preparing cloudinit image')
try:
cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso')
- self.phone_home_port = network.find_free_port()
+ self.phone_home_port = ports.find_free_port()
pubkey_content = None
if ssh_pubkey:
with open(ssh_pubkey) as pubkey:
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 @@
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 @@ def do_migrate(self, dest_uri, src_uri=None):
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
--
2.35.1
- [PATCH 0/9] Avocado tests: filter out tests using TCG booting full blown distros, Cleber Rosa, 2022/02/25
- [PATCH 1/9] Avocado GitLab CI jobs: don't reset TARGETS and simplify commands, Cleber Rosa, 2022/02/25
- [PATCH 2/9] Avocado tests: use logging namespace that is preserved in test logs, Cleber Rosa, 2022/02/25
- [PATCH 3/9] Avocado migration test: adapt to "utils.network" API namespace change,
Cleber Rosa <=
- [PATCH 4/9] Avocado: bump to version 95.0, Cleber Rosa, 2022/02/25
- [PATCH 5/9] tests/avocado/linux_ssh_mips_malta.py: add missing accel (tcg) tag, Cleber Rosa, 2022/02/25
- [PATCH 7/9] Avocado tests: improve documentation on tag filtering, Cleber Rosa, 2022/02/25
- [PATCH 6/9] tests/avocado/virtiofs_submounts.py: shared_dir may not exist, Cleber Rosa, 2022/02/25
- [PATCH 9/9] Avocado tests: don't run tests with TCG that boot full blown distros, Cleber Rosa, 2022/02/25