Skip to content

net: Introduce dual-stream udn tests#4786

Merged
rnetser merged 2 commits into
RedHatQE:mainfrom
azhivovk:new_rhcos9-10_tests_udn
Jun 30, 2026
Merged

net: Introduce dual-stream udn tests#4786
rnetser merged 2 commits into
RedHatQE:mainfrom
azhivovk:new_rhcos9-10_tests_udn

Conversation

@azhivovk

@azhivovk azhivovk commented May 8, 2026

Copy link
Copy Markdown
Contributor
Short description:

New dual-stream tests: UDN scenarios
This PR adds two tests that verify TCP connection survives migration in both directions (RHCOS 9 -> RHCOS 10 and back). VMs are scheduled using node affinity on the RHCOS 9 worker label rather than hostnames, so the tests are resilient to node replacement.

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 UDN which is supported in tests only for IPv4.
Due to low availability of dual-stream BMs, the test implemented with IPv4 only. IPv6 will be added in a follow-up.

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

Summary by CodeRabbit

  • New Features
    • Added an optional VM affinity parameter to allow more control over VM scheduling behavior.
  • Tests
    • Introduced class-scoped fixtures to provision and coordinate UDN server/client virtual machines and collect active TCP connections.
    • Updated connectivity tests to use shared fixtures and verify TCP connectivity remains intact during live migration between RHCOS 9 and RHCOS 10.

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@azhivovk, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1ac7ea61-139b-43e2-945d-7cb83d9957b6

📥 Commits

Reviewing files that changed from the base of the PR and between 00b07c3 and 03381cb.

📒 Files selected for processing (3)
  • tests/network/libs/vm_factory.py
  • tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py
  • tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py
📝 Walkthrough

Walkthrough

udn_vm now accepts an optional affinity override. New UDN fixtures create and validate server/client VMs plus active TCP pairs. The connectivity tests are enabled for mixed OS nodes, use those fixtures, migrate the server between RHCOS9 and RHCOS10, and recheck each TCP connection after migration.

Changes

UDN Mixed-OS Migration Connectivity

Layer / File(s) Summary
udn_vm affinity parameter extension
tests/network/libs/vm_factory.py
udn_vm imports Affinity, accepts an optional affinity, and uses it instead of auto-generated anti-affinity when provided.
conftest: server VM, client VM, and active TCP connection fixtures
tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py
Adds _UDN_PRIMARY_IFACE_NAME, server/client VM fixtures with guest-agent and interface validation, and an active TCP connection fixture tied to that interface name.
test_connectivity: migration scenarios with TCP assertion
tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py
Enables the migration tests with markers, wires in explicit fixtures, sets node affinity for each migration direction, runs live migration, and asserts all TCP pairs remain connected.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

new-tests

Suggested reviewers

  • yossisegev
  • orelmisan
  • nirdothan
  • RoniKishner
  • frenzyfriday
  • EdDev
  • Anatw
  • servolkov
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the PR’s main change: introducing dual-stream UDN tests.
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.
Stp Link Required ✅ Passed PASS: test_connectivity.py already has a module-level STP URL, so the new test methods are covered.
Description check ✅ Passed The PR description covers all required template sections with the needed details and a Jira link, so it is sufficiently complete.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped RedHatQE/openshift-virtualization-tests-design-docs.


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.

@openshift-virtualization-qe-bot-2

Copy link
Copy Markdown
Contributor

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
  • dshchedr
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • Anatw
  • EdDev
  • RoniKishner
  • azhivovk
  • dshchedr
  • frenzyfriday
  • nirdothan
  • orelmisan
  • rnetser
  • servolkov
  • vsibirsk
  • 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

azhivovk commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

Change: Drop localnet changes

@azhivovk

azhivovk commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

/wip

@azhivovk

azhivovk commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Change: fixtures' scope module -> class (scope should be minimal and specified as possible)

@servolkov servolkov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, only small ones from my side:

Comment thread tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py
Comment thread tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py Outdated
@azhivovk

azhivovk commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

Apply changes after CR:

  • Renaming and typing
  • Edit commit message

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py`:
- Around line 4-6: Move the annotation-only imports in conftest.py behind a
TYPE_CHECKING guard so they are not loaded at runtime; the symbols to relocate
include DynamicClient, Namespace, Layer2UserDefinedNetwork, TcpServer,
VMTcpClient, and BaseVirtualMachine. Update the relevant type-hint usage in the
fixture/helper definitions to work with deferred or quoted annotations, and if
any annotations are still evaluated at runtime, add from __future__ import
annotations or quote those references so the module imports cleanly without
extra collection-time work or cycle risk.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 65067b0d-ea10-443f-81f3-70316ae7877c

📥 Commits

Reviewing files that changed from the base of the PR and between 1237f55 and 00b07c3.

📒 Files selected for processing (2)
  • tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py
  • tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py

Comment thread tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
@azhivovk

Copy link
Copy Markdown
Contributor Author

Change: use client_server_active_connection as in existing IPv4 UDN tests

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
@azhivovk

azhivovk commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

/verified
Dual-stream PSI with cnv -4.23 (low availability of dual-stream BMs):
uv run pytest --verbose -rs -s -o log_cli=true --leftovers-collector --tb=native --skip-deprecated-api-test --cluster-sanity-skip-storage-check tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py
Result: 2 passed, 1 deselected, 14 warnings in 486.48s (0:08:06)

Regression due to udn_vm refactoring:
tests/network/user_defined_network/ + tests/network/bgp/
All passed

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

@coderabbitai

Test execution plan request details

CRITICAL: You MUST post an inline review comment on the first changed line of the first file.
The inline comment should contain the full Test Execution Plan (smoke decision, gating decision, and specific affected tests).
Do NOT submit a blocking review event (REQUEST_CHANGES/APPROVE).
Post a single inline PR comment on Files Changed (non-blocking COMMENT flow).

As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan.
You will post an inline review comment with the test execution plan on the first changed file.
If you fail to run or post a comment, retry.

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

  3. Analyze pytest-specific elements: fixtures (scope, dependencies), parametrization, markers, conftest changes

  4. Trace test dependencies through imports, shared utilities, fixture inheritance, fixture teardown, and yield from cleanup in conftest

  5. Detect new tests introduced in the PR

  6. Utilities and libs impact (when utilities/ or libs/ changes):
    You MUST use shell scripts (rg, git diff) to trace the full impact.
    Follow these sub-steps in order:

    6a. Identify modified symbols: For each changed file under utilities/ or libs/,
    list every modified function or method.
    Example: git diff HEAD~1 --unified=0 -- utilities/hco.py | grep '^[+-]def '

    6b. Find direct callers: Search tests and conftest for each symbol from 6a.
    Example: rg -l 'get_hco_version' tests/

    6c. Trace fixture teardown and cleanup: Find fixtures that reach
    the modified symbol through yield from or context-manager wrappers.
    Example: rg -l 'yield from.*enable_common_boot|def.*enable_common_boot' tests/

    6d. Trace same-file callers: In each changed file, find other functions
    whose body calls a modified symbol (including code after yield
    in @contextmanager helpers).
    Example: rg 'get_hco_version|enable_common_boot' utilities/hco.py

    6e. Expand transitively: If function A calls modified B, then
    tests/fixtures that call A are affected — even when the test body
    never imports B directly.

    Do NOT limit impact to tests that import the modified symbol only.

  7. Smoke test impact: Intersect the affected set from step 6 with smoke-marked tests.
    Run: rg -l '@pytest.mark.smoke' tests/
    VERIFY the above command returned actual file paths before concluding False.
    Set True if either condition is met:

    • a smoke-marked file appears in the affected set from 6b-6e, OR
    • any conftest.py in the smoke test's parent-directory hierarchy (up to repo root)
      imports or calls a modified utilities/libs symbol — including autouse fixtures
      that depend on modified functions. ALL tests in that directory and below are affected.
      Example check: for each smoke_file, scan dirname(smoke_file)/conftest.py,
      dirname(dirname(smoke_file))/conftest.py, etc. for modified symbol imports
      and autouse fixtures that depend on modified symbols.
  8. Gating test impact: Intersect the affected set from step 6 with gating-marked tests.
    Run: rg -l '@pytest.mark.gating' tests/
    Set True if a gating-marked file also appears in the affected set from 6b-6e.
    Utilities/libs changes often affect gating tests without affecting smoke tests.
    Do NOT stop analysis after concluding Run smoke tests: False.

Output rules:
Do NOT include analysis step numbers (1-8) in your visible output.

Your deliverable:
Your inline informational comment will be based on the following requirements:

Test Execution Plan

  • Run smoke tests: True / False — If True, state the dependency path (test → fixture → changed symbol). True ONLY with a verified path.
  • Run gating tests: True / False — If True, state the dependency path. True if any gating-marked test is in the affected set.
  • Affected tests to run (required when utilities/, libs/, or shared conftest changes — list concrete paths even when smoke is False)

Use these formats:

  • path/to/test_file.py - When the entire test file needs verification
  • path/to/test_file.py::TestClass::test_method - When specific test(s) needed
  • path/to/test_file.py::test_function - When specific test(s) needed
  • -m marker - When a marker covers multiple affected tests (e.g. -m gating only if ALL gating tests in scope need run)
  • Tag each listed test or group with its marker when not obvious, e.g. (gating) or (smoke)

Real test commands (MANDATORY when changes affect session/runtime code):

When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
config hooks, session-scoped setup) or modifies runtime behavior that unit tests mock away,
you MUST include concrete pytest commands the PR author must run on a real cluster
to verify the change works end-to-end. Include:

  • A command for the error/fix path (the scenario the PR fixes)
  • A command for the happy path (regression: the normal case still works)
  • Use lightweight tests (e.g., --collect-only for startup failures,
    a single small test for runtime behavior)
    If the PR only changes test logic (not utilities/libs/conftest), the affected test
    paths themselves serve as the real test commands — no separate section needed.

Example output for a session-startup fix:

**Real tests (cluster required)**
Error path (the fix):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=nonexistent-sc --collect-only`
Expected: ValueError with clear message, not IndexError

Happy path (regression):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=<valid-sc> -k test_bar`
Expected: session starts normally

Guidelines:

  • Include tests affected directly OR via fixture setup/teardown, yield from cleanup, or transitive utility call chains (caller calls modified helper)
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name when only specific tests use an affected fixture or utility wrapper (preferred for partial file impact)
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal
  • Example: if leaf helper foo() changes, include tests whose fixture teardown calls wrapper bar() where bar() calls foo(), even when the test body only imports an unrelated symbol from the same utilities module

Hardware-Related Checks (SR-IOV, GPU, DPDK):

When PR modifies fixtures for hardware-specific resources:

  • Collection Safety: Fixtures MUST have existence checks (return None when hardware unavailable)
  • Test Plan: MUST verify both WITH and WITHOUT hardware:
    • Run affected tests on cluster WITH hardware
    • Verify collection succeeds on cluster WITHOUT hardware

CRITICAL WORKFLOW COMPLETION RULES:

When responding to this test execution plan request, you MUST follow these rules EXACTLY:

  1. YOUR ONLY DELIVERABLE: Post one non-blocking inline comment containing the test execution plan on the first changed line
  2. THEN STOP IMMEDIATELY - Do NOT generate any additional response
  3. FALLBACK ONLY: If inline comment API calls fail after retrying, post as a regular PR comment
  4. SILENCE = SUCCESS: After successfully submitting the review, your task is complete. No confirmation needed.

ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):

  • ❌ Do NOT post acknowledgment messages like "Test execution plan posted", "Review posted successfully", "I've successfully posted"
  • ❌ Do NOT mention review IDs, URLs, or confirmation of posting in the PR thread
  • ❌ Do NOT add any follow-up comments after submitting the review
  • ❌ Do NOT reply to confirm task completion
  • ❌ Do NOT explain what you did - just do it and stop

Remember: The pull request review is visible to users. Additional comments are redundant noise.

CRITICAL — Verification rules for smoke and gating decisions:
- For each True decision, you must have traced a concrete path: test file → fixture → utility function → modified symbol.
- Do NOT assume impact based on scope, file proximity, or infrastructure-sounding names.
Only set True when you trace a concrete path through steps 6a-6e, then 7 or 8.
WRONG: "utilities/hco.py changed → run smoke" (no traced dependency path)
WRONG: "Run smoke tests: False" with no affected-test list when gating tests use the changed utility
RIGHT: "Run smoke tests: False, Run gating tests: True" plus tests/.../test_foo.py::TestBar::test_baz (gating)
RIGHT: "Smoke test X uses fixture Y → wrapper Z → changed function W in utilities/hco.py"

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"

echo "== PR metadata =="
gh pr view "$pr" --repo "$repo" --json number,baseRefName,headRefName,headRefOid,url,title

echo
echo "== Changed files in PR order =="
gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate \
  | jq -r '.[] | [.filename, .status] | `@tsv`'

base_branch=$(gh pr view "$pr" --repo "$repo" --json baseRefName --jq '.baseRefName')
head_sha=$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')

echo
echo "== Fetch base branch and compute merge-base =="
git fetch --no-tags origin "$base_branch":"refs/remotes/origin/$base_branch" >/dev/null 2>&1 || true
merge_base=$(git merge-base "origin/$base_branch" HEAD)
echo "BASE_BRANCH=$base_branch"
echo "MERGE_BASE=$merge_base"
echo "HEAD_SHA=$head_sha"

echo
echo "== Diff summary (merge-base...HEAD) =="
git diff --stat "$merge_base"...HEAD

echo
echo "== First changed file patch from GitHub API =="
first_file=$(gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate | jq -r '.[0].filename')
echo "FIRST_FILE=$first_file"
gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate \
  | jq -r --arg f "$first_file" '.[] | select(.filename==$f) | .patch'

echo
echo "== Modified defs in tests/network/libs/vm_factory.py =="
git diff --unified=0 "$merge_base"...HEAD -- tests/network/libs/vm_factory.py | sed -n '1,220p'
echo
git diff --unified=0 "$merge_base"...HEAD -- tests/network/libs/vm_factory.py | grep -nE '^[+-].*(def |class )' || true

echo
echo "== AST outline of tests/network/libs/vm_factory.py =="
ast-grep outline tests/network/libs/vm_factory.py --view expanded || true

echo
echo "== Relevant slices: tests/network/libs/vm_factory.py =="
sed -n '1,260p' tests/network/libs/vm_factory.py

echo
echo "== Relevant slices: tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py =="
sed -n '1,260p' tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py

echo
echo "== Relevant slices: tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py =="
sed -n '1,260p' tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py

echo
echo "== Direct callers/importers of udn_vm in tests and conftest =="
rg -n --glob 'tests/**/*.py' '\budn_vm\b' tests

echo
echo "== Same-file callers / affinity handling in vm_factory =="
rg -n 'affinity|template_labels|anti_affinity_namespaces|udn_vm\s*\(' tests/network/libs/vm_factory.py

echo
echo "== Smoke-marked test files =="
rg -n --glob 'tests/**/*.py' '`@pytest`\.mark\.smoke' tests || true

echo
echo "== Gating-marked test files =="
rg -n --glob 'tests/**/*.py' '`@pytest`\.mark\.gating' tests || true

echo
echo "== UDN RHEL9/RHEL10 references =="
rg -n --glob 'tests/**/*.py' 'rhel9_rhel10_cluster|mixed_os_nodes|RHCOS9_WORKER_LABEL|client_server_active_connection|active_tcp_connections' tests

echo
echo "== Parent conftest chain for affected test directory =="
for f in \
  tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py \
  tests/network/user_defined_network/conftest.py \
  tests/network/conftest.py \
  tests/conftest.py
do
  if [[ -f "$f" ]]; then
    echo "--- $f"
    rg -n '\budn_vm\b|client_server_active_connection|active_tcp_connections|new_node_affinity|RHCOS9_WORKER_LABEL|affinity' "$f" || true
  fi
done

Length of output: 37157


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"
base_branch=$(gh pr view "$pr" --repo "$repo" --json baseRefName --jq '.baseRefName')
git fetch --no-tags origin "$base_branch":"refs/remotes/origin/$base_branch" >/dev/null 2>&1 || true
merge_base=$(git merge-base "origin/$base_branch" HEAD)

echo "== Exact added lines in first file =="
git diff --unified=0 "$merge_base"...HEAD -- tests/network/libs/vm_factory.py

echo
echo "== udn_vm call sites with surrounding context =="
for f in \
  tests/network/user_defined_network/test_user_defined_network.py \
  tests/network/user_defined_network/test_user_defined_network_passt.py \
  tests/network/user_defined_network/ip_specification/conftest.py \
  tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py \
  tests/network/provider_migration/conftest.py \
  tests/network/bgp/conftest.py \
  tests/network/bgp/evpn/conftest.py
do
  echo "--- $f"
  sed -n '1,260p' "$f" | nl -ba | sed -n '1,260p'
  echo
done

echo
echo "== Search for udn_vm calls passing affinity= =="
rg -nUP --glob 'tests/**/*.py' 'udn_vm\s*\([^)]*affinity\s*=' tests || true

echo
echo "== Search for udn_vm calls passing template_labels= =="
rg -nUP --glob 'tests/**/*.py' 'udn_vm\s*\([^)]*template_labels\s*=' tests || true

echo
echo "== Search for udn_vm calls passing both affinity= and template_labels= =="
python - <<'PY'
import pathlib, re
for path in pathlib.Path("tests").rglob("*.py"):
    text = path.read_text()
    for m in re.finditer(r'udn_vm\s*\((.*?)\)', text, re.S):
        call = m.group(1)
        if 'affinity=' in call and 'template_labels=' in call:
            line = text[:m.start()].count('\n') + 1
            print(f"{path}:{line}")
PY

echo
echo "== Gating markers in user_defined_network test file =="
rg -n -C2 '`@pytest`\.mark\.gating|def test_|class ' tests/network/user_defined_network/test_user_defined_network.py

echo
echo "== Parent conftest chain for direct caller files =="
for f in \
  tests/network/user_defined_network/test_user_defined_network.py \
  tests/network/user_defined_network/test_user_defined_network_passt.py \
  tests/network/provider_migration/test_ip_persistence.py \
  tests/network/bgp/evpn/test_evpn_connectivity.py
do
  dir=$(dirname "$f")
  echo "### caller=$f"
  while true; do
    cf="$dir/conftest.py"
    if [[ -f "$cf" ]]; then
      echo "--- $cf"
      rg -n '\budn_vm\b|def .*vm|`@pytest`\.fixture|yield|client_server_active_connection|active_tcp_connections|new_node_affinity|template_labels|affinity' "$cf" || true
    fi
    [[ "$dir" == "." || "$dir" == "tests" ]] && break
    dir=$(dirname "$dir")
  done
done

echo
echo "== Smoke files overlapping network subtree =="
rg -n --glob 'tests/network/**/*.py' '`@pytest`\.mark\.smoke' tests || true

echo
echo "== PR review threads / existing comments on first file =="
gh api "repos/$repo/pulls/$pr/comments?per_page=100" --paginate \
  | jq -r '.[] | select(.path=="tests/network/libs/vm_factory.py") | [.id, .path, .line, .side, (.body|gsub("\n";" ")|.[0:140])] | `@tsv`'

Length of output: 5324


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"

echo "== udn_vm call inventory (affinity/template_labels flags) =="
python - <<'PY'
import pathlib, re
for path in sorted(pathlib.Path("tests").rglob("*.py")):
    text = path.read_text()
    for m in re.finditer(r'udn_vm\s*\((.*?)\)', text, re.S):
        call = m.group(1)
        line = text[:m.start()].count('\n') + 1
        affinity = 'affinity=' in call
        labels = 'template_labels=' in call
        print(f"{path}:{line}\taffinity={affinity}\ttemplate_labels={labels}")
PY

echo
for f in \
  tests/network/user_defined_network/test_user_defined_network.py \
  tests/network/user_defined_network/test_user_defined_network_passt.py \
  tests/network/user_defined_network/ip_specification/conftest.py \
  tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py \
  tests/network/provider_migration/conftest.py \
  tests/network/bgp/conftest.py \
  tests/network/bgp/evpn/conftest.py
do
  if [[ -f "$f" ]]; then
    echo "== $f =="
    rg -n -C3 '\budn_vm\s*\(|`@pytest`\.mark\.(gating|smoke|polarion|mixed_os_nodes|ipv4)|def test_|class |`@pytest`\.fixture' "$f" || true
    echo
  fi
done

echo "== Direct references to fixtures introduced in this PR =="
rg -n -C2 '\budn_server_vm\b|\budn_client_vm\b|\budn_active_tcp_connection\b' tests/network/user_defined_network/rhel9_rhel10_cluster

echo
echo "== Network smoke-marked files =="
rg -n --glob 'tests/network/**/*.py' '`@pytest`\.mark\.smoke' tests || true

echo
echo "== Gating-marked files that also reference udn_vm directly =="
python - <<'PY'
import pathlib, re
for path in sorted(pathlib.Path("tests").rglob("*.py")):
    text = path.read_text()
    if '`@pytest.mark.gating`' in text and re.search(r'\budn_vm\b', text):
        print(path)
PY

echo
echo "== Existing PR comments on tests/network/libs/vm_factory.py =="
gh api "repos/$repo/pulls/$pr/comments?per_page=100" --paginate \
  | jq -r '.[] | select(.path=="tests/network/libs/vm_factory.py") | [.id, .line, .side, (.body|gsub("\n";" ")|.[0:160])] | `@tsv`'

Length of output: 27918


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Consumers of affected BGP/EVPN fixtures =="
for sym in vm_cudn tcp_server_cudn_vm vm_evpn_target vm_evpn_reference; do
  echo "-- $sym"
  rg -n --glob 'tests/**/*.py' "\\b${sym}\\b" tests/network/bgp tests/network/bgp/evpn || true
  echo
done

echo "== Test files under affected directories =="
fd -t f '^test_.*\.py$' tests/network/bgp tests/network/bgp/evpn tests/network/user_defined_network/ip_specification tests/network/user_defined_network

echo
echo "== Any existing smoke/gating markers in those candidate files =="
for f in $(fd -t f '^test_.*\.py$' tests/network/bgp tests/network/bgp/evpn tests/network/user_defined_network/ip_specification tests/network/user_defined_network); do
  echo "--- $f"
  rg -n '`@pytest`\.mark\.(gating|smoke|polarion|ipv4|mixed_os_nodes)' "$f" || true
done

Length of output: 11253


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"
path="tests/network/libs/vm_factory.py"
line="8"
side="RIGHT"

me="$(gh api user --jq '.login')"
head_sha="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"

existing_id="$(
  gh api "repos/$repo/pulls/$pr/comments?per_page=100" --paginate \
    | jq -r --arg me "$me" --arg path "$path" --argjson line "$line" --arg side "$side" '
        .[] | select(.user.login == $me and .path == $path and .line == $line and .side == $side) | .id
      ' \
    | head -n1
)"

if [[ -n "${existing_id:-}" ]]; then
  exit 0
fi

body=$(cat <<'EOF'
**Test Execution Plan**

- **Run smoke tests: False** — no verified smoke-marked test or parent `conftest.py` dependency path reaches `tests/network/libs/vm_factory.py::udn_vm`.
- **Run gating tests: True** — `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` → `client` / `server` fixtures → `vma_udn` / `vmb_udn` fixtures → `tests/network/libs/vm_factory.py::udn_vm` (`template_labels` anti-affinity path).

- **Affected tests to run**
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py` — direct coverage of the new `affinity=` path via `udn_server_vm` / `udn_client_vm`
  - `tests/network/user_defined_network/test_user_defined_network.py` (includes gating coverage)
  - `tests/network/user_defined_network/test_user_defined_network_passt.py`
  - `tests/network/user_defined_network/ip_specification/test_ip_specification.py`
  - `tests/network/bgp/test_bgp_connectivity.py`
  - `tests/network/bgp/evpn/test_evpn_connectivity.py`

**Real tests (cluster required)**

Error path (the fix):
`pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`
Expected: the VM is created on an RHCOS 9 node via explicit `affinity=`, migration to RHCOS 10 succeeds after `set_template_affinity(...)`, and the TCP session survives.

Happy path (regression):
`pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration`
Expected: the existing `template_labels`-driven anti-affinity path still schedules correctly and the TCP session survives migration.
EOF
)

gh api "repos/$repo/pulls/$pr/comments" \
  -X POST \
  -f body="$body" \
  -f commit_id="$head_sha" \
  -f path="$path" \
  -F line="$line" \
  -f side="$side"

Length of output: 2936


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"

body=$(cat <<'EOF'
**Test Execution Plan**

- **Run smoke tests: False** — no verified smoke-marked test or parent `conftest.py` dependency path reaches `tests/network/libs/vm_factory.py::udn_vm`.
- **Run gating tests: True** — `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` → `client` / `server` fixtures → `vma_udn` / `vmb_udn` fixtures → `tests/network/libs/vm_factory.py::udn_vm` (`template_labels` anti-affinity path).

- **Affected tests to run**
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py` — direct coverage of the new `affinity=` path via `udn_server_vm` / `udn_client_vm`
  - `tests/network/user_defined_network/test_user_defined_network.py` (includes gating coverage)
  - `tests/network/user_defined_network/test_user_defined_network_passt.py`
  - `tests/network/user_defined_network/ip_specification/test_ip_specification.py`
  - `tests/network/bgp/test_bgp_connectivity.py`
  - `tests/network/bgp/evpn/test_evpn_connectivity.py`

**Real tests (cluster required)**

Error path (the fix):
`pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`
Expected: the VM is created on an RHCOS 9 node via explicit `affinity=`, migration to RHCOS 10 succeeds after `set_template_affinity(...)`, and the TCP session survives.

Happy path (regression):
`pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration`
Expected: the existing `template_labels`-driven anti-affinity path still schedules correctly and the TCP session survives migration.
EOF
)

gh pr comment "$pr" --repo "$repo" --body "$body"

Length of output: 2295


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"

body_file="$(mktemp)"
cat > "$body_file" <<'EOF'
**Test Execution Plan**

- **Run smoke tests: False** — no verified smoke-marked test or parent `conftest.py` dependency path reaches `tests/network/libs/vm_factory.py::udn_vm`.
- **Run gating tests: True** — `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` → `client` / `server` fixtures → `vma_udn` / `vmb_udn` fixtures → `tests/network/libs/vm_factory.py::udn_vm` (`template_labels` anti-affinity path).

- **Affected tests to run**
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py` — direct coverage of the new `affinity=` path via `udn_server_vm` / `udn_client_vm`
  - `tests/network/user_defined_network/test_user_defined_network.py` (includes gating coverage)
  - `tests/network/user_defined_network/test_user_defined_network_passt.py`
  - `tests/network/user_defined_network/ip_specification/test_ip_specification.py`
  - `tests/network/bgp/test_bgp_connectivity.py`
  - `tests/network/bgp/evpn/test_evpn_connectivity.py`

**Real tests (cluster required)**

Error path (the fix):
`pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`
Expected: the VM is created on an RHCOS 9 node via explicit `affinity=`, migration to RHCOS 10 succeeds after `set_template_affinity(...)`, and the TCP session survives.

Happy path (regression):
`pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration`
Expected: the existing `template_labels`-driven anti-affinity path still schedules correctly and the TCP session survives migration.
EOF

gh api "repos/$repo/issues/$pr/comments" \
  -X POST \
  --input "$body_file"

Length of output: 2502


@openshift-virtualization-qe-bot-3

Test Execution Plan

  • Run smoke tests: False — no verified smoke-marked test or parent conftest.py dependency path reaches tests/network/libs/vm_factory.py::udn_vm.

  • Run gating tests: Truetests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migrationclient / server fixtures → vma_udn / vmb_udn fixtures → tests/network/libs/vm_factory.py::udn_vm (template_labels anti-affinity path).

  • Affected tests to run

    • tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py — direct coverage of the new affinity= path via udn_server_vm / udn_client_vm
    • tests/network/user_defined_network/test_user_defined_network.py (gating)
    • tests/network/user_defined_network/test_user_defined_network_passt.py
    • tests/network/user_defined_network/ip_specification/test_ip_specification.py
    • tests/network/bgp/test_bgp_connectivity.py
    • tests/network/bgp/evpn/test_evpn_connectivity.py

Real tests (cluster required)

Error path (the fix):
pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10
Expected: the VM is created on an RHCOS 9 node via explicit affinity=, migration to RHCOS 10 succeeds after set_template_affinity(...), and the TCP session survives.

Happy path (regression):
pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration
Expected: the existing template_labels-driven anti-affinity path still schedules correctly and the TCP session survives migration.

@azhivovk

Copy link
Copy Markdown
Contributor Author

/check-can-merge

1 similar comment
@azhivovk

Copy link
Copy Markdown
Contributor Author

/check-can-merge

Comment thread tests/network/libs/vm_factory.py Outdated
azhivovk added 2 commits June 30, 2026 13:23
The new primary UDN tests need to pin VMs to specific
RHCOS node types during live migration, requiring
explicit node affinity support in udn_vm.

Add affinity parameter.
template_labels and affinity are independent: labels
are always applied when provided; affinity takes
precedence over the auto-generated pod anti-affinity
from template_labels, but does not suppress the labels.

Signed-off-by: Asia Khromov <azhivovk@redhat.com>
Assisted-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The l2bridge UDN binding depends on components that may
behave differently across RHCOS versions.
These tests verify that an active TCP connection over a
primary UDN is preserved when the server VM migrates
between RHCOS 9 and RHCOS 10 nodes in both directions.

Tests cover IPv4 only - IPv6 is not yet officially supported
in primary UDN.

Signed-off-by: Asia Khromov <azhivovk@redhat.com>
Assisted-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@azhivovk

azhivovk commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Change after CR: Apply affinity when given since there's no point of overriding default affinity when affinity=None

@azhivovk

azhivovk commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

/verified

New dual-stream tests passed

Last change produces the same logic as before
#4786 (comment)

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

@coderabbitai

Test execution plan request details

CRITICAL: You MUST post an inline review comment on the first changed line of the first file.
The inline comment should contain the full Test Execution Plan (smoke decision, gating decision, and specific affected tests).
Do NOT submit a blocking review event (REQUEST_CHANGES/APPROVE).
Post a single inline PR comment on Files Changed (non-blocking COMMENT flow).

As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan.
You will post an inline review comment with the test execution plan on the first changed file.
If you fail to run or post a comment, retry.

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

  3. Analyze pytest-specific elements: fixtures (scope, dependencies), parametrization, markers, conftest changes

  4. Trace test dependencies through imports, shared utilities, fixture inheritance, fixture teardown, and yield from cleanup in conftest

  5. Detect new tests introduced in the PR

  6. Utilities and libs impact (when utilities/ or libs/ changes):
    You MUST use shell scripts (rg, git diff) to trace the full impact.
    Follow these sub-steps in order:

    6a. Identify modified symbols: For each changed file under utilities/ or libs/,
    list every modified function or method.
    Example: git diff HEAD~1 --unified=0 -- utilities/hco.py | grep '^[+-]def '

    6b. Find direct callers: Search tests and conftest for each symbol from 6a.
    Example: rg -l 'get_hco_version' tests/

    6c. Trace fixture teardown and cleanup: Find fixtures that reach
    the modified symbol through yield from or context-manager wrappers.
    Example: rg -l 'yield from.*enable_common_boot|def.*enable_common_boot' tests/

    6d. Trace same-file callers: In each changed file, find other functions
    whose body calls a modified symbol (including code after yield
    in @contextmanager helpers).
    Example: rg 'get_hco_version|enable_common_boot' utilities/hco.py

    6e. Expand transitively: If function A calls modified B, then
    tests/fixtures that call A are affected — even when the test body
    never imports B directly.

    Do NOT limit impact to tests that import the modified symbol only.

  7. Smoke test impact: Intersect the affected set from step 6 with smoke-marked tests.
    Run: rg -l '@pytest.mark.smoke' tests/
    VERIFY the above command returned actual file paths before concluding False.
    Set True if either condition is met:

    • a smoke-marked file appears in the affected set from 6b-6e, OR
    • any conftest.py in the smoke test's parent-directory hierarchy (up to repo root)
      imports or calls a modified utilities/libs symbol — including autouse fixtures
      that depend on modified functions. ALL tests in that directory and below are affected.
      Example check: for each smoke_file, scan dirname(smoke_file)/conftest.py,
      dirname(dirname(smoke_file))/conftest.py, etc. for modified symbol imports
      and autouse fixtures that depend on modified symbols.
  8. Gating test impact: Intersect the affected set from step 6 with gating-marked tests.
    Run: rg -l '@pytest.mark.gating' tests/
    Set True if a gating-marked file also appears in the affected set from 6b-6e.
    Utilities/libs changes often affect gating tests without affecting smoke tests.
    Do NOT stop analysis after concluding Run smoke tests: False.

Output rules:
Do NOT include analysis step numbers (1-8) in your visible output.

Your deliverable:
Your inline informational comment will be based on the following requirements:

Test Execution Plan

  • Run smoke tests: True / False — If True, state the dependency path (test → fixture → changed symbol). True ONLY with a verified path.
  • Run gating tests: True / False — If True, state the dependency path. True if any gating-marked test is in the affected set.
  • Affected tests to run (required when utilities/, libs/, or shared conftest changes — list concrete paths even when smoke is False)

Use these formats:

  • path/to/test_file.py - When the entire test file needs verification
  • path/to/test_file.py::TestClass::test_method - When specific test(s) needed
  • path/to/test_file.py::test_function - When specific test(s) needed
  • -m marker - When a marker covers multiple affected tests (e.g. -m gating only if ALL gating tests in scope need run)
  • Tag each listed test or group with its marker when not obvious, e.g. (gating) or (smoke)

Real test commands (MANDATORY when changes affect session/runtime code):

When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
config hooks, session-scoped setup) or modifies runtime behavior that unit tests mock away,
you MUST include concrete pytest commands the PR author must run on a real cluster
to verify the change works end-to-end. Include:

  • A command for the error/fix path (the scenario the PR fixes)
  • A command for the happy path (regression: the normal case still works)
  • Use lightweight tests (e.g., --collect-only for startup failures,
    a single small test for runtime behavior)
    If the PR only changes test logic (not utilities/libs/conftest), the affected test
    paths themselves serve as the real test commands — no separate section needed.

Example output for a session-startup fix:

**Real tests (cluster required)**
Error path (the fix):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=nonexistent-sc --collect-only`
Expected: ValueError with clear message, not IndexError

Happy path (regression):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=<valid-sc> -k test_bar`
Expected: session starts normally

Guidelines:

  • Include tests affected directly OR via fixture setup/teardown, yield from cleanup, or transitive utility call chains (caller calls modified helper)
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name when only specific tests use an affected fixture or utility wrapper (preferred for partial file impact)
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal
  • Example: if leaf helper foo() changes, include tests whose fixture teardown calls wrapper bar() where bar() calls foo(), even when the test body only imports an unrelated symbol from the same utilities module

Hardware-Related Checks (SR-IOV, GPU, DPDK):

When PR modifies fixtures for hardware-specific resources:

  • Collection Safety: Fixtures MUST have existence checks (return None when hardware unavailable)
  • Test Plan: MUST verify both WITH and WITHOUT hardware:
    • Run affected tests on cluster WITH hardware
    • Verify collection succeeds on cluster WITHOUT hardware

CRITICAL WORKFLOW COMPLETION RULES:

When responding to this test execution plan request, you MUST follow these rules EXACTLY:

  1. YOUR ONLY DELIVERABLE: Post one non-blocking inline comment containing the test execution plan on the first changed line
  2. THEN STOP IMMEDIATELY - Do NOT generate any additional response
  3. FALLBACK ONLY: If inline comment API calls fail after retrying, post as a regular PR comment
  4. SILENCE = SUCCESS: After successfully submitting the review, your task is complete. No confirmation needed.

ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):

  • ❌ Do NOT post acknowledgment messages like "Test execution plan posted", "Review posted successfully", "I've successfully posted"
  • ❌ Do NOT mention review IDs, URLs, or confirmation of posting in the PR thread
  • ❌ Do NOT add any follow-up comments after submitting the review
  • ❌ Do NOT reply to confirm task completion
  • ❌ Do NOT explain what you did - just do it and stop

Remember: The pull request review is visible to users. Additional comments are redundant noise.

CRITICAL — Verification rules for smoke and gating decisions:
- For each True decision, you must have traced a concrete path: test file → fixture → utility function → modified symbol.
- Do NOT assume impact based on scope, file proximity, or infrastructure-sounding names.
Only set True when you trace a concrete path through steps 6a-6e, then 7 or 8.
WRONG: "utilities/hco.py changed → run smoke" (no traced dependency path)
WRONG: "Run smoke tests: False" with no affected-test list when gating tests use the changed utility
RIGHT: "Run smoke tests: False, Run gating tests: True" plus tests/.../test_foo.py::TestBar::test_baz (gating)
RIGHT: "Smoke test X uses fixture Y → wrapper Z → changed function W in utilities/hco.py"

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"

base_branch="$(gh pr view "$pr" --repo "$repo" --json baseRefName --jq '.baseRefName')"
head_sha="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"

git fetch --no-tags origin "$base_branch":"refs/remotes/origin/$base_branch" >/dev/null 2>&1 || true
merge_base="$(git merge-base "origin/$base_branch" HEAD)"

# Discover current PR file order from GitHub and capture the first changed file.
first_file="$(gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate | jq -r '.[0].filename')"

# Determine the first added/changed line on the RIGHT side for the first file.
first_right_line="$(
  gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate \
    | jq -r --arg f "$first_file" '
        .[] | select(.filename==$f) | .patch
      ' \
    | python - <<'PY'
import sys, re
patch = sys.stdin.read().splitlines()
new_line = None
for line in patch:
    if line.startswith('@@'):
        m = re.search(r'\+(\d+)(?:,(\d+))?', line)
        if m:
            new_line = int(m.group(1))
        continue
    if new_line is None:
        continue
    if line.startswith('+') and not line.startswith('+++'):
        print(new_line)
        raise SystemExit(0)
    if line.startswith('-') and not line.startswith('---'):
        continue
    new_line += 1
raise SystemExit("No added line found in first file patch")
PY
)"

# Fresh evidence for the current diff.
echo "BASE_BRANCH=$base_branch"
echo "MERGE_BASE=$merge_base"
echo "HEAD_SHA=$head_sha"
echo "FIRST_FILE=$first_file"
echo "FIRST_RIGHT_LINE=$first_right_line"

echo "== Current diff summary =="
git diff --stat "$merge_base"...HEAD

echo "== Current zero-context diff for first file =="
git diff --unified=0 "$merge_base"...HEAD -- "$first_file"

echo "== Current first file outline =="
ast-grep outline "$first_file" --view expanded || true

echo "== Current first file slice =="
sed -n '1,260p' "$first_file"

echo "== Current changed test files =="
gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate | jq -r '.[] | [.filename, .status] | `@tsv`'

echo "== Direct callers of udn_vm in tests =="
rg -n --glob 'tests/**/*.py' '\budn_vm\s*\(' tests

echo "== Same-file references to udn_vm/affinity/template_labels in first file =="
rg -n '^\s*def\s+udn_vm\b|\baffinity\b|\btemplate_labels\b|\banti_affinity_namespaces\b' "$first_file"

echo "== New dual-stream conftest =="
sed -n '1,260p' tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py

echo "== New dual-stream test file =="
sed -n '1,260p' tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py

echo "== Existing IPv4 UDN test file =="
sed -n '1,260p' tests/network/user_defined_network/test_user_defined_network.py

echo "== UDN passt test file =="
sed -n '1,220p' tests/network/user_defined_network/test_user_defined_network_passt.py

echo "== IP specification test file =="
sed -n '1,220p' tests/network/user_defined_network/ip_specification/test_ip_specification.py

echo "== BGP connectivity test file =="
sed -n '1,220p' tests/network/bgp/test_bgp_connectivity.py

echo "== EVPN connectivity test file =="
sed -n '1,240p' tests/network/bgp/evpn/test_evpn_connectivity.py

echo "== Caller conftests =="
for f in \
  tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py \
  tests/network/user_defined_network/ip_specification/conftest.py \
  tests/network/provider_migration/conftest.py \
  tests/network/bgp/conftest.py \
  tests/network/bgp/evpn/conftest.py
do
  if [[ -f "$f" ]]; then
    echo "--- $f"
    rg -n -C2 '\budn_vm\s*\(|`@pytest`\.fixture|yield|template_labels|affinity|new_node_affinity|client_server_active_connection|active_tcp_connections' "$f" || true
  fi
done

echo "== Smoke-marked files =="
rg -l '`@pytest`\.mark\.smoke' tests || true

echo "== Gating-marked files =="
rg -l '`@pytest`\.mark\.gating' tests || true

# Build the updated plan body. Use specific affected tests where possible.
body_file="$(mktemp)"
cat > "$body_file" <<'EOF'
**Test Execution Plan**

- **Run smoke tests: False** — I did not verify any smoke-marked test or parent `conftest.py` dependency path that reaches `tests/network/libs/vm_factory.py::udn_vm`.
- **Run gating tests: True** — `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` `(gating)` → `client` / `server` fixtures → `vma_udn` / `vmb_udn` fixtures in `tests/network/user_defined_network/conftest.py` → `tests/network/libs/vm_factory.py::udn_vm` (existing `template_labels` path touched by this change).

- **Affected tests to run**
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos9`
  - `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` `(gating)`
  - `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_server_live_migration`
  - `tests/network/user_defined_network/test_user_defined_network_passt.py`
  - `tests/network/user_defined_network/ip_specification/test_ip_specification.py`
  - `tests/network/bgp/test_bgp_connectivity.py`
  - `tests/network/bgp/evpn/test_evpn_connectivity.py`

**Real tests (cluster required)**

Error path (the fix):  
`pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`  
Expected: when explicit `affinity=` is passed into `udn_vm`, it is applied to the VM template, the server migrates from an RHCOS 9 worker to an RHCOS 10 worker after `set_template_affinity(...)`, and the TCP connection stays established.

Happy path (regression):  
`pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration`  
Expected: existing callers that rely on the default `template_labels` anti-affinity path still schedule correctly and preserve the TCP connection during migration.
EOF

# Find an existing inline comment by coderabbitai[bot] on the same path/line, update if found; otherwise create it.
existing_id="$(
  gh api "repos/$repo/pulls/$pr/comments?per_page=100" --paginate \
    | jq -r --arg path "$first_file" --argjson line "$first_right_line" '
        .[] | select(.user.login=="coderabbitai[bot]" and .path==$path and .line==$line and .side=="RIGHT") | .id
      ' \
    | head -n1
)"

if [[ -n "${existing_id:-}" ]]; then
  gh api "repos/$repo/pulls/comments/$existing_id" \
    -X PATCH \
    --input "$body_file" >/dev/null
else
  gh api "repos/$repo/pulls/$pr/comments" \
    -X POST \
    -f commit_id="$head_sha" \
    -f path="$first_file" \
    -F line="$first_right_line" \
    -f side="RIGHT" \
    --input "$body_file" >/dev/null
fi

Length of output: 7520


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"

base_branch="$(gh pr view "$pr" --repo "$repo" --json baseRefName --jq '.baseRefName')"
head_sha="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"

git fetch --no-tags origin "$base_branch":"refs/remotes/origin/$base_branch" >/dev/null 2>&1 || true
merge_base="$(git merge-base "origin/$base_branch" HEAD)"

first_file="$(gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate | jq -r '.[0].filename')"
patch="$(
  gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate \
    | jq -r --arg f "$first_file" '.[] | select(.filename==$f) | .patch // ""'
)"

echo "FIRST_FILE=$first_file"
echo "== Patch for first changed file =="
printf '%s\n' "$patch"

read -r comment_side comment_line < <(
  PATCH_CONTENT="$patch" python - <<'PY'
import os, re, sys
patch = os.environ["PATCH_CONTENT"].splitlines()
old_line = new_line = None

for line in patch:
    if line.startswith('@@'):
        m = re.search(r'-(\d+)(?:,\d+)? \+(\d+)(?:,\d+)?', line)
        if not m:
            continue
        old_line = int(m.group(1))
        new_line = int(m.group(2))
        continue
    if old_line is None or new_line is None:
        continue
    if line.startswith('+') and not line.startswith('+++'):
        print("RIGHT", new_line)
        sys.exit(0)
    if line.startswith('-') and not line.startswith('---'):
        print("LEFT", old_line)
        sys.exit(0)
    old_line += 1
    new_line += 1

sys.exit("Unable to determine first changed line/side from patch")
PY
)

echo "COMMENT_SIDE=$comment_side"
echo "COMMENT_LINE=$comment_line"

echo "== Current diff summary =="
git diff --stat "$merge_base"...HEAD

echo "== Current zero-context diff for first file =="
git diff --unified=0 "$merge_base"...HEAD -- "$first_file"

echo "== Modified symbol(s) in libs file(s) =="
git diff --unified=0 "$merge_base"...HEAD -- tests/network/libs/vm_factory.py | grep -nE '^[+-].*(def |class )' || true

echo "== Direct callers of udn_vm in tests/conftest =="
rg -n --glob 'tests/**/*.py' '\budn_vm\s*\(' tests

echo "== Gating-marked files =="
rg -l '`@pytest`\.mark\.gating' tests || true

echo "== Smoke-marked files =="
rg -l '`@pytest`\.mark\.smoke' tests || true

echo "== Relevant slices =="
sed -n '1,260p' tests/network/libs/vm_factory.py
sed -n '1,260p' tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py
sed -n '1,260p' tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py
sed -n '1,260p' tests/network/user_defined_network/test_user_defined_network.py
sed -n '1,220p' tests/network/user_defined_network/test_user_defined_network_passt.py
sed -n '1,220p' tests/network/user_defined_network/ip_specification/test_ip_specification.py
sed -n '1,220p' tests/network/bgp/test_bgp_connectivity.py
sed -n '1,240p' tests/network/bgp/evpn/test_evpn_connectivity.py

echo "== Relevant conftests =="
for f in \
  tests/network/user_defined_network/conftest.py \
  tests/network/user_defined_network/rhel9_rhel10_cluster/conftest.py \
  tests/network/user_defined_network/ip_specification/conftest.py \
  tests/network/bgp/conftest.py \
  tests/network/bgp/evpn/conftest.py \
  tests/network/provider_migration/conftest.py
do
  if [[ -f "$f" ]]; then
    echo "--- $f"
    rg -n -C2 '\budn_vm\s*\(|`@pytest`\.fixture|yield|template_labels|affinity|new_node_affinity|client_server_active_connection|active_tcp_connections|vma_udn|vmb_udn|client|server' "$f" || true
  fi
done

body_file="$(mktemp)"
cat > "$body_file" <<'EOF'
**Test Execution Plan**

- **Run smoke tests: False** — no verified smoke-marked test or parent `conftest.py` dependency path reaches `tests/network/libs/vm_factory.py::udn_vm`.
- **Run gating tests: True** — `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` `(gating)` → `client` / `server` fixtures → `vma_udn` / `vmb_udn` fixtures in `tests/network/user_defined_network/conftest.py` → `tests/network/libs/vm_factory.py::udn_vm` (the existing `template_labels` path that this refactor preserves).

- **Affected tests to run**
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos9`
  - `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` `(gating)`
  - `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_server_live_migration`
  - `tests/network/user_defined_network/test_user_defined_network_passt.py`
  - `tests/network/user_defined_network/ip_specification/test_ip_specification.py`
  - `tests/network/bgp/test_bgp_connectivity.py`
  - `tests/network/bgp/evpn/test_evpn_connectivity.py`

**Real tests (cluster required)**

Error path (the fix):  
`pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`  
Expected: when explicit `affinity=` is passed into `udn_vm`, it is applied as-is to the VM template, migration from an RHCOS 9 worker to an RHCOS 10 worker succeeds after `set_template_affinity(...)`, and the TCP connection remains established.

Happy path (regression):  
`pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration`  
Expected: existing callers that rely on the default `template_labels` anti-affinity path still schedule correctly and preserve the TCP connection during migration.
EOF

existing_id="$(
  gh api "repos/$repo/pulls/$pr/comments?per_page=100" --paginate \
    | jq -r --arg path "$first_file" '
        .[] | select(.user.login=="coderabbitai[bot]" and .path==$path) | .id
      ' \
    | tail -n1
)"

if [[ -n "${existing_id:-}" ]]; then
  gh api "repos/$repo/pulls/comments/$existing_id" \
    -X PATCH \
    --input "$body_file" >/dev/null
else
  gh api "repos/$repo/pulls/$pr/comments" \
    -X POST \
    -f commit_id="$head_sha" \
    -f path="$first_file" \
    -F line="$comment_line" \
    -f side="$comment_side" \
    --input "$body_file" >/dev/null
fi

Length of output: 9261


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"

head_sha="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"
first_file="$(gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate | jq -r '.[0].filename')"
patch="$(gh api "repos/$repo/pulls/$pr/files?per_page=100" --paginate | jq -r --arg f "$first_file" '.[] | select(.filename==$f) | .patch // ""')"

meta_file="$(mktemp)"
PATCH_CONTENT="$patch" python - <<'PY' > "$meta_file"
import os, re, sys
patch = os.environ["PATCH_CONTENT"].splitlines()
old_line = new_line = None

for line in patch:
    if line.startswith('@@'):
        m = re.search(r'-(\d+)(?:,\d+)? \+(\d+)(?:,\d+)?', line)
        if not m:
            continue
        old_line = int(m.group(1))
        new_line = int(m.group(2))
        continue
    if old_line is None or new_line is None:
        continue
    if line.startswith('+') and not line.startswith('+++'):
        print("RIGHT")
        print(new_line)
        sys.exit(0)
    if line.startswith('-') and not line.startswith('---'):
        print("LEFT")
        print(old_line)
        sys.exit(0)
    old_line += 1
    new_line += 1

sys.exit("Unable to determine first changed line/side from patch")
PY

comment_side="$(sed -n '1p' "$meta_file")"
comment_line="$(sed -n '2p' "$meta_file")"

body="$(cat <<'EOF'
**Test Execution Plan**

- **Run smoke tests: False** — no verified smoke-marked test or parent `conftest.py` dependency path reaches `tests/network/libs/vm_factory.py::udn_vm`.
- **Run gating tests: True** — `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` `(gating)` → `client` / `server` fixtures → `vma_udn` / `vmb_udn` fixtures in `tests/network/user_defined_network/conftest.py` → `tests/network/libs/vm_factory.py::udn_vm` (the existing `template_labels` path that this refactor preserves).

- **Affected tests to run**
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos9`
  - `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` `(gating)`
  - `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_server_live_migration`
  - `tests/network/user_defined_network/test_user_defined_network_passt.py`
  - `tests/network/user_defined_network/ip_specification/test_ip_specification.py`
  - `tests/network/bgp/test_bgp_connectivity.py`
  - `tests/network/bgp/evpn/test_evpn_connectivity.py`

**Real tests (cluster required)**

Error path (the fix):  
`pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`  
Expected: when explicit `affinity=` is passed into `udn_vm`, it is applied as-is to the VM template, migration from an RHCOS 9 worker to an RHCOS 10 worker succeeds after `set_template_affinity(...)`, and the TCP connection remains established.

Happy path (regression):  
`pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration`  
Expected: existing callers that rely on the default `template_labels` anti-affinity path still schedule correctly and preserve the TCP connection during migration.
EOF
)"

existing_id="$(
  gh api "repos/$repo/pulls/$pr/comments?per_page=100" --paginate \
    | jq -r --arg path "$first_file" '
        .[] | select(.user.login=="coderabbitai[bot]" and .path==$path) | .id
      ' \
    | tail -n1
)"

if [[ -n "${existing_id:-}" ]]; then
  gh api "repos/$repo/pulls/comments/$existing_id" \
    -X PATCH \
    -f body="$body"
else
  gh api "repos/$repo/pulls/$pr/comments" \
    -X POST \
    -f body="$body" \
    -f commit_id="$head_sha" \
    -f path="$first_file" \
    -F line="$comment_line" \
    -f side="$comment_side"
fi

Length of output: 4805


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="4786"

body="$(cat <<'EOF'
**Test Execution Plan**

- **Run smoke tests: False** — no verified smoke-marked test or parent `conftest.py` dependency path reaches `tests/network/libs/vm_factory.py::udn_vm`.
- **Run gating tests: True** — `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` `(gating)` → `client` / `server` fixtures → `vma_udn` / `vmb_udn` fixtures in `tests/network/user_defined_network/conftest.py` → `tests/network/libs/vm_factory.py::udn_vm` (the existing `template_labels` path that this refactor preserves).

- **Affected tests to run**
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`
  - `tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos9`
  - `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration` `(gating)`
  - `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_server_live_migration`
  - `tests/network/user_defined_network/test_user_defined_network_passt.py`
  - `tests/network/user_defined_network/ip_specification/test_ip_specification.py`
  - `tests/network/bgp/test_bgp_connectivity.py`
  - `tests/network/bgp/evpn/test_evpn_connectivity.py`

**Real tests (cluster required)**

Error path (the fix):  
`pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10`  
Expected: when explicit `affinity=` is passed into `udn_vm`, it is applied as-is to the VM template, migration from an RHCOS 9 worker to an RHCOS 10 worker succeeds after `set_template_affinity(...)`, and the TCP connection remains established.

Happy path (regression):  
`pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration`  
Expected: existing callers that rely on the default `template_labels` anti-affinity path still schedule correctly and preserve the TCP connection during migration.
EOF
)"

existing_id="$(
  gh api "repos/$repo/issues/$pr/comments?per_page=100" --paginate \
    | jq -r '
        .[] 
        | select(.user.login=="coderabbitai[bot]" and (.body | startswith("**Test Execution Plan**")))
        | .id
      ' \
    | tail -n1
)"

if [[ -n "${existing_id:-}" ]]; then
  gh api "repos/$repo/issues/comments/$existing_id" \
    -X PATCH \
    -f body="$body"
else
  gh api "repos/$repo/issues/$pr/comments" \
    -X POST \
    -f body="$body"
fi

Length of output: 3444


@openshift-virtualization-qe-bot-3

CRITICAL — I could not post the requested comment to #4786 because GitHub returned 403 Resource not accessible by integration for both:

  • inline review comments on Files Changed
  • fallback regular PR comments

That rule exists to ensure the plan is actually attached to the PR, but the current integration permissions prevent it.

Test Execution Plan

  • Run smoke tests: False — no verified smoke-marked test or parent conftest.py dependency path reaches tests/network/libs/vm_factory.py::udn_vm.
  • Run gating tests: Truetests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration (gating)client / server fixtures → vma_udn / vmb_udn fixtures in tests/network/user_defined_network/conftest.pytests/network/libs/vm_factory.py::udn_vm via the preserved template_labels path.

Affected tests to run

  • tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10
  • tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos9
  • tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration (gating)
  • tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_server_live_migration
  • tests/network/user_defined_network/test_user_defined_network_passt.py
  • tests/network/user_defined_network/ip_specification/test_ip_specification.py
  • tests/network/bgp/test_bgp_connectivity.py
  • tests/network/bgp/evpn/test_evpn_connectivity.py

Real tests (cluster required)

Error path (the fix):
pytest tests/network/user_defined_network/rhel9_rhel10_cluster/test_connectivity.py::TestConnectivity::test_connectivity_preserved_during_server_migration_to_rhcos10
Expected: when explicit affinity= is passed into udn_vm, it is applied as-is to the VM template, migration from an RHCOS 9 worker to an RHCOS 10 worker succeeds after set_template_affinity(...), and the TCP connection remains established.

Happy path (regression):
pytest tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn::test_connectivity_is_preserved_during_client_live_migration
Expected: existing callers that rely on the default template_labels anti-affinity path still schedule correctly and preserve the TCP connection during migration.

@rnetser rnetser left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-virtualization-qe-bot-5

Copy link
Copy Markdown

New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published

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.

10 participants