Skip to content

Use passthrough context in guest validation#4478

Merged
vyadavmsft merged 1 commit into
mainfrom
vyadav_pci_auto
May 13, 2026
Merged

Use passthrough context in guest validation#4478
vyadavmsft merged 1 commit into
mainfrom
vyadav_pci_auto

Conversation

@vyadavmsft
Copy link
Copy Markdown
Collaborator

The device passthrough functional test was deriving expected guest devices from platform.platform_runbook.device_pools. That makes the test strongly depend on platform runbook configuration and fails in auto-discovery scenarios where the runtime has assigned devices but the platform runbook does not expose device_pools in the expected shape.

Use the libvirt node context instead. The platform records the concrete devices assigned to the VM in node_context.passthrough_devices, so the test now resolves vendor/device IDs from those assigned host PCI addresses and validates that matching devices are visible in the guest.

This keeps validation tied to runtime assignment state instead of the original pool definition and removes the extra runbook parsing paths for vendor/device IDs and BDF dictionaries.

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:

Test Results

Image VM Size Result
PASSED / FAILED / SKIPPED

The device passthrough functional test was deriving expected guest devices from platform.platform_runbook.device_pools. That makes the test strongly depend on platform runbook configuration and fails in auto-discovery scenarios where the runtime has assigned devices but the platform runbook does not expose device_pools in the expected shape.

Use the libvirt node context instead. The platform records the concrete devices assigned to the VM in node_context.passthrough_devices, so the test now resolves vendor/device IDs from those assigned host PCI addresses and validates that matching devices are visible in the guest.

This keeps validation tied to runtime assignment state instead of the original pool definition and removes the extra runbook parsing paths for vendor/device IDs and BDF dictionaries.
Copilot AI review requested due to automatic review settings May 13, 2026 00:26
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 33.347

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

This PR updates the device passthrough functional test to validate guest-visible devices based on the libvirt runtime node context (node_context.passthrough_devices) rather than deriving expectations from platform_runbook.device_pools, improving compatibility with auto-discovery/runtime assignment scenarios.

Changes:

  • Resolve expected vendor/device IDs from the concrete host PCI devices recorded in node_context.passthrough_devices.
  • Remove runbook-driven device pool parsing (including dict fallbacks and BDF normalization helpers) from the test.
  • Validate guest visibility counts by aggregating assigned devices per (pool_type, vendor_id, device_id).

Comment thread lisa/microsoft/testsuites/device_passthrough/functional_tests.py
Comment thread lisa/microsoft/testsuites/device_passthrough/functional_tests.py
@vyadavmsft vyadavmsft merged commit 0101e4b into main May 13, 2026
91 checks passed
@vyadavmsft vyadavmsft deleted the vyadav_pci_auto branch May 13, 2026 20:06
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