Skip to content

feat(vm_extensions): add Guest Proxy Agent boot validation test - #4632

Open
Jayprakash gupta (Jaype-e) wants to merge 3 commits into
microsoft:mainfrom
Jaype-e:jaype-e/proxy-agent-boot-validation
Open

feat(vm_extensions): add Guest Proxy Agent boot validation test#4632
Jayprakash gupta (Jaype-e) wants to merge 3 commits into
microsoft:mainfrom
Jaype-e:jaype-e/proxy-agent-boot-validation

Conversation

@Jaype-e

Copy link
Copy Markdown
Member

Summary

Adds a dedicated boot-validation test suite for the Azure Guest Proxy Agent VM extension (Microsoft.Cplat.ProxyAgent / ProxyAgentLinux). No such coverage exists in LISA today.

New file: lisa/microsoft/testsuites/vm_extensions/runtime_extensions/proxy_agent.py

Design

Follows the VmExtensionTestBase onboarding pattern from docs/vm_extension_validation_framework.rst — three class constants plus a single test case, with all lifecycle logic delegated to the shared _boot_validation() helper rather than reimplemented.

Constant Value
PUBLISHER Microsoft.Cplat.ProxyAgent
EXTENSION_TYPE ProxyAgentLinux
EXTENSION_KEY proxy_agent
DEFAULT_VERSION 1.0

The extension requires neither public nor protected settings, so the case installs with settings={}. _boot_validation() then: installs -> asserts provisioning_state == Succeeded -> verifies the installed handler version -> asserts the VM is still reachable over SSH -> deletes the extension.

Per the framework contract, boot-validation cases never fall back to DEFAULT_VERSION. The version must come from the proxy_agent_version (or generic extension_version) runbook variable; the case is skipped, not failed, when neither is set.

How to run

lisa -r <runbook> -v proxy_agent_version:1.0 \
  -v "testcase_criteria:name=MICROSOFT_CPLAT_PROXYAGENT_PROXYAGENTLINUX_boot_validation_test"

Or by tag: -v "testcase_criteria:tags=ProxyAgentLinux"

Validation status

Static checks only — this has not yet been executed against a live Azure subscription. Opening as a draft for that reason.

Check Result
flake8 pass
black pass
isort pass
mypy pass
LISA discovery pass - registers as ProxyAgentTests, area vm_extension, tags VM_Extension, ProxyAgentLinux

Still to be confirmed on real hardware: extension provisioning succeeds, the requested version is actually delivered in the target region, and SSH reachability post-install.


Key Test Cases:
MICROSOFT_CPLAT_PROXYAGENT_PROXYAGENTLINUX_boot_validation_test|smoke_test

Impacted LISA Features:
AzureExtension

Tested Azure Marketplace Images:

  • canonical ubuntu-24_04-lts server latest
  • redhat rhel 9_5 latest
  • microsoftcblmariner azure-linux-3 azure-linux-3-gen2 latest

Add a dedicated ProxyAgentTests suite for the Azure Guest Proxy Agent VM
extension (Microsoft.Cplat.ProxyAgent.ProxyAgentLinux), following the
VmExtensionTestBase onboarding pattern documented in
docs/vm_extension_validation_framework.rst.

The extension requires neither public nor protected settings, so the suite
starts with boot validation only: install with empty settings, assert
provisioning succeeds, verify the installed version, assert the VM is still
reachable over SSH, then remove the extension. All of this is delegated to
the shared _boot_validation helper rather than being reimplemented.

Version is supplied at runtime via the proxy_agent_version (or generic
extension_version) runbook variable; the case is skipped when neither is set.

Validated statically only: flake8, black, isort, mypy, and LISA test
discovery. Not yet executed against a live Azure subscription.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 76eafff1-9e53-4a91-8a02-91c1c5e79ae7
Copilot AI lite review requested due to automatic review settings August 4, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new VM extension boot-validation test suite for the Azure Guest Proxy Agent extension (Microsoft.Cplat.ProxyAgent / ProxyAgentLinux) under the vm extension validation framework, using the shared VmExtensionTestBase._boot_validation() flow.

Changes:

  • Introduces ProxyAgentTests with suite metadata (area/tags/requirements) for Guest Proxy Agent.
  • Adds a single boot-validation test case that installs the extension with empty settings and relies on _boot_validation() for lifecycle and reachability checks.

Comment thread lisa/microsoft/testsuites/vm_extensions/runtime_extensions/proxy_agent.py Outdated
priority=5,
maturity="preview",
)
def MICROSOFT_CPLAT_PROXYAGENT_PROXYAGENTLINUX_boot_validation_test( # noqa: N802
priority=5,
maturity="preview",
)
def MICROSOFT_CPLAT_PROXYAGENT_PROXYAGENTLINUX_boot_validation_test( # noqa: N802

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please use lowercase for the method name.

- Set DEFAULT_VERSION to empty string; boot-validation never falls back
  to it (use_default=False), and the framework discourages hardcoding
  extension versions in test code.
- Rename test method to lowercase snake_case
  (microsoft_cplat_proxyagent_proxyagentlinux_boot_validation_test),
  removing the noqa: N802 suppression and matching sibling tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dc8510fd-f72a-4f2b-be02-a3a73a022d93
Copilot AI review requested due to automatic review settings August 14, 2026 05:29
The base VmExtensionTestBase already defines DEFAULT_VERSION = "",
and boot-validation never uses it (use_default=False), so the
subclass override is unnecessary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dc8510fd-f72a-4f2b-be02-a3a73a022d93

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (2)

lisa/microsoft/testsuites/vm_extensions/runtime_extensions/proxy_agent.py:37

  • PR description’s design table lists DEFAULT_VERSION as 1.0, but the implementation sets it to an empty string (which aligns with the boot-validation requirement to avoid DEFAULT_VERSION fallbacks). Please update the PR description to reflect the code, or (less preferred) change the constant if the intent really is to have a code fallback.
    PUBLISHER = "Microsoft.Cplat.ProxyAgent"
    EXTENSION_TYPE = "ProxyAgentLinux"
    EXTENSION_KEY = "proxy_agent"

lisa/microsoft/testsuites/vm_extensions/runtime_extensions/proxy_agent.py:24

  • The suite description says it will “confirm the requested version was installed”, but _boot_validation() only asserts an exact match when the runbook specifies a full Major.Minor.Patch version; for Major.Minor it only logs the installed patch. Please adjust the description to match the actual behavior to avoid misleading future readers.

This issue also appears on line 34 of the same file.

    The extension requires no public or protected settings, so coverage starts
    with boot validation: install the extension with empty settings, confirm
    provisioning succeeds, confirm the requested version was installed, confirm
    the VM is still reachable over SSH, then remove the extension.

Copilot AI review requested due to automatic review settings August 14, 2026 05:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (2)

lisa/microsoft/testsuites/vm_extensions/runtime_extensions/proxy_agent.py:36

  • The PR description's design table includes DEFAULT_VERSION=1.0, but this suite does not define DEFAULT_VERSION (which aligns with the framework guidance to avoid hardcoding versions). Please update the PR description to match the implementation, or explain why a DEFAULT_VERSION fallback is needed here.
    PUBLISHER = "Microsoft.Cplat.ProxyAgent"
    EXTENSION_TYPE = "ProxyAgentLinux"
    EXTENSION_KEY = "proxy_agent"

lisa/microsoft/testsuites/vm_extensions/runtime_extensions/proxy_agent.py:25

  • The suite description says it will "confirm the requested version was installed", but VmExtensionTestBase._boot_validation only asserts an exact installed version match when a full Major.Minor.Patch version is requested; for Major.Minor it only logs the installed version. Please adjust the description so it matches the actual boot-validation behavior to avoid misleading readers/runbook authors.
    The extension requires no public or protected settings, so coverage starts
    with boot validation: install the extension with empty settings, confirm
    provisioning succeeds, confirm the requested version was installed, confirm
    the VM is still reachable over SSH, then remove the extension.

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