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, } }