Skip to content

WIP: net: Introduce dual-stream primary network tests#4774

Open
azhivovk wants to merge 3 commits intoRedHatQE:mainfrom
azhivovk:new_rhcos9-10_tests_part2
Open

WIP: net: Introduce dual-stream primary network tests#4774
azhivovk wants to merge 3 commits intoRedHatQE:mainfrom
azhivovk:new_rhcos9-10_tests_part2

Conversation

@azhivovk
Copy link
Copy Markdown
Contributor

@azhivovk azhivovk commented May 7, 2026

Short description:

New dual-stream tests: primary network scenarios

More details:

STD: #4569

What this PR does / why we need it:

Added automation for new dual-stream tests

Which issue(s) this PR fixes: -
Special notes for reviewer:

Follow-up implementation of new tests of primary network
Do not review the first infra commit - it'll be merged in first PR of this series #4772

jira-ticket: https://redhat.atlassian.net/browse/CNV-86194

Summary by CodeRabbit

  • New Features

    • Added node selector support for virtual machines, enabling pod pinning to specific Kubernetes nodes.
  • Tests

    • Introduced test infrastructure and fixtures for validating connectivity across mixed RHCOS 9 and RHCOS 10 environments.
    • Added pytest marker for tests requiring dual-stream operating system clusters.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (1)
  • WIP

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 66d2c8b5-8ccb-42c2-8128-24f7585dd40d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds VM node pinning and test fixtures to enable live migration testing across RHCOS 9 and RHCOS 10 clusters. Changes span VM spec enhancements, node selection utilities, factory function updates, test fixtures, and executable migration tests that validate primary-network connectivity after server VM migration between OS versions.

Changes

RHCOS 9/10 Live Migration Test Infrastructure

Layer / File(s) Summary
VM Spec Schema
libs/vm/spec.py
Adds optional nodeSelector: dict[str, str] | None field to VMISpec for capturing node affinity labels.
Test Markers
pytest.ini
Defines mixed_os_nodes marker for tests requiring dual-stream RHCOS 9 and RHCOS 10 worker clusters.
Node Selection Library
tests/network/libs/nodes.py
New module with RHCOS_9_VERSION_PREFIX, RHCOS_10_VERSION_PREFIX constants; node_by_rhcos_version() scans workers and returns first match by OS version; update_vm_node_selector() patches VM spec to pin by hostname.
VM Factory Node Support
tests/network/libs/vm_factory.py, tests/network/localnet/liblocalnet.py
udn_vm() and localnet_vm() now accept optional node parameter; when provided, sets spec.template.spec.nodeSelector to {kubernetes.io/hostname: node.hostname}, otherwise applies anti-affinity.
Network Test Fixtures
tests/network/conftest.py
Adds rhcos9_node and rhcos10_node module-scoped fixtures via node_by_rhcos_version() to select workers by OS version.
Primary Network Fixtures & Helpers
tests/network/primary_network/rhel9_rhel10_cluster/conftest.py, tests/network/primary_network/rhel9_rhel10_cluster/lib_helpers.py
New primary_network_vm() factory creates Fedora VMs pinned to a specific node with masquerade-only networking; primary_server_vm and primary_client_vm fixtures start VMs and wait for guest agent connectivity.
Connectivity Tests
tests/network/primary_network/rhel9_rhel10_cluster/test_connectivity.py
Removes __test__ = False and implements executable tests: test_primary_connectivity_reestablished_after_server_migration_to_rhcos10 and test_primary_connectivity_reestablished_after_server_migration_to_rhcos9 now accept VM and node fixtures, perform live migration, resolve server IP, and ping from client to verify connectivity after migration.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title uses 'WIP:' prefix and is vague about the core changes; 'dual-stream primary network tests' doesn't clarify what infrastructure was added or changed. Remove 'WIP:' and be specific: e.g., 'net: Add nodeSelector support and dual-stream primary network connectivity tests' or split into two focused PRs if infrastructure and tests are distinct efforts.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description covers all required template sections with relevant details about the dual-stream tests, objectives, and related tracking information.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-virtualization-qe-bot-4
Copy link
Copy Markdown

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest verify-bugs-are-open - verify-bugs-are-open
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • EdDev

Reviewers:

  • Anatw
  • EdDev
  • azhivovk
  • frenzyfriday
  • nirdothan
  • orelmisan
  • servolkov
  • yossisegev
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@azhivovk
Copy link
Copy Markdown
Contributor Author

azhivovk commented May 8, 2026

Change: rebase

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 8, 2026
@azhivovk
Copy link
Copy Markdown
Contributor Author

azhivovk commented May 8, 2026

Change: Drop udn and localnet changes

@azhivovk
Copy link
Copy Markdown
Contributor Author

azhivovk commented May 8, 2026

/wip

@openshift-virtualization-qe-bot-4 openshift-virtualization-qe-bot-4 changed the title net: Introduce dual-stream primary network tests WIP: net: Introduce dual-stream primary network tests May 8, 2026
azhivovk and others added 3 commits May 8, 2026 13:26
- Add mixed_os_nodes marker to pytest.ini to select tests only on
  compatible clusters
- Add rhcos9_node/rhcos10_node fixtures to network conftest
- Add update_vm_node_selector helper and HOSTNAME_LABEL to nodes lib

Signed-off-by: Asia Khromov <azhivovk@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Asia Khromov <azhivovk@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The primary (masquerade) network relies on OVN flow tables
that must be updated correctly when a VM migrates to a node
running a different RHCOS version.
These tests verify that primary network connectivity
is re-established after cross-OS migration in both directions.

Signed-off-by: Asia Khromov <azhivovk@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@azhivovk azhivovk force-pushed the new_rhcos9-10_tests_part2 branch from 1ab144e to 4938d0d Compare May 8, 2026 10:34
@azhivovk
Copy link
Copy Markdown
Contributor Author

azhivovk commented May 8, 2026

Change:

  • Move shared IPv6 masquerade config
  • Add IPv6 testing
  • Remove redundant comments
  • Add back the STD docstring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants