Skip to content

Commit

Permalink
thin_write_in_qemu_img_commit: 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
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 <[email protected]>
  • Loading branch information
bgartzi committed Jan 14, 2025
1 parent 3accaae commit e15a5ca
Showing 1 changed file with 2 additions and 5 deletions.
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)
expected = {
"length": int(utils_numeric.normalize_data_size(params["write_size"], "B")),
"start": 0,
Expand Down

0 comments on commit e15a5ca

Please sign in to comment.