Skip to content

net, udn: Introduce passt migration test#2833

Merged
rnetser merged 3 commits intoRedHatQE:mainfrom
nirdothan:passt
Jan 8, 2026
Merged

net, udn: Introduce passt migration test#2833
rnetser merged 3 commits intoRedHatQE:mainfrom
nirdothan:passt

Conversation

@nirdothan
Copy link
Copy Markdown
Contributor

@nirdothan nirdothan commented Nov 24, 2025

Short description:

passt network binding has been reintroduced into openshift virtualization since release 4.20 as tech preview.
Introduce two seamless migration tests that are identical to the existing l2bridge binding seamless migration tests.

Summary by CodeRabbit

  • New Features

    • PASST binding support for user-defined networks and configurable VM network binding
    • New iperf3 traffic context manager with a standardized server port for client-server tests
  • Tests

    • Added PASST live-migration connectivity tests and fixtures to provision UDNs and paired VMs
  • Refactor

    • Reorganized network test utilities and imports; removed an older local traffic helper

✏️ Tip: You can customize this high-level summary in your review settings.

@nirdothan nirdothan marked this pull request as draft November 24, 2025 18:30
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 24, 2025

📝 Walkthrough

Walkthrough

Rename/add UDN binding constants; make udn_primary_network accept a binding and propagate it through udn_vm call sites. Centralize iperf port and client-server context manager into libs/net/traffic_generator, remove local duplicates, add UDN fixtures, and add PASST live-migration connectivity tests.

Changes

Cohort / File(s) Summary
UDN core
libs/net/udn.py
Rename UDN_BINDING_PLUGIN_NAMEUDN_BINDING_DEFAULT_PLUGIN_NAME, add UDN_BINDING_PASST_PLUGIN_NAME, and change udn_primary_network(name: str)udn_primary_network(name: str, binding: str) to construct Interface with the provided binding.
UDN VM factory
tests/network/libs/vm_factory.py
Add binding: str parameter to udn_vm(...) and pass it to udn_primary_network(...).
UDN tests & fixtures
tests/network/user_defined_network/conftest.py, tests/network/user_defined_network/test_user_defined_network.py, tests/network/user_defined_network/test_user_defined_network_passt.py
Add udn_namespace, namespaced_layer2_user_defined_network, udn_affinity_label fixtures; update udn_vm calls to pass binding=UDN_BINDING_DEFAULT_PLUGIN_NAME; add PASST enablement fixture, VM-pair fixture, helper, and two PASST live-migration connectivity tests.
BGP tests
tests/network/bgp/conftest.py
Import UDN_BINDING_DEFAULT_PLUGIN_NAME and pass binding to udn_vm in vm_cudn.
Traffic generator (centralized)
libs/net/traffic_generator.py
Add IPERF_SERVER_PORT = 5201 and new context manager client_server_active_connection(...) that starts an iperf server and VMTcpClient, yields (VMTcpClient, TcpServer), and manages cleanup.
LocalNet library refactor
tests/network/localnet/liblocalnet.py
Remove local _IPERF_SERVER_PORT and local client_server_active_connection(); use IPERF_SERVER_PORT and client_server_active_connection from libs.net.traffic_generator.
LocalNet tests updates
tests/network/localnet/conftest.py, tests/network/localnet/test_default_bridge.py, tests/network/localnet/test_ovs_bridge.py
Update imports to use client_server_active_connection (and IPERF_SERVER_PORT where applicable) from libs.net.traffic_generator; remove local port argument where applicable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

verified, lgtm-openshift-virtualization-qe-bot, commented-coderabbitai[bot]

Suggested reviewers

  • rnetser
  • EdDev
  • yossisegev
  • vsibirsk
  • servolkov
  • Anatw
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.35% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive Description is incomplete. It omits required template sections including 'More details', 'Special notes for reviewer', and 'jira-ticket', leaving several key areas blank. Complete the missing sections: provide more details on implementation approach, special testing considerations, reviewer notes on HCO fixture scope/concerns, and link to related Jira ticket(s).
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately describes the main addition: introducing PASST network binding migration tests. It's concise, specific, and clearly summarizes the primary change.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@nirdothan
Copy link
Copy Markdown
Contributor Author

wait_for_ready_vm_with_restart should be under a dedicated lib and I still think all fixtures should be in conftest.py, but it could be handled in a follow-up Also because you moved some helpers and fixtures which are used in other tests, it's better to verify nothing broke in udn and localnet tests

/verified uv run pytest --verbose -rs -s -o log_cli=true --junitxml=xunit_results.xml --pytest-log-file=pytest-tests.log --leftovers-collector --tb=native --skip-deprecated-api-test --cluster-sanity-skip-check --cluster-sanity-skip-storage-check tests/network/user_defined_network/test_user_defined_network.py
============================================== 6 passed, 1 deselected, 37 warnings in 410.94s (0:06:50) ==============================================

/verified uv run pytest --verbose -rs -s -o log_cli=true --junitxml=xunit_results.xml --pytest-log-file=pytest-tests.log --leftovers-collector --tb=native --skip-deprecated-api-test --cluster-sanity-skip-check --cluster-sanity-skip-storage-check -k "localnet"
===================================== 4 passed, 2579 deselected, 68 warnings, 2 quarantined in 771.08s (0:12:51) =====================================

Comment thread tests/network/user_defined_network/test_user_defined_network_passt.py Outdated
@nirdothan
Copy link
Copy Markdown
Contributor Author

/verified uv run pytest $(cat params) tests/network/user_defined_network/test_user_defined_network_passt.py
================================================================================================== 2 passed, 1 deselected, 38 warnings in 452.18s (0:07:32) ===================================================================================================

Copy link
Copy Markdown
Contributor

@EdDev EdDev left a comment

Choose a reason for hiding this comment

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

/approve

@rnetser
Copy link
Copy Markdown
Collaborator

rnetser commented Jan 6, 2026

/approve
/lgtm

@nirdothan
Copy link
Copy Markdown
Contributor Author

/verified
uv run pytest $(cat params) tests/network/user_defined_network/test_user_defined_network_passt.py
================================================================================================== 2 passed, 1 deselected, 38 warnings in 452.18s (0:07:32) ===================================================================================================

@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

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/net/traffic_generator.py
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 7, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Step 1: Check smoke test impact
echo "=== Finding all smoke tests ==="
rg "pytest.mark.smoke" --type=py -B2 | grep "def test_" | head -20

echo -e "\n=== Checking if smoke tests use modified functions ==="
echo "Checking udn_vm:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg -l "udn_vm" {} 2>/dev/null' | head -5

echo "Checking udn_primary_network:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg -l "udn_primary_network" {} 2>/dev/null' | head -5

echo "Checking client_server_active_connection:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg -l "client_server_active_connection" {} 2>/dev/null' | head -5

echo -e "\n=== Checking if smoke tests import from modified modules ==="
echo "From libs.net.udn:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg "from libs.net.udn import" {} 2>/dev/null' | head -5

echo "From tests.network.libs.vm_factory:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg "from tests.network.libs.vm_factory import" {} 2>/dev/null' | head -5

echo "From libs.net.traffic_generator:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg "from libs.net.traffic_generator import" {} 2>/dev/null' | head -5

echo -e "\n=== Get first changed file and commit SHA ==="
gh pr view 2833 --json files,headRefOid --jq '{first_file: .files[0].path, commit_sha: .headRefOid}'

Length of output: 476


🏁 Script executed:

#!/bin/bash

# Generate and post inline review comment with test execution plan
COMMIT_SHA=$(gh pr view 2833 --json headRefOid --jq '.headRefOid')
FIRST_FILE=$(gh pr view 2833 --json files --jq '.files[0].path')

echo "Commit SHA: $COMMIT_SHA"
echo "First file: $FIRST_FILE"

# Create test execution plan
cat > /tmp/test_plan.md << 'EOF'
## Test Execution Plan

**Run smoke tests: False**

### Primary Tests (New PASST Functionality)
- `tests/network/user_defined_network/test_user_defined_network_passt.py::test_passt_connectivity_is_preserved_during_client_live_migration`
- `tests/network/user_defined_network/test_user_defined_network_passt.py::test_passt_connectivity_is_preserved_during_server_live_migration`

### Secondary Tests (Backward Compatibility)
- `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn` - Verify existing UDN tests with modified `udn_vm()` and `udn_primary_network()`

### Tertiary Tests (Dependency Validation)
- `tests/network/bgp/test_bgp_connectivity.py::test_connectivity_cudn_vm_and_external_network` - Validate `udn_vm()` signature change
- `tests/network/localnet/test_default_bridge.py` - Validate moved `client_server_active_connection`
- `tests/network/localnet/test_ovs_bridge.py` - Validate moved `client_server_active_connection`

**Rationale:**
- New PASST tests exercise new binding path with backward-compatible parameters
- Modified functions have default parameters maintaining backward compatibility
- **Smoke test impact: None** - Verified no smoke tests use modified functions or import from modified modules

**Verification Status:** Author confirmed successful execution:
- PASST: "2 passed, 1 deselected"
- UDN: "6 passed, 1 deselected"
- Localnet: "4 passed"
- PR approved and has /lgtm
EOF

# Post inline review comment
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  "/repos/RedHatQE/openshift-virtualization-tests/pulls/2833/reviews" \
  -f body="" \
  -f event="COMMENT" \
  -f commit_id="$COMMIT_SHA" \
  -F comments[][path]="$FIRST_FILE" \
  -F comments[][line]=1 \
  -F comments[][side]="RIGHT" \
  -f "comments[][body]=@/tmp/test_plan.md"

echo "Exit code: $?"

Length of output: 1835



🧠 Learnings used
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 1904
File: tests/network/conftest.py:348-362
Timestamp: 2025-10-27T15:30:06.412Z
Learning: In tests/network/conftest.py, the _verify_nmstate_running_pods function currently runs unconditionally in network_sanity, but rnetser plans to implement marker-based conditional checking (following the pattern of _verify_dpdk, _verify_sriov, etc.) in a future PR after adding nmstate markers to the relevant tests.

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: 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: 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: 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: 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: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 1028
File: utilities/infra.py:1249-1254
Timestamp: 2025-08-06T13:57:51.928Z
Learning: User rnetser verified that all calls to get_infrastructure() function use the admin_client parameter, confirming that signature changes requiring this parameter don't cause breaking changes in the openshift-virtualization-tests codebase.

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: 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: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 2119
File: tests/network/localnet/conftest.py:352-366
Timestamp: 2025-10-31T13:05:24.570Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, tests run sequentially by default on the same cluster (with module-scoped fixtures properly cleaned up between modules), and parallel test runs use different machines/clusters. This means cluster-scoped resources (like ClusterUserDefinedNetwork or NodeNetworkConfigurationPolicy) can safely use the same names across different test modules without risk of collision.

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: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 3358
File: tests/network/sriov/test_sriov.py:21-21
Timestamp: 2026-01-07T09:52:12.342Z
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: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 3196
File: tests/network/upgrade/test_upgrade_network.py:4-4
Timestamp: 2025-12-22T16:27:44.327Z
Learning: For PRs that remove test cases (especially redundant test cleanup PRs in openshift-virtualization-tests), test collection verification (pytest --collect-only showing selected/deselected counts) is sufficient to confirm the removal was clean and the test module remains functional. Full test execution is not required for test deletion PRs.

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: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T20:32:10.833Z
Learning: Applies to **/test_*.py : All new tests MUST have markers — check pytest.ini for available markers, NEVER commit unmarked tests

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: 3228
File: .coderabbit.yaml:30-41
Timestamp: 2026-01-05T10:33:50.728Z
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: 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: 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: akri3i
Repo: RedHatQE/openshift-virtualization-tests PR: 1210
File: tests/virt/cluster/general/mass_machine_type_transition_tests/conftest.py:83-97
Timestamp: 2025-06-23T19:19:31.961Z
Learning: In OpenShift Virtualization mass machine type transition tests, the kubevirt_api_lifecycle_automation_job requires cluster-admin privileges to function properly, as confirmed by the test maintainer akri3i.

Learnt from: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-07T14:51:53.484Z
Learning: In the openshift-virtualization-tests repository, the team has decided to avoid using predefined time constants (like TIMEOUT_2MIN, TIMEOUT_5SEC) and prefers using explicit numeric values for timeout parameters.

Learnt from: vamsikrishna-siddu
Repo: RedHatQE/openshift-virtualization-tests PR: 2199
File: tests/storage/test_online_resize.py:108-113
Timestamp: 2025-09-28T14:43:07.181Z
Learning: In the openshift-virtualization-tests repo, PR #2199 depends on PR #2139 which adds architecture-specific OS_FLAVOR attributes to the Images.Cirros class (OS_FLAVOR_CIRROS for x86_64/ARM64, OS_FLAVOR_FEDORA for s390x), enabling conditional logic based on the underlying OS flavor in tests.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 1716
File: tests/virt/conftest.py:289-297
Timestamp: 2025-08-09T01:52:26.683Z
Learning: When user dshchedr moves working code from one location to another in the openshift-virtualization-tests repository, they prefer not to modify it unless there's a real issue, maintaining the original implementation to avoid introducing unnecessary changes.

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.

Currently, the udn VM factory only creates VMs
with l2bridge network bindings.
Add support for creation of UDN VMs with
passt network bindings, in preparation for
passt binding udn test.
Modify existing UDN vms to explicitly
use l2bridge, as there are now
2 supported binding plugins.

Signed-off-by: Nir Dothan <ndothan@redhat.com>
client_server_active_connection was placed
under localnet but it is generic to network
therefore move to network libs.

Signed-off-by: Nir Dothan <ndothan@redhat.com>
Introduce passt based seamless migration tests
similar to those that are currently testing
l2bridge binding.

Move common udn fixtures to conftest.py

wait_for_ready_vm_with_restart:

In order to be able to wait for external dependencies
to materialize without specifically checking them,
add a function that waits for READY condition.
If the condition is not met within the time period
restart the VM and wait again for the condition.
Restarting the VM is required in scenarios that
VM/VMI does not know how to wait for dependencies
and is stuck in either pending or failed state.

Assited by Cursor AI.

Signed-off-by: Nir Dothan <ndothan@redhat.com>
@nirdothan
Copy link
Copy Markdown
Contributor Author

/verified
uv run pytest $(cat params) tests/network/user_defined_network/test_user_defined_network_passt.py
================================================================================================== 2 passed, 1 deselected, 38 warnings in 418.76s (0:06:58) ===================================================================================================

@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

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/net/traffic_generator.py
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 7, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check smoke test impact
echo "=== Finding smoke tests ==="
rg "pytest.mark.smoke" --type=py -B2 | grep "def test_" | head -10

echo -e "\n=== Checking if smoke tests use modified functions ==="
echo "Checking udn_vm:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg -l "udn_vm" {} 2>/dev/null' | head -5

echo "Checking udn_primary_network:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg -l "udn_primary_network" {} 2>/dev/null' | head -5

echo "Checking client_server_active_connection:"
rg "pytest.mark.smoke" --type=py -l | xargs -I {} sh -c 'rg -l "client_server_active_connection" {} 2>/dev/null' | head -5

echo -e "\n=== Getting PR details ==="
gh pr view 2833 --json headRefOid,files --jq '{commit: .headRefOid, first_file: .files[0].path}'

Length of output: 299


🏁 Script executed:

#!/bin/bash

# Create and post inline review comment
COMMIT_SHA=$(gh pr view 2833 --json headRefOid --jq -r '.headRefOid')
FIRST_FILE=$(gh pr view 2833 --json files --jq -r '.files[0].path')

echo "Commit: $COMMIT_SHA"
echo "First file: $FIRST_FILE"

# Create test execution plan
cat > /tmp/test_plan.md << 'EOF'
## Test Execution Plan

**Run smoke tests: False**

### Primary Tests (New PASST Functionality)
- `tests/network/user_defined_network/test_user_defined_network_passt.py::test_passt_connectivity_is_preserved_during_client_live_migration`
- `tests/network/user_defined_network/test_user_defined_network_passt.py::test_passt_connectivity_is_preserved_during_server_live_migration`

### Secondary Tests (Backward Compatibility)
- `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn` - Verify existing UDN tests with modified `udn_vm()` and `udn_primary_network()`

### Tertiary Tests (Dependency Validation)
- `tests/network/bgp/test_bgp_connectivity.py::test_connectivity_cudn_vm_and_external_network` - Validate `udn_vm()` signature change
- `tests/network/localnet/test_default_bridge.py` - Validate moved `client_server_active_connection`
- `tests/network/localnet/test_ovs_bridge.py` - Validate moved `client_server_active_connection`

**Rationale:**
- New PASST tests exercise new binding path with backward-compatible parameters
- Modified functions have default parameters maintaining backward compatibility
- **Smoke test impact: None** - Verified no smoke tests use modified functions or import from modified modules

**Verification Status:**
- PASST: "2 passed, 1 deselected"
- UDN: "6 passed, 1 deselected"
- Localnet: "4 passed"
- PR approved with /lgtm
EOF

# Post inline review comment
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  "/repos/RedHatQE/openshift-virtualization-tests/pulls/2833/reviews" \
  -f body="" \
  -f event="COMMENT" \
  -f commit_id="$COMMIT_SHA" \
  -F comments[][path]="$FIRST_FILE" \
  -F comments[][line]=1 \
  -F comments[][side]="RIGHT" \
  -f "comments[][body]=@/tmp/test_plan.md"

echo "Posted inline review comment"

Length of output: 389


🏁 Script executed:

#!/bin/bash

# Get PR details properly
echo "=== Getting PR details ==="
gh pr view 2833 --json headRefOid,files > /tmp/pr_details.json
cat /tmp/pr_details.json

COMMIT_SHA=$(jq -r '.headRefOid' /tmp/pr_details.json)
FIRST_FILE=$(jq -r '.files[0].path' /tmp/pr_details.json)

echo ""
echo "Commit SHA: $COMMIT_SHA"
echo "First file: $FIRST_FILE"

# Create test execution plan
cat > /tmp/test_plan.md << 'EOF'
## Test Execution Plan

**Run smoke tests: False**

### Primary Tests (New PASST Functionality)
- `tests/network/user_defined_network/test_user_defined_network_passt.py::test_passt_connectivity_is_preserved_during_client_live_migration`
- `tests/network/user_defined_network/test_user_defined_network_passt.py::test_passt_connectivity_is_preserved_during_server_live_migration`

### Secondary Tests (Backward Compatibility)
- `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn` - Verify existing UDN tests with modified `udn_vm()` and `udn_primary_network()`

### Tertiary Tests (Dependency Validation)
- `tests/network/bgp/test_bgp_connectivity.py::test_connectivity_cudn_vm_and_external_network` - Validate `udn_vm()` signature change
- `tests/network/localnet/test_default_bridge.py` - Validate moved `client_server_active_connection`
- `tests/network/localnet/test_ovs_bridge.py` - Validate moved `client_server_active_connection`

**Rationale:**
- New PASST tests exercise new binding path with backward-compatible parameters
- Modified functions have default parameters maintaining backward compatibility
- **Smoke test impact: None** - Verified no smoke tests use modified functions or import from modified modules

**Verification Status:**
- PASST: "2 passed, 1 deselected"
- UDN: "6 passed, 1 deselected"
- Localnet: "4 passed"
- PR approved with /lgtm
EOF

# Post inline review comment using gh API
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  "/repos/RedHatQE/openshift-virtualization-tests/pulls/2833/reviews" \
  --field body="" \
  --field event="COMMENT" \
  --field commit_id="$COMMIT_SHA" \
  --raw-field 'comments[0][path]='"$FIRST_FILE" \
  --field 'comments[0][line]=1' \
  --field 'comments[0][side]=RIGHT' \
  --field 'comments[0][body]=@/tmp/test_plan.md'

echo ""
echo "API call completed"

Length of output: 4465


🏁 Script executed:

#!/bin/bash

COMMIT_SHA="5e74252c8f43d58bea2e4777863e91f775ecc144"
FIRST_FILE="libs/net/traffic_generator.py"

# Create JSON payload for review with inline comment
cat > /tmp/review_payload.json << 'EOJSON'
{
  "commit_id": "5e74252c8f43d58bea2e4777863e91f775ecc144",
  "body": "",
  "event": "COMMENT",
  "comments": [
    {
      "path": "libs/net/traffic_generator.py",
      "line": 1,
      "side": "RIGHT",
      "body": "## Test Execution Plan\n\n**Run smoke tests: False**\n\n### Primary Tests (New PASST Functionality)\n- `tests/network/user_defined_network/test_user_defined_network_passt.py::test_passt_connectivity_is_preserved_during_client_live_migration`\n- `tests/network/user_defined_network/test_user_defined_network_passt.py::test_passt_connectivity_is_preserved_during_server_live_migration`\n\n### Secondary Tests (Backward Compatibility)\n- `tests/network/user_defined_network/test_user_defined_network.py::TestPrimaryUdn` - Verify existing UDN tests with modified `udn_vm()` and `udn_primary_network()`\n\n### Tertiary Tests (Dependency Validation)\n- `tests/network/bgp/test_bgp_connectivity.py::test_connectivity_cudn_vm_and_external_network` - Validate `udn_vm()` signature change\n- `tests/network/localnet/test_default_bridge.py` - Validate moved `client_server_active_connection`\n- `tests/network/localnet/test_ovs_bridge.py` - Validate moved `client_server_active_connection`\n\n**Rationale:**\n- New PASST tests exercise new binding path with backward-compatible parameters\n- Modified functions have default parameters maintaining backward compatibility\n- **Smoke test impact: None** - Verified no smoke tests use modified functions or import from modified modules\n\n**Verification Status:**\n- PASST: \"2 passed, 1 deselected\"\n- UDN: \"6 passed, 1 deselected\"\n- Localnet: \"4 passed\"\n- PR approved with /lgtm"
    }
  ]
}
EOJSON

# Post the review
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  "/repos/RedHatQE/openshift-virtualization-tests/pulls/2833/reviews" \
  --input /tmp/review_payload.json

echo "Review posted"

Length of output: 1741



🧠 Learnings used
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 1904
File: tests/network/conftest.py:348-362
Timestamp: 2025-10-27T15:30:06.412Z
Learning: In tests/network/conftest.py, the _verify_nmstate_running_pods function currently runs unconditionally in network_sanity, but rnetser plans to implement marker-based conditional checking (following the pattern of _verify_dpdk, _verify_sriov, etc.) in a future PR after adding nmstate markers to the relevant tests.

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: 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: 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: 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: 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: 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: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 1028
File: utilities/infra.py:1249-1254
Timestamp: 2025-08-06T13:57:51.928Z
Learning: User rnetser verified that all calls to get_infrastructure() function use the admin_client parameter, confirming that signature changes requiring this parameter don't cause breaking changes in the openshift-virtualization-tests codebase.

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: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 2119
File: tests/network/localnet/conftest.py:352-366
Timestamp: 2025-10-31T13:05:24.570Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, tests run sequentially by default on the same cluster (with module-scoped fixtures properly cleaned up between modules), and parallel test runs use different machines/clusters. This means cluster-scoped resources (like ClusterUserDefinedNetwork or NodeNetworkConfigurationPolicy) can safely use the same names across different test modules without risk of collision.

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: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 3358
File: tests/network/sriov/test_sriov.py:21-21
Timestamp: 2026-01-07T09:52:12.342Z
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: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 3196
File: tests/network/upgrade/test_upgrade_network.py:4-4
Timestamp: 2025-12-22T16:27:44.327Z
Learning: For PRs that remove test cases (especially redundant test cleanup PRs in openshift-virtualization-tests), test collection verification (pytest --collect-only showing selected/deselected counts) is sufficient to confirm the removal was clean and the test module remains functional. Full test execution is not required for test deletion PRs.

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: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T20:32:10.833Z
Learning: Applies to **/test_*.py : All new tests MUST have markers — check pytest.ini for available markers, NEVER commit unmarked tests

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: 3228
File: .coderabbit.yaml:30-41
Timestamp: 2026-01-05T10:33:50.728Z
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: 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: 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: akri3i
Repo: RedHatQE/openshift-virtualization-tests PR: 1210
File: tests/virt/cluster/general/mass_machine_type_transition_tests/conftest.py:83-97
Timestamp: 2025-06-23T19:19:31.961Z
Learning: In OpenShift Virtualization mass machine type transition tests, the kubevirt_api_lifecycle_automation_job requires cluster-admin privileges to function properly, as confirmed by the test maintainer akri3i.

Learnt from: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-07T14:51:53.484Z
Learning: In the openshift-virtualization-tests repository, the team has decided to avoid using predefined time constants (like TIMEOUT_2MIN, TIMEOUT_5SEC) and prefers using explicit numeric values for timeout parameters.

Learnt from: vamsikrishna-siddu
Repo: RedHatQE/openshift-virtualization-tests PR: 2199
File: tests/storage/test_online_resize.py:108-113
Timestamp: 2025-09-28T14:43:07.181Z
Learning: In the openshift-virtualization-tests repo, PR #2199 depends on PR #2139 which adds architecture-specific OS_FLAVOR attributes to the Images.Cirros class (OS_FLAVOR_CIRROS for x86_64/ARM64, OS_FLAVOR_FEDORA for s390x), enabling conditional logic based on the underlying OS flavor in tests.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 1716
File: tests/virt/conftest.py:289-297
Timestamp: 2025-08-09T01:52:26.683Z
Learning: When user dshchedr moves working code from one location to another in the openshift-virtualization-tests repository, they prefer not to modify it unless there's a real issue, maintaining the original implementation to avoid introducing unnecessary changes.

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.

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: 5

🤖 Fix all issues with AI agents
In @libs/net/traffic_generator.py:
- Line 1: Replace uses of typing.Generator with collections.abc.Generator:
update import statements so any "from typing import Generator" becomes "from
collections.abc import Generator" and adjust type annotations in
functions/classes that reference Generator (e.g., any parameters or return types
annotated as Generator) to use the new import; ensure imports are de-duplicated
and run static type checks to confirm compatibility with Python 3.9+.
- Around line 194-229: The function client_server_active_connection currently
annotates its return as Generator[tuple[VMTcpClient, TcpServer], None, None];
replace this with the simpler Iterator[tuple[VMTcpClient, TcpServer]] (and add
the import from typing if missing) so the annotation only expresses that the
context yields a sequence of client/server tuples without the unnecessary
explicit send/return None parameters.

In @tests/network/user_defined_network/conftest.py:
- Around line 9-15: Add a Google-style docstring to the pytest fixture
udn_namespace in conftest.py that describes what the fixture provides (a test
namespace created via create_ns), its scope (module), the side effects (creates
and yields a Kubernetes Namespace resource and any teardown behavior performed
by create_ns), and the return value (what is yielded). Place the docstring
immediately above the udn_namespace function definition and follow Google
docstring sections like Args, Yields, and Side effects so readers understand the
setup/teardown and what callers receive.
- Around line 18-32: Add a concise docstring to the
namespaced_layer2_user_defined_network fixture describing its purpose and side
effects: state that it creates a Layer2UserDefinedNetwork named "layer2-udn" in
udn_namespace with role "Primary", a /24 subnet, Persistent IPAM, uses
admin_client, waits for the "NetworkAllocationSucceeded" condition to be TRUE
via udn.wait_for_condition, and yields the udn for tests; place the docstring
immediately above the fixture definition so future readers know what the fixture
configures and what tests can expect.
- Around line 35-37: The fixture udn_affinity_label lacks a docstring and should
use the yield pattern for consistency; update the pytest fixture function
udn_affinity_label to include a one-line docstring describing its purpose (e.g.,
"Provide a UDN affinity label for tests") and change the implementation to yield
the affinity.new_label(key_prefix="udn") instead of returning it (no teardown
required), keeping the fixture scope="module".

Comment thread libs/net/traffic_generator.py
Comment thread libs/net/traffic_generator.py
Comment thread tests/network/user_defined_network/conftest.py
Comment thread tests/network/user_defined_network/conftest.py
Comment thread tests/network/user_defined_network/conftest.py
@rnetser
Copy link
Copy Markdown
Collaborator

rnetser commented Jan 7, 2026

/approve
/lgtm

@rnetser
Copy link
Copy Markdown
Collaborator

rnetser commented Jan 7, 2026

@nirdothan please address and resolve the comments

Copy link
Copy Markdown
Contributor

@EdDev EdDev left a comment

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-4
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.