You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Ubuntu release-aware distro prefiltering so incompatible tests can be excluded before VM deployment instead of being skipped after provisioning.
Export OsRequirement for use in supported_os and unsupported_os, with an inclusive minimum and exclusive maximum release. Validate malformed bounds, empty ranges, and unsupported non-Ubuntu version constraints.
Infer Ubuntu releases from marketplace offers/SKUs and recognizable gallery/VHD release or codename tokens, including Ubuntu 26.04/resolute. Ignore point releases, architecture/generation labels, kernel versions, and image publication versions when evaluating release requirements.
Share gated target resolution between the runner and CLI listing. Keep enable_distro_pre_filtering opt-in and retain tests when the target/release cannot be determined safely.
Check declared release requirements against the connected guest at runtime, including when prefiltering is disabled. Preserve existing class-only/non-Ubuntu behavior and specialized architecture, kernel, package, and hardware guards.
Apply release requirements to 17 tests across 13 suite files:
Use matching VM capabilities for each test. Verify both early exclusion of unsupported Ubuntu releases and retained non-Ubuntu selection; existing runtime guards may still skip retained cases.
Test Results
Image
VM Size
Result
N/A - local unit/static validation
N/A
PASSED
Azure marketplace deployment
Not provisioned
SKIPPED - not run
Executed commands and results:
.\.venv\Scripts\python.exe-m unittest selftests.test_additional_ubuntu_requirements selftests.test_application_health_extension selftests.test_azure_disk_encryption selftests.test_distro_prefilter selftests.test_drm_requirements selftests.test_linux_patch_extension selftests.test_metrics_extension selftests.test_network_watcher_extension selftests.test_testsuite selftests.test_vm_extension_ubuntu_requirements
# PASSED: 86 tests.# Resolve the Python files changed by this branch before squashing:$files=@(git diff --name-only origin/main...HEAD --'*.py'|ForEach-Object { $_-replace'/','\' })
.\.nox\flake8\Scripts\python.exe-m flake8 @files# PASSED: 30 changed Python files.
.\.nox\black\Scripts\python.exe-m black --check @files# PASSED: 30 files would be left unchanged.
.\.nox\isort\Scripts\python.exe-m isort --check-only @files# PASSED.
.\.nox\mypy\Scripts\python.exe-m mypy -p lisa
# PASSED: 609 source files.
git diff --check origin/main...HEAD
# PASSED.
Live Azure tests and the full unittest discovery suite were not run. Validation used the existing targeted test, formatting, lint, and typing tools configured by the repository.
Introduce OsRequirement with inclusive minimum and exclusive maximum Ubuntu release bounds. Infer releases from marketplace, gallery and VHD image identifiers, and share opt-in resolution between the runner and CLI listing. Preserve conservative handling of unknown releases and existing non-Ubuntu class requirements.
Validate declared release requirements against connected guests at runtime. Apply release policies to 17 tests across 13 suite files covering SGX, PTP, DRM, trusted boot and VM extensions. Correct Key Vault's supported range and exclude Ubuntu 22.04 and newer from Monitor Agent while preserving specialized runtime guards.
Document requirement authoring and SIG naming, and add regression tests for resolution, selection, release boundaries and runtime behavior.
Validation: 86 tests passed; flake8, Black and isort passed for 30 changed Python files; mypy passed for 609 source files; whitespace checks passed. Live Azure tests were not run.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the local VariableEntry import already provided at module scope to resolve pylint W0404 and the dependent PR validation failure.
Validation: pylint passed for all 30 changed Python files; 33 prefilter tests passed; flake8 and whitespace checks passed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Selected 25 test case(s): verify_sgx,verify_timesync_ptp,verify_timesync_unbind_clocksource,verify_timesync_unbind_clockevent,verify_timesync_ntp,verify_timesync_chrony,verify_pmu_disabled_for_arm64,verify_timedrift_corrected,verify_drm_driver,verify_dri_node,verify_no_error_output,verify_connection_status,verify_secureboot_compatibility,verify_measuredboot_compatibility,verify_azuremonitoragent_linux,verify_application_health_extension,verify_azsecpack,verify_azure_disk_encryption_enabled,verify_azure_disk_encryption_provisioned,verify_key_vault_extension,verify_azure_performance_diagnostics,verify_vm_assess_patches,verify_vm_install_patches,verify_metricsextension,verify_azure_network_watcher
Add check to defer Ubuntu version filtering if not identified.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Selected 25 test case(s): verify_sgx,verify_timesync_ptp,verify_timesync_unbind_clocksource,verify_timesync_unbind_clockevent,verify_timesync_ntp,verify_timesync_chrony,verify_pmu_disabled_for_arm64,verify_timedrift_corrected,verify_drm_driver,verify_dri_node,verify_no_error_output,verify_connection_status,verify_secureboot_compatibility,verify_measuredboot_compatibility,verify_azuremonitoragent_linux,verify_application_health_extension,verify_azsecpack,verify_azure_disk_encryption_enabled,verify_azure_disk_encryption_provisioned,verify_key_vault_extension,verify_azure_performance_diagnostics,verify_vm_assess_patches,verify_vm_install_patches,verify_metricsextension,verify_azure_network_watcher
The reason will be displayed to describe this comment to others. Learn more.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
LiliDeng
changed the title
Add Ubuntu release-aware distro prefiltering for 17 tests
[AI Generated] Add Ubuntu release-aware distro prefiltering for 17 tests
Oct 10, 2026
Skip reasons and prefilter logs rendered OsRequirement with the default
dataclass repr, e.g.
OsRequirement(os_type=<class 'lisa.operating_system.Ubuntu'>, min_version='20.04', ...)
They now use a compact form:
Ubuntu, Ubuntu[>=20.04), Ubuntu[<24.04), Ubuntu[>=20.04,<24.04)
The per-case "pre-filter dropped" debug line repeated the existing summary
debug line. Each dropped case's OS requirement is now included in that one
summary line instead.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Minor: Avoid relying on a bare assertion for required test metadata because optimized Python removes it. Fail explicitly before using the environment requirement.
Replace bare assert with explicit test failure
selftests/test_distro_prefilter.py:152
Minor: Avoid a bare assert in the test; Python can remove it under optimized execution, after which a failed inference produces an unrelated attribute error. Fail explicitly so the test retains the intended diagnostic in every mode.
This issue also appears in the following locations of the same file:
line 168
line 188
line 198
Make missing requirement metadata failure explicit
selftests/test_drm_requirements.py:102
Minor: A bare assertion is removed in optimized Python, which would turn missing requirement metadata into a later attribute error. Make the metadata failure explicit.
Replace bare assert with explicit setup failure
selftests/test_testsuite.py:349
Minor: Replace this bare assertion with an explicit test failure; otherwise optimized Python removes the guard and a setup failure is reported later as an unrelated attribute error.
This issue also appears on line 387 of the same file.
Selected 25 test case(s): verify_sgx,verify_timesync_ptp,verify_timesync_unbind_clocksource,verify_timesync_unbind_clockevent,verify_timesync_ntp,verify_timesync_chrony,verify_pmu_disabled_for_arm64,verify_timedrift_corrected,verify_drm_driver,verify_dri_node,verify_no_error_output,verify_connection_status,verify_secureboot_compatibility,verify_measuredboot_compatibility,verify_azuremonitoragent_linux,verify_application_health_extension,verify_azsecpack,verify_azure_disk_encryption_enabled,verify_azure_disk_encryption_provisioned,verify_key_vault_extension,verify_azure_performance_diagnostics,verify_vm_assess_patches,verify_vm_install_patches,verify_metricsextension,verify_azure_network_watcher
…erge
The main merge added Ubuntu 26 to the AzSecPack runtime allowlist on both
x86_64 and ARM64. The metadata still excluded every Ubuntu release from
25.01 onward, so prefiltering dropped verify_azsecpack on 26.04 before the
supported runtime path could run. The exclusion is now split into 25.x and
27+, and the expected majors in the test now include 26.
main also marked verify_sgx as deprecated, so the default stable gate
dropped it in test_marketplace_selection_and_gate. This failed 13
subtests, even with prefiltering disabled. The test now passes
apply_stable_gate=False so it checks OS/release prefiltering only.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Selected 25 test case(s): verify_sgx,verify_timesync_ptp,verify_timesync_unbind_clocksource,verify_timesync_unbind_clockevent,verify_timesync_ntp,verify_timesync_chrony,verify_pmu_disabled_for_arm64,verify_timedrift_corrected,verify_drm_driver,verify_dri_node,verify_no_error_output,verify_connection_status,verify_secureboot_compatibility,verify_measuredboot_compatibility,verify_azuremonitoragent_linux,verify_application_health_extension,verify_azsecpack,verify_azure_disk_encryption_enabled,verify_azure_disk_encryption_provisioned,verify_key_vault_extension,verify_azure_performance_diagnostics,verify_vm_assess_patches,verify_vm_install_patches,verify_metricsextension,verify_azure_network_watcher
Replace the per-major exclusion ranges (19.x, 21.x, 23.x, 25.x, 27+) with
a single OsRequirement(Ubuntu, max_version="18.01"). The prefilter now
drops only Ubuntu releases older than 18.x. The runtime _is_supported()
check still enforces the exact major allowlist and the ARM64 limits.
Selftests: AzSecPack moves from the discrete-major cases to a new
metadata_minimum_cases list with minimum (18, 1). Tests that picked cases
by list position now refer to them directly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Minor: segments.index("images") selects the first matching segment, so a valid full SIG resource ID whose resource-group or gallery name is images reads providers (or another intermediate segment) instead of the image definition. Ubuntu release inference then falls back to unknown and the enabled prefilter silently retains incompatible tests. Select the last /images/<definition> marker instead.
Minor: This bare assertion can disappear under optimized Python, turning a missing requirement environment into a less useful attribute error. Use an explicit test failure guard before dereferencing it.
Use an explicit guard for the test precondition
selftests/test_distro_prefilter.py:157
Minor: Avoid a bare assertion for this test precondition because optimized Python removes it and the later dereference then fails without identifying the inference failure. Use an explicit test failure guard.
This issue also appears in the following locations of the same file:
line 173
line 193
line 203
Explicitly guard the required patch environment
selftests/test_drm_requirements.py:102
Minor: This bare assertion can disappear under optimized Python, so the test may proceed without the requirement it needs to patch and fail misleadingly. Use an explicit test failure guard.
Replace bare assertion with an always-running guard
selftests/test_testsuite.py:349
Minor: This bare assertion is removed under optimized Python, allowing the test to continue with an uninitialized environment and fail misleadingly. Use an explicit guard that always runs.
This issue also appears on line 387 of the same file.
Selected 25 test case(s): verify_sgx,verify_timesync_ptp,verify_timesync_unbind_clocksource,verify_timesync_unbind_clockevent,verify_timesync_ntp,verify_timesync_chrony,verify_pmu_disabled_for_arm64,verify_timedrift_corrected,verify_drm_driver,verify_dri_node,verify_no_error_output,verify_connection_status,verify_secureboot_compatibility,verify_measuredboot_compatibility,verify_azuremonitoragent_linux,verify_application_health_extension,verify_azsecpack,verify_azure_disk_encryption_enabled,verify_azure_disk_encryption_provisioned,verify_key_vault_extension,verify_azure_performance_diagnostics,verify_vm_assess_patches,verify_vm_install_patches,verify_metricsextension,verify_azure_network_watcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add Ubuntu release-aware distro prefiltering so incompatible tests can be excluded before VM deployment instead of being skipped after provisioning.
OsRequirementfor use insupported_osandunsupported_os, with an inclusive minimum and exclusive maximum release. Validate malformed bounds, empty ranges, and unsupported non-Ubuntu version constraints.enable_distro_pre_filteringopt-in and retain tests when the target/release cannot be determined safely.verify_sgxverify_timesync_ptpverify_secureboot_compatibility,verify_measuredboot_compatibilityverify_drm_driver,verify_dri_node,verify_no_error_output,verify_connection_statusverify_application_health_extensionverify_azure_disk_encryption_enabledverify_key_vault_extensionverify_azuremonitoragent_linuxverify_vm_assess_patches,verify_azure_network_watcherverify_metricsextensionverify_azsecpackverify_azure_performance_diagnosticsThese are prefilter policies, not guarantees that every retained image satisfies all runtime checks.
Related Issue
Type of Change
Checklist
Test Validation
The following are recommended live validation cases, not completed Azure runs.
Key Test Cases:
verify_key_vault_extension|verify_azuremonitoragent_linux|verify_application_health_extension|verify_drm_driver|verify_azsecpack
Impacted LISA Features:
AzureExtension, ACC, SecurityProfile
Test eligibility and requirements are affected; feature implementations are unchanged.
Tested Azure Marketplace Images:
Recommended images for follow-up validation:
Use matching VM capabilities for each test. Verify both early exclusion of unsupported Ubuntu releases and retained non-Ubuntu selection; existing runtime guards may still skip retained cases.
Test Results
Executed commands and results:
Live Azure tests and the full unittest discovery suite were not run. Validation used the existing targeted test, formatting, lint, and typing tools configured by the repository.