net: Filter IPv4 on IPv6-only clusters#5492
Conversation
📝 WalkthroughWalkthroughAdds a cluster-aware IP version helper, applies it to upgrade and localnet IP checks, and updates one default-bridge test to filter unsupported addresses before comparing IPs. ChangesCluster-supported IP filtering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Couldn't analyze Error: Server ErrorThe server encountered an error and could not complete your request.Please try again in 30 seconds. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
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
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
📌 Additional InformationCustom Commands:
For more information, please refer to the project documentation or contact the maintainers. |
|
/lgtm |
EdDev
left a comment
There was a problem hiding this comment.
Nice, thanks.
See inline comments.
|
|
@servolkov upgrade VMs were refactored accordingly in the first commit 20456ef |
|
/verified Single-stack IPv6 BM with cnv-4.23: |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -e
echo "=== git diff stat ==="
git diff origin/main...HEAD --stat 2>/dev/null || true
echo "=== ip.py content ==="
cat -n libs/net/ip.py | sed -n '1,80p'
echo "=== cluster.py content ==="
cat -n libs/net/cluster.py
echo "=== conftest.py (localnet) ==="
cat -n tests/network/localnet/conftest.py
echo "=== test_default_bridge.py ==="
cat -n tests/network/localnet/test_default_bridge.py
echo "=== root conftest relevant section ==="
rg -n "supported_cluster_ip_versions|ipv4_supported_cluster|ipv6_supported_cluster" tests/conftest.pyLength of output: 2568 🏁 Script executed: #!/bin/bash
set -e
echo "=== ip.py content ==="
cat -n libs/net/ip.py | sed -n '1,80p'
echo "=== cluster.py content ==="
cat -n libs/net/cluster.py
echo "=== conftest.py (localnet) ==="
cat -n tests/network/localnet/conftest.py
echo "=== test_default_bridge.py ==="
cat -n tests/network/localnet/test_default_bridge.py
echo "=== root conftest relevant section ==="
rg -n "supported_cluster_ip_versions|ipv4_supported_cluster|ipv6_supported_cluster" tests/conftest.pyLength of output: 2484
Best-effort plan based on available PR summary context (unverified against live repo):
Note: the author ( Once repository access is restored, please re-trigger |
|
/check-can-merge |
|
/approve |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
|
/cherry-pick cnv-4.22 |
Cherry-pick from `main` branch, original PR: #5492, PR owner: azhivovk Signed-off-by: Asia Khromov <azhivovk@redhat.com> Co-authored-by: Asia Khromov <azhivovk@redhat.com>
- libs/vm/spec.py: add macAddress field to Interface (RedHatQE#5349) - libs/net/vmspec.py: add wait_for_ifaces_status helper (RedHatQE#5492) - libs/net/ip.py: add random_cidr_addresses_by_family helper (RedHatQE#5492) - libs/net/ip.py: add filter_link_local_addresses helper (RedHatQE#5492) - libs/net/traffic_generator.py: add bind_ip/bind_dev to TcpServer and VMTcpClient (RedHatQE#5492) - tests/network/libs/connectivity.py: add poll_tcp_connectivity helper (RedHatQE#5492) RedHatQE#5349 RedHatQE#5492 Signed-off-by: Asia Khromov <azhivovk@redhat.com> Assisted-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
What this PR does / why we need it:
On IPv6-only clusters, VMIs may still report IPv4 addresses due to a cloud-init limitation:
Which issue(s) this PR fixes:
This caused fixture predicates to wait indefinitely (count mismatch) and the IP visibility test to fail (extra IPv4 address in reported set).
This change includes extracting a new cached helper for repeated fetching of cluster IP support and addition of a new helper to strip cluster-unsupported addresses. Apply it in the localnet fixture predicates and in
test_vmi_reports_ip_on_secondary_interface_without_vlan.Filtering rather than blocking preserves test coverage on IPv6-only clusters. Blocking would skip the test entirely, losing the regression guard for CNV-38477. The cloud-init DHCPv4 behavior is a
known infrastructure limitation, not a product bug - filtering the extra IPv4 addresses out is the correct response
Special notes for reviewer:
Targeted for backport to 4.22, the first release to support secondary networks on single-stack IPv6 clusters
jira-ticket: -
Summary by CodeRabbit