feat(vm_extensions): add Guest Proxy Agent boot validation test - #4632
feat(vm_extensions): add Guest Proxy Agent boot validation test#4632Jayprakash gupta (Jaype-e) wants to merge 3 commits into
Conversation
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
There was a problem hiding this comment.
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
ProxyAgentTestswith 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.
| 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 |
There was a problem hiding this comment.
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
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
There was a problem hiding this comment.
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_VERSIONas1.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 fullMajor.Minor.Patchversion; forMajor.Minorit 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.
There was a problem hiding this comment.
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.
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.pyDesign
Follows the
VmExtensionTestBaseonboarding pattern fromdocs/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.PUBLISHERMicrosoft.Cplat.ProxyAgentEXTENSION_TYPEProxyAgentLinuxEXTENSION_KEYproxy_agentDEFAULT_VERSION1.0The extension requires neither public nor protected settings, so the case installs with
settings={}._boot_validation()then: installs -> assertsprovisioning_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 theproxy_agent_version(or genericextension_version) runbook variable; the case is skipped, not failed, when neither is set.How to run
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.
ProxyAgentTests, areavm_extension, tagsVM_Extension, ProxyAgentLinuxStill 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_testImpacted LISA Features:
AzureExtension
Tested Azure Marketplace Images:
canonical ubuntu-24_04-lts server latestredhat rhel 9_5 latestmicrosoftcblmariner azure-linux-3 azure-linux-3-gen2 latest