Skip to content

STOR-3090: Add CSI storage test for pod delete after host umount of mounted volume - #31488

Open
radeore wants to merge 1 commit into
openshift:mainfrom
radeore:vol-umount-test
Open

STOR-3090: Add CSI storage test for pod delete after host umount of mounted volume#31488
radeore wants to merge 1 commit into
openshift:mainfrom
radeore:vol-umount-test

Conversation

@radeore

@radeore radeore commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add CSI suite OpenShift CSI extended - Pod delete after umount (migrated from openshift tests private OCP-66187).
  • Added PodDeleteAfterUmountTest bool to OpenShiftCSIDriverConfig (default false).
  • Register this test suite in AddOpenShiftCSITests only when the flag is set 'true' in CSI driver OCP-manifests.

Test plan

  • make openshift-tests
  • Dry-run: ./openshift-tests run openshift/csi --dry-run | grep 'Pod delete after umount'
  • Run against multiple CSI drivers (GCP PD, Azure Disk, Azure File)

Test run logs:

Ran 1 of 1 Specs in 26.038 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "External Storage [Driver: pd.csi.storage.gke.io] [Testpattern: Dynamic PV (default fs)] OpenShift CSI extended - Pod delete after umount should delete pod after volume directory was umounted on the node",
    "result": "passed"
---
Ran 1 of 1 Specs in 34.894 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "External Storage [Driver: file.csi.azure.com] [Testpattern: Dynamic PV (default fs)] OpenShift CSI extended - Pod delete after umount should delete pod after volume directory was umounted on the node",
     "result": "passed"
  
--- 

 Ran 1 of 1 Specs in 61.331 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "External Storage [Driver: disk.csi.azure.com] [Testpattern: Dynamic PV (default fs)] OpenShift CSI extended - Pod delete after umount should delete pod after volume directory was umounted on the node",
    

Summary by CodeRabbit

  • New Features
    • Added an optional CSI storage test that verifies pods can be deleted successfully after a host-side volume unmount.
    • The test provisions and mounts a volume, validates the mount, removes it, and confirms cleanup succeeds.
    • The test is disabled by default and can be enabled through configuration.
  • Documentation
    • Documented the new optional CSI test setting and its default behavior.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 5, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 5, 2026

Copy link
Copy Markdown

@radeore: This pull request references STOR-3090 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add CSI suite OpenShift CSI extended - Pod delete after umount (migrated from openshift tests private OCP-66187).
  • Register via RegisterAlwaysOnCSISuites so it runs for all CSI drivers in openshift/csi.

Test plan

  • make openshift-tests
  • Dry-run: ./openshift-tests run openshift/csi --dry-run | grep 'Pod delete after umount'
  • Run against at least one driver (GCP PD)

Test run logs:

Ran 1 of 1 Specs in 26.038 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
 {
   "name": "External Storage [Driver: pd.csi.storage.gke.io] [Testpattern: Dynamic PV (default fs)] OpenShift CSI extended - Pod delete after umount should delete pod after volume directory was umounted on the node",
   "lifecycle": "blocking",
   "duration": 26038,
   "startTime": "2026-08-05 20:46:00.551357 UTC",
   "endTime": "2026-08-05 20:46:26.589434 UTC",
   "result": "passed"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Walkthrough

Adds an optional OpenShift CSI test suite. The suite dynamically provisions a volume, mounts it in a pod, unmounts it on the host, removes the volume directory, and verifies successful pod deletion.

Changes

CSI pod deletion validation

Layer / File(s) Summary
Suite configuration and registration
test/extended/storage/csi/csi.go, test/extended/storage/csi/README.md, test/extended/storage/csi/pod_delete_after_umount.go
Adds the PodDeleteAfterUmountTest option, documents its disabled default, and registers the suite when enabled.
Volume and pod setup
test/extended/storage/csi/pod_delete_after_umount.go
Creates a dynamic filesystem volume and pod, then verifies the CSI mount on the pod’s node.
Host unmount and pod deletion
test/extended/storage/csi/pod_delete_after_umount.go
Unmounts and removes the host volume directory, verifies the unmount, and requires pod deletion to complete successfully.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant StorageFramework
  participant KubernetesAPI
  participant HostExecution
  StorageFramework->>KubernetesAPI: Create volume and pod
  KubernetesAPI-->>StorageFramework: Return bound PV and pod node
  StorageFramework->>HostExecution: Verify CSI mount path
  StorageFramework->>HostExecution: Unmount and remove volume directory
  HostExecution-->>StorageFramework: Confirm path is not mounted
  StorageFramework->>KubernetesAPI: Delete pod
  KubernetesAPI-->>StorageFramework: Complete pod deletion
Loading

Suggested reviewers: bertinatto, tsmetana


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
Container-Privileges ❌ Error The new suite sets NamespacePodSecurityLevel to LevelPrivileged and calls NewHostExec, which creates a hostNetwork pod with Privileged=true. Avoid privileged host execution where possible, or document and isolate the required hostNetwork/privileged pod with the minimum necessary security settings.
No-Sensitive-Data-In-Logs ❌ Error The suite logs node.Name in a Ginkgo step and passes mount paths containing pod UIDs/PV names to HostExec, whose error logger emits the remote host and command. Use redacted, opaque identifiers in steps and errors, and prevent HostExec failure logs from emitting node names or full mount paths.
✅ Passed checks (13 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Stable And Deterministic Test Names ✅ Passed The added Ginkgo test title and suite name are fixed descriptive strings; no pod, node, namespace, timestamp, IP, UUID, or generated value appears in a test title.
Test Structure And Quality ✅ Passed The single It tests one behavior, defers pod/volume/host cleanup, uses f.Timeouts.PodStart and finite delete/provision waits, and supplies diagnostic messages for all direct assertions.
Microshift Test Compatibility ✅ Passed The new Ginkgo test uses core Kubernetes CSI, PVC, Pod, Node, and privileged host-exec APIs; it references no unavailable OpenShift API, namespace, or MicroShift-unsupported topology feature.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The new suite creates one pod, uses its assigned node for host mount operations, and has no multi-node, HA, anti-affinity, spreading, failover, or rescheduling assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The patch changes CSI documentation/configuration and an e2e test only; it adds no Deployment, controller, affinity, topology spread, node selector, toleration, replica, or PDB constraints.
Ote Binary Stdout Contract ✅ Passed The PR adds no process-level stdout writes. csi.go uses fmt.Errorf, and the new suite’s formatting and Ginkgo actions run inside test registration or It; no main, init, log, or klog changes were ad...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The new Ginkgo test uses only Kubernetes APIs, host mount commands, and filepath.Join; it has no IPv4 literals, IP parsing, URL construction, or external network calls, and its test image is mirror...
No-Weak-Crypto ✅ Passed The patch adds CSI test/configuration/docs only; exact diff and structural scans show no weak crypto algorithms, crypto APIs, custom crypto, or secret/token comparisons.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a CSI test for pod deletion after host unmount.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: radeore
Once this PR has been reviewed and has the lgtm label, please assign jsafrane for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
openshift-ci Bot requested review from bertinatto and tsmetana August 5, 2026 21:00
@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Aug 5, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-trt

openshift-trt Bot commented Aug 6, 2026

Copy link
Copy Markdown

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New Test Risks for sha: ccd7e34

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-aws-csi Medium - "External Storage [Driver: ebs.csi.aws.com] [Testpattern: Dynamic PV (default fs)] OpenShift CSI extended - Pod delete after umount should delete pod after volume directory was umounted on the node" is a new test, and was only seen in one job.
pull-ci-openshift-origin-main-e2e-gcp-csi Medium - "External Storage [Driver: pd.csi.storage.gke.io] [Testpattern: Dynamic PV (default fs)] OpenShift CSI extended - Pod delete after umount should delete pod after volume directory was umounted on the node" is a new test, and was only seen in one job.

New tests seen in this PR at sha: ccd7e34

  • "External Storage [Driver: ebs.csi.aws.com] [Testpattern: Dynamic PV (default fs)] OpenShift CSI extended - Pod delete after umount should delete pod after volume directory was umounted on the node" [Total: 1, Pass: 1, Fail: 0, Flake: 0]
  • "External Storage [Driver: pd.csi.storage.gke.io] [Testpattern: Dynamic PV (default fs)] OpenShift CSI extended - Pod delete after umount should delete pod after volume directory was umounted on the node" [Total: 1, Pass: 1, Fail: 0, Flake: 0]

@radeore

radeore commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@radeore: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-ovn 31cba00 link true /test e2e-gcp-ovn

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants