Skip to content

[Main] Storage: Change Cirros images for RHEL from DataSource into upgrade tests#5003

Open
josemacassan wants to merge 4 commits into
RedHatQE:mainfrom
josemacassan:improve-datasource-upgrade-test-4.20-main
Open

[Main] Storage: Change Cirros images for RHEL from DataSource into upgrade tests#5003
josemacassan wants to merge 4 commits into
RedHatQE:mainfrom
josemacassan:improve-datasource-upgrade-test-4.20-main

Conversation

@josemacassan
Copy link
Copy Markdown
Contributor

@josemacassan josemacassan commented May 26, 2026

Short description:

Forwardport: #2917

More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:

Summary by CodeRabbit

  • Tests

    • Switched storage upgrade tests to use RHEL 10 VMs for upgrade scenarios.
    • Added shared constants to standardize expected filenames and contents.
    • Updated test flows to provision RHEL VMs, inject/verify upgrade files, and adjust restore/run sequencing.
  • Refactor

    • Replaced CirrOS-specific command helper with a generic SSH-based runner and added a disk-serial assertion helper.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Replace CirrOS-based snapshot-upgrade VMs with RHEL10 fixtures, add shared upgrade-file constants, change VM creation to accept data-source-backed volumes and inject files via SSH, update three snapshot/restore tests to use RHEL VMs and generic VM command helpers, and remove the CirrOS-specific helper.

Changes

Storage Upgrade Test Enhancements

Layer / File(s) Summary
Upgrade test constants
tests/storage/upgrade/constants.py
Adds UPGRADE_FIRST_FILE_NAME, UPGRADE_FIRST_FILE_CONTENT, UPGRADE_SECOND_FILE_NAME, UPGRADE_SECOND_FILE_CONTENT.
Utilities: import and helper changes
tests/storage/upgrade/utils.py, utilities/storage.py
Rework imports to use VirtualMachineForTests/running_vm, data_volume_template_with_source_ref_dict, and write_file_via_ssh; remove CirrOS console helper and add assert_disk_serial.
VM creation for snapshot upgrade tests
tests/storage/upgrade/utils.py
create_vm_for_snapshot_upgrade_tests now accepts data_source, provisions VMs via VirtualMachineForTests with a data-volume template from data_source, and writes the first upgrade file over SSH using constants.
Snapshot-time file injection
tests/storage/upgrade/utils.py
During snapshot creation, write the second upgrade file via write_file_via_ssh using the shared constants.
RHEL10 VM fixtures and snapshot fixtures
tests/storage/upgrade/conftest.py
Add rhel_vm_for_upgrade_a and rhel_vm_for_upgrade_b session fixtures and update snapshots_for_upgrade_a/b to use these RHEL VM fixtures (remove CirrOS fixtures).
Test module updates and rewrites
tests/storage/upgrade/test_upgrade_storage.py
Import shared constants and generic VM command helpers; rewrite test_vm_snapshot_restore_before_upgrade, test_vm_snapshot_restore_check_after_upgrade, and test_vm_snapshot_restore_create_after_upgrade to use RHEL VM fixtures, ensure running state, wait for restore completion, and assert first-file present/second-file absent via SSH helper.
Remove CirrOS-specific helper / add disk serial assert
utilities/storage.py
Remove run_command_on_cirros_vm_and_check_output; add assert_disk_serial using SSH and run_ssh_commands.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

new-tests

Suggested reviewers

  • jpeimer
  • kgoldbla
  • geetikakay
  • dshchedr
  • rlobillo
  • dalia-frank
  • RoniKishner
  • hmeir

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (2 errors)

Check name Status Explanation Resolution
Description check ❌ Error The description is largely incomplete. While it includes a forwardport reference, critical sections like 'What this PR does / why we need it', 'Which issue(s) this PR fixes', 'Special notes for reviewer', and 'jira-ticket' are empty placeholders with no substantive content. Complete the required template sections: explain the rationale and impact of switching from CirrOS to RHEL VMs, reference any related issues, add reviewer notes, and provide the JIRA ticket URL or mark as NONE.
Stp Link Required ❌ Error Newly added test file test_upgrade_storage.py lacks STP/RFE/Jira link in docstring. Only @pytest.mark.polarion decorators present, which don't satisfy the requirement. Add module-level, class-level, or test function docstring with STP:/RFE:/Jira: followed by URL to satisfy the STP link requirement.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: replacing CirrOS images with RHEL VMs using DataSource in upgrade tests. It is specific, under 120 chars (80 chars), and directly maps to the changeset modifications.
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.
✨ 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.

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

Report bugs in Issues

Welcome! 🎉

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

🔄 Automatic Actions

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

📋 Available Commands

PR Status Management

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

Review & Approval

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

Testing & Validation

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

Container Operations

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

Cherry-pick Operations

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

Label Management

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

✅ Merge Requirements

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

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

📊 Review Process

Approvers and Reviewers

Approvers:

  • dshchedr
  • jpeimer
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • Ahmad-Hafe
  • RoniKishner
  • acinko-rh
  • dalia-frank
  • dshchedr
  • ema-aka-young
  • geetikakay
  • hmeir
  • josemacassan
  • jpeimer
  • kgoldbla
  • kshvaika
  • rlobillo
  • rnetser
  • vsibirsk
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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.65%. Comparing base (a2dc143) to head (33a3a3f).
⚠️ Report is 84 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5003      +/-   ##
==========================================
- Coverage   98.67%   98.65%   -0.02%     
==========================================
  Files          25       25              
  Lines        2487     2461      -26     
==========================================
- Hits         2454     2428      -26     
  Misses         33       33              
Flag Coverage Δ
utilities 98.65% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/storage/upgrade/utils.py (1)

20-27: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

HIGH: Add explicit type hints to updated public helpers.

Both context-manager helpers are public and changed in this PR, but they remain untyped. Please add full parameter and return annotations to keep these utilities strict and self-documenting.

💡 Proposed typing shape
 from contextlib import contextmanager
+from collections.abc import Generator
+from typing import Any

 `@contextmanager`
 def create_vm_for_snapshot_upgrade_tests(
-    vm_name,
-    namespace,
-    client,
-    storage_class_for_snapshot,
-    cpu_model,
-    data_source,
-):
+    vm_name: str,
+    namespace: str,
+    client: Any,
+    storage_class_for_snapshot: str,
+    cpu_model: str,
+    data_source: Any,
+) -> Generator[VirtualMachineForTests]:
@@
 `@contextmanager`
-def create_snapshot_for_upgrade(vm, client):
+def create_snapshot_for_upgrade(vm: VirtualMachineForTests, client: Any) -> Generator[VirtualMachineSnapshot]:

As per coding guidelines: "Type hints are MANDATORY."

Also applies to: 52-53

🤖 Prompt for 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.

In `@tests/storage/upgrade/utils.py` around lines 20 - 27, The public
context-manager helpers (notably create_vm_for_snapshot_upgrade_tests and the
other context-manager helper in this module) lack type hints; add explicit
annotations for all params and returns using typing (e.g., import Any, Dict,
Optional, Generator) and annotate parameters as vm_name: str, namespace: str,
client: Any, storage_class_for_snapshot: str, cpu_model: str, data_source:
Optional[Dict[str, Any]] (or a more precise dict type if known), and change the
return type to a context-manager generator like Generator[Any, None, None] or
Generator[Dict[str, Any], None, None] (use the precise VM type if available) and
apply the same full-parameter/return annotations to the other helper mentioned.
🤖 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/storage/upgrade/conftest.py`:
- Around line 59-61: The test fixture calls update_scratch_space_sc but that
symbol is not defined or imported, causing a NameError at runtime; fix by
importing update_scratch_space_sc from its module (or add a local definition)
and ensure the import is added to tests/storage/upgrade/conftest.py so the
with-statement using update_scratch_space_sc (and the variable
edited_cdi_config) resolves correctly at runtime.
- Line 27: Rename the verb-named fixtures to noun-style names: change
skip_if_less_than_two_storage_classes to two_storage_classes_required and
skip_if_not_override_cdiconfig_scratch_space to
cdiconfig_scratch_space_override_required (leave
storage_class_for_updating_cdiconfig_scratch as-is); update the fixture
definitions accordingly and then update every test, conftest import or parameter
that references skip_if_less_than_two_storage_classes or
skip_if_not_override_cdiconfig_scratch_space to use the new names
two_storage_classes_required and cdiconfig_scratch_space_override_required so
all usages match the renamed fixtures.

In `@tests/storage/upgrade/test_upgrade_storage.py`:
- Around line 55-61: Remove the duplicated client keyword argument passed to the
VirtualMachineRestore constructor calls; each invocation (e.g., the one creating
vm_restore with name=f"restore-snapshot-{rhel_vm_for_upgrade_a.name}" and
namespace=snapshots_for_upgrade_a.namespace and the other similar invocation
later) currently contains client=admin_client twice — keep a single
client=admin_client and remove the redundant one so the
VirtualMachineRestore(...) calls (and variables like vm_restore,
rhel_vm_for_upgrade_a, snapshots_for_upgrade_a) use only one client kwarg.

---

Outside diff comments:
In `@tests/storage/upgrade/utils.py`:
- Around line 20-27: The public context-manager helpers (notably
create_vm_for_snapshot_upgrade_tests and the other context-manager helper in
this module) lack type hints; add explicit annotations for all params and
returns using typing (e.g., import Any, Dict, Optional, Generator) and annotate
parameters as vm_name: str, namespace: str, client: Any,
storage_class_for_snapshot: str, cpu_model: str, data_source: Optional[Dict[str,
Any]] (or a more precise dict type if known), and change the return type to a
context-manager generator like Generator[Any, None, None] or Generator[Dict[str,
Any], None, None] (use the precise VM type if available) and apply the same
full-parameter/return annotations to the other helper mentioned.
🪄 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: 687c7ce5-f291-469c-852b-658c127810ca

📥 Commits

Reviewing files that changed from the base of the PR and between 06b7e39 and 5f13ae0.

📒 Files selected for processing (5)
  • tests/storage/upgrade/conftest.py
  • tests/storage/upgrade/constants.py
  • tests/storage/upgrade/test_upgrade_storage.py
  • tests/storage/upgrade/utils.py
  • utilities/storage.py
💤 Files with no reviewable changes (1)
  • utilities/storage.py

Comment thread tests/storage/upgrade/conftest.py Outdated
Comment thread tests/storage/upgrade/conftest.py Outdated
Comment thread tests/storage/upgrade/test_upgrade_storage.py
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
tests/storage/upgrade/conftest.py (1)

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Restore meaningful PR template content before merge.

The PR description still uses placeholders and does not provide meaningful content under ##### What this PR does / why we need it:. This is a required merge-gate section and must be filled with concrete rationale and scope.

As per coding guidelines, ##### What this PR does / why we need it: “MUST be present AND have meaningful content” and placeholder-only content must be flagged as HIGH.

🤖 Prompt for 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.

In `@tests/storage/upgrade/conftest.py` at line 1, PR template still contains
placeholder text for the required section "##### What this PR does / why we need
it:" — update the PR description to replace the placeholder with a concrete
summary that states the change set, scope, and rationale (e.g., what behaviors
or tests in this change affect, why the upgrade tests/fixtures in this PR are
needed, and any rollout/compatibility considerations). Ensure the header "#####
What this PR does / why we need it:" is present and populated with meaningful
content before merge.
tests/storage/upgrade/test_upgrade_storage.py (1)

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Restore required PR template content before merge.

##### What this PR does / why we need it: is currently placeholder-level/empty per the provided PR metadata. Please add meaningful, concrete content and ensure all required template sections remain present.

As per coding guidelines: “##### What this PR does / why we need it: — MUST be present AND have meaningful content… Flag as HIGH if the section is missing, empty… or contains only placeholder tokens.”

🤖 Prompt for 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.

In `@tests/storage/upgrade/test_upgrade_storage.py` at line 1, Restore and
populate the PR template section titled "##### What this PR does / why we need
it:" with concrete, meaningful content (not placeholders) that summarizes the
change, the motivation, and any user/behavioral impact; replace any placeholder
tokens like "TBD" or empty lines with a short paragraph describing the purpose
of this PR, intended behavior, and why it’s needed, and ensure the other
required template sections remain present and unchanged so CI/QA checks
recognize the template.
utilities/storage.py (2)

690-694: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Add mandatory type hints to new public utility function

Line 690 introduces a new public function in utilities/ without type hints. Please annotate vm, command, and return type explicitly.

Proposed fix
-def assert_disk_serial(vm, command=shlex.split("sudo ls /dev/disk/by-id")):
+def assert_disk_serial(
+    vm: virt_util.VirtualMachineForTests,
+    command: list[str] | None = None,
+) -> None:
+    effective_command = command or _DEFAULT_DISK_SERIAL_COMMAND
     assert (
         HOTPLUG_DISK_SERIAL
-        in run_ssh_commands(host=vm.ssh_exec, commands=command, wait_timeout=TIMEOUT_2MIN, sleep=TIMEOUT_5SEC)[0]
+        in run_ssh_commands(
+            host=vm.ssh_exec,
+            commands=effective_command,
+            wait_timeout=TIMEOUT_2MIN,
+            sleep=TIMEOUT_5SEC,
+        )[0]
     ), f"hotplug disk serial id {HOTPLUG_DISK_SERIAL} is not in VM"

As per coding guidelines: “Type hints are MANDATORY… all new public functions under utilities.”

🤖 Prompt for 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.

In `@utilities/storage.py` around lines 690 - 694, The function assert_disk_serial
is a new public utility and must have explicit type hints: annotate the vm
parameter (e.g., vm: Any or the concrete VM class used across utilities),
annotate command as a list of strings (e.g., command: list[str] or List[str])
and set the return type to None (-> None). Update the signature of
assert_disk_serial(vm, command=shlex.split(...)) accordingly, and add the
necessary typing imports (Any or the VM class and List from typing) if they are
not already present; keep the body using run_ssh_commands and
HOTPLUG_DISK_SERIAL unchanged.

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: PR template content is incomplete and blocks review quality

The PR description is missing meaningful content in ##### What this PR does / why we need it: (currently placeholder-level). Please restore substantive rationale in that section before merge.

As per coding guidelines: “What this PR does / why we need it: MUST be present AND have meaningful content… flag as HIGH if placeholder-only.”

🤖 Prompt for 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.

In `@utilities/storage.py` at line 1, The PR description currently contains only
placeholder content for the header "##### What this PR does / why we need it:" —
update that section to include a concise summary of changes, the reason these
changes are required, the impact/risks, and any verification steps; specifically
replace the placeholder text under "##### What this PR does / why we need it:"
with meaningful content (summary, motivation, risk/impact, and testing notes) so
the reviewer can evaluate the change.
🤖 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 `@utilities/storage.py`:
- Around line 69-70: Replace the inline shlex.split default in
assert_disk_serial with the module-level constant and avoid a shared mutable
default by changing the function signature to command=None; inside
assert_disk_serial set command = _DEFAULT_DISK_SERIAL_COMMAND when command is
None, then call run_ssh_commands(host=vm.ssh_exec, commands=command,
wait_timeout=TIMEOUT_2MIN, sleep=TIMEOUT_5SEC) and assert HOTPLUG_DISK_SERIAL is
present; also remove any unused duplicate shlex.split declarations so
_DEFAULT_DISK_SERIAL_COMMAND is the single source of truth.

---

Outside diff comments:
In `@tests/storage/upgrade/conftest.py`:
- Line 1: PR template still contains placeholder text for the required section
"##### What this PR does / why we need it:" — update the PR description to
replace the placeholder with a concrete summary that states the change set,
scope, and rationale (e.g., what behaviors or tests in this change affect, why
the upgrade tests/fixtures in this PR are needed, and any rollout/compatibility
considerations). Ensure the header "##### What this PR does / why we need it:"
is present and populated with meaningful content before merge.

In `@tests/storage/upgrade/test_upgrade_storage.py`:
- Line 1: Restore and populate the PR template section titled "##### What this
PR does / why we need it:" with concrete, meaningful content (not placeholders)
that summarizes the change, the motivation, and any user/behavioral impact;
replace any placeholder tokens like "TBD" or empty lines with a short paragraph
describing the purpose of this PR, intended behavior, and why it’s needed, and
ensure the other required template sections remain present and unchanged so
CI/QA checks recognize the template.

In `@utilities/storage.py`:
- Around line 690-694: The function assert_disk_serial is a new public utility
and must have explicit type hints: annotate the vm parameter (e.g., vm: Any or
the concrete VM class used across utilities), annotate command as a list of
strings (e.g., command: list[str] or List[str]) and set the return type to None
(-> None). Update the signature of assert_disk_serial(vm,
command=shlex.split(...)) accordingly, and add the necessary typing imports (Any
or the VM class and List from typing) if they are not already present; keep the
body using run_ssh_commands and HOTPLUG_DISK_SERIAL unchanged.
- Line 1: The PR description currently contains only placeholder content for the
header "##### What this PR does / why we need it:" — update that section to
include a concise summary of changes, the reason these changes are required, the
impact/risks, and any verification steps; specifically replace the placeholder
text under "##### What this PR does / why we need it:" with meaningful content
(summary, motivation, risk/impact, and testing notes) so the reviewer can
evaluate the change.
🪄 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: 55c31e4c-1507-4873-8cc1-d35bbacbc500

📥 Commits

Reviewing files that changed from the base of the PR and between d46d2c3 and 7a56b07.

📒 Files selected for processing (5)
  • tests/storage/upgrade/conftest.py
  • tests/storage/upgrade/constants.py
  • tests/storage/upgrade/test_upgrade_storage.py
  • tests/storage/upgrade/utils.py
  • utilities/storage.py

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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
tests/storage/upgrade/conftest.py (1)

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Restore meaningful PR template content before merge.

The PR description still uses placeholders and does not provide meaningful content under ##### What this PR does / why we need it:. This is a required merge-gate section and must be filled with concrete rationale and scope.

As per coding guidelines, ##### What this PR does / why we need it: “MUST be present AND have meaningful content” and placeholder-only content must be flagged as HIGH.

🤖 Prompt for 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.

In `@tests/storage/upgrade/conftest.py` at line 1, PR template still contains
placeholder text for the required section "##### What this PR does / why we need
it:" — update the PR description to replace the placeholder with a concrete
summary that states the change set, scope, and rationale (e.g., what behaviors
or tests in this change affect, why the upgrade tests/fixtures in this PR are
needed, and any rollout/compatibility considerations). Ensure the header "#####
What this PR does / why we need it:" is present and populated with meaningful
content before merge.
tests/storage/upgrade/test_upgrade_storage.py (1)

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Restore required PR template content before merge.

##### What this PR does / why we need it: is currently placeholder-level/empty per the provided PR metadata. Please add meaningful, concrete content and ensure all required template sections remain present.

As per coding guidelines: “##### What this PR does / why we need it: — MUST be present AND have meaningful content… Flag as HIGH if the section is missing, empty… or contains only placeholder tokens.”

🤖 Prompt for 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.

In `@tests/storage/upgrade/test_upgrade_storage.py` at line 1, Restore and
populate the PR template section titled "##### What this PR does / why we need
it:" with concrete, meaningful content (not placeholders) that summarizes the
change, the motivation, and any user/behavioral impact; replace any placeholder
tokens like "TBD" or empty lines with a short paragraph describing the purpose
of this PR, intended behavior, and why it’s needed, and ensure the other
required template sections remain present and unchanged so CI/QA checks
recognize the template.
utilities/storage.py (2)

690-694: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Add mandatory type hints to new public utility function

Line 690 introduces a new public function in utilities/ without type hints. Please annotate vm, command, and return type explicitly.

Proposed fix
-def assert_disk_serial(vm, command=shlex.split("sudo ls /dev/disk/by-id")):
+def assert_disk_serial(
+    vm: virt_util.VirtualMachineForTests,
+    command: list[str] | None = None,
+) -> None:
+    effective_command = command or _DEFAULT_DISK_SERIAL_COMMAND
     assert (
         HOTPLUG_DISK_SERIAL
-        in run_ssh_commands(host=vm.ssh_exec, commands=command, wait_timeout=TIMEOUT_2MIN, sleep=TIMEOUT_5SEC)[0]
+        in run_ssh_commands(
+            host=vm.ssh_exec,
+            commands=effective_command,
+            wait_timeout=TIMEOUT_2MIN,
+            sleep=TIMEOUT_5SEC,
+        )[0]
     ), f"hotplug disk serial id {HOTPLUG_DISK_SERIAL} is not in VM"

As per coding guidelines: “Type hints are MANDATORY… all new public functions under utilities.”

🤖 Prompt for 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.

In `@utilities/storage.py` around lines 690 - 694, The function assert_disk_serial
is a new public utility and must have explicit type hints: annotate the vm
parameter (e.g., vm: Any or the concrete VM class used across utilities),
annotate command as a list of strings (e.g., command: list[str] or List[str])
and set the return type to None (-> None). Update the signature of
assert_disk_serial(vm, command=shlex.split(...)) accordingly, and add the
necessary typing imports (Any or the VM class and List from typing) if they are
not already present; keep the body using run_ssh_commands and
HOTPLUG_DISK_SERIAL unchanged.

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: PR template content is incomplete and blocks review quality

The PR description is missing meaningful content in ##### What this PR does / why we need it: (currently placeholder-level). Please restore substantive rationale in that section before merge.

As per coding guidelines: “What this PR does / why we need it: MUST be present AND have meaningful content… flag as HIGH if placeholder-only.”

🤖 Prompt for 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.

In `@utilities/storage.py` at line 1, The PR description currently contains only
placeholder content for the header "##### What this PR does / why we need it:" —
update that section to include a concise summary of changes, the reason these
changes are required, the impact/risks, and any verification steps; specifically
replace the placeholder text under "##### What this PR does / why we need it:"
with meaningful content (summary, motivation, risk/impact, and testing notes) so
the reviewer can evaluate the change.
🤖 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 `@utilities/storage.py`:
- Around line 69-70: Replace the inline shlex.split default in
assert_disk_serial with the module-level constant and avoid a shared mutable
default by changing the function signature to command=None; inside
assert_disk_serial set command = _DEFAULT_DISK_SERIAL_COMMAND when command is
None, then call run_ssh_commands(host=vm.ssh_exec, commands=command,
wait_timeout=TIMEOUT_2MIN, sleep=TIMEOUT_5SEC) and assert HOTPLUG_DISK_SERIAL is
present; also remove any unused duplicate shlex.split declarations so
_DEFAULT_DISK_SERIAL_COMMAND is the single source of truth.

---

Outside diff comments:
In `@tests/storage/upgrade/conftest.py`:
- Line 1: PR template still contains placeholder text for the required section
"##### What this PR does / why we need it:" — update the PR description to
replace the placeholder with a concrete summary that states the change set,
scope, and rationale (e.g., what behaviors or tests in this change affect, why
the upgrade tests/fixtures in this PR are needed, and any rollout/compatibility
considerations). Ensure the header "##### What this PR does / why we need it:"
is present and populated with meaningful content before merge.

In `@tests/storage/upgrade/test_upgrade_storage.py`:
- Line 1: Restore and populate the PR template section titled "##### What this
PR does / why we need it:" with concrete, meaningful content (not placeholders)
that summarizes the change, the motivation, and any user/behavioral impact;
replace any placeholder tokens like "TBD" or empty lines with a short paragraph
describing the purpose of this PR, intended behavior, and why it’s needed, and
ensure the other required template sections remain present and unchanged so
CI/QA checks recognize the template.

In `@utilities/storage.py`:
- Around line 690-694: The function assert_disk_serial is a new public utility
and must have explicit type hints: annotate the vm parameter (e.g., vm: Any or
the concrete VM class used across utilities), annotate command as a list of
strings (e.g., command: list[str] or List[str]) and set the return type to None
(-> None). Update the signature of assert_disk_serial(vm,
command=shlex.split(...)) accordingly, and add the necessary typing imports (Any
or the VM class and List from typing) if they are not already present; keep the
body using run_ssh_commands and HOTPLUG_DISK_SERIAL unchanged.
- Line 1: The PR description currently contains only placeholder content for the
header "##### What this PR does / why we need it:" — update that section to
include a concise summary of changes, the reason these changes are required, the
impact/risks, and any verification steps; specifically replace the placeholder
text under "##### What this PR does / why we need it:" with meaningful content
(summary, motivation, risk/impact, and testing notes) so the reviewer can
evaluate the change.
🪄 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: 55c31e4c-1507-4873-8cc1-d35bbacbc500

📥 Commits

Reviewing files that changed from the base of the PR and between d46d2c3 and 7a56b07.

📒 Files selected for processing (5)
  • tests/storage/upgrade/conftest.py
  • tests/storage/upgrade/constants.py
  • tests/storage/upgrade/test_upgrade_storage.py
  • tests/storage/upgrade/utils.py
  • utilities/storage.py
📜 Review details
🔇 Additional comments (7)
tests/storage/upgrade/conftest.py (1)

27-41: LGTM!

Also applies to: 45-51, 54-70, 73-79

tests/storage/upgrade/test_upgrade_storage.py (1)

6-10: LGTM!

Also applies to: 20-20, 24-24, 27-27, 51-77, 126-141, 155-182

tests/storage/upgrade/constants.py (1)

5-9: LGTM!

tests/storage/upgrade/utils.py (3)

3-16: LGTM!


20-48: LGTM!


51-66: LGTM!

utilities/storage.py (1)

309-309: LGTM!

🛑 Comments failed to post (1)
utilities/storage.py (1)

69-70: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="utilities/storage.py"

echo "== Grep for _DEFAULT_DISK_SERIAL_COMMAND =="
rg -n "_DEFAULT_DISK_SERIAL_COMMAND" "$FILE" || true

echo "== Grep for by-id =="
rg -n "disk/by-id" "$FILE" || true

echo "== Grep for shlex.split in file =="
rg -n "shlex\.split\(" "$FILE" || true

echo "== Show lines 50-90 =="
nl -ba "$FILE" | sed -n '50,95p'

echo "== Show lines 660-720 =="
nl -ba "$FILE" | sed -n '660,720p'

Repository: RedHatQE/openshift-virtualization-tests

Length of output: 265


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="utilities/storage.py"

echo "== Grep for _DEFAULT_DISK_SERIAL_COMMAND =="
rg -n "_DEFAULT_DISK_SERIAL_COMMAND" "$FILE" || true

echo "== Grep for disk/by-id =="
rg -n "disk/by-id" "$FILE" || true

echo "== Grep for shlex.split( in file =="
rg -n "shlex\.split\(" "$FILE" || true

echo "== Show lines 50-95 =="
nl -ba "$FILE" | sed -n '50,95p'

echo "== Show lines 660-720 =="
nl -ba "$FILE" | sed -n '660,720p'

Repository: RedHatQE/openshift-virtualization-tests

Length of output: 1117


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="utilities/storage.py"

echo "== Lines 55-80 =="
awk 'NR>=55 && NR<=80 {printf "%d:%s\n", NR, $0}' "$FILE"

echo "== Lines 675-705 =="
awk 'NR>=675 && NR<=705 {printf "%d:%s\n", NR, $0}' "$FILE"

Repository: RedHatQE/openshift-virtualization-tests

Length of output: 2283


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="utilities/storage.py"
rg -n "_DEFAULT_DISK_SERIAL_COMMAND" . -S || true
rg -n "assert_disk_serial\(" . -S || true

Repository: RedHatQE/openshift-virtualization-tests

Length of output: 665


🏁 Script executed:

#!/bin/bash
set -euo pipefail
FILE="utilities/storage.py"

# Find definition of run_ssh_commands (prefer local definition, but repo search is fine)
rg -n "def run_ssh_commands" "$FILE" || true
rg -n "run_ssh_commands" "$FILE" | head -n 50

# Repo-wide locate of run_ssh_commands definition
rg -n "def run_ssh_commands" . -S

# Show assert_disk_serial callers context (lines around matches)
FILE1="tests/storage/test_hotplug.py"
FILE2="tests/storage/upgrade/test_upgrade_storage.py"
awk 'NR>=200 && NR<=330 {print NR ":" $0}' "$FILE1" | head -n 140
awk 'NR>=70 && NR<=140 {print NR ":" $0}' "$FILE2"
awk 'NR>=160 && NR<=240 {print NR ":" $0}' "$FILE2"

Repository: RedHatQE/openshift-virtualization-tests

Length of output: 653


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search entire repo for run_ssh_commands implementation or any mention
rg -n "def run_ssh_commands" . -S || true
rg -n "run_ssh_commands\(" . -S | head -n 200

# Also check if pyhelper_utils is vendored in-repo
fd -a "pyhelper_utils" . || true
find . -maxdepth 5 -type f -name "*run_ssh_commands*" -o -name "shell.py" | head -n 200 || true

Repository: RedHatQE/openshift-virtualization-tests

Length of output: 10298


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import inspect
try:
    import pyhelper_utils.shell as sh
except Exception as e:
    print("IMPORT_ERROR:", repr(e))
    raise SystemExit(0)

print("run_ssh_commands module file:", getattr(sh, "__file__", None))
print("run_ssh_commands signature:", inspect.signature(sh.run_ssh_commands))

try:
    src = inspect.getsource(sh.run_ssh_commands)
    print("\n--- run_ssh_commands source (truncated to 250 lines) ---")
    lines = src.splitlines()
    for i, line in enumerate(lines[:250], start=1):
        print(f"{i:03d}:{line}")
    if len(lines) > 250:
        print(f"... ({len(lines)} total lines)")
except OSError as e:
    print("SOURCE_ERROR:", repr(e))
PY

Repository: RedHatQE/openshift-virtualization-tests

Length of output: 153


🌐 Web query:

pyhelper_utils.shell run_ssh_commands commands parameter mutates list

💡 Result:

The pyhelper-utils library provides utility functions, including an SSH command executor, but there is no evidence in its official documentation or repository suggesting that the commands parameter in its run_ssh_command function mutates the provided list [1][2]. In Python, passing a list to a function allows the function to access and modify the original list object if it performs in-place operations (such as.append,.extend, or item assignment) [1]. However, official usage examples for pyhelper-utils typically demonstrate passing the output of shlex.split directly to the commands parameter, as shown below: from rrmngmnt import Host, UserWithPKey host = Host("1.1.1.1") user = UserWithPKey('user', '/path/to/pkey') host.executor_user = user run_ssh_command(host=host, commands=shlex.split("ls -l")) If you are concerned about list mutation, you can pass a copy of your list to the function to ensure the original remains unchanged: run_ssh_command(host=host, commands=my_command_list[:]) There is no specialized or documented behavior in pyhelper-utils that treats the commands parameter in a way that causes unexpected side effects or mutations to external variables [1][2].

Citations:


Fix unused _DEFAULT_DISK_SERIAL_COMMAND and remove the shared mutable default list

  • utilities/storage.py:69 defines _DEFAULT_DISK_SERIAL_COMMAND = shlex.split("sudo ls /dev/disk/by-id"), but assert_disk_serial uses its own inline shlex.split(...) default at utilities/storage.py:690, leaving _DEFAULT_DISK_SERIAL_COMMAND as dead code.
  • utilities/storage.py:690 uses shlex.split(...) as a default argument; that list is created once at import time and then shared across calls. Default args should avoid shared mutable state.

Example fix:

_DEFAULT_DISK_SERIAL_COMMAND = shlex.split("sudo ls /dev/disk/by-id")

def assert_disk_serial(vm, command=None):
    if command is None:
        command = _DEFAULT_DISK_SERIAL_COMMAND
    assert HOTPLUG_DISK_SERIAL in run_ssh_commands(
        host=vm.ssh_exec, commands=command, wait_timeout=TIMEOUT_2MIN, sleep=TIMEOUT_5SEC
    )[0], f"hotplug disk serial id {HOTPLUG_DISK_SERIAL} is not in VM"
🤖 Prompt for 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.

In `@utilities/storage.py` around lines 69 - 70, Replace the inline shlex.split
default in assert_disk_serial with the module-level constant and avoid a shared
mutable default by changing the function signature to command=None; inside
assert_disk_serial set command = _DEFAULT_DISK_SERIAL_COMMAND when command is
None, then call run_ssh_commands(host=vm.ssh_exec, commands=command,
wait_timeout=TIMEOUT_2MIN, sleep=TIMEOUT_5SEC) and assert HOTPLUG_DISK_SERIAL is
present; also remove any unused duplicate shlex.split declarations so
_DEFAULT_DISK_SERIAL_COMMAND is the single source of truth.

@josemacassan
Copy link
Copy Markdown
Contributor Author

/build-and-push-container

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

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

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

/retest all

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

Overlapping files

utilities/storage.py

josemacassan and others added 4 commits June 4, 2026 08:59
…tests. (RedHatQE#2917)

Change use of Cirros images coming from artifactory to RHEL coming from
DataSource into upgrade tests. `tests/storage/upgrade`.
We are refactoring tests by using RHEL images from DataSource, for this
I have changed all the Cirros resources into upgrade tests as well as
RHEL utilities and config functions
I have added a function called `write_file_via_ssh` that writes a file
using `run_ssh_commands` function. It has an internal import to avoid
circular import errors I was facing. Programmatically I think is not a
very good practice so I appreciate some comments specially in there
(perhaps `utilities/storage.py` is not the best place to locate it, and
other place might avoid those errors).
https://issues.redhat.com/browse/CNV-69123

---------

Signed-off-by: Jose Manuel Castano <joscasta@redhat.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Remove unused fixtures that reference non-existent update_scratch_space_sc
function (removed in fbda8ef). Fix duplicate client keyword arguments in
VirtualMachineRestore constructor calls.

Signed-off-by: Jose Manuel Castano <joscasta@redhat.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes B008 ruff violation by using _DEFAULT_DISK_SERIAL_COMMAND
instead of calling shlex.split() in function argument default.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Jose Manuel Castano <joscasta@redhat.com>
@josemacassan josemacassan force-pushed the improve-datasource-upgrade-test-4.20-main branch from cbaa713 to 33a3a3f Compare June 4, 2026 06:59
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
tests/storage/upgrade/conftest.py (1)

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Restore meaningful PR template content in “What this PR does / why we need it”.

The PR description still contains placeholder-only content for ##### What this PR does / why we need it:. This blocks reviewers from validating intent/scope and must be replaced with concrete rationale and expected behavior changes before merge.

As per coding guidelines: ##### What this PR does / why we need it: must be present and have meaningful content; placeholder-only text is a HIGH-severity violation.

🤖 Prompt for 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.

In `@tests/storage/upgrade/conftest.py` at line 1, Replace the placeholder under
the PR heading "##### What this PR does / why we need it:" with a concise,
concrete summary that states the change being introduced, the rationale, the
scope (which modules/functions are affected), and the expected behavior or
observable outcomes (including any test or migration impacts); ensure the
section mentions any relevant functions/classes or test files affected (e.g.,
tests/storage/upgrade/conftest.py) so reviewers can validate intent and scope.
tests/storage/upgrade/test_upgrade_storage.py (1)

39-40: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Restore required PR template content before merge.

##### What this PR does / why we need it: is currently placeholder-only in the PR description. This blocks reviewability and must be meaningful content.

As per coding guidelines: “What this PR does / why we need it: — MUST be present AND have meaningful content.”

🤖 Prompt for 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.

In `@tests/storage/upgrade/test_upgrade_storage.py` around lines 39 - 40, The PR
description is missing meaningful content for the required template section;
update the PR body so the "##### What this PR does / why we need it:" section
contains a concise explanation of the change and its rationale (e.g., what
TestUpgradeStorage covers and why the updated_default_storage_class_ocs_virt
fixture is needed for this upgrade test), then push the corrected PR description
before merging so the template requirement is satisfied.
utilities/storage.py (1)

689-693: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

HIGH: New utility function is missing required typing and docstring contract.

assert_disk_serial is a new public helper in utilities/ and should include type hints and a Google-style docstring.

Proposed fix
-def assert_disk_serial(vm, command=_DEFAULT_DISK_SERIAL_COMMAND):
+def assert_disk_serial(
+    vm: virt_util.VirtualMachineForTests,
+    command: list[str] = _DEFAULT_DISK_SERIAL_COMMAND,
+) -> None:
+    """Assert that the VM exposes the expected hotplug disk serial in /dev/disk/by-id.
+
+    Args:
+        vm: VM to inspect over SSH.
+        command: Command token list used to query disk identifiers.
+    """
     assert (
         HOTPLUG_DISK_SERIAL
         in run_ssh_commands(host=vm.ssh_exec, commands=command, wait_timeout=TIMEOUT_2MIN, sleep=TIMEOUT_5SEC)[0]
     ), f"hotplug disk serial id {HOTPLUG_DISK_SERIAL} is not in VM"

As per coding guidelines: “Type hints are MANDATORY… all new public functions under utilities” and “Write Google-format docstrings for all public functions with non-obvious return values or side effects.”

🤖 Prompt for 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.

In `@utilities/storage.py` around lines 689 - 693, Add type hints and a
Google-style docstring to the new public function assert_disk_serial: annotate
parameters (vm: virtual machine type — e.g., VM or whatever class represents vm
in this module — and command: str = _DEFAULT_DISK_SERIAL_COMMAND) and the return
type as None; then add a Google-format docstring above the function that
describes the purpose, parameters (vm, command), the side effect (raises
AssertionError if HOTPLUG_DISK_SERIAL not present), and mentions it calls
run_ssh_commands and checks HOTPLUG_DISK_SERIAL in the command output to help
locate behavior; keep the existing assertion logic unchanged and reference
HOTPLUG_DISK_SERIAL and run_ssh_commands in the docstring.
🤖 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.

Outside diff comments:
In `@tests/storage/upgrade/conftest.py`:
- Line 1: Replace the placeholder under the PR heading "##### What this PR does
/ why we need it:" with a concise, concrete summary that states the change being
introduced, the rationale, the scope (which modules/functions are affected), and
the expected behavior or observable outcomes (including any test or migration
impacts); ensure the section mentions any relevant functions/classes or test
files affected (e.g., tests/storage/upgrade/conftest.py) so reviewers can
validate intent and scope.

In `@tests/storage/upgrade/test_upgrade_storage.py`:
- Around line 39-40: The PR description is missing meaningful content for the
required template section; update the PR body so the "##### What this PR does /
why we need it:" section contains a concise explanation of the change and its
rationale (e.g., what TestUpgradeStorage covers and why the
updated_default_storage_class_ocs_virt fixture is needed for this upgrade test),
then push the corrected PR description before merging so the template
requirement is satisfied.

In `@utilities/storage.py`:
- Around line 689-693: Add type hints and a Google-style docstring to the new
public function assert_disk_serial: annotate parameters (vm: virtual machine
type — e.g., VM or whatever class represents vm in this module — and command:
str = _DEFAULT_DISK_SERIAL_COMMAND) and the return type as None; then add a
Google-format docstring above the function that describes the purpose,
parameters (vm, command), the side effect (raises AssertionError if
HOTPLUG_DISK_SERIAL not present), and mentions it calls run_ssh_commands and
checks HOTPLUG_DISK_SERIAL in the command output to help locate behavior; keep
the existing assertion logic unchanged and reference HOTPLUG_DISK_SERIAL and
run_ssh_commands in the docstring.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 41eb2313-9769-4270-a656-c35eb83f69a8

📥 Commits

Reviewing files that changed from the base of the PR and between 7a56b07 and 33a3a3f.

📒 Files selected for processing (5)
  • tests/storage/upgrade/conftest.py
  • tests/storage/upgrade/constants.py
  • tests/storage/upgrade/test_upgrade_storage.py
  • tests/storage/upgrade/utils.py
  • utilities/storage.py

@josemacassan
Copy link
Copy Markdown
Contributor Author

/build-and-push-container

1 similar comment
@josemacassan
Copy link
Copy Markdown
Contributor Author

/build-and-push-container

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

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

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

/build-and-push-container

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

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

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

Verification failed for PR #5003 (image: openshift-virtualization-tests:pr-5003).
Result: UNSTABLE
Job: openshift-virtualization-tests-runner #5549

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

/build-and-push-container

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

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

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

Verification failed for PR #5003 (image: openshift-virtualization-tests:pr-5003).
Result: ABORTED
Job: openshift-virtualization-tests-runner #5559

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

/build-and-push-container

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

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

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

Verification failed for PR #5003.
Result: UNSTABLE
Job: openshift-virtualization-tests-runner #5574

Execution details
pytest -s -o log_cli=true -m tier2 --jira --skip-deprecated-api-test --upgrade cnv --cnv-version 4.22.0 --cnv-channel=candidate --storage-class-matrix=hostpath-csi-basic,ocs-storagecluster-ceph-rbd-virtualization --cluster-sanity-skip-check -m 'not
Image: openshift-virtualization-tests:pr-5003

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.

7 participants