Fix deployment issue seen in verify_hv_kvp_daemon_installed #4406
Open
Fix deployment issue seen in verify_hv_kvp_daemon_installed #4406
Conversation
…strator.azure.features.SecurityProfileSettings'>
70b23e5 to
ea7d0cd
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an assertion failure during feature/settings equality checks by making VirtualizationSettings.__eq__ safely handle comparisons against non-VirtualizationSettings objects (returning non-equal instead of raising).
Changes:
- Replace a type-assert in
VirtualizationSettings.__eq__with a safe type check to avoid raisingAssertionErrorduring comparisons.
Comment on lines
893
to
896
| def __eq__(self, o: object) -> bool: | ||
| assert isinstance(o, VirtualizationSettings), f"actual: {type(o)}" | ||
| if not isinstance(o, VirtualizationSettings): | ||
| return False | ||
| return super().__eq__(o) and self.host_type == o.host_type |
There was a problem hiding this comment.
In eq, returning False for an unrelated type works, but Python’s comparison protocol recommends returning NotImplemented when the other operand isn’t the expected type. This lets Python fall back to the other operand’s eq and keeps equality symmetric (especially if subclasses or proxy types are involved).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
When run verify_hv_kvp_daemon_installed with size Standard_E20bds_v6 encounter below issue:
AzureImageStandard.verify_hv_kvp_daemon_installed: FAILED deployment failed. AssertionError: actual: <class 'lisa.sut_orchestrator.azure.features.SecurityProfileSettings'>
2026-04-03 03:08:46.615[3504][INFO] lisa.RootRunner test result summary
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
debian debian-13 13-gen2 0.20260112.2355
Test Results