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 <josh@hoblitt.com>
This commit is contained in:
Joshua Hoblitt committed 2026-07-10 14:39:29 -07:00
1 parent c4ac54cea0
commit 3c0be0d67a
3 files changed
+13 -14

No files matched your search

+1 -1
View File
@@ -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,
+3 -4
View File
@@ -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
@@ -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,
}
}