Skip to content

net, evpn: add source provider migration test#4817

Open
servolkov wants to merge 3 commits into
RedHatQE:mainfrom
servolkov:net/evpn-source-provider-migration
Open

net, evpn: add source provider migration test#4817
servolkov wants to merge 3 commits into
RedHatQE:mainfrom
servolkov:net/evpn-source-provider-migration

Conversation

@servolkov
Copy link
Copy Markdown
Contributor

@servolkov servolkov commented May 12, 2026

What this PR does / why we need it:

Add source provider migration test for EVPN.

  • Add VNI-aware teardown for L2 endpoints: clean up VLAN/VNI bridge mappings,
    allowing re-deployment with different parameters in the same test session.
  • Add macAddress field to Interface dataclass for explicit MAC assignment.
  • Add explicit MAC support to deploy_evpn_l2_endpoint.
  • Add test_source_provider_migration: emulates migration of an external L2
    workload into the cluster as a CUDN VM, preserving its IP and MAC addresses.
    The old endpoint is torn down, a VM takes over the original identity, then a
    new L2 endpoint is deployed with different IPs to verify connectivity.
Which issue(s) this PR fixes:
Special notes for reviewer:
  • test_source_provider_migration uses @pytest.mark.order("last") because it
    tears down the shared L2 endpoint, which would break other tests if run earlier.
  • IPv6 static IP fix: random_ipv6_address() generates addresses with a random 7th hextet,
    but OVN IPAM caps /64 allocation to 65536 addresses.
    Replaced with a low-offset hardcoded address. Only affects IPs requested via
    network.kubevirt.io/addresses; external netns endpoints are unaffected.
    The known bug: https://redhat.atlassian.net/browse/OCPBUGS-86810
  • The new L2 endpoint is created as a test step rather than a fixture. This is a
    known limitation — currently only one L2 endpoint can exist at a time. A follow-up
    will reorganise fixtures to separate VLAN lifecycle from endpoints, enabling
    independent concurrent endpoints.
jira-ticket: https://redhat.atlassian.net/browse/CNV-87077

Summary by CodeRabbit

  • New Features

    • VM interfaces can include an explicit MAC address; L2 endpoints accept and apply a provided MAC.
  • Tests

    • EVPN connectivity tests now perform a full source-provider migration end-to-end and run last.
    • IPv4/IPv6 endpoint addressing is deterministic for repeatable runs.
    • Tests inject endpoint MACs into VM templates and add a fixture to provision VMs attached to external L2 endpoints.
  • Bug Fixes

    • L2 endpoint teardown now fully cleans bridge/VNI state.

@openshift-virtualization-qe-bot-5
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
  • 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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3913e9ff-b1dc-48aa-8912-e20f422837b4

📥 Commits

Reviewing files that changed from the base of the PR and between 7483cce and b827d09.

📒 Files selected for processing (3)
  • tests/network/bgp/evpn/conftest.py
  • tests/network/bgp/evpn/libevpn.py
  • tests/network/bgp/evpn/test_evpn_connectivity.py

📝 Walkthrough

Walkthrough

Adds optional MAC fields to VM and EVPN models, threads MAC through L2 endpoint deploy/teardown and command generation, introduces a vm_source_provider fixture configuring a VM with the external endpoint MAC/IPs, and implements a last-ordered migration test that deploys an explicit-MAC L2 endpoint and validates EVPN connectivity.

Changes

MAC Address Configuration for EVPN L2 Endpoints

Layer / File(s) Summary
Data Models
libs/vm/spec.py, tests/network/bgp/evpn/libevpn.py
Interface dataclass adds optional macAddress: str | None = None; EvpnEndpoint dataclass adds optional mac_address: str | None = None.
L2 Endpoint Service
tests/network/bgp/evpn/libevpn.py
deploy_evpn_l2_endpoint() gains mac_address parameter and forwards it to the command builder; _build_l2_endpoint_commands() accepts mac_address and conditionally emits a netns veth MAC-setting command; teardown_evpn_l2_endpoint() signature is VNI-scoped and removes bridge/VNI-specific VLAN/tunnel mappings.
Test Infrastructure
tests/network/bgp/evpn/conftest.py
Imports updated for UDN and VM-spec helpers; EXTERNAL_L2_ENDPOINT_IPV6 now computed deterministically and EXTERNAL_L2_ENDPOINT_MAC constant added; external_l2_endpoint fixture deploys endpoint with explicit mac_address and tears down by vni; new vm_source_provider fixture builds and yields a Fedora VM attached to the UDN primary network with its interface MAC and annotated IP addresses set from the external L2 endpoint.
Test Implementation
tests/network/bgp/evpn/test_evpn_connectivity.py
Adds EVPN helper imports and deterministic endpoint IP constants; test_source_provider_migration() is fixture-parameterized, marked @pytest.mark.order("last"), tears down prior L2 endpoint by VNI, starts vm_source_provider, deploys a new explicit-MAC L2 endpoint, and asserts end-to-end EVPN connectivity for the target VM using the source-provider as reference.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels: new-tests

Suggested reviewers:

  • dshchedr
  • orelmisan
  • rnetser
  • vsibirsk
  • RoniKishner
  • nirdothan
  • EdDev
  • yossisegev
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely describes the main change: adding a source provider migration test for EVPN, well under 120 characters.
Description check ✅ Passed Description covers all required template sections: what the PR does (detailed), issues fixed (none listed), special notes (VNI teardown, IPv6 fix, fixture limitations), and Jira ticket provided.
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 Newly added test function test_source_provider_migration in test_evpn_connectivity.py is covered by module-level STP link at line 2 per check rule.

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

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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/bgp/evpn/test_evpn_connectivity.py`:
- Around line 26-31: The test imports assert_evpn_workloads_connectivity but it
does not exist in libevpn.py, causing ImportError; either add an implementation
named assert_evpn_workloads_connectivity in tests.network.bgp.evpn.libevpn that
performs the expected connectivity assertions (mirror behavior of
evpn_workloads_active_connections and any teardown hooks used by the test) or
remove the import and calls to assert_evpn_workloads_connectivity in the test;
implement the function with the same signature the test expects and ensure it
calls/uses evpn_workloads_active_connections, deploy_evpn_l2_endpoint, and
teardown_evpn_l2_endpoint as needed to assert connectivity.
🪄 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: 5fa7a612-5442-43f4-b25f-3443a5bcc428

📥 Commits

Reviewing files that changed from the base of the PR and between 7c8f779 and ef4048b.

📒 Files selected for processing (4)
  • libs/vm/spec.py
  • tests/network/bgp/evpn/conftest.py
  • tests/network/bgp/evpn/libevpn.py
  • tests/network/bgp/evpn/test_evpn_connectivity.py

Comment thread tests/network/bgp/evpn/test_evpn_connectivity.py
@servolkov
Copy link
Copy Markdown
Contributor Author

/wip

@openshift-virtualization-qe-bot-5 openshift-virtualization-qe-bot-5 changed the title net, evpn: add source provider migration test WIP: net, evpn: add source provider migration test May 12, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 12, 2026
Copy link
Copy Markdown
Contributor

@Anatw Anatw left a comment

Choose a reason for hiding this comment

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

Thank you, Sergei.

@servolkov
Copy link
Copy Markdown
Contributor Author

/check-can-merge

@servolkov
Copy link
Copy Markdown
Contributor Author

/retest tox

@servolkov
Copy link
Copy Markdown
Contributor Author

/retest pre-commit.ci

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

No pre-commit.ci configured for this repository

servolkov added 2 commits May 28, 2026 17:10
Clean up VLAN/VNI bridge mappings when removing L2 endpoints,
allowing re-deployment with different parameters in the same session.

Signed-off-by: Sergei Volkov <sevolkov@redhat.com>
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
Emulates migration of an external L2 workload into the cluster
as a CUDN VM, preserving its IP and MAC addresses. The old endpoint
is torn down and re-created with new IPs while the VM takes over
the original identity.

test_source_provider_migration uses @pytest.mark.order("last")
because it tears down the shared L2 endpoint, which would break
other tests if run earlier.

Signed-off-by: Sergei Volkov <sevolkov@redhat.com>
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>

Signed-off-by: Sergei Volkov <sevolkov@redhat.com>
@servolkov
Copy link
Copy Markdown
Contributor Author

Rebase to get proper labels

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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/bgp/evpn/conftest.py`:
- Line 292: The code replaces spec.template.spec.domain.devices with a new
Devices(...) which discards defaults from base_vmspec() (e.g., boot disks);
instead preserve existing Devices and only update its interfaces: fetch
spec.template.spec.domain.devices (create a Devices if None) and set/replace its
interfaces list with [iface] or append iface as needed so other fields (disks,
boot order) from base_vmspec() remain intact; adjust the assignment around
Devices/iface usage in this block to mutate devices.interfaces rather than
overwrite spec.template.spec.domain.devices.
🪄 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: 74b0a5da-cfa6-4f3c-b9ca-d66cb0ef1a0f

📥 Commits

Reviewing files that changed from the base of the PR and between 85cd69a and 7483cce.

📒 Files selected for processing (4)
  • libs/vm/spec.py
  • tests/network/bgp/evpn/conftest.py
  • tests/network/bgp/evpn/libevpn.py
  • tests/network/bgp/evpn/test_evpn_connectivity.py

Comment thread tests/network/bgp/evpn/conftest.py
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 28, 2026
@servolkov
Copy link
Copy Markdown
Contributor Author

/verified

this

@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 Test Execution Plan with the smoke tests recommendation.
Do NOT submit a formal review - just post the inline comment directly.

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, and fixture inheritance
  5. Detect new tests introduced in the PR
  6. Smoke Test Impact Analysis: Determine if any changes could affect smoke tests by checking:
    • Changes to files/functions used by tests marked with @pytest.mark.smoke
    • Changes to fixtures or utilities imported by smoke tests
    • Changes to conftest.py files that may affect smoke test execution
    • Changes to core infrastructure code (utilities/, libs/) that smoke tests depend on

Your deliverable:
Your change request comment will be based on the following requirements:

Test Execution Plan

  • Run smoke tests: True / False (Based on your smoke test impact analysis - True if any changes may affect smoke tests)
  • 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 specific marker(s) can be used to cover multiple cases.

Guidelines:

  • Include only tests directly affected by the changes
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name if only specific tests are needed
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal

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 an inline review 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 submitting the review fails 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: Before setting "Run smoke tests: True", you MUST use shell scripts to:
- Trace the actual fixture dependency chain from smoke tests to changed fixtures
- Verify that smoke tests actually import/use changed utilities or functions
- Confirm the dependency path exists; do NOT assume based on scope or semantics
- Be conservative: Session-scoped fixtures or infrastructure-sounding names do NOT
automatically mean smoke test impact. Only flag smoke test impact when you can
demonstrate a concrete dependency path.
WRONG: "This session-scoped storage fixture might affect smoke tests"
RIGHT: "Smoke test X uses fixture Y, which depends on the changed fixture Z"

Comment thread libs/vm/spec.py
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get current PR head SHA and first changed line of first file
echo "=== PR head SHA ==="
gh api "repos/RedHatQE/openshift-virtualization-tests/pulls/4817" --jq '.head.sha'

echo "=== PR files with patches ==="
gh api "repos/RedHatQE/openshift-virtualization-tests/pulls/4817/files" --jq '.[] | {filename: .filename, patch: .patch}' 2>/dev/null | head -60

echo "=== Verify smoke tests have no dependency on Interface or EVPN fixtures ==="
rg -n "pytest.mark.smoke" --type py -l | head -20

Length of output: 11533


🏁 Script executed:

#!/bin/bash
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  "repos/RedHatQE/openshift-virtualization-tests/pulls/4817/reviews" \
  --input - <<'EOF'
{
  "commit_id": "7483cce650b641153136cede383b9bb8229801c0",
  "event": "COMMENT",
  "comments": [
    {
      "path": "libs/vm/spec.py",
      "line": 80,
      "side": "RIGHT",
      "body": "## Test Execution Plan\n\n**Run smoke tests: False**\n> Smoke test files (tests/virt/, tests/storage/, tests/infrastructure/, tests/install_upgrade_operators/) have no confirmed import or fixture dependency path to the changed `Interface` dataclass or any EVPN fixture/utility.\n\n### Tests to run\n\n- `tests/network/bgp/evpn/test_evpn_connectivity.py` — Run the full EVPN connectivity suite. `conftest.py` changes affect `external_l2_endpoint` teardown (now passes `vni=EVPN_MAC_VRF_VNI`) and add the new `vm_source_provider` fixture (module-scoped impact). `libevpn.py` signature changes to `teardown_evpn_l2_endpoint` (new required `vni` parameter) and `deploy_evpn_l2_endpoint` (new `mac_address` parameter) affect all tests using L2 endpoints.\n- `tests/network/bgp/evpn/test_evpn_connectivity.py::test_source_provider_migration` — New test introduced in this PR; validates full source-provider migration flow: L2 endpoint teardown → VM identity takeover (IP+MAC preserved) → new L2 endpoint deployment → end-to-end connectivity assertion."
    }
  ]
}
EOF

Length of output: 3217



@openshift-virtualization-qe-bot-3
Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #5041.

Overlapping files

tests/network/bgp/evpn/test_evpn_connectivity.py

@openshift-virtualization-qe-bot-3
Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #4954.

Overlapping files

tests/network/bgp/evpn/libevpn.py

@openshift-virtualization-qe-bot-3
Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #5014.

Overlapping files

libs/vm/spec.py

Comment thread tests/network/bgp/evpn/libevpn.py Outdated
Comment thread tests/network/bgp/evpn/test_evpn_connectivity.py Outdated
Comment thread tests/network/bgp/evpn/test_evpn_connectivity.py
Emulates migration of an external L2 workload into the cluster
as a CUDN VM, preserving its IP and MAC addresses. The old endpoint
is torn down and re-created with new IPs while the VM takes over
the original identity.

test_source_provider_migration uses @pytest.mark.order("last")
because it tears down the shared L2 endpoint, which would break
other tests if run earlier.

Signed-off-by: Sergei Volkov <sevolkov@redhat.com>
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
@servolkov
Copy link
Copy Markdown
Contributor Author

Change:

  1. const for EVPN CUDN NET SEED to reuse in L2 enpoints
  2. mac cmd inline

@servolkov
Copy link
Copy Markdown
Contributor Author

/verified

this

@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 formal review - just post the inline comment directly.

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 change request 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)
  • 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)

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 an inline review 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 submitting the review fails 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"

Comment thread libs/vm/spec.py
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get current PR head SHA
echo "=== PR head SHA ==="
gh api "repos/RedHatQE/openshift-virtualization-tests/pulls/4817" --jq '.head.sha'

echo "=== PR files with patches ==="
gh api "repos/RedHatQE/openshift-virtualization-tests/pulls/4817/files" --jq '.[] | {filename: .filename, patch: .patch}'

echo "=== Check callers of Interface from libs/vm/spec.py in tests/ ==="
rg -n "from libs.vm.spec import|from libs\.vm\.spec" --type py -l | head -30

echo "=== Check gating tests ==="
rg -l "`@pytest.mark.gating`" --type py | head -30

echo "=== Check smoke tests ==="
rg -l "`@pytest.mark.smoke`" --type py | head -30

echo "=== Check if any gating test imports Interface from libs/vm/spec ==="
rg -n "from libs.vm.spec import" --type py -l | xargs -I{} grep -l "gating" {} 2>/dev/null | head -10

echo "=== Check if EVPN tests have gating mark ==="
rg -n "pytest.mark.gating" tests/network/bgp/evpn/ --type py | head -10

Length of output: 14969


🏁 Script executed:

#!/bin/bash
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  "repos/RedHatQE/openshift-virtualization-tests/pulls/4817/reviews" \
  --input - <<'EOF'
{
  "commit_id": "b827d09f389303c6c3fed89351556d674225fe66",
  "event": "COMMENT",
  "comments": [
    {
      "path": "libs/vm/spec.py",
      "line": 80,
      "side": "RIGHT",
      "body": "## Test Execution Plan\n\n**Run smoke tests: False**\n> Verified: none of the smoke-marked files (`tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py`, `tests/virt/node/general/test_container_disk_vm.py`, `tests/storage/cdi_upload/test_upload_virtctl.py`, `tests/storage/cdi_clone/test_clone.py`, `tests/install_upgrade_operators/csv/test_csv.py`, `tests/infrastructure/instance_types/supported_os/test_rhel_os.py`) import `Interface` from `libs/vm/spec.py` or any EVPN fixture/utility.\n\n**Run gating tests: False**\n> Verified: no gating-marked test imports `Interface` from `libs/vm/spec.py`; EVPN test module has no `@pytest.mark.gating` marks.\n\n### Affected tests to run\n\n- `tests/network/bgp/evpn/test_evpn_connectivity.py` — Run the full EVPN connectivity suite. `conftest.py` changes update `external_l2_endpoint` fixture teardown (now passes `vni=EVPN_MAC_VRF_VNI` to `teardown_evpn_l2_endpoint`) and add the new module-scoped `vm_source_provider` fixture. `libevpn.py` signature changes: `teardown_evpn_l2_endpoint` gains a required `vni` parameter; `deploy_evpn_l2_endpoint` gains optional `mac_address` — both affect all tests using L2 endpoints.\n- `tests/network/bgp/evpn/test_evpn_connectivity.py::test_source_provider_migration` — New test introduced in this PR; validates full source-provider migration flow: L2 endpoint teardown → VM identity takeover (IP+MAC preserved) → new L2 endpoint deployment → end-to-end connectivity assertion."
    }
  ]
}
EOF

Length of output: 3645




🧠 Learnings used
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-16T10:28:54.212Z
Learning: In the openshift-virtualization-tests repository, when determining smoke test impact for test execution plans, only set "Run smoke tests: True" if there is a verified, traceable dependency path from smoke tests to the changed code. Session-scoped fixtures or infrastructure-sounding changes do NOT automatically imply smoke test impact - the dependency chain must be explicitly verified using shell scripts before recommending smoke test execution.

Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-04-30T13:42:43.892Z
Learning: In the openshift-virtualization-tests repository, when processing test execution plan requests for PRs that introduce NEW test classes or test files (not just modifications to existing tests), always verify STD-first workflow compliance as part of the analysis: (1) check if the new test class has actual implementation code (assertions, test logic) — if so, it needs a prior STD PR, (2) check if the test file has a module docstring with STP or Jira/RFE link, (3) check if `What this PR does / why we need it:` in the PR description has meaningful content. Flag any violation even when the bot's primary request is only for a test execution plan. These checks should be appended to the test execution plan inline comment.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3062
File: conftest.py:333-333
Timestamp: 2025-12-16T20:11:03.645Z
Learning: In the openshift-virtualization-tests repository, when determining smoke test impact for changes affecting py_config["os_login_param"], follow this verification methodology: (1) Find all smoke tests: `rg "pytest.mark.smoke" --type=py -B2 | grep "def test_"`, (2) For each smoke test file, search for VM creation patterns: `rg "VirtualMachineForTests|running_vm|VirtualMachineForTestsFromTemplate|wait_for_ssh|check_ssh_connectivity"`, (3) Trace the dependency chain: smoke test → VirtualMachineForTests/running_vm() → wait_for_ssh_connectivity() (default enabled) → vm.login_params property → py_config["os_login_param"][vm.os_flavor], (4) Check utilities/virt.py for login_params usage: `rg "os_login_param|login_params" utilities/virt.py -C3`. Any smoke test creating VMs with default SSH connectivity checks (running_vm with check_ssh_connectivity=True) depends on os_login_param, even if the test doesn't directly reference it.

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 5039
File: tests/network/l2_bridge/nad_ref_change/lib_helpers.py:1-1
Timestamp: 2026-06-02T21:17:09.602Z
Learning: In RedHatQE/openshift-virtualization-tests, when a PR only relocates functions to shared libraries and updates import paths in test files (no logic change), do NOT flag the callers as requiring full test re-execution. At most, run `pytest --collect-only` to verify the new import paths resolve correctly. Only require full re-execution of caller tests when the moved function's implementation changes behavior.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4954
File: .flake8:4-4
Timestamp: 2026-06-01T14:00:52.523Z
Learning: In RedHatQE/openshift-virtualization-tests, the smoke-marked test files (tests/storage/cdi_clone/test_clone.py, tests/storage/cdi_upload/test_upload_virtctl.py, tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py, tests/virt/node/general/test_container_disk_vm.py) have traceable dependency paths to utilities/storage.py, utilities/hco.py (wait_for_hco_conditions), utilities/infra.py, and utilities/virt.py via direct imports and via tests/storage/conftest.py. Do not conclude "no smoke dependency path" without verifying these transitive imports.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-05-29T11:02:22.804Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, version-bump PRs that update the main branch to reference a new CNV release (e.g., "Update project `main` to reference cnv 5.0") do NOT add new test files or test modules. These PRs only update metadata (pyproject.toml, tox.ini, .coderabbit.yaml) and clean up resolved Jira fixtures/markers in existing files. The "Stp Link Required" pre-merge check may incorrectly flag hundreds of "newly added" test files as a false positive due to the base-branch comparison shifting after branching — this should be ignored for such PRs.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3062
File: conftest.py:333-333
Timestamp: 2025-12-16T15:09:49.597Z
Learning: In the openshift-virtualization-tests repository, when conftest.py or utilities/bitwarden.py changes affect py_config["os_login_param"], smoke test impact must be determined by: (1) finding all smoke tests using `rg "pytest.mark.smoke"`, (2) checking each for VM creation patterns (VirtualMachineForTests, running_vm, VirtualMachineForTestsFromTemplate), (3) tracing whether running_vm is called with default check_ssh_connectivity=True, which accesses vm.login_params property that reads py_config["os_login_param"][vm.os_flavor]. The dependency chain is: smoke test → VM creation → running_vm → wait_for_ssh_connectivity → vm.login_params → os_login_param. Any smoke test creating VMs with SSH connectivity (the default) depends on os_login_param.

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 4772
File: tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py:31-37
Timestamp: 2026-05-08T06:44:12.879Z
Learning: In tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py and tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py (dual-stream RHCOS 9/10 migration tests), the incremental/state-coupled test design is intentional and agreed upon in the STD (https://github.com/RedHatQE/openshift-virtualization-tests-design-docs/blob/main/stps/sig-virt/dual-stream-cluster-rhcos9-rhcos10/network.md). Tests are ordered (RHCOS 9 → RHCOS 10 → RHCOS 9) using pytest.mark.incremental, and test_*_to_rhcos9 intentionally relies on the VM already being on RHCOS 10 from the previous test. Do not flag this as a state-coupling issue or suggest making these tests independently runnable.

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 4962
File: tests/network/l2_bridge/nad_ref_change/test_nad_ref_change.py:89-95
Timestamp: 2026-05-21T13:52:58.266Z
Learning: In the `tests/network/l2_bridge/nad_ref_change/test_nad_ref_change.py` `TestRunningVMLinuxBridgeVlanChange` class (marked `pytest.mark.incremental`), the test `test_vm_state_iface_info_preserved` is intentionally scoped only to verifying VM interface metadata invariance (MAC, name, IPs) after a NAD reference live-update. It does NOT assert that the NAD reference field itself changed in the VM spec, because functional correctness of the NAD switch (i.e., that traffic actually moved to the new VLAN) is validated by the subsequent `test_connectivity` / `test_two_networks` tests. Do not flag missing spec-level assertions inside `test_vm_state_iface_info_preserved`.

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 4962
File: tests/network/l2_bridge/nad_ref_change/test_nad_ref_change.py:86-95
Timestamp: 2026-05-27T09:21:14.771Z
Learning: In RedHatQE/openshift-virtualization-tests, when testing NAD live-update behavior in tests/network/l2_bridge/nad_ref_change/, asserting full equality on `lookup_iface_status` results before and after `update_nad_references` is intentional. The test intent is that NO interface field (MAC, name, IPs, or any other) should change as a result of the live NAD reference swap. Do not suggest narrowing the assertion to a subset of fields; full equality is the desired behavior and will correctly fail if the live update causes any unexpected interface metadata change.

Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-22T15:56:00.157Z
Learning: In the openshift-virtualization-tests repository, when responding to test execution plan requests from openshift-virtualization-qe-bot-3, do NOT use "REQUEST_CHANGES" review type if the PR author has already marked the PR as verified (e.g., with `/verified` command). Test execution plans are informational guides, not blocking requirements. Use COMMENT event for informational test plans, or only REQUEST_CHANGES if there are actual code issues that need to be addressed before merging.

Learnt from: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-18T15:22:26.757Z
Learning: Applies to tests/**/test_*.py : New feature tests must follow the STD-first workflow: (1) STP (Software Test Plan) reviewed and approved, (2) STD (Software Test Description) placeholder tests with docstrings and `__test__ = False` reviewed, (3) Implementation only after STD review. Never submit test implementation without prior STD review.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-16T14:00:59.076Z
Learning: In the openshift-virtualization-tests repository, when responding to test execution plan requests from openshift-virtualization-qe-bot-3, CodeRabbit must post ONLY an inline review comment on the Files Changed tab and then stop immediately without generating any follow-up comments in the PR discussion thread. No acknowledgment messages, no confirmation of posting, no explanation - silence after posting the inline review equals success. Additional comments create empty/meaningless reviews that clutter the PR.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4328
File: tests/network/flat_overlay/test_multi_network_policy.py:32-32
Timestamp: 2026-04-14T16:15:36.741Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, when reviewing any PR with "Quarantine" in the title or a `quarantine` label, always verify compliance with docs/QUARANTINE_GUIDELINES.md:
- Category 1 (Product Bug): must use `pytest.mark.jira("CNV-XXXXX", run=False)` — the `pytest_jira` plugin conditionally skips the test when the Jira issue is open. Do NOT suggest replacing this with `xfail`.
- Category 2 (Automation Issue): must use `pytest.mark.xfail(run=False, reason=...)` — pytest itself handles the skip.
Flag any quarantine PR that uses the wrong category marker, is missing a Jira ticket reference, or uses `run=False` in the wrong context. Raising these compliance questions is always appropriate for quarantine PRs, even if the final resolution confirms the marker is correct.

Learnt from: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 3358
File: tests/network/sriov/test_sriov.py:21-21
Timestamp: 2026-01-07T09:52:22.771Z
Learning: For PRs that only remove or modify pytest markers (like removing pytest.mark.post_upgrade) without changing test logic in openshift-virtualization-tests, collection verification using `pytest --collect-only` is sufficient. Full test execution is not required to verify marker-only changes.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-09-29T19:05:24.987Z
Learning: The test execution plan for PR `#1904` focuses on cluster-type conditional logic where nmstate functionality is bypassed on cloud clusters (Azure/AWS) but fully functional on bare-metal/PSI clusters, requiring different test strategies for each environment type.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-16T14:06:22.391Z
Learning: In the openshift-virtualization-tests repository, when posting test execution plan inline review comments using GitHub API, the full test execution plan content must go in the `comments[].body` field (which appears on Files Changed tab), NOT in the top-level `body` field (which appears in PR discussion thread). The top-level `body` field should be omitted or left empty to avoid posting redundant comments in the PR discussion thread.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4118
File: utilities/database.py:0-0
Timestamp: 2026-03-17T01:32:13.674Z
Learning: In RedHatQE/openshift-virtualization-tests, maintainer dshchedr prefers CodeRabbit to post targeted inline comments on the Files changed tab for each applicable location rather than aggregating multiple issues into a single discussion thread.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4118
File: utilities/database.py:0-0
Timestamp: 2026-03-17T01:32:13.674Z
Learning: In RedHatQE/openshift-virtualization-tests, maintainer dshchedr prefers CodeRabbit to post targeted inline comments on the Files Changed tab at each applicable location rather than aggregating multiple issues into a single PR discussion thread reply.

Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 1776
File: libs/net/node_network.py:25-31
Timestamp: 2025-08-20T23:43:28.117Z
Learning: In the RedHatQE/openshift-virtualization-tests project, servolkov's team always uses bare metal (BM) clusters with IPv4 setup in their testing environment, making defensive checks for IPv4 data presence potentially redundant in their networking code.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3371
File: scripts/tests_analyzer/compare_coderabbit_decisions.py:199-289
Timestamp: 2026-01-13T10:06:14.822Z
Learning: In the openshift-virtualization-tests repository, user rnetser prefers to keep pagination loops inline rather than extracting them into generic helper functions when the loops have different URL patterns and unique post-processing logic, as the inline approach improves readability and makes each endpoint's behavior more explicit.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3228
File: .coderabbit.yaml:30-41
Timestamp: 2026-01-05T10:33:55.037Z
Learning: In the openshift-virtualization-tests repository, user rnetser prefers minimal pre-merge checks in CodeRabbit configuration: only docstrings enforcement (80% threshold) is needed, not title or description checks.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 2469
File: utilities/sanity.py:139-142
Timestamp: 2025-11-08T07:36:57.616Z
Learning: In the openshift-virtualization-tests repository, user rnetser prefers to keep refactoring PRs (like PR `#2469`) strictly focused on moving/organizing code into more granular modules without adding new functionality, error handling, or behavioral changes. Such improvements should be handled in separate PRs.

Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 1160
File: tests/storage/storage_migration/test_mtc_storage_class_migration.py:165-176
Timestamp: 2025-06-17T07:45:37.776Z
Learning: In the openshift-virtualization-tests repository, user jpeimer prefers explicit fixture parameters over composite fixtures in test methods, even when there are many parameters, as they find this approach more readable and maintainable for understanding test dependencies.

Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 3571
File: tests/storage/storage_migration/utils.py:158-167
Timestamp: 2026-01-25T13:18:26.819Z
Learning: In the openshift-virtualization-tests repository, user jpeimer prefers to avoid nitpicky style changes (e.g., removing `.keys()` from dict membership checks) because verifying every change is expensive. Be cautious about suggesting low-impact stylistic improvements that require verification overhead.

Learnt from: akri3i
Repo: RedHatQE/openshift-virtualization-tests PR: 1210
File: tests/virt/cluster/general/mass_machine_type_transition_tests/conftest.py:24-64
Timestamp: 2025-06-23T19:28:20.281Z
Learning: In OpenShift Virtualization mass machine type transition tests, the machine type glob pattern "pc-q35-rhel8.*.*" is intentionally hard-coded in the kubevirt_api_lifecycle_automation_job as it's used only once for this specific test case, with plans to update it in the future if the job needs to support other machine types.

Learnt from: RoniKishner
Repo: RedHatQE/openshift-virtualization-tests PR: 1411
File: utilities/os_utils.py:246-279
Timestamp: 2025-07-22T17:13:59.166Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, CentOS preferences follow the format "centos-stream<version>" (e.g., "centos-stream9", "centos-stream10"). The generate_instance_type_centos_os_matrix function correctly uses regex to extract numeric versions and constructs the latest version string in the same format as the input preferences for proper comparison.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-09-29T19:05:24.987Z
Learning: For PR `#1904` test execution, the critical validation point is test_connectivity_over_migration_between_localnet_vms which should fail gracefully on cloud clusters but pass on bare-metal/PSI clusters, representing the core nmstate conditional logic functionality.

Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 4709
File: tests/network/bgp/evpn/conftest.py:220-226
Timestamp: 2026-05-05T07:58:54.345Z
Learning: In `tests/network/bgp/evpn/conftest.py`, the EVPN stretched L2 test suite (including the `external_l2_endpoint` fixture) is intentionally designed for dual-stack environments only. Both `EXTERNAL_L2_ENDPOINT_IPV4` and `EXTERNAL_L2_ENDPOINT_IPV6` are always passed to `deploy_evpn_l2_endpoint`. Do not flag the hardcoded dual-stack endpoint IPs as a single-stack compatibility issue. A future follow-up PR will introduce a general cluster IP-family detection helper to be used repo-wide, including here.

Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 4709
File: tests/network/bgp/evpn/conftest.py:220-226
Timestamp: 2026-05-05T08:24:05.950Z
Learning: In `tests/network/bgp/evpn/conftest.py` and `tests/network/bgp/evpn/libevpn.py`, passing both `EXTERNAL_L2_ENDPOINT_IPV4` and `EXTERNAL_L2_ENDPOINT_IPV6` to `deploy_evpn_l2_endpoint` does NOT fail on single-stack IPv4 clusters. Assigning IPv6 to a Linux netns interface is always a valid kernel operation. `evpn_workloads_active_connections` is driven by the VM's own IPs (not the endpoint IPs), so in a single-stack IPv4 cluster only an IPv4 TCP connection is attempted; the IPv6 endpoint address remains configured but unused. Do not flag the dual-stack endpoint IP list as a single-stack compatibility issue.

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 3598
File: tests/network/sriov/conftest.py:62-71
Timestamp: 2026-01-28T17:36:14.188Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, sanity checks validate that the cluster supports at least one IP family (IPv4 or IPv6) before SR-IOV tests run. Therefore, defensive guards checking for empty IP addresses in SR-IOV VM fixtures (like `sriov_vm` in tests/network/sriov/conftest.py) are not necessary—if neither `ipv4_supported_cluster` nor `ipv6_supported_cluster` is True, the cluster is considered broken and will fail sanity validation.

Learnt from: vsibirsk
Repo: RedHatQE/openshift-virtualization-tests PR: 2045
File: tests/virt/cluster/vm_lifecycle/conftest.py:46-47
Timestamp: 2025-09-15T06:49:53.478Z
Learning: In the openshift-virtualization-tests repo, large fixture refactoring efforts like the golden image data source migration are handled incrementally by directory/team ownership. The virt/cluster directory is handled separately from virt/node, tests/infra, tests/storage, etc., with each area managed by relevant teams in follow-up PRs.

@rnetser
Copy link
Copy Markdown
Collaborator

rnetser commented Jun 4, 2026

/approve
/lgtm

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.