diff --git a/test/e2e/configuration_test.go b/test/e2e/configuration_test.go index cae45f9c5c..b5b7e0e296 100644 --- a/test/e2e/configuration_test.go +++ b/test/e2e/configuration_test.go @@ -87,17 +87,17 @@ var _ = Describe("[cluster-ns] Configuration namespaced. Deploy cluster", func() }, 30002, )), - // Entry(newData("Multiregion, Backup and 2 users", "data/atlascluster_multiregion.yaml", - // append( - // []utils.DBUser{}, - // *utils.NewDBUser("user1"). - // WithSecretRef("dbuser-secret-u1"). - // AddRole("atlasAdmin", "admin", ""), - // *utils.NewDBUser("user2"). - // WithSecretRef("dbuser-secret-u2"). - // AddRole("atlasAdmin", "admin", ""), - // ), - // )), // TODO CLOUDP-83419 + Entry(newData("Multiregion, Backup and 2 users", "data/atlascluster_multiregion.yaml", + []model.DBUser{ + *model.NewDBUser("user1"). + WithSecretRef("dbuser-secret-u1"). + AddRole("atlasAdmin", "admin", ""), + *model.NewDBUser("user2"). + WithSecretRef("dbuser-secret-u2"). + AddRole("atlasAdmin", "admin", ""), + }, + 30004, + )), ) }) @@ -133,7 +133,6 @@ func mainCycle(clusterConfigurationFile string, resources model.UserInputs, port By("Create namespaced Operator\n", func() { CopyKustomizeNamespaceOperator(resources) - // CreateCopyKustomizeNamespace(resources.namespace) kube.Apply("-k", resources.GetOperatorFolder()) Eventually( kube.GetPodStatus(resources.Namespace), @@ -168,9 +167,9 @@ func mainCycle(clusterConfigurationFile string, resources model.UserInputs, port }) By("Deploy application for user", func() { - // // kube apply application - // // send ddata - // // retrieve data + // kube apply application + // send data + // retrieve data for i, user := range resources.Users { // TODO in parallel(?) // data port := strconv.Itoa(i + portGroup) diff --git a/test/e2e/user_input_test.go b/test/e2e/user_input_test.go index 88af1a5db8..00dd21d073 100644 --- a/test/e2e/user_input_test.go +++ b/test/e2e/user_input_test.go @@ -72,13 +72,28 @@ func compareClustersSpec(requested model.ClusterSpec, created mongodbatlas.Clust "ProviderSettings": PointTo(MatchFields(IgnoreExtras, Fields{ "InstanceSizeName": Equal(requested.ProviderSettings.InstanceSizeName), "ProviderName": Equal(string(requested.ProviderSettings.ProviderName)), - "RegionName": Equal(requested.ProviderSettings.RegionName), })), "ConnectionStrings": PointTo(MatchFields(IgnoreExtras, Fields{ "Standard": Not(BeEmpty()), "StandardSrv": Not(BeEmpty()), })), }), "Cluster should be the same as requested by the user") + + if len(requested.ReplicationSpecs) > 0 { + for i, replica := range requested.ReplicationSpecs { + for key, region := range replica.RegionsConfig { + // diffent type + ExpectWithOffset(1, created.ReplicationSpecs[i].RegionsConfig[key].AnalyticsNodes).Should(PointTo(Equal(*region.AnalyticsNodes)), "Replica Spec: AnalyticsNodes is not the same") + ExpectWithOffset(1, created.ReplicationSpecs[i].RegionsConfig[key].ElectableNodes).Should(PointTo(Equal(*region.ElectableNodes)), "Replica Spec: ElectableNodes is not the same") + ExpectWithOffset(1, created.ReplicationSpecs[i].RegionsConfig[key].Priority).Should(PointTo(Equal(*region.Priority)), "Replica Spec: Priority is not the same") + ExpectWithOffset(1, created.ReplicationSpecs[i].RegionsConfig[key].ReadOnlyNodes).Should(PointTo(Equal(*region.ReadOnlyNodes)), "Replica Spec: ReadOnlyNodes is not the same") + } + } + } else { + ExpectWithOffset(1, requested.ProviderSettings).To(PointTo(MatchFields(IgnoreExtras, Fields{ + "RegionName": Equal(created.ProviderSettings.RegionName), + })), "Cluster should be the same as requested by the user: Region Name") + } } func SaveK8sResources(resources []string, ns string) { @@ -110,9 +125,7 @@ func checkUsersAttributes(input model.UserInputs) { // CopyKustomizeNamespaceOperator create copy of `/deploy/namespaced` folder with kustomization file for overriding namespace func CopyKustomizeNamespaceOperator(input model.UserInputs) { - // fullPath := filepath.Join("data", input.projectName, "operator") fullPath := input.GetOperatorFolder() - // fullPath := filepath.Dir(projectPath) os.Mkdir(fullPath, os.ModePerm) utils.CopyFile("../../deploy/namespaced/crds.yaml", filepath.Join(fullPath, "crds.yaml")) utils.CopyFile("../../deploy/namespaced/namespaced-config.yaml", filepath.Join(fullPath, "namespaced-config.yaml"))