From 3c0be0d67a03bee25b0dfaaa58c3ce7133bd314f Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Mon, 29 Jun 2026 17:39:13 -0700 Subject: [PATCH] test: build the smoke object store with the shared store fixture Generalize the object suite's sharedstore.Create to accept the target namespace, store name, and RGW instance count instead of the hardcoded object-ns / sharedstore / single instance, then use it to stand up the SmokeSuite object store. TestObjectStorage_SmokeTest previously created its store with runObjectE2ETestLite, which applies a CephObjectStore manifest and polls for health on fixed intervals. It now builds the store through the typed-client, watch-based sharedstore fixture and tears it down with Destroy. lite-store is the only object store in the smoke namespace, so the fixture safely owns the cluster-global .rgw.root realm pool that Destroy deletes. The object suite's own call is updated to pass its namespace, "sharedstore", and one instance, preserving its existing behavior. Signed-off-by: Joshua Hoblitt --- tests/integration/ceph_object_test.go | 2 +- tests/integration/ceph_smoke_test.go | 7 +++---- .../object/util/sharedstore/sharedstore.go | 18 +++++++++--------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/integration/ceph_object_test.go b/tests/integration/ceph_object_test.go index b646346ac..0c5e9ff8e 100644 --- a/tests/integration/ceph_object_test.go +++ b/tests/integration/ceph_object_test.go @@ -211,7 +211,7 @@ func runObjectE2ETest(helper *clients.TestClient, k8sh *utils.K8sHelper, install // now test operation of the first object store testObjectStoreOperations(s, helper, k8sh, settings, storeName, swiftAndKeystone) - sharedObjectStore := sharedstore.Create(s.T(), k8sh, installer, tlsEnable, + sharedObjectStore := sharedstore.Create(s.T(), k8sh, installer, tlsEnable, settings.Namespace, "sharedstore", 1, bucketowner.Namespace, userkeys.Namespace, topickafka.Namespace, diff --git a/tests/integration/ceph_smoke_test.go b/tests/integration/ceph_smoke_test.go index 5f4f351bf..de3c31f02 100644 --- a/tests/integration/ceph_smoke_test.go +++ b/tests/integration/ceph_smoke_test.go @@ -28,6 +28,7 @@ import ( "github.com/rook/rook/tests/framework/clients" "github.com/rook/rook/tests/framework/installer" "github.com/rook/rook/tests/framework/utils" + "github.com/rook/rook/tests/integration/object/util/sharedstore" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -125,10 +126,8 @@ func (s *SmokeSuite) TestObjectStorage_SmokeTest() { if utils.IsPlatformOpenShift() { s.T().Skip("object store tests skipped on openshift") } - storeName := "lite-store" - deleteStore := true - tls := false - runObjectE2ETestLite(s.T(), s.helper, s.k8sh, s.installer, s.settings.Namespace, storeName, 2, deleteStore, tls, false) + store := sharedstore.Create(s.T(), s.k8sh, s.installer, false, s.settings.Namespace, "lite-store", 2) + store.Destroy() } // Test to make sure all rook components are installed and Running diff --git a/tests/integration/object/util/sharedstore/sharedstore.go b/tests/integration/object/util/sharedstore/sharedstore.go index e0b2d0169..5f5deff9b 100644 --- a/tests/integration/object/util/sharedstore/sharedstore.go +++ b/tests/integration/object/util/sharedstore/sharedstore.go @@ -68,17 +68,17 @@ func (s *Sharedstore) Destroy() { s.destroy() } -// Setup creates a shared CephObjectStore and its NodePort Service in -// ObjectStoreNamespace, waits for the store to become Ready, and returns a -// teardown function that deletes both resources. The teardown function should -// be deferred by the caller. -func Create(t *testing.T, k8sh *utils.K8sHelper, installer *installer.CephInstaller, tlsEnable bool, allowedNamespaces ...string) *Sharedstore { +// Create creates a CephObjectStore named storeName in namespace (with its +// realm, zone, shared pools, and NodePort Service), waits for it to become +// Ready, and returns a Sharedstore whose Destroy method tears it all down; +// Destroy should be deferred by the caller. instances sets the RGW gateway +// count and allowedNamespaces is propagated to AllowUsersInNamespaces. +func Create(t *testing.T, k8sh *utils.K8sHelper, installer *installer.CephInstaller, tlsEnable bool, namespace, storeName string, instances int32, allowedNamespaces ...string) *Sharedstore { t.Helper() s := &Sharedstore{tlsEnable: tlsEnable} ctx := context.TODO() - ns := "object-ns" - storeName := "sharedstore" + ns := namespace // securePort is the in-container RGW TLS listener port. The NodePort Service // below exposes the conventional 443 externally and forwards to it. @@ -154,7 +154,7 @@ func Create(t *testing.T, k8sh *utils.K8sHelper, installer *installer.CephInstal }, Gateway: cephv1.GatewaySpec{ Port: 80, - Instances: 1, + Instances: instances, }, AllowUsersInNamespaces: allowedNamespaces, }, @@ -166,7 +166,7 @@ func Create(t *testing.T, k8sh *utils.K8sHelper, installer *installer.CephInstal objectStore.Spec.Gateway = cephv1.GatewaySpec{ SecurePort: securePort, SSLCertificateRef: certSecretName, - Instances: 1, + Instances: instances, } }