diff --git a/test/c3/appframework/appframework_test.go b/test/c3/appframework/appframework_test.go index c754b8c36..9305fc081 100644 --- a/test/c3/appframework/appframework_test.go +++ b/test/c3/appframework/appframework_test.go @@ -709,7 +709,7 @@ var _ = Describe("c3appfw test", func() { // Create Single site Cluster and SHC, with App Framework enabled on SHC Deployer // Deploy the CM testenvInstance.Log.Info("Deploy Cluster manager in single site configuration") - _, err = deployment.DeployClusterMaster(deployment.GetName(), "", "") + _, err = deployment.DeployClusterMaster(deployment.GetName(), "", "", "") Expect(err).To(Succeed(), "Unable to deploy Cluster Manager") // Deploy the indexer cluster diff --git a/test/custom_resource_crud/custom_resource_crud_c3_test.go b/test/custom_resource_crud/custom_resource_crud_c3_test.go index cd6606fdc..5970c03c5 100644 --- a/test/custom_resource_crud/custom_resource_crud_c3_test.go +++ b/test/custom_resource_crud/custom_resource_crud_c3_test.go @@ -53,10 +53,11 @@ var _ = Describe("Crcrud test for SVA C3", func() { }) Context("Clustered deployment (C3 - clustered indexer, search head cluster)", func() { - It("crcrud: can deploy indexer and search head cluster, change their CR, update the instances", func() { + It("crcrud, integration, c3: can deploy indexer and search head cluster, change their CR, update the instances", func() { // Deploy Single site Cluster and Search Head Clusters - err := deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/) + mcRef := deployment.GetName() + err := deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/, mcRef) Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the Cluster Manager goes to Ready phase @@ -68,8 +69,12 @@ var _ = Describe("Crcrud test for SVA C3", func() { // Ensure Search Head Cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(mcRef, "") + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Verify RF SF is met testenv.VerifyRFSFMet(deployment, testenvInstance) @@ -130,6 +135,9 @@ var _ = Describe("Crcrud test for SVA C3", func() { // Verify Search Head go to ready state testenv.SearchHeadClusterReady(deployment, testenvInstance) + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) + // Verify CPU limits on Search Heads after updating the CR for i := 0; i < searchHeadCount; i++ { SearchHeadPodName := fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), i) @@ -139,10 +147,11 @@ var _ = Describe("Crcrud test for SVA C3", func() { }) Context("Clustered deployment (C3 - clustered indexer, search head cluster)", func() { - It("crcrud, integration: can verify IDXC, CM and SHC PVCs are correctly deleted after the CRs deletion", func() { + It("crcrud, integration, c3: can verify IDXC, CM and SHC PVCs are correctly deleted after the CRs deletion", func() { // Deploy Single site Cluster and Search Head Clusters - err := deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/) + mcRef := deployment.GetName() + err := deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/, mcRef) Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the Cluster Manager goes to Ready phase @@ -154,8 +163,12 @@ var _ = Describe("Crcrud test for SVA C3", func() { // Ensure Search Head Cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(mcRef, "") + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Verify RF SF is met testenv.VerifyRFSFMet(deployment, testenvInstance) @@ -174,21 +187,30 @@ var _ = Describe("Crcrud test for SVA C3", func() { // Delete the Search Head Cluster shc := &enterpriseApi.SearchHeadCluster{} - deployment.GetInstance(deployment.GetName()+"-shc", shc) + err = deployment.GetInstance(deployment.GetName()+"-shc", shc) + Expect(err).To(Succeed(), "Unable to GET SHC instance", "SHC Name", shc) err = deployment.DeleteCR(shc) Expect(err).To(Succeed(), "Unable to delete SHC instance", "SHC Name", shc) // Delete the Indexer Cluster idxc := &enterpriseApi.IndexerCluster{} - deployment.GetInstance(deployment.GetName()+"-idxc", idxc) + err = deployment.GetInstance(deployment.GetName()+"-idxc", idxc) + Expect(err).To(Succeed(), "Unable to GET IDXC instance", "IDXC Name", idxc) err = deployment.DeleteCR(idxc) Expect(err).To(Succeed(), "Unable to delete IDXC instance", "IDXC Name", idxc) // Delete the Cluster Manager cm := &enterpriseApi.ClusterMaster{} - deployment.GetInstance(deployment.GetName(), cm) + err = deployment.GetInstance(deployment.GetName(), cm) + Expect(err).To(Succeed(), "Unable to GET Cluster Manager instance", "Cluster Manager Name", cm) err = deployment.DeleteCR(cm) - Expect(err).To(Succeed(), "Unable to delete CM instance", "CM Name", cm) + Expect(err).To(Succeed(), "Unable to delete Cluster Manager instance", "Cluster Manger Name", cm) + + // Delete Monitoring Console + err = deployment.GetInstance(mcRef, mc) + Expect(err).To(Succeed(), "Unable to GET Monitoring Console instance", "Monitoring Console Name", mcRef) + err = deployment.DeleteCR(mc) + Expect(err).To(Succeed(), "Unable to delete Monitoring Console instance", "Monitoring Console Name", mcRef) // Verify Search Heads PVCs (etc and var) have been deleted testenv.VerifyPVCsPerDeployment(deployment, testenvInstance, "shc-search-head", 3, false, verificationTimeout) @@ -201,6 +223,9 @@ var _ = Describe("Crcrud test for SVA C3", func() { // Verify Cluster Manager PVCs (etc and var) have been deleted testenv.VerifyPVCsPerDeployment(deployment, testenvInstance, splcommon.ClusterManager, 1, false, verificationTimeout) + + // Verify Monitoring Console PVCs (etc and var) have been deleted + testenv.VerifyPVCsPerDeployment(deployment, testenvInstance, "monitoring-console", 1, false, verificationTimeout) }) }) }) diff --git a/test/custom_resource_crud/custom_resource_crud_m4_test.go b/test/custom_resource_crud/custom_resource_crud_m4_test.go index 68a1bd432..6706bbb6a 100644 --- a/test/custom_resource_crud/custom_resource_crud_m4_test.go +++ b/test/custom_resource_crud/custom_resource_crud_m4_test.go @@ -50,11 +50,12 @@ var _ = Describe("Crcrud test for SVA M4", func() { }) Context("Multisite cluster deployment (M4 - Multisite indexer cluster, Search head cluster)", func() { - It("crcrud, integration : can deploy can deploy multisite indexer and search head clusters, change their CR, update the instances", func() { + It("crcrud, integration, m4: can deploy can deploy multisite indexer and search head clusters, change their CR, update the instances", func() { // Deploy Multisite Cluster and Search Head Clusters + mcRef := deployment.GetName() siteCount := 3 - err := deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), 1, siteCount) + err := deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), 1, siteCount, mcRef) Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the cluster-manager goes to Ready phase @@ -69,8 +70,12 @@ var _ = Describe("Crcrud test for SVA M4", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(mcRef, "") + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Verify RF SF is met testenv.VerifyRFSFMet(deployment, testenvInstance) @@ -102,6 +107,12 @@ var _ = Describe("Crcrud test for SVA M4", func() { // Verify Indexers go to ready state testenv.IndexersReady(deployment, testenvInstance, siteCount) + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) + + // Verify RF SF is met + testenv.VerifyRFSFMet(deployment, testenvInstance) + // Verify CPU limits after updating the CR for i := 1; i <= siteCount; i++ { podName := fmt.Sprintf(testenv.MultiSiteIndexerPod, deployment.GetName(), i, 0) diff --git a/test/custom_resource_crud/custom_resource_crud_s1_test.go b/test/custom_resource_crud/custom_resource_crud_s1_test.go index 3607f0762..659e065b5 100644 --- a/test/custom_resource_crud/custom_resource_crud_s1_test.go +++ b/test/custom_resource_crud/custom_resource_crud_s1_test.go @@ -49,15 +49,23 @@ var _ = Describe("Crcrud test for SVA S1", func() { }) Context("Standalone deployment (S1)", func() { - It("crcrud, integration: can deploy a standalone instance, change its CR, update the instance", func() { + It("crcrud, integration, s1: can deploy a standalone instance, change its CR, update the instance", func() { // Deploy Standalone - standalone, err := deployment.DeployStandalone(deployment.GetName()) + mcRef := deployment.GetName() + standalone, err := deployment.DeployStandalone(deployment.GetName(), mcRef, "") Expect(err).To(Succeed(), "Unable to deploy standalone instance") // Verify Standalone goes to ready state testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(deployment.GetName(), "") + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) + // Verify CPU limits before updating the CR standalonePodName := fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0) testenv.VerifyCPULimits(deployment, testenvInstance.GetName(), standalonePodName, defaultCPULimits) @@ -75,6 +83,9 @@ var _ = Describe("Crcrud test for SVA S1", func() { // Verify Standalone goes to ready state testenv.VerifyStandalonePhase(deployment, testenvInstance, deployment.GetName(), splcommon.PhaseReady) + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) + // Verify CPU limits after updating the CR testenv.VerifyCPULimits(deployment, testenvInstance.GetName(), standalonePodName, newCPULimits) }) diff --git a/test/delete_cr/deletecr_test.go b/test/delete_cr/deletecr_test.go index a551459c6..de8a9c9c6 100644 --- a/test/delete_cr/deletecr_test.go +++ b/test/delete_cr/deletecr_test.go @@ -54,7 +54,7 @@ var _ = Describe("DeleteCR test", func() { Context("Multisite cluster deployment (M13 - Multisite indexer cluster, Search head cluster)", func() { It("deletecr: can deploy indexers and search head cluster", func() { - err := deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/) + err := deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/, "") Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the cluster-manager goes to Ready phase diff --git a/test/ingest_search/ingest_search_test.go b/test/ingest_search/ingest_search_test.go index 24ef0c13b..ff3f2f361 100644 --- a/test/ingest_search/ingest_search_test.go +++ b/test/ingest_search/ingest_search_test.go @@ -51,9 +51,9 @@ var _ = Describe("Ingest and Search Test", func() { }) Context("Standalone deployment (S1)", func() { - It("ingest_search, integration: can search internal logs for standalone instance", func() { + It("ingest_search, integration, s1: can search internal logs for standalone instance", func() { - standalone, err := deployment.DeployStandalone(deployment.GetName()) + standalone, err := deployment.DeployStandalone(deployment.GetName(), "", "") Expect(err).To(Succeed(), "Unable to deploy standalone instance ") // Wait for standalone to be in READY Status @@ -127,9 +127,9 @@ var _ = Describe("Ingest and Search Test", func() { }) Context("Standalone deployment (S1)", func() { - It("ingest_search, integration: can ingest custom data to new index and search", func() { + It("ingest_search, integration, s1: can ingest custom data to new index and search", func() { - standalone, err := deployment.DeployStandalone(deployment.GetName()) + standalone, err := deployment.DeployStandalone(deployment.GetName(), "", "") Expect(err).To(Succeed(), "Unable to deploy standalone instance ") // Wait for standalone to be in READY Status diff --git a/test/licensemanager/lm_c3_test.go b/test/licensemanager/lm_c3_test.go index dcfd7d205..a1bb116fb 100644 --- a/test/licensemanager/lm_c3_test.go +++ b/test/licensemanager/lm_c3_test.go @@ -49,7 +49,7 @@ var _ = Describe("Licensemanager test", func() { }) Context("Clustered deployment (C3 - clustered indexer, search head cluster)", func() { - It("licensemanager, integration: Splunk Operator can configure License Manager with Indexers and Search Heads in C3 SVA", func() { + It("licensemanager, integration, c3: Splunk Operator can configure License Manager with Indexers and Search Heads in C3 SVA", func() { // Download License File licenseFilePath, err := testenv.DownloadLicenseFromS3Bucket() @@ -58,7 +58,8 @@ var _ = Describe("Licensemanager test", func() { // Create License Config Map testenvInstance.CreateLicenseConfigMap(licenseFilePath) - err = deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/) + mcRef := deployment.GetName() + err = deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/, mcRef) Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the cluster-manager goes to Ready phase @@ -70,8 +71,12 @@ var _ = Describe("Licensemanager test", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(mcRef, deployment.GetName()) + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Verify RF SF is met testenv.VerifyRFSFMet(deployment, testenvInstance) @@ -91,6 +96,10 @@ var _ = Describe("Licensemanager test", func() { testenv.VerifyLMConfiguredOnPod(deployment, searchHeadPodName) searchHeadPodName = fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), 2) testenv.VerifyLMConfiguredOnPod(deployment, searchHeadPodName) + + // Verify LM Configured on Monitoring Console + monitoringConsolePodName := fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName(), 0) + testenv.VerifyLMConfiguredOnPod(deployment, monitoringConsolePodName) }) }) diff --git a/test/licensemanager/lm_m4_test.go b/test/licensemanager/lm_m4_test.go index 51927e7c3..810ed9186 100644 --- a/test/licensemanager/lm_m4_test.go +++ b/test/licensemanager/lm_m4_test.go @@ -43,7 +43,7 @@ var _ = Describe("Licensemanager test", func() { }) Context("Multisite cluster deployment (M4 - Multisite indexer cluster, Search head cluster)", func() { - It("licensemanager: Splunk Operator can configure license manager with indexers and search head in M4 SVA", func() { + It("licensemanager, integration, m4: Splunk Operator can configure license manager with indexers and search head in M4 SVA", func() { // Download License File licenseFilePath, err := testenv.DownloadLicenseFromS3Bucket() @@ -53,7 +53,8 @@ var _ = Describe("Licensemanager test", func() { testenvInstance.CreateLicenseConfigMap(licenseFilePath) siteCount := 3 - err = deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), 1, siteCount) + mcRef := deployment.GetName() + err = deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), 1, siteCount, mcRef) Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the cluster-manager goes to Ready phase @@ -68,8 +69,12 @@ var _ = Describe("Licensemanager test", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(mcRef, deployment.GetName()) + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Verify RF SF is met testenv.VerifyRFSFMet(deployment, testenvInstance) @@ -89,6 +94,10 @@ var _ = Describe("Licensemanager test", func() { testenv.VerifyLMConfiguredOnPod(deployment, searchHeadPodName) searchHeadPodName = fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), 2) testenv.VerifyLMConfiguredOnPod(deployment, searchHeadPodName) + + // Verify LM Configured on Monitoring Console + monitoringConsolePodName := fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName(), 0) + testenv.VerifyLMConfiguredOnPod(deployment, monitoringConsolePodName) }) }) diff --git a/test/licensemanager/lm_s1_test.go b/test/licensemanager/lm_s1_test.go index 15e81e919..b9b8f980e 100644 --- a/test/licensemanager/lm_s1_test.go +++ b/test/licensemanager/lm_s1_test.go @@ -43,7 +43,7 @@ var _ = Describe("Licensemanager test", func() { }) Context("Standalone deployment (S1) with LM", func() { - It("licensemanager: Splunk Operator can configure License Manager with Standalone in S1 SVA", func() { + It("licensemanager, integration, s1: Splunk Operator can configure License Manager with Standalone in S1 SVA", func() { // Download License File licenseFilePath, err := testenv.DownloadLicenseFromS3Bucket() @@ -53,7 +53,8 @@ var _ = Describe("Licensemanager test", func() { testenvInstance.CreateLicenseConfigMap(licenseFilePath) // Create standalone Deployment with License Manager - standalone, err := deployment.DeployStandaloneWithLM(deployment.GetName()) + mcRef := deployment.GetName() + standalone, err := deployment.DeployStandaloneWithLM(deployment.GetName(), mcRef) Expect(err).To(Succeed(), "Unable to deploy standalone instance with LM") // Wait for License Manager to be in READY status @@ -62,12 +63,20 @@ var _ = Describe("Licensemanager test", func() { // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console + mc, err := deployment.DeployMonitoringConsole(mcRef, deployment.GetName()) + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Verify LM is configured on standalone instance standalonePodName := fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0) testenv.VerifyLMConfiguredOnPod(deployment, standalonePodName) + + // Verify LM Configured on Monitoring Console + monitoringConsolePodName := fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName(), 0) + testenv.VerifyLMConfiguredOnPod(deployment, monitoringConsolePodName) }) }) }) diff --git a/test/scaling_test/scaling_test.go b/test/scaling_test/scaling_test.go index 5204de5e9..166ea4752 100644 --- a/test/scaling_test/scaling_test.go +++ b/test/scaling_test/scaling_test.go @@ -52,15 +52,12 @@ var _ = Describe("Scaling test", func() { Context("Standalone deployment (S1)", func() { It("scaling_test: Can Scale Up and Scale Down Standalone CR", func() { - standalone, err := deployment.DeployStandalone(deployment.GetName()) + standalone, err := deployment.DeployStandalone(deployment.GetName(), "", "") Expect(err).To(Succeed(), "Unable to deploy standalone instance ") // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Wait for Monitoring Console Pod to be in READY status - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Check Monitoring console is configured with all standalone instances in namespace peerList := testenv.GetConfiguredPeers(testenvInstance.GetName(), deployment.GetName()) testenvInstance.Log.Info("Peer List", "instance", peerList) @@ -83,9 +80,6 @@ var _ = Describe("Scaling test", func() { // Wait for Standalone to be in READY status testenv.VerifyStandalonePhase(deployment, testenvInstance, deployment.GetName(), splcommon.PhaseReady) - // Wait for Monitoring Console Pod to be in READY status - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Scale Down Standalone testenvInstance.Log.Info("Scaling Down Standalone CR") scaledReplicaCount = scaledReplicaCount - 1 @@ -114,7 +108,7 @@ var _ = Describe("Scaling test", func() { defaultSHReplicas := 3 defaultIndexerReplicas := 3 - err := deployment.DeploySingleSiteCluster(deployment.GetName(), defaultIndexerReplicas, true) + err := deployment.DeploySingleSiteCluster(deployment.GetName(), defaultIndexerReplicas, true, "") Expect(err).To(Succeed(), "Unable to deploy search head cluster") // Ensure that the cluster-manager goes to Ready phase @@ -126,9 +120,6 @@ var _ = Describe("Scaling test", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Wait for Monitoring Console Pod to be in READY status - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Scale Search Head Cluster scaledSHReplicas := defaultSHReplicas + 1 testenvInstance.Log.Info("Scaling up Search Head Cluster", "Current Replicas", defaultSHReplicas, "New Replicas", scaledSHReplicas) @@ -185,9 +176,6 @@ var _ = Describe("Scaling test", func() { // Adding this check in the end as SHC take the longest time to scale up due recycle of SHC members testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Wait for Monitoring Console Pod to be in READY status - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Verify New SearchHead is added to Cluster Manager searchHeadName := fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), scaledSHReplicas-1) testenvInstance.Log.Info("Checking for Search Head On CM", "Search Head Name", searchHeadName) @@ -267,7 +255,7 @@ var _ = Describe("Scaling test", func() { defaultIndexerReplicas := 1 siteCount := 3 - err := deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), defaultIndexerReplicas, siteCount) + err := deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), defaultIndexerReplicas, siteCount, "") Expect(err).To(Succeed(), "Unable to deploy search head cluster") // Ensure that the cluster-manager goes to Ready phase @@ -282,9 +270,6 @@ var _ = Describe("Scaling test", func() { // Ensure cluster configured as multisite testenv.IndexerClusterMultisiteStatus(deployment, testenvInstance, siteCount) - // Wait for Monitoring Console Pod to be in READY status - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Ingest data on Indexers for i := 1; i <= siteCount; i++ { podName := fmt.Sprintf(testenv.MultiSiteIndexerPod, deployment.GetName(), i, 0) @@ -325,9 +310,6 @@ var _ = Describe("Scaling test", func() { testenvInstance.Log.Info("Checking for Indexer On CM", "Indexer Name", indexerName) Expect(testenv.CheckIndexerOnCM(deployment, indexerName)).To(Equal(true)) - // Wait for Monitoring Console Pod to be in READY status - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Wait for RF SF is Met testenv.VerifyRFSFMet(deployment, testenvInstance) diff --git a/test/secret/secret_c3_test.go b/test/secret/secret_c3_test.go index 17b99afc9..06aa44bfb 100644 --- a/test/secret/secret_c3_test.go +++ b/test/secret/secret_c3_test.go @@ -44,7 +44,7 @@ var _ = Describe("Secret Test for SVA C3", func() { }) Context("Clustered deployment (C3 - clustered indexer, search head cluster)", func() { - It("secret, smoke: secret update on indexers and search head cluster", func() { + It("secret, smoke, c3: secret update on indexers and search head cluster", func() { /* Test Scenario 1. Update Secrets Data @@ -60,7 +60,8 @@ var _ = Describe("Secret Test for SVA C3", func() { // Create License Config Map testenvInstance.CreateLicenseConfigMap(licenseFilePath) - err = deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true) + mcRef := deployment.GetName() + err = deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true, mcRef) Expect(err).To(Succeed(), "Unable to deploy cluster") // Wait for License Manager to be in READY status @@ -75,10 +76,15 @@ var _ = Describe("Secret Test for SVA C3", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(deployment.GetName(), deployment.GetName()) + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Verify RF SF is met + testenvInstance.Log.Info("Checkin RF SF before secret change") testenv.VerifyRFSFMet(deployment, testenvInstance) // Get Current Secrets Struct @@ -110,10 +116,11 @@ var _ = Describe("Secret Test for SVA C3", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Verify RF SF is met + testenvInstance.Log.Info("Checkin RF SF after secret change") testenv.VerifyRFSFMet(deployment, testenvInstance) // Once Pods are READY check each versioned secret for updated secret keys diff --git a/test/secret/secret_m4_test.go b/test/secret/secret_m4_test.go index 5ba7d860e..68e64c65b 100644 --- a/test/secret/secret_m4_test.go +++ b/test/secret/secret_m4_test.go @@ -43,8 +43,8 @@ var _ = Describe("Secret Test for M4 SVA", func() { } }) - Context("Multisite cluster deployment (M13 - Multisite indexer cluster, Search head cluster)", func() { - It("secret, integration: secret update on multisite indexers and search head cluster", func() { + Context("Multisite cluster deployment (M4 - Multisite indexer cluster, Search head cluster)", func() { + It("secret, integration, m4: secret update on multisite indexers and search head cluster", func() { /* Test Scenario 1. Update Secrets Data @@ -61,7 +61,8 @@ var _ = Describe("Secret Test for M4 SVA", func() { testenvInstance.CreateLicenseConfigMap(licenseFilePath) siteCount := 3 - err = deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), 1, siteCount) + mcName := deployment.GetName() + err = deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), 1, siteCount, mcName) Expect(err).To(Succeed(), "Unable to deploy cluster") // Wait for License Manager to be in READY status @@ -79,8 +80,16 @@ var _ = Describe("Secret Test for M4 SVA", func() { // Ensure cluster configured as multisite testenv.IndexerClusterMultisiteStatus(deployment, testenvInstance, siteCount) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(deployment.GetName(), deployment.GetName()) + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) + + // Verify RF SF is met + testenvInstance.Log.Info("Checkin RF SF before secret change") + testenv.VerifyRFSFMet(deployment, testenvInstance) // Get Current Secrets Struct namespaceScopedSecretName := fmt.Sprintf(testenv.NamespaceScopedSecretObjectName, testenvInstance.GetName()) @@ -118,8 +127,12 @@ var _ = Describe("Secret Test for M4 SVA", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) + + // Verify RF SF is met + testenvInstance.Log.Info("Checkin RF SF after secret change") + testenv.VerifyRFSFMet(deployment, testenvInstance) // Once Pods are READY check each versioned secret for updated secret keys secretObjectNames := testenv.GetVersionedSecretNames(testenvInstance.GetName(), 2) diff --git a/test/secret/secret_s1_test.go b/test/secret/secret_s1_test.go index bc094141a..256f49091 100644 --- a/test/secret/secret_s1_test.go +++ b/test/secret/secret_s1_test.go @@ -19,7 +19,10 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + enterpriseApi "github.com/splunk/splunk-operator/pkg/apis/enterprise/v3" splcommon "github.com/splunk/splunk-operator/pkg/splunk/common" + corev1 "k8s.io/api/core/v1" + "github.com/splunk/splunk-operator/test/testenv" ) @@ -43,8 +46,8 @@ var _ = Describe("Secret Test for SVA S1", func() { } }) - Context("Standalone deployment (S1) with LM", func() { - It("secret, integration: Secret update on a standalone instance", func() { + Context("Standalone deployment (S1) with LM and MC", func() { + It("secret, integration, s1: Secret update on a standalone instance with LM and MC", func() { /* Test Scenario 1. Update Secrets Data @@ -61,7 +64,8 @@ var _ = Describe("Secret Test for SVA S1", func() { testenvInstance.CreateLicenseConfigMap(licenseFilePath) // Create standalone Deployment with License Manager - standalone, err := deployment.DeployStandaloneWithLM(deployment.GetName()) + mcName := deployment.GetName() + standalone, err := deployment.DeployStandaloneWithLM(deployment.GetName(), mcName) Expect(err).To(Succeed(), "Unable to deploy standalone instance with LM") // Wait for License Manager to be in READY status @@ -70,8 +74,12 @@ var _ = Describe("Secret Test for SVA S1", func() { // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(deployment.GetName(), deployment.GetName()) + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Get Current Secrets Struct namespaceScopedSecretName := fmt.Sprintf(testenv.NamespaceScopedSecretObjectName, testenvInstance.GetName()) @@ -96,8 +104,8 @@ var _ = Describe("Secret Test for SVA S1", func() { // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Once Pods are READY check each versioned secret for updated secret keys secretObjectNames := testenv.GetVersionedSecretNames(testenvInstance.GetName(), 2) @@ -123,8 +131,8 @@ var _ = Describe("Secret Test for SVA S1", func() { }) }) - Context("Standalone deployment (S1) with LM", func() { - It("secret: Secret Object is recreated on delete and new secrets are applied to Splunk Pods", func() { + Context("Standalone deployment (S1) with LM amd MC", func() { + It("secret, integration, s1: Secret Object is recreated on delete and new secrets are applied to Splunk Pods", func() { /* Test Scenario 1. Delete Secret Object @@ -141,7 +149,8 @@ var _ = Describe("Secret Test for SVA S1", func() { testenvInstance.CreateLicenseConfigMap(licenseFilePath) // Create standalone Deployment with License Manager - standalone, err := deployment.DeployStandaloneWithLM(deployment.GetName()) + mcName := deployment.GetName() + standalone, err := deployment.DeployStandaloneWithLM(deployment.GetName(), mcName) Expect(err).To(Succeed(), "Unable to deploy standalone instance with LM") // Wait for License Manager to be in READY status @@ -150,8 +159,12 @@ var _ = Describe("Secret Test for SVA S1", func() { // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(deployment.GetName(), deployment.GetName()) + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console One instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Get Current Secrets Struct namespaceScopedSecretName := fmt.Sprintf(testenv.NamespaceScopedSecretObjectName, testenvInstance.GetName()) @@ -172,8 +185,8 @@ var _ = Describe("Secret Test for SVA S1", func() { // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Once Pods are READY check each versioned secret for updated secret keys secretObjectNames := testenv.GetVersionedSecretNames(testenvInstance.GetName(), 2) @@ -199,7 +212,7 @@ var _ = Describe("Secret Test for SVA S1", func() { }) Context("Standalone deployment (S1)", func() { - It("secret, smoke: Secret Object data is repopulated in secret object on passing empty Data map and new secrets are applied to Splunk Pods", func() { + It("secret, smoke, s1: Secret Object data is repopulated in secret object on passing empty Data map and new secrets are applied to Splunk Pods", func() { /* Test Scenario 1. Delete Secret Passing Empty Data Map to secret Object @@ -208,15 +221,31 @@ var _ = Describe("Secret Test for SVA S1", func() { 4. Verify New Secrets are present in server.conf (Pass4SymmKey) 5. Verify New Secrets via api access (password)*/ - // Create standalone Deployment with License Manager - standalone, err := deployment.DeployStandalone(deployment.GetName()) - Expect(err).To(Succeed(), "Unable to deploy standalone instance with LM") + // Create standalone Deployment with MonitoringConsoleRef + mcName := deployment.GetName() + standaloneSpec := enterpriseApi.StandaloneSpec{ + CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ + Spec: splcommon.Spec{ + ImagePullPolicy: "IfNotPresent", + }, + Volumes: []corev1.Volume{}, + MonitoringConsoleRef: corev1.ObjectReference{ + Name: mcName, + }, + }, + } + standalone, err := deployment.DeployStandaloneWithGivenSpec(deployment.GetName(), standaloneSpec) + Expect(err).To(Succeed(), "Unable to deploy standalone instance with MonitoringConsoleRef") // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Deploy Monitoring Console CRD + mc, err := deployment.DeployMonitoringConsole(deployment.GetName(), "") + Expect(err).To(Succeed(), "Unable to deploy Monitoring Console instance") + + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Get Current Secrets Struct namespaceScopedSecretName := fmt.Sprintf(testenv.NamespaceScopedSecretObjectName, testenvInstance.GetName()) @@ -234,8 +263,8 @@ var _ = Describe("Secret Test for SVA S1", func() { // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) + // Verify Monitoring Console is Ready and stays in ready state + testenv.VerifyMonitoringConsoleReady(deployment, deployment.GetName(), mc, testenvInstance) // Once Pods are READY check each versioned secret for updated secret keys secretObjectNames := testenv.GetVersionedSecretNames(testenvInstance.GetName(), 2) diff --git a/test/smoke/smoke_test.go b/test/smoke/smoke_test.go index 47c2c9ebe..7d7b68df9 100644 --- a/test/smoke/smoke_test.go +++ b/test/smoke/smoke_test.go @@ -47,23 +47,20 @@ var _ = Describe("Smoke test", func() { }) Context("Standalone deployment (S1)", func() { - It("smoke, basic: can deploy a standalone instance", func() { + It("smoke, basic, s1: can deploy a standalone instance", func() { - standalone, err := deployment.DeployStandalone(deployment.GetName()) + standalone, err := deployment.DeployStandalone(deployment.GetName(), "", "") Expect(err).To(Succeed(), "Unable to deploy standalone instance ") // Verify standalone goes to ready state testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) }) }) Context("Clustered deployment (C3 - clustered indexer, search head cluster)", func() { - It("smoke, basic: can deploy indexers and search head cluster", func() { + It("smoke, basic, c3: can deploy indexers and search head cluster", func() { - err := deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/) + err := deployment.DeploySingleSiteCluster(deployment.GetName(), 3, true /*shc*/, "") Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the cluster-manager goes to Ready phase @@ -75,19 +72,16 @@ var _ = Describe("Smoke test", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Verify RF SF is met testenv.VerifyRFSFMet(deployment, testenvInstance) }) }) - Context("Multisite cluster deployment (M13 - Multisite indexer cluster, Search head cluster)", func() { - It("smoke, basic: can deploy indexers and search head cluster", func() { + Context("Multisite cluster deployment (M4 - Multisite indexer cluster, Search head cluster)", func() { + It("smoke, basic, m4: can deploy indexers and search head cluster", func() { siteCount := 3 - err := deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), 1, siteCount) + err := deployment.DeployMultisiteClusterWithSearchHead(deployment.GetName(), 1, siteCount, "") Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the cluster-manager goes to Ready phase @@ -102,9 +96,6 @@ var _ = Describe("Smoke test", func() { // Ensure search head cluster go to Ready phase testenv.SearchHeadClusterReady(deployment, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Verify RF SF is met testenv.VerifyRFSFMet(deployment, testenvInstance) }) @@ -114,7 +105,7 @@ var _ = Describe("Smoke test", func() { It("smoke, basic: can deploy multisite indexers cluster", func() { siteCount := 3 - err := deployment.DeployMultisiteCluster(deployment.GetName(), 1, siteCount) + err := deployment.DeployMultisiteCluster(deployment.GetName(), 1, siteCount, "") Expect(err).To(Succeed(), "Unable to deploy cluster") // Ensure that the cluster-manager goes to Ready phase @@ -126,16 +117,13 @@ var _ = Describe("Smoke test", func() { // Ensure cluster configured as multisite testenv.IndexerClusterMultisiteStatus(deployment, testenvInstance, siteCount) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Verify RF SF is met testenv.VerifyRFSFMet(deployment, testenvInstance) }) }) Context("Standalone deployment (S1) with Service Account", func() { - It("smoke, basic: can deploy a standalone instance attached to a service account", func() { + It("smoke, basic, s1: can deploy a standalone instance attached to a service account", func() { // Create Service Account serviceAccountName := "smoke-service-account" testenvInstance.CreateServiceAccount(serviceAccountName) @@ -157,9 +145,6 @@ var _ = Describe("Smoke test", func() { // Wait for Standalone to be in READY status testenv.StandaloneReady(deployment, deployment.GetName(), standalone, testenvInstance) - // Verify MC Pod is Ready - // testenv.MCPodReady(testenvInstance.GetName(), deployment) - // Verify serviceAccount is configured on Pod standalonePodName := fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0) testenv.VerifyServiceAccountConfiguredOnPod(deployment, testenvInstance.GetName(), standalonePodName, serviceAccountName) diff --git a/test/testenv/deployment.go b/test/testenv/deployment.go index 2bf3c1efd..86a3d7a4a 100644 --- a/test/testenv/deployment.go +++ b/test/testenv/deployment.go @@ -91,8 +91,23 @@ func (d *Deployment) Teardown() error { } // DeployStandalone deploys a standalone splunk enterprise instance on the specified testenv -func (d *Deployment) DeployStandalone(name string) (*enterpriseApi.Standalone, error) { +func (d *Deployment) DeployStandalone(name string, mcRef string, licenseMaster string) (*enterpriseApi.Standalone, error) { standalone := newStandalone(name, d.testenv.namespace) + + // If license file specified, deploy License Manager + if licenseMaster != "" && d.testenv.licenseFilePath != "" { + // Deploy the license manager + _, err := d.DeployLicenseManager(name) + if err != nil { + return nil, err + } + licenseMaster = name + } + if mcRef != "" { + standalone.Spec.MonitoringConsoleRef = corev1.ObjectReference{ + Name: mcRef, + } + } deployed, err := d.deployCR(name, standalone) if err != nil { return nil, err @@ -194,9 +209,14 @@ func (d *Deployment) DeployLicenseManager(name string) (*enterpriseApi.LicenseMa } //DeployClusterMaster deploys the cluster manager -func (d *Deployment) DeployClusterMaster(name, licenseMasterName string, ansibleConfig string) (*enterpriseApi.ClusterMaster, error) { +func (d *Deployment) DeployClusterMaster(name, licenseMasterName string, ansibleConfig string, mcRef string) (*enterpriseApi.ClusterMaster, error) { d.testenv.Log.Info("Deploying "+splcommon.ClusterManager, "name", name) cm := newClusterMaster(name, d.testenv.namespace, licenseMasterName, ansibleConfig) + if mcRef != "" { + cm.Spec.MonitoringConsoleRef = corev1.ObjectReference{ + Name: mcRef, + } + } deployed, err := d.deployCR(name, cm) if err != nil { return nil, err @@ -227,10 +247,15 @@ func (d *Deployment) DeployIndexerCluster(name, licenseMasterName string, count } // DeploySearchHeadCluster deploys a search head cluster -func (d *Deployment) DeploySearchHeadCluster(name, clusterMasterRef, licenseMasterName string, ansibleConfig string) (*enterpriseApi.SearchHeadCluster, error) { +func (d *Deployment) DeploySearchHeadCluster(name, clusterMasterRef, licenseMasterName string, ansibleConfig string, mcRef string) (*enterpriseApi.SearchHeadCluster, error) { d.testenv.Log.Info("Deploying search head cluster", "name", name) - indexer := newSearchHeadCluster(name, d.testenv.namespace, clusterMasterRef, licenseMasterName, ansibleConfig) - deployed, err := d.deployCR(name, indexer) + sh := newSearchHeadCluster(name, d.testenv.namespace, clusterMasterRef, licenseMasterName, ansibleConfig) + if mcRef != "" { + sh.Spec.MonitoringConsoleRef = corev1.ObjectReference{ + Name: mcRef, + } + } + deployed, err := d.deployCR(name, sh) return deployed.(*enterpriseApi.SearchHeadCluster), err } @@ -299,7 +324,7 @@ func (d *Deployment) DeleteCR(cr runtime.Object) error { } // DeploySingleSiteCluster deploys a lm and indexer cluster (shc optional) -func (d *Deployment) DeploySingleSiteCluster(name string, indexerReplicas int, shc bool) error { +func (d *Deployment) DeploySingleSiteCluster(name string, indexerReplicas int, shc bool, mcRef string) error { var licenseMaster string @@ -315,7 +340,7 @@ func (d *Deployment) DeploySingleSiteCluster(name string, indexerReplicas int, s } // Deploy the cluster manager - _, err := d.DeployClusterMaster(name, licenseMaster, "") + _, err := d.DeployClusterMaster(name, licenseMaster, "", mcRef) if err != nil { return err } @@ -328,7 +353,7 @@ func (d *Deployment) DeploySingleSiteCluster(name string, indexerReplicas int, s // Deploy the SH cluster if shc { - _, err = d.DeploySearchHeadCluster(name+"-shc", name, licenseMaster, "") + _, err = d.DeploySearchHeadCluster(name+"-shc", name, licenseMaster, "", mcRef) if err != nil { return err } @@ -338,7 +363,7 @@ func (d *Deployment) DeploySingleSiteCluster(name string, indexerReplicas int, s } // DeployMultisiteClusterWithSearchHead deploys a lm, cluster-manager, indexers in multiple sites and SH clusters -func (d *Deployment) DeployMultisiteClusterWithSearchHead(name string, indexerReplicas int, siteCount int) error { +func (d *Deployment) DeployMultisiteClusterWithSearchHead(name string, indexerReplicas int, siteCount int, mcRef string) error { var licenseMaster string @@ -366,7 +391,7 @@ func (d *Deployment) DeployMultisiteClusterWithSearchHead(name string, indexerRe search_factor: 2 replication_factor: 2 ` - _, err := d.DeployClusterMaster(name, licenseMaster, defaults) + _, err := d.DeployClusterMaster(name, licenseMaster, defaults, mcRef) if err != nil { return err } @@ -388,7 +413,7 @@ func (d *Deployment) DeployMultisiteClusterWithSearchHead(name string, indexerRe multisite_master: splunk-%s-%s-service site: site0 `, name, splcommon.ClusterManager) - _, err = d.DeploySearchHeadCluster(name+"-shc", name, licenseMaster, siteDefaults) + _, err = d.DeploySearchHeadCluster(name+"-shc", name, licenseMaster, siteDefaults, mcRef) if err != nil { return err } @@ -397,7 +422,7 @@ func (d *Deployment) DeployMultisiteClusterWithSearchHead(name string, indexerRe } // DeployMultisiteCluster deploys a lm, cluster-manager, indexers in multiple sites -func (d *Deployment) DeployMultisiteCluster(name string, indexerReplicas int, siteCount int) error { +func (d *Deployment) DeployMultisiteCluster(name string, indexerReplicas int, siteCount int, mcRef string) error { var licenseMaster string @@ -425,7 +450,7 @@ func (d *Deployment) DeployMultisiteCluster(name string, indexerReplicas int, si search_factor: 2 replication_factor: 2 ` - _, err := d.DeployClusterMaster(name, licenseMaster, defaults) + _, err := d.DeployClusterMaster(name, licenseMaster, defaults, mcRef) if err != nil { return err } @@ -447,7 +472,7 @@ func (d *Deployment) DeployMultisiteCluster(name string, indexerReplicas int, si } // DeployStandaloneWithLM deploys a standalone splunk enterprise instance with license manager on the specified testenv -func (d *Deployment) DeployStandaloneWithLM(name string) (*enterpriseApi.Standalone, error) { +func (d *Deployment) DeployStandaloneWithLM(name string, mcRef string) (*enterpriseApi.Standalone, error) { var licenseMaster string // If license file specified, deploy License Manager @@ -461,6 +486,11 @@ func (d *Deployment) DeployStandaloneWithLM(name string) (*enterpriseApi.Standal } standalone := newStandaloneWithLM(name, d.testenv.namespace, licenseMaster) + if mcRef != "" { + standalone.Spec.MonitoringConsoleRef = corev1.ObjectReference{ + Name: mcRef, + } + } deployed, err := d.deployCR(name, standalone) if err != nil { return nil, err @@ -550,7 +580,7 @@ func (d *Deployment) DeployMultisiteClusterWithSearchHeadAndIndexes(name string, multisite_master: splunk-%s-%s-service site: site0 `, name, splcommon.ClusterManager) - _, err = d.DeploySearchHeadCluster(name+"-shc", name, licenseMaster, siteDefaults) + _, err = d.DeploySearchHeadCluster(name+"-shc", name, licenseMaster, siteDefaults, "") return err } diff --git a/test/testenv/verificationutils.go b/test/testenv/verificationutils.go index 4b57d12e3..17c4fa688 100644 --- a/test/testenv/verificationutils.go +++ b/test/testenv/verificationutils.go @@ -168,7 +168,7 @@ func ClusterManagerReady(deployment *Deployment, testenvInstance *TestEnv) { if err != nil { return splcommon.PhaseError } - testenvInstance.Log.Info("Waiting for "+splcommon.ClusterManager+"instance status to be ready", "instance", cm.ObjectMeta.Name, "Phase", cm.Status.Phase) + testenvInstance.Log.Info("Waiting for "+splcommon.ClusterManager+" instance status to be ready", "instance", cm.ObjectMeta.Name, "Phase", cm.Status.Phase) DumpGetPods(testenvInstance.GetName()) // Test ClusterManager Phase to see if its ready return cm.Status.Phase