Repository navigation
CherryPicked: [v2.10] fix: eliminate TOCTOU bug in static IP preservation check - #505
Merged
Merged
Conversation
* fix: eliminate TOCTOU bug in static IP preservation check Refactor check_static_ip_preservation() to verify all static IPs simultaneously instead of sequentially to ensure that all Static IPs are present on the migrated guest at the moment (to catch a possible bug when firstboot script on the guest wrongly overwrites already configured primary Static IP. - Single TimeoutSampler verifies all static IPs on each iteration - One SSH call per retry instead of one per IP - Use dict(matched) shallow copy to prevent mutation - Use zip(..., strict=True) for length safety * refactor: extract helper functions from static IP verification closure Address CodeRabbit review feedback on PR #494: - Extract _load_current_interfaces() and _match_expected_static_ips() as module-level helpers for independent testability - Implement phased interface matching priority: exact MAC match first, then exact name match, then unique substring name match (prevents false positives from ambiguous substring matches) - Update docstring with correct timeout default (660s) and specific exception types * refactor: use VMSSHConnection type instead of Any in _load_current_interfaces Addresses CodeRabbit review comment on PR #494. Replaces the generic Any annotation with the concrete VMSSHConnection type for static type safety and updates the docstring accordingly.
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features:
🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
Collaborator
|
/lgtm |
|
New container for ghcr.io/redhatqe/mtv-api-tests:v2.10 published |
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.
Cherry-pick from
mainbranch, original PR: #494, PR owner: krcmarik