diff --git a/avocado/plugins/runners/podman_image.py b/avocado/plugins/runners/podman_image.py index 0b9a5dd5c7..06299d6b21 100644 --- a/avocado/plugins/runners/podman_image.py +++ b/avocado/plugins/runners/podman_image.py @@ -7,7 +7,7 @@ from avocado.core.nrunner.app import BaseRunnerApp from avocado.core.nrunner.runner import RUNNER_RUN_STATUS_INTERVAL, BaseRunner from avocado.core.utils import messages -from avocado.utils.podman import Podman, PodmanException +from avocado.utils.podman import AsyncPodman, PodmanException class PodmanImageRunner(BaseRunner): @@ -34,7 +34,7 @@ def _run_podman_pull(self, uri, queue): # information for debugging in case of errors. logging.getLogger("avocado.utils.podman").addHandler(logging.NullHandler()) try: - podman = Podman() + podman = AsyncPodman() loop = asyncio.get_event_loop() loop.run_until_complete(podman.execute("pull", uri)) queue.put({"result": "pass"}) diff --git a/avocado/plugins/spawners/podman.py b/avocado/plugins/spawners/podman.py index 386860389b..00a33d0288 100644 --- a/avocado/plugins/spawners/podman.py +++ b/avocado/plugins/spawners/podman.py @@ -16,7 +16,7 @@ from avocado.core.version import VERSION from avocado.utils import distro from avocado.utils.asset import Asset -from avocado.utils.podman import Podman, PodmanException +from avocado.utils.podman import AsyncPodman, PodmanException LOG = logging.getLogger(__name__) @@ -163,7 +163,7 @@ def podman(self): if self._podman is None: podman_bin = self.config.get("spawner.podman.bin") try: - self._podman = Podman(podman_bin) + self._podman = AsyncPodman(podman_bin) except PodmanException as ex: LOG.error(ex) return self._podman diff --git a/avocado/utils/podman.py b/avocado/utils/podman.py index a557559701..8595dcfd1c 100644 --- a/avocado/utils/podman.py +++ b/avocado/utils/podman.py @@ -32,7 +32,7 @@ class PodmanException(Exception): pass -class Podman: +class AsyncPodman: def __init__(self, podman_bin=None): path = which(podman_bin or "podman") if not path: diff --git a/selftests/functional/plugin/podman_image.py b/selftests/functional/plugin/podman_image.py index d358f254bf..2fbe95592a 100644 --- a/selftests/functional/plugin/podman_image.py +++ b/selftests/functional/plugin/podman_image.py @@ -1,5 +1,5 @@ from avocado import Test -from avocado.utils.podman import Podman +from avocado.utils.podman import AsyncPodman class PodmanImageTest(Test): @@ -8,7 +8,7 @@ async def test(self): :avocado: dependency={"type": "package", "name": "podman", "action": "check"} :avocado: dependency={"type": "podman-image", "uri": "registry.fedoraproject.org/fedora:38"} """ - podman = Podman() + podman = AsyncPodman() _, stdout, _ = await podman.execute( "images", "--filter", diff --git a/selftests/functional/utils/podman.py b/selftests/functional/utils/podman.py index 8d7586f050..23f775a618 100644 --- a/selftests/functional/utils/podman.py +++ b/selftests/functional/utils/podman.py @@ -1,15 +1,15 @@ from avocado import Test -from avocado.utils.podman import Podman +from avocado.utils.podman import AsyncPodman -class PodmanTest(Test): +class AsyncPodmanTest(Test): async def test_python_version(self): """ :avocado: dependency={"type": "package", "name": "podman", "action": "check"} :avocado: dependency={"type": "podman-image", "uri": "fedora:38"} :avocado: tags=slow """ - podman = Podman() + podman = AsyncPodman() result = await podman.get_python_version("fedora:38") self.assertEqual(result, (3, 11, "/usr/bin/python3")) @@ -19,7 +19,7 @@ async def test_container_info(self): :avocado: dependency={"type": "podman-image", "uri": "fedora:38"} :avocado: tags=slow """ - podman = Podman() + podman = AsyncPodman() _, stdout, _ = await podman.execute("create", "fedora:38", "/bin/bash") container_id = stdout.decode().strip() result = await podman.get_container_info(container_id)