Skip to content

Apply guest requirements to guest environments#4464

Merged
LiliDeng merged 2 commits into
mainfrom
vyadav_guest1
May 6, 2026
Merged

Apply guest requirements to guest environments#4464
LiliDeng merged 2 commits into
mainfrom
vyadav_guest1

Conversation

@vyadavmsft
Copy link
Copy Markdown
Collaborator

@vyadavmsft vyadavmsft commented May 5, 2026

Description

When guest_enabled is set, build the parent environment requirement from the platform/runbook requirement instead of copying the testcase environment requirement. This keeps testcase min_count, OS, and feature constraints on the guest environment path while Azure/OpenVMM parent hosts are sized by the orchestrator configuration.

The existing platform/test requirement merge remains unchanged for non-guest runs and is factored into a helper. The deploy task also initializes its test result before cleanup so static analysis can prove it is always bound.

Add a runner regression test that verifies guest-enabled runs create a one-node parent environment from the platform requirement while preserving the two-node testcase requirement for guests.

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

@vyadavmsft vyadavmsft requested a review from LiliDeng as a code owner May 5, 2026 01:59
Copilot AI review requested due to automatic review settings May 5, 2026 01:59
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

✅ 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 31.525

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 guest-enabled environment selection in the LISA runner so parent hosts are derived from the platform/orchestrator requirement instead of inheriting testcase environment sizing, while preserving the testcase requirement for guest-side validation.

Changes:

  • Split the platform/test requirement merge logic into helpers and route guest-enabled runs through a new parent-requirement builder.
  • Initialize the deploy task’s primary test_result before the nested try blocks.
  • Add a selftest covering guest-enabled requirement merging with a platform-defined parent requirement.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lisa/runners/lisa_runner.py Refactors requirement merging and changes guest-enabled parent environment construction.
selftests/runners/test_lisa_runner.py Adds a regression test for guest-enabled requirement merging.

Comment thread selftests/runners/test_lisa_runner.py
Comment thread selftests/runners/test_lisa_runner.py
@vyadavmsft
Copy link
Copy Markdown
Collaborator Author

@copilot apply changes based on the comments in this thread

@vyadavmsft
Copy link
Copy Markdown
Collaborator Author

@copilot can you run more test.

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

@copilot apply changes based on the comments in this thread

Done in commit 16357d9. Both issues from the review are addressed:

  1. Bare assert statements replaced with self.assertIsNotNone calls.
  2. Static runtime_data.requirement.environment assertion replaced with a loop over all generated environments. The new check verifies every environment has exactly 1 node and core_count=4 from the platform requirement. This would fail if guest-enabled runs reverted to using testcase requirements — mock_ut1 (2-node requirement) would produce a 2-node env, and mock_ut3 (8-core suite requirement) would produce an env with 8 cores.

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

@copilot can you run more test.

...

Ran 127 tests across all relevant selftests modules — all pass:

  • selftests.runners.test_lisa_runner — 19 tests (all runner scenarios including the new guest-enabled regression test)
  • selftests.test_testsuite — 18 tests
  • selftests.test_environment — 11 tests
  • selftests.test_env_requirement — 4 tests
  • selftests.test_platform — 9 tests
  • selftests.test_search_space, selftests.test_testselector, selftests.test_notifier, selftests.test_variable, selftests.test_secret, selftests.test_parallel, selftests.combinators.* — 66 tests

The pre-existing failures in the full discover run (5 failures, 43 errors) are caused by class double-registration when all modules load together — they are present on the base branch before my changes and are unrelated to this PR.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

✅ 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 48.296

Copilot AI review requested due to automatic review settings May 5, 2026 19:22
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread lisa/schema.py Outdated
Comment thread lisa/runners/lisa_runner.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/schema.py
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

✅ 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 61.660

vyadavmsft added 2 commits May 5, 2026 15:25
When guest_enabled is set, build the parent environment requirement from the platform/runbook requirement instead of copying the testcase environment requirement. This keeps testcase min_count, OS, and feature constraints on the guest environment path while Azure/OpenVMM parent hosts are sized by the orchestrator configuration.

The existing platform/test requirement merge remains unchanged for non-guest runs and is factored into a helper. The deploy task also initializes its test result before cleanup so static analysis can prove it is always bound.

Add a runner regression test that verifies guest-enabled runs create a one-node parent environment from the platform requirement while preserving the two-node testcase requirement for guests.
Allow a single platform guest runbook entry to request multiple guest nodes through capability.node_count. During platform runbook loading, LISA now expands that guest template into concrete guest runbooks and normalizes each expanded guest capability back to node_count 1 while preserving the requested core_count, memory_mb, and other guest settings.

This lets OpenVMM create g0..gN from one YAML template. The existing per-guest network derivation then produces unique TAP names and forwarded SSH ports, for example tap0/60022 through tap3/60025 for a four-node template.

Also treat a non-zero forwarded_port as shorthand for enabling SSH forwarding, so TAP guest runbooks can specify the base forwarded port without repeating forward_ssh_port.
Copilot AI review requested due to automatic review settings May 5, 2026 22:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

✅ 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 50.450

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread lisa/schema.py
Comment thread lisa/schema.py
Comment thread lisa/sut_orchestrator/openvmm/schema.py
Comment thread lisa/sut_orchestrator/openvmm/schema.py
@LiliDeng LiliDeng merged commit d59c4c9 into main May 6, 2026
65 checks passed
@LiliDeng LiliDeng deleted the vyadav_guest1 branch May 6, 2026 06:32
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.

4 participants