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

Conversation

bgartzi
Copy link
Contributor

@bgartzi bgartzi commented Jan 14, 2025

_get_qemu_version was removed from virttest.env_process in avocado-framework/avocado-vt@fe5614d

There were a bunch of test cases that were using the private function, and so affected by this removal, such as the one being fixed in #4249

This path updates the other test cases so they call the public (and still available) function from virttest instead.

ID: 3313

@bgartzi
Copy link
Contributor Author

bgartzi commented Jan 14, 2025

@YongxueHong could you have a look?

Based on #3954 I'd also appreciate your input @hellohellenmao @maxujun @BohdanMar @fbq815 on qemu/tests/thin_write_in_qemu_img_commit.py.

@nanliu-r I would also appreciate if you could have a look onto qemu/tests/cpu_info_check.py.

If you all would rather split this into 2 separate PRs, tell me.

YongxueHong
YongxueHong previously approved these changes Jan 14, 2025
Copy link
Contributor

@YongxueHong YongxueHong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bgartzi
Thank you for resolving that so quickly!
LGTM.

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 <bgartzia@redhat.com>
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>
@bgartzi
Copy link
Contributor Author

bgartzi commented Jan 14, 2025

Sorry for the noise @YongxueHong I forgot to select the right part of the tuple in qemu/tests/thin_write_in_qemu_img_commit.py. It's fixed now.

Thanks also for having a look that quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants