Skip to content

Excluded unsupported Hyper-v modules in hv_modules tests for CVMs.#4512

Open
SRIKKANTH wants to merge 1 commit into
mainfrom
smyakam/hyperv_cvm
Open

Excluded unsupported Hyper-v modules in hv_modules tests for CVMs.#4512
SRIKKANTH wants to merge 1 commit into
mainfrom
smyakam/hyperv_cvm

Conversation

@SRIKKANTH
Copy link
Copy Markdown
Collaborator

@SRIKKANTH SRIKKANTH commented Jun 2, 2026

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.

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

Impacted LISA Features:

Tested Azure Marketplace Images:

  • Canonical 0001-com-ubuntu-confidential-vm-focal 20_04-lts-cvm latest

Test Results

Image VM Size Result
Canonical 0001-com-ubuntu-confidential-vm-focal 20_04-lts-cvm latest Standard_DC8as_v6 PASSED

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.
Copilot AI review requested due to automatic review settings June 2, 2026 07:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 in lisa/features/security_profile.py to detect confidential VMs from the SecurityProfile feature.

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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

✅ AI Test Selection — PASSED

3 test case(s) selected (view run)

Marketplace image: redhat rhel 9_5 latest

Count
✅ Passed 3
❌ Failed 0
⏭️ Skipped 0
Total 3
Test case details
Test Case Status Time (s) Message
verify_hyperv_modules (lisa_0_1) ✅ PASSED 15.932
verify_initrd_modules (lisa_0_0) ✅ PASSED 22.966
verify_reload_hyperv_modules (lisa_0_2) ✅ PASSED 262.041

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