Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
env_process: Refactor huge pages setup/cleanup steps
Creating a new Setuper subclass for setting and cleaning huge pages up. Removing the original code from virttest.env_process and replacing it instead with the new HugePagesSetup class being registered in the setup_manager. _pre_hugepages_surp and _post_hugepages_surp were left in env_process. Their goal is to provide a mechanism in env_process to raise a TestFail in case pages were leaked during a test. If that mechanism was refactored into the setuper, the TestFail would be masked by just an Error due to the way setup_manager handles postprocess exceptions. Changing the way SetupManager handles that requires bigger discussion on how the test infrastructure should handle test status reports, which is a way broader topic that what this patch aims to be. 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]>
- Loading branch information