Skip to content

Commit

Permalink
cpu_info_check: Avoid _get_qemu_version
Browse files Browse the repository at this point in the history
Running qemu version was extracted by calling
virttest.env_process._get_qemu_version. However, that function was
removed from avocado-vt in fe5614d78ce74395544d6c2834573e0e6f25eb5e. It
was done assuming it wasn't used outside virttest.env_process, as it was
considered to be private (due to the `_` prefix).

However, virttest.utils_qemu provides the public get_qemu_version which
gives a quite similar result.

This patch, replaces virttest.env_process._get_qemu_version by
virttest.utils_qemu.get_qemu_version in the
cpu_info_check test case.

Signed-off-by: Beñat Gartzia <bgartzia@redhat.com>
  • Loading branch information
bgartzi committed Jan 14, 2025
1 parent e15a5ca commit 25b65a3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions qemu/tests/cpu_info_check.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import re

from avocado.utils import process
from virttest import cpu, env_process, error_context, utils_misc
from virttest import cpu, env_process, error_context, utils_misc, utils_qemu
from virttest.utils_version import VersionInterval


Expand Down Expand Up @@ -45,9 +43,7 @@ def get_patterns(p_list):
list(map(cpu_types.extend, list(cpu.CPU_TYPES.values())))

qemu_path = utils_misc.get_qemu_binary(params)
qemu_version = env_process._get_qemu_version(qemu_path)
match = re.search(r"[0-9]+\.[0-9]+\.[0-9]+(\-[0-9]+)?", qemu_version)
host_qemu = match.group(0)
host_qemu = utils_qemu.get_qemu_version(qemu_path)[0]
remove_list_deprecated = params.get("remove_list_deprecated", "")
if host_qemu in VersionInterval("[7.0.0-8, )") and remove_list_deprecated:
params["remove_list"] = remove_list_deprecated
Expand Down

0 comments on commit 25b65a3

Please sign in to comment.