Make verify_l3_cache topology-aware and skip unparseable lscpu output#4520
Make verify_l3_cache topology-aware and skip unparseable lscpu output#4520umfranci wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors verify_l3_cache in lisa/microsoft/testsuites/core/cpu.py to (a) gracefully skip when lscpu --extended output can’t be parsed due to missing/partial cache hierarchy (instead of hard-failing with AssertionError), and (b) consolidate L3 cache topology validation into a single generic helper intended to cover a wider range of CPU/NUMA/L3 layouts.
Changes:
- Catch
AssertionErrorfromLscpu.get_cpu_info()and raiseSkippedExceptionwhen cache topology data is missing or not parseable. - Replace multiple topology-specific branching paths with
_verify_l3_cache_topology()that validates socket/NUMA/L3 sharing invariants. - Add additional debug logging to help diagnose observed L3/NUMA sharing patterns.
❌ AI Test Selection — FAILED88 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest
Test case details
|
❌ AI Test Selection — FAILED88 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest
Test case details
|
❌ AI Test Selection — FAILED88 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest
Test case details
|
|
| Count | |
|---|---|
| ✅ Passed | 29 |
| ❌ Failed | 0 |
| ⏭️ Skipped | 6 |
| Total | 35 |
Test case details
| Test Case | Status | Time (s) | Message |
|---|---|---|---|
| verify_deployment_provision_synthetic_nic (lisa_0_3) | ✅ PASSED | 34.641 | |
| verify_deployment_provision_standard_ssd_disk (lisa_0_4) | ✅ PASSED | 41.768 | |
| smoke_test (lisa_0_1) | ✅ PASSED | 39.543 | |
| smoke_test_check_serial_console_pattern (lisa_0_2) | ✅ PASSED | 39.042 | |
| verify_deployment_provision_premium_disk (lisa_0_6) | ✅ PASSED | 43.442 | |
| verify_deployment_provision_ephemeral_managed_disk (lisa_0_5) | ✅ PASSED | 47.172 | |
| verify_deployment_provision_premiumv2_disk (lisa_0_7) | ✅ PASSED | 40.007 | |
| verify_deployment_provision_sriov (lisa_0_8) | ✅ PASSED | 50.591 | |
| verify_reboot_in_platform (lisa_0_9) | ✅ PASSED | 46.118 | |
| verify_deployment_provision_ultra_datadisk (lisa_0_10) | ✅ PASSED | 42.353 | |
| verify_deployment_provision_swiotlb_force (lisa_0_13) | ✅ PASSED | 79.415 | |
| verify_stop_start_in_platform (lisa_0_11) | ✅ PASSED | 202.987 | |
| verify_vmbus_devices_channels_bsd (lisa_0_18) | ⏭️ SKIPPED | 0.000 | check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.BSD'>] but VM supports [<class 'lisa.operatin |
| verify_gdb (lisa_0_0) | ✅ PASSED | 68.103 | |
| verify_default_targetpw (lisa_0_36) | ✅ PASSED | 3.139 | |
| verify_grub (lisa_0_37) | ✅ PASSED | 1.843 | |
| verify_network_file_configuration (lisa_0_39) | ⏭️ SKIPPED | 0.259 | skipped: unsupported distro type: <class 'lisa.operating_system.Ubuntu'> |
| verify_ifcfg_eth0 (lisa_0_40) | ⏭️ SKIPPED | 0.255 | skipped: unsupported distro type: <class 'lisa.operating_system.Ubuntu'> |
| verify_udev_rules_moved (lisa_0_41) | ⏭️ SKIPPED | 0.236 | skipped: Unsupported distro type : <class 'lisa.operating_system.Ubuntu'> |
| verify_dhcp_file_configuration (lisa_0_42) | ⏭️ SKIPPED | 0.241 | skipped: Unsupported distro type : <class 'lisa.operating_system.Ubuntu'> |
| verify_repository_installed (lisa_0_46) | ✅ PASSED | 17.003 | |
| verify_serial_console_is_enabled (lisa_0_47) | ✅ PASSED | 1.893 | |
| verify_no_pre_exist_users (lisa_0_52) | ✅ PASSED | 4.117 | |
| verify_resource_disk_file_system (lisa_0_54) | ✅ PASSED | 8.273 | |
| verify_waagent_version (lisa_0_55) | ✅ PASSED | 2.055 | |
| verify_python_version (lisa_0_56) | ✅ PASSED | 1.810 | |
| verify_openssl_version (lisa_0_57) | ✅ PASSED | 1.858 | |
| verify_azure_64bit_os (lisa_0_58) | ✅ PASSED | 1.892 | |
| verify_omi_version (lisa_0_59) | ✅ PASSED | 3.839 | |
| verify_no_swap_on_osdisk (lisa_0_60) | ✅ PASSED | 1.928 | |
| verify_essential_kernel_modules (lisa_0_61) | ✅ PASSED | 2.551 | |
| verify_dhcp_client_timeout (lisa_0_22) | ✅ PASSED | 2.403 | |
| verify_dns_name_resolution (lisa_0_23) | ✅ PASSED | 3.023 | |
| verify_sched_core_basic (lisa_0_14) | ⏭️ SKIPPED | 8.588 | before_case skipped: Unsupported system: 'Ubuntu 22.04.5 LTS'. SCHED_CORE support is only tested on AzureLinux 3.0 and l |
| verify_floppy_module_is_blacklisted (lisa_0_16) | ✅ PASSED | 8.895 |
|
| Count | |
|---|---|
| ✅ Passed | 46 |
| ❌ Failed | 0 |
| ⏭️ Skipped | 7 |
| Total | 53 |
Test case details
| Test Case | Status | Time (s) | Message |
|---|---|---|---|
| verify_vmbus_devices_channels_bsd (lisa_0_37) | ⏭️ SKIPPED | 0.000 | check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.BSD'>] but VM supports [<class 'lisa.operatin |
| verify_vmbus_devices_channels (lisa_0_38) | ✅ PASSED | 5.613 | |
| verify_serial_console (lisa_0_2) | ✅ PASSED | 40.374 | |
| smoke_test (lisa_0_3) | ✅ PASSED | 29.960 | |
| smoke_test_check_serial_console_pattern (lisa_0_4) | ✅ PASSED | 32.127 | |
| verify_deployment_provision_synthetic_nic (lisa_0_5) | ✅ PASSED | 26.487 | |
| verify_deployment_provision_standard_ssd_disk (lisa_0_6) | ✅ PASSED | 48.239 | |
| verify_deployment_provision_ephemeral_managed_disk (lisa_0_7) | ✅ PASSED | 24.875 | |
| verify_deployment_provision_premium_disk (lisa_0_8) | ✅ PASSED | 25.583 | |
| verify_deployment_provision_premiumv2_disk (lisa_0_9) | ✅ PASSED | 50.553 | |
| verify_deployment_provision_sriov (lisa_0_10) | ✅ PASSED | 38.692 | |
| verify_reboot_in_platform (lisa_0_11) | ✅ PASSED | 44.594 | |
| verify_deployment_provision_ultra_datadisk (lisa_0_12) | ✅ PASSED | 42.241 | |
| verify_stop_start_in_platform (lisa_0_13) | ✅ PASSED | 64.070 | |
| verify_deployment_provision_swiotlb_force (lisa_0_15) | ✅ PASSED | 92.947 | |
| verify_gdb (lisa_0_1) | ✅ PASSED | 65.821 | |
| verify_kvp (lisa_0_0) | ✅ PASSED | 52.333 | |
| verify_default_targetpw (lisa_0_40) | ✅ PASSED | 1.290 | |
| verify_grub (lisa_0_41) | ✅ PASSED | 0.846 | |
| verify_network_file_configuration (lisa_0_43) | ⏭️ SKIPPED | 0.333 | skipped: unsupported distro type: <class 'lisa.operating_system.Ubuntu'> |
| verify_ifcfg_eth0 (lisa_0_44) | ⏭️ SKIPPED | 0.296 | skipped: unsupported distro type: <class 'lisa.operating_system.Ubuntu'> |
| verify_udev_rules_moved (lisa_0_45) | ⏭️ SKIPPED | 0.277 | skipped: Unsupported distro type : <class 'lisa.operating_system.Ubuntu'> |
| verify_dhcp_file_configuration (lisa_0_46) | ⏭️ SKIPPED | 0.366 | skipped: Unsupported distro type : <class 'lisa.operating_system.Ubuntu'> |
| verify_serial_console_is_enabled (lisa_0_51) | ✅ PASSED | 1.238 | |
| verify_no_pre_exist_users (lisa_0_56) | ✅ PASSED | 1.244 | |
| verify_resource_disk_file_system (lisa_0_58) | ✅ PASSED | 3.346 | |
| verify_waagent_version (lisa_0_59) | ✅ PASSED | 1.225 | |
| verify_python_version (lisa_0_60) | ✅ PASSED | 0.776 | |
| verify_repository_installed (lisa_0_50) | ✅ PASSED | 20.440 | |
| verify_openssl_version (lisa_0_61) | ✅ PASSED | 1.372 | |
| verify_azure_64bit_os (lisa_0_62) | ✅ PASSED | 1.145 | |
| verify_omi_version (lisa_0_63) | ✅ PASSED | 0.991 | |
| verify_no_swap_on_osdisk (lisa_0_64) | ✅ PASSED | 0.755 | |
| verify_essential_kernel_modules (lisa_0_65) | ✅ PASSED | 1.294 | |
| verify_dhcp_client_timeout (lisa_0_36) | ✅ PASSED | 1.028 | |
| verify_dns_name_resolution (lisa_0_66) | ✅ PASSED | 1.696 | |
| verify_dns_name_resolution_after_upgrade (lisa_0_67) | ✅ PASSED | 96.617 | |
| verify_floppy_module_is_blacklisted (lisa_0_18) | ✅ PASSED | 0.878 | |
| verify_initrd_modules (lisa_0_31) | ✅ PASSED | 41.049 | |
| verify_hyperv_modules (lisa_0_32) | ✅ PASSED | 1.810 | |
| verify_enable_kprobe (lisa_0_35) | ✅ PASSED | 1.381 | |
| verify_hyperv_platform_id (lisa_0_87) | ⏭️ SKIPPED | 56.834 | skipped: Could not install msr-tools and rdmsr was not available. |
| verify_resource_disk_mounted (lisa_0_69) | ✅ PASSED | 1.597 | |
| verify_swap (lisa_0_70) | ✅ PASSED | 1.313 | |
| verify_resource_disk_io (lisa_0_71) | ✅ PASSED | 1.316 | |
| verify_scsi_disk_controller_type (lisa_0_72) | ✅ PASSED | 0.483 | |
| verify_os_partition_identifier (lisa_0_74) | ✅ PASSED | 0.974 | |
| verify_pmu_disabled_for_arm64 (lisa_0_24) | ✅ PASSED | 0.740 | |
| verify_timedrift_corrected (lisa_0_25) | ✅ PASSED | 73.537 | |
| verify_timesync_ptp (lisa_0_19) | ✅ PASSED | 5.918 | |
| verify_vdso (lisa_0_16) | ✅ PASSED | 148.600 | |
| verify_vm_hot_resize (lisa_0_26) | ✅ PASSED | 39.147 | |
| verify_boot_with_debug_kernel (lisa_0_17) | ⏭️ SKIPPED | 5.327 | skipped: Ubuntu not supported. This test case only supports redhat/centos distro. |
❌ AI Test Selection — FAILED88 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest
Test case details
|
❌ AI Test Selection — FAILED88 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest
Test case details
|
|
@umfranci please check the conflicts. If you are fixing the same issue, please close it. |
Description
Rework
verify_l3_cacheto fix two kinds of failures:Crash when L3 cache info is missing:
get_cpu_info()throwsAssertionErrorwhenlscpu --extendedoutput lacks L3 data (ARM64 VMs, or AMD EPYC 7763 VMs with partial cache reporting). The fix catches this and raisesSkippedExceptioninstead, so these VMs are gracefully SKIPPED rather than hard-FAILed.Replace rigid branching with invariant-based validation: The old code assumed only two L3 layouts (1:1 or socket-shared) across 5 helper methods, which false-failed valid modern topologies. It is replaced with a single
_verify_l3_cache_topology()enforcing four universal invariants:This shall cover Intel 1:1, AMD EPYC multi-CCD, and sub-NUMA clustering without special-casing.
Some Sample Failures fixed:
AssertionError: lscpu NUMA node mapping is not in expected format: 0 0 0 -(no cache hierarchy)AssertionError: lscpu NUMA node mapping is not in expected format: 0 0 0 0:0:0(L1d/L1i/L2 only, no L3)AssertionError: lscpu NUMA node mapping is not in expected format: 16 1 0 8:8:8(AMD EPYC 7763 partial L3)Type of Change
Checklist
Test Validation
Key Test Cases:
verify_l3_cache
Impacted LISA Features:
Lscpu (CPU topology validation)
Tested Azure Marketplace Images:
Test Results
Tested with other ARM/AMD/Intel SKUs already succeeding