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: Refactor kvm module reload/restore steps #4035

Conversation

bgartzi
Copy link
Contributor

@bgartzi bgartzi commented Dec 3, 2024

KVM modules are reloaded and restored before and after running tests. That was done directly in the preprocess and postprocess functions in virttest.env_process. Write a Setuper subclass that implements those in setup/cleanup methods 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.

ID: 2934

KVM modules are reloaded and restored before and after running tests.
That was done directly in the preprocess and postprocess functions in
virttest.env_process. Write a Setuper subclass that implements those in
setup/cleanup methods 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 <[email protected]>
@bgartzi bgartzi force-pushed the env_process_refactoring-reload_kvm branch from a0463ce to 6d21daa Compare December 3, 2024 14:47
@bgartzi
Copy link
Contributor Author

bgartzi commented Dec 3, 2024

A test failed at first [0]. After checking it, I thought it could have been a cirrus issue, I'm not sure though. A flaky test perhaps? Anyway, after pushing the patch again all the checks were able to pass.

@YongxueHong would you mind having a look? Thanks!

  1. https://cirrus-ci.com/task/5848486225117184

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.

LGTM.

@YongxueHong YongxueHong merged commit 2c4c8fe into avocado-framework:master Dec 8, 2024
59 checks passed
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.

3 participants