Excluded unsupported Hyper-v modules in hv_modules tests for CVMs.#4512
Open
SRIKKANTH wants to merge 1 commit into
Open
Excluded unsupported Hyper-v modules in hv_modules tests for CVMs.#4512SRIKKANTH wants to merge 1 commit into
SRIKKANTH wants to merge 1 commit into
Conversation
CVMs do not surface emulated input devices or framebuffer/DRM over VMBus, so the corresponding kernel modules are intentionally absent in CVMs. Reference: https://elixir.bootlin.com/linux/v7.0/source/drivers/hv/channel_mgmt.c#L31 In the above file only modules with ".allowed_in_isolated = true," are available in CVMs. Below are modules that are not exposed to a guest when running as a Confidential VM. - hid_hyperv - hyperv_keyboard - hyperv_fb - hyperv_drm These modules should be skipped in checks for module presence and in reload tests on CVMs.
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the Hyper-V kernel module validation tests to account for Confidential VMs (CVMs), where certain host-emulated input/display VMBus devices (and corresponding kernel modules) are intentionally unavailable.
Changes:
- Add a CVM-unavailable module allowlist and skip those modules in initrd/module-presence checks and reload tests.
- Introduce a reusable
is_cvm()helper inlisa/features/security_profile.pyto detect confidential VMs from theSecurityProfilefeature.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lisa/microsoft/testsuites/core/hv_module.py | Skips input/display-related Hyper-V modules for CVMs in presence/initrd/reload checks. |
| lisa/features/security_profile.py | Adds is_cvm() helper to detect Confidential VM security profile on a node. |
Comment on lines
+171
to
+188
| def is_cvm(node: Any) -> bool: | ||
| """ | ||
| Returns True if the node is provisioned as a Confidential VM. | ||
|
|
||
| Falls back to False when the platform does not expose a SecurityProfile | ||
| feature (e.g. ready / hyperv platforms), so callers can use this as a | ||
| guard without extra checks. | ||
| """ | ||
| try: | ||
| settings = Feature.get_feature_settings( | ||
| node.features[SecurityProfile].get_settings() | ||
| ) | ||
| except Exception: | ||
| return False | ||
| return ( | ||
| isinstance(settings, SecurityProfileSettings) | ||
| and settings.security_profile == SecurityProfileType.CVM | ||
| ) |
Comment on lines
220
to
+226
| if isinstance(environment.platform, AzurePlatform): | ||
| missing_modules.discard("hid_hyperv") | ||
| # CVMs legitimately do not load host-emulated input or framebuffer | ||
| # modules, so absence is expected and must not fail this test. | ||
| if is_cvm(node): | ||
| for module in _CVM_UNAVAILABLE_MODULES: | ||
| missing_modules.discard(module) |
Comment on lines
+273
to
+278
| if node_is_cvm and module in _CVM_UNAVAILABLE_MODULES: | ||
| log.debug( | ||
| f"{module} is not available on Confidential VMs, skipping reload" | ||
| ) | ||
| skipped_modules.append(module) | ||
| continue |
✅ AI Test Selection — PASSED3 test case(s) selected (view run) Marketplace image: redhat rhel 9_5 latest
Test case details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CVMs do not surface emulated input devices or framebuffer/DRM over VMBus, so the corresponding kernel modules are intentionally absent in CVMs. Reference: https://elixir.bootlin.com/linux/v7.0/source/drivers/hv/channel_mgmt.c#L31 In the above file only modules with ".allowed_in_isolated = true," are available in CVMs. Below are modules that are not exposed to a guest when running as a Confidential VM.
These modules should be skipped in checks for module presence and in reload tests on CVMs.
Description
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results