From e15a5ca52211b20f3cb707927df157d93bf65b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Be=C3=B1at=20Gartzia?= Date: Tue, 14 Jan 2025 15:38:31 +0100 Subject: [PATCH] thin_write_in_qemu_img_commit: Avoid _get_qemu_version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 function which gives a quite similar result. This patch, replaces virttest.env_process._get_qemu_version by virttest.utils_qemu.get_qemu_version in the thin_write_in_qemu_img_commit test case. Signed-off-by: BeƱat Gartzia --- qemu/tests/thin_write_in_qemu_img_commit.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/qemu/tests/thin_write_in_qemu_img_commit.py b/qemu/tests/thin_write_in_qemu_img_commit.py index 409b9e3940..20b5219ea6 100644 --- a/qemu/tests/thin_write_in_qemu_img_commit.py +++ b/qemu/tests/thin_write_in_qemu_img_commit.py @@ -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 @@ -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) expected = { "length": int(utils_numeric.normalize_data_size(params["write_size"], "B")), "start": 0,