Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid calling env_process._get_qemu_version from test cases #4250

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 2 additions & 5 deletions qemu/tests/thin_write_in_qemu_img_commit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
import re

from virttest import data_dir, env_process, utils_misc, utils_numeric
from virttest import data_dir, utils_misc, utils_numeric, utils_qemu
from virttest.qemu_io import QemuIOSystem
from virttest.qemu_storage import QemuImg
from virttest.utils_version import VersionInterval
Expand Down Expand Up @@ -44,9 +43,7 @@ def _qemu_io(img, cmd):
def _verify_map_output(output):
""" "Verify qemu map output."""
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]
expected = {
"length": int(utils_numeric.normalize_data_size(params["write_size"], "B")),
"start": 0,
Expand Down
Loading