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

env_process: Tested package version check refactoring #4039

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bgartzi
Copy link
Contributor

@bgartzi bgartzi commented Dec 10, 2024

Another bunch of patches regarding the env_process preprocess and postprocess functionr refactoring patch series. In this one, those steps related to extracting, logging and checking required package versions are refactored.

I usually send 1 patch per PR. However, I'm sending a bunch of them together this time. This is due to the version_info, a variable that lived inside the preprocess function and that most of the version-check related steps used. I'm doing so not to modify the public API of the env_process submodule.

First version_info is made a global variable of the submodule, so both steps inside the preprocess and those being refactored can access it. Once all have been written into Setupers, then the version_info variable is also migrated to the virttest.test_setup.requirement_checks submodule.

This is part of a larger patch series that will refactor env_process
preprocess steps that verify tested package versions.

In this patch, version_info is made a global variable of
test_setup.requirement_checks so it is available in the scope in which
package version checks are going to be rewritten.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
KVM (kernel) version is checked and compared to the required version,
if there's one. That was done in the preprocess and postprocess
functions in virttest.env_process. Write a Setuper subclass that
implements that in the setup method and register the setuper in the
env_process setup_manager.

This is a patch from a larger patch series refactoring the env_process
preprocess and postprocess functions. In each of these patches, a
pre/post process step is identified and replaced with a Setuper subclass
so the following can finally be met:
    - Only cleanup steps of successful setup steps are run to avoid
      possible environment corruption or hard to read errors.
    - Running setup/cleanup steps symmetrically during env pre/post
      process.
    - Reduce explicit pre/post process function code length.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
QEMU version is checked and compared to the required version, if there's
one. That was done in the preprocess and postprocess functions in
virttest.env_process. Write a Setuper subclass that implements that in
the setup method and register the setuper in the env_process
setup_manager.

This is a patch from a larger patch series refactoring the env_process
preprocess and postprocess functions. In each of these patches, a
pre/post process step is identified and replaced with a Setuper subclass
so the following can finally be met:
    - Only cleanup steps of successful setup steps are run to avoid
      possible environment corruption or hard to read errors.
    - Running setup/cleanup steps symmetrically during env pre/post
      process.
    - Reduce explicit pre/post process function code length.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
Bootloader version is checked and logged into the package version dict,
That was done in the preprocess and postprocess functions in
virttest.env_process. Write a Setuper subclass that implements that in
the setup method and register the setuper in the env_process
setup_manager.

This is a patch from a larger patch series refactoring the env_process
preprocess and postprocess functions. In each of these patches, a
pre/post process step is identified and replaced with a Setuper subclass
so the following can finally be met:
    - Only cleanup steps of successful setup steps are run to avoid
      possible environment corruption or hard to read errors.
    - Running setup/cleanup steps symmetrically during env pre/post
      process.
    - Reduce explicit pre/post process function code length.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
virtio_win version is checked and compared to the required version,
if there's one. That was done in the preprocess and postprocess
functions in virttest.env_process. Write a Setuper subclass that
implements that in the setup method and register the setuper in the
env_process setup_manager.

This is a patch from a larger patch series refactoring the env_process
preprocess and postprocess functions. In each of these patches, a
pre/post process step is identified and replaced with a Setuper subclass
so the following can finally be met:
    - Only cleanup steps of successful setup steps are run to avoid
      possible environment corruption or hard to read errors.
    - Running setup/cleanup steps symmetrically during env pre/post
      process.
    - Reduce explicit pre/post process function code length.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
libvirt version is checked and compared to the required version,
if there's one. That was done in the preprocess and postprocess
functions in virttest.env_process. Write a Setuper subclass that
implements that in the setup method and register the setuper in the
env_process setup_manager.

This is a patch from a larger patch series refactoring the env_process
preprocess and postprocess functions. In each of these patches, a
pre/post process step is identified and replaced with a Setuper subclass
so the following can finally be met:
    - Only cleanup steps of successful setup steps are run to avoid
      possible environment corruption or hard to read errors.
    - Running setup/cleanup steps symmetrically during env pre/post
      process.
    - Reduce explicit pre/post process function code length.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
After checking all test-relevant package versions, the dict carrying
the information must be logged into the test data. That was done in the
preprocess and postprocess functions in virttest.env_process. Write a
Setuper subclass that implements that in the setup method and register
the setuper in the env_process setup_manager.

While on it, remove the requirement_checks import from env_process as
all steps are now refactored into Setupers in requirement_checks.

This is a patch from a larger patch series refactoring the env_process
preprocess and postprocess functions. In each of these patches, a
pre/post process step is identified and replaced with a Setuper subclass
so the following can finally be met:
    - Only cleanup steps of successful setup steps are run to avoid
      possible environment corruption or hard to read errors.
    - Running setup/cleanup steps symmetrically during env pre/post
      process.
    - Reduce explicit pre/post process function code length.

Signed-off-by: Beñat Gartzia Arruabarrena <bgartzia@redhat.com>
@bgartzi bgartzi force-pushed the env_process_refactoring-check_versions branch from ba7ced3 to 6ea7c8f Compare December 11, 2024 07:45
@bgartzi
Copy link
Contributor Author

bgartzi commented Dec 11, 2024

Hey @YongxueHong, this one is larger than usual. As mentioned, it was so as not to change the public env_process API between different MRs.

However, I pushed a new version (which results in the same code) that doesn't really change the API of env_process. Now, the main reason to push all of these together is just that all of them look into different package versions and make sure they meet the test demands.

If you'd prefer, I could split the PR into a bunch of them instead as usual. Just let me know.

@YongxueHong
Copy link
Contributor

Hey @YongxueHong, this one is larger than usual. As mentioned, it was so as not to change the public env_process API between different MRs.

However, I pushed a new version (which results in the same code) that doesn't really change the API of env_process. Now, the main reason to push all of these together is just that all of them look into different package versions and make sure they meet the test demands.

If you'd prefer, I could split the PR into a bunch of them instead as usual. Just let me know.

Hi @bgartzi
It's clear enough for me, let's keep them. Thanks.

@bgartzi bgartzi changed the title env_process: Tested pacakge version check refactoring env_process: Tested package version check refactoring Dec 18, 2024
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