Skip to content

OCPNODE-4055: Add Additional Storage Support - API validation test cases#31384

Open
BhargaviGudi wants to merge 1 commit into
openshift:mainfrom
BhargaviGudi:additionStorageSupportAPI
Open

OCPNODE-4055: Add Additional Storage Support - API validation test cases#31384
BhargaviGudi wants to merge 1 commit into
openshift:mainfrom
BhargaviGudi:additionStorageSupportAPI

Conversation

@BhargaviGudi

@BhargaviGudi BhargaviGudi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Add comprehensive API validation tests for Additional Storage Support (additionalArtifactStores, additionalImageStores, additionalLayerStores) feature. These tests validate ContainerRuntimeConfig API behavior
using DryRun, ensuring proper validation without triggering MCO reconciliation.

Test Coverage

13 API validation tests across 4 categories:

Combined Additional Stores (3 tests)

  • Reject invalid path in any store type
  • Reject when layer stores exceed maximum count
  • Reject duplicate paths within same store type

Additional Layer Stores (8 tests)

  • Reject empty path
  • Reject relative path (non-absolute)
  • Reject path with spaces
  • Reject path with invalid characters (@, etc.)
  • Reject path exceeding 256 characters
  • Reject more than 5 layer stores (max enforcement)
  • Reject path with consecutive forward slashes
  • Reject duplicate paths

Additional Image Stores (1 test)

  • Smoke test: validation wiring

Additional Artifact Stores (1 test)

  • Smoke test: validation wiring

Test Characteristics

  • Suite: openshift/conformance/parallel
  • Execution: Non-disruptive, parallel, ~2-3 minutes total
  • Method: DryRun API calls only (no actual MCO reconciliation)
  • Feature Tag: [Feature:AdditionalStorageSupport]
  • OCPFeatureGate: AdditionalStorageConfig
  • Platform Support: AWS, GCP, vSphere, Metal IPI (skips Azure and MicroShift)

Files Changed

New Files

  • test/extended/node/additional_storage_api.go - 13 API validation tests

Modified Files

  • test/extended/node/node_utils.go - Added skipUnlessAdditionalStorageConfigEnabled() helper function with platform and feature gate checks
  • test/extended/node/README.md - Added documentation for API validation test suite

Prerequisites

  • AdditionalStorageConfig feature gate must be enabled
  • Test automatically skips on:
    • MicroShift (no MachineConfig support)
    • Microsoft Azure (known platform issues)

Related

  • Feature: Additional Storage Support
  • Availability: TechPreview (OCP 4.22), GA (OCP 4.23+/5.0)
  • Jira: OCPNODE-4055

Summary by CodeRabbit

  • New Features

    • Added end-to-end conformance coverage for Additional Storage Support APIs.
    • Added validation for image, layer, and artifact store paths, including invalid formats, duplicates, excessive entries, and length limits.
    • Tests automatically skip when the required feature is unavailable or the platform is unsupported.
  • Documentation

    • Documented the new test suite, prerequisites, execution steps, and coverage.

@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 commented Jul 14, 2026

Copy link
Copy Markdown

@BhargaviGudi: This pull request references OCPNODE-4055 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Add comprehensive API validation tests for Additional Storage Support (additionalArtifactStores, additionalImageStores, additionalLayerStores) feature. These tests validate ContainerRuntimeConfig API behavior
using DryRun, ensuring proper validation without triggering MCO reconciliation.

Test Coverage

13 API validation tests across 4 categories:

Combined Additional Stores (3 tests)

  • Reject invalid path in any store type
  • Reject when layer stores exceed maximum count
  • Reject duplicate paths within same store type

Additional Layer Stores (8 tests)

  • Reject empty path
  • Reject relative path (non-absolute)
  • Reject path with spaces
  • Reject path with invalid characters (@, etc.)
  • Reject path exceeding 256 characters
  • Reject more than 5 layer stores (max enforcement)
  • Reject path with consecutive forward slashes
  • Reject duplicate paths

Additional Image Stores (1 test)

  • Smoke test: validation wiring

Additional Artifact Stores (1 test)

  • Smoke test: validation wiring

Test Characteristics

  • Suite: openshift/conformance/parallel
  • Execution: Non-disruptive, parallel, ~2-3 minutes total
  • Method: DryRun API calls only (no actual MCO reconciliation)
  • Feature Tag: [Feature:AdditionalStorageSupport]
  • OCPFeatureGate: AdditionalStorageConfig
  • Platform Support: AWS, GCP, vSphere, Metal IPI (skips Azure and MicroShift)

Files Changed

New Files

  • test/extended/node/additional_storage_api.go - 13 API validation tests

Modified Files

  • test/extended/node/node_utils.go - Added skipUnlessAdditionalStorageConfigEnabled() helper function with platform and feature gate checks
  • test/extended/node/README.md - Added documentation for API validation test suite

Prerequisites

  • AdditionalStorageConfig feature gate must be enabled
  • Test automatically skips on:
    • MicroShift (no MachineConfig support)
    • Microsoft Azure (known platform issues)

Related

  • Feature: Additional Storage Support
  • Availability: TechPreview (OCP 4.22), GA (OCP 4.23+/5.0)
  • Jira: OCPNODE-4055

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.

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

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Walkthrough

Adds a feature-gated OpenShift conformance suite validating Additional Storage API path and count constraints through DryRun requests, with image and artifact smoke coverage and README documentation.

Changes

Additional Storage API validation

Layer / File(s) Summary
Additional storage execution gate
test/extended/node/node_utils.go
Skips tests on MicroShift, Azure, or clusters without the AdditionalStorageConfig feature gate.
Combined and layer store validation
test/extended/node/additional_storage_api.go
Adds DryRun validations for invalid paths, duplicate stores, length and count limits, spaces, special characters, and consecutive slashes.
Image and artifact coverage documentation
test/extended/node/additional_storage_api.go, test/extended/node/README.md
Adds invalid-path smoke tests for image and artifact stores and documents suite execution and coverage.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GinkgoSuite
  participant SkipHelper
  participant ClusterConfig
  participant ContainerRuntimeConfigAPI
  GinkgoSuite->>SkipHelper: check AdditionalStorageConfig prerequisites
  SkipHelper->>ClusterConfig: read platform and FeatureGate
  ClusterConfig-->>SkipHelper: platform and enabled feature gates
  GinkgoSuite->>ContainerRuntimeConfigAPI: submit Additional*Stores request with DryRun
  ContainerRuntimeConfigAPI-->>GinkgoSuite: return validation result
Loading
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: new API validation test cases for Additional Storage Support.
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 All Describe/Context/It titles are static strings; no generated names, timestamps, node/namespace/IP values, or other run-to-run dynamic data appear in test titles.
Test Structure And Quality ✅ Passed Each It is a single DryRun API-validation case; no persistent resources or waits are created, and setup uses a shared BeforeEach skip gate consistent with nearby tests.
Microshift Test Compatibility ✅ Passed The new suite is tagged with [apigroup:config.openshift.io] and [apigroup:machineconfiguration.openshift.io], and BeforeEach calls a helper that g.Skip()s on MicroShift before using those APIs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The new tests only DryRun-create ContainerRuntimeConfig objects and don’t count, schedule, drain, or compare nodes; no multi-node/HA assumption appears.
Topology-Aware Scheduling Compatibility ✅ Passed PR only adds e2e tests/docs and a feature-gate skip helper; it does not add manifests, operators, or controllers with topology-sensitive scheduling rules.
Ote Binary Stdout Contract ✅ Passed No new init/TestMain/BeforeSuite stdout writes; the touched files only add Ginkgo test definitions and a BeforeEach skip helper, with no fmt.Print/klog/log stdout setup.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The new Ginkgo tests use DryRun API calls only; no IPv4 literals, host/IP parsing, or external network connectivity were found.
No-Weak-Crypto ✅ Passed Touched files only add API-validation tests and a feature-gate skip helper; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret-token comparisons found.
Container-Privileges ✅ Passed The PR only adds Go tests and docs; no new manifests/pod specs or privilege settings like privileged, hostPID, or allowPrivilegeEscalation were introduced.
No-Sensitive-Data-In-Logs ✅ Passed New logs only report test progress, validation errors, and platform/feature-gate skip reasons; no passwords, tokens, PII, hostnames, or customer data are logged.
✨ 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 requested review from MaysaMacedo and mrunalp July 14, 2026 15:58
@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BhargaviGudi
Once this PR has been reviewed and has the lgtm label, please assign rphillips 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

@BhargaviGudi

BhargaviGudi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

/assign @saschagrunert @cpmeadors

@BhargaviGudi

BhargaviGudi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

/label acknowledge-critical-fixes-only

@BhargaviGudi

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-ovn-techpreview

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
test/extended/node/node_utils.go (1)

908-947: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Skip-on-fetch-error masks real cluster/RBAC problems as "skipped" instead of "failed".

If IsMicroShiftCluster, Infrastructures().Get, or FeatureGates().Get fail (e.g. transient API error or an RBAC issue), the test silently skips via g.Skip(...) rather than failing. That hides genuine test-infrastructure problems behind a green/skipped result. Note this diverges from the analogous existing helper (isFeatureGateEnabled/SkipWhenFeatureGateEnabled in test/extended/machine_config/helpers.go), which uses o.Expect(err).NotTo(o.HaveOccurred(), ...) to fail loudly on fetch errors rather than skip.

🔧 Suggested fix: fail loudly on fetch errors, skip only on confirmed condition
 	isMicroShift, err := exutil.IsMicroShiftCluster(oc.AdminKubeClient())
-	if err != nil {
-		framework.Logf("Failed to detect MicroShift cluster: %v", err)
-		g.Skip("Cannot verify cluster type")
-	}
+	o.Expect(err).NotTo(o.HaveOccurred(), "Failed to detect MicroShift cluster")
 	if isMicroShift {
 		g.Skip("Skipping test on MicroShift cluster - MachineConfig resources are not available")
 	}

-	// Skip on Microsoft
+	// Skip on Microsoft Azure
 	infra, err := oc.AdminConfigClient().ConfigV1().Infrastructures().Get(ctx, "cluster", metav1.GetOptions{})
-	if err != nil {
-		framework.Logf("Failed to get Infrastructure resource: %v", err)
-		g.Skip("Cannot verify platform type")
-	}
+	o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get Infrastructure resource")
 	if infra.Status.PlatformStatus != nil && infra.Status.PlatformStatus.Type == configv1.AzurePlatformType {
 		g.Skip("Skipping test on Microsoft Azure cluster")
 	}

 	// Verify AdditionalStorageConfig feature gate is enabled
 	g.By("Verifying AdditionalStorageConfig feature gate is enabled")
 	fgs, err := oc.AdminConfigClient().ConfigV1().FeatureGates().Get(ctx, "cluster", metav1.GetOptions{})
-	if err != nil {
-		framework.Logf("Failed to get FeatureGate resource: %v", err)
-		g.Skip("Cannot verify AdditionalStorageConfig feature gate requirement")
-	}
+	o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get FeatureGate resource")
🤖 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 `@test/extended/node/node_utils.go` around lines 908 - 947, Update
skipUnlessAdditionalStorageConfigEnabled to fail loudly when
IsMicroShiftCluster, Infrastructures().Get, or FeatureGates().Get returns an
error, using the established expectation pattern from
isFeatureGateEnabled/SkipWhenFeatureGateEnabled rather than g.Skip. Retain
skipping only for confirmed MicroShift, Azure, or disabled
AdditionalStorageConfig conditions.
test/extended/node/additional_storage_api.go (1)

33-493: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Significant boilerplate duplication across all 13 test cases.

Each It repeats the same mcClient construction, ObjectMeta, and MachineConfigPoolSelector scaffolding, differing only in the ContainerRuntimeConfig fields under test. A small helper that builds the base ContainerRuntimeConfig/client and accepts a mutator (or just the store-type spec) would cut this file's size substantially and make future test additions less error-prone.

♻️ Sketch of a shared helper
func newAdditionalStorageCtrCfg(name string, cfg *machineconfigv1.ContainerRuntimeConfiguration) *machineconfigv1.ContainerRuntimeConfig {
	return &machineconfigv1.ContainerRuntimeConfig{
		ObjectMeta: metav1.ObjectMeta{Name: name},
		Spec: machineconfigv1.ContainerRuntimeConfigSpec{
			MachineConfigPoolSelector: &metav1.LabelSelector{
				MatchLabels: map[string]string{
					"pools.operator.machineconfiguration.openshift.io/worker": "",
				},
			},
			ContainerRuntimeConfig: cfg,
		},
	}
}

This is a nice-to-have; the existing verbose style is consistent with other node e2e tests (e.g. test/extended/node/node_e2e/container_runtime_config.go), so treat as optional cleanup rather than a blocker.

🤖 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 `@test/extended/node/additional_storage_api.go` around lines 33 - 493, Reduce
repeated setup across the additional storage tests by introducing a shared
helper, such as newAdditionalStorageCtrCfg, that accepts the test name and
ContainerRuntimeConfiguration while constructing the common metadata and worker
MachineConfigPoolSelector. Update the 13 test cases in the Combined Additional
Stores, Additional Layer Stores, Additional Image Stores, and Additional
Artifact Stores contexts to use it; keep each test’s client creation and
validation-specific store fields unchanged.
🤖 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.

Nitpick comments:
In `@test/extended/node/additional_storage_api.go`:
- Around line 33-493: Reduce repeated setup across the additional storage tests
by introducing a shared helper, such as newAdditionalStorageCtrCfg, that accepts
the test name and ContainerRuntimeConfiguration while constructing the common
metadata and worker MachineConfigPoolSelector. Update the 13 test cases in the
Combined Additional Stores, Additional Layer Stores, Additional Image Stores,
and Additional Artifact Stores contexts to use it; keep each test’s client
creation and validation-specific store fields unchanged.

In `@test/extended/node/node_utils.go`:
- Around line 908-947: Update skipUnlessAdditionalStorageConfigEnabled to fail
loudly when IsMicroShiftCluster, Infrastructures().Get, or FeatureGates().Get
returns an error, using the established expectation pattern from
isFeatureGateEnabled/SkipWhenFeatureGateEnabled rather than g.Skip. Retain
skipping only for confirmed MicroShift, Azure, or disabled
AdditionalStorageConfig conditions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 963c6316-91bc-4607-824c-c33012a10933

📥 Commits

Reviewing files that changed from the base of the PR and between 0f64c49 and 2507d15.

📒 Files selected for processing (3)
  • test/extended/node/README.md
  • test/extended/node/additional_storage_api.go
  • test/extended/node/node_utils.go

@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 Jul 14, 2026
@BhargaviGudi

Copy link
Copy Markdown
Contributor Author

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci Bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Jul 14, 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

@BhargaviGudi

Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-ci-4.22-e2e-gcp-ovn-techpreview

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@BhargaviGudi: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.22-e2e-gcp-ovn-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/77b3d950-7fa6-11f1-896a-c1d5ee81f276-0

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

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. 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.

3 participants