diff --git a/test/appframework_az/c3/appframework_azure_test.go b/test/appframework_az/c3/appframework_azure_test.go index 23e594238..8d3df96cf 100644 --- a/test/appframework_az/c3/appframework_azure_test.go +++ b/test/appframework_az/c3/appframework_azure_test.go @@ -59,7 +59,6 @@ var _ = Describe("c3appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console * Create app source for Monitoring Console * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload V1 apps to Azure for Indexer Cluster and Search Head Cluster @@ -87,46 +86,12 @@ var _ = Describe("c3appfw test", func() { */ //################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console + // Upload V1 apps to Azure for Indexer Cluster appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "c3appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Prepare Monitoring Console spec with its own app source - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Upload V1 apps to Azure for Indexer Cluster - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) azTestDirIdxc = "c3appfw-idxc-" + testenv.RandomDNSName(4) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -146,13 +111,12 @@ var _ = Describe("c3appfw test", func() { appFrameworkSpecShc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, azTestDirShc, 60) // get revision number of the resource - resourceVersion := testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) // Deploy C3 CRD testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster with Search Head Cluster") indexerReplicas := 3 shReplicas := 3 - cm, _, shc, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, mcName, "") + cm, _, shc, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, "", "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster with Search Head Cluster") @@ -162,8 +126,6 @@ var _ = Describe("c3appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - Expect(testcaseEnvInst.VerifyMCVersionChangedAndReady(ctx, deployment, mc, resourceVersion)).To(Succeed(), "MC version not changed or not ready") - // Verify no SH in disconnected status is present on CM Expect(testcaseEnvInst.VerifyNoDisconnectedSHPresentOnCM(ctx, deployment)).To(Succeed(), "Disconnected SH found on CM") @@ -176,11 +138,9 @@ var _ = Describe("c3appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), indexerReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterMasterPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: indexerReplicas, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -195,7 +155,6 @@ var _ = Describe("c3appfw test", func() { uploadedApps = nil // get revision number of the resource - resourceVersion = testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) // Upload V2 apps to Azure for Indexer Cluster appVersion = "V2" @@ -211,13 +170,6 @@ var _ = Describe("c3appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V2 apps to Azure for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - //uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList) @@ -227,8 +179,6 @@ var _ = Describe("c3appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - Expect(testcaseEnvInst.VerifyMCVersionChangedAndReady(ctx, deployment, mc, resourceVersion)).To(Succeed(), "MC version not changed or not ready") - // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -239,10 +189,7 @@ var _ = Describe("c3appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV2 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV2 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -257,7 +204,6 @@ var _ = Describe("c3appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V2 apps to Azure for Monitoring Console * Create app source for Monitoring Console * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload V2 apps to Azure for Indexer Cluster and Search Head Cluster @@ -285,10 +231,8 @@ var _ = Describe("c3appfw test", func() { */ //################## SETUP #################### - // Upload V2 apps to Azure for Monitoring Console appVersion := "V2" appFileList := testenv.GetAppFileList(appListV2) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) azTestDirMC := "c3appfw-mc-" + testenv.RandomDNSName(4) uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) @@ -343,13 +287,12 @@ var _ = Describe("c3appfw test", func() { appFrameworkSpecShc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, azTestDirShc, 60) // get revision number of the resource - resourceVersion := testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) // Deploy C3 CRD testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster with Search Head Cluster") indexerReplicas := 3 shReplicas := 3 - cm, _, shc, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, mcName, "") + cm, _, shc, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, "", "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster with Search Head Cluster") @@ -359,8 +302,6 @@ var _ = Describe("c3appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - Expect(testcaseEnvInst.VerifyMCVersionChangedAndReady(ctx, deployment, mc, resourceVersion)).To(Succeed(), "MC version not changed or not ready") - // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -370,11 +311,9 @@ var _ = Describe("c3appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), indexerReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterMasterPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: "V2", CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: indexerReplicas, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: "V2", CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: "V2", CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -389,7 +328,6 @@ var _ = Describe("c3appfw test", func() { uploadedApps = nil // get revision number of the resource - resourceVersion = testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) // Upload V1 apps to Azure for Indexer Cluster appVersion = "V1" @@ -405,8 +343,6 @@ var _ = Describe("c3appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V1 apps to Azure for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -420,8 +356,6 @@ var _ = Describe("c3appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - Expect(testcaseEnvInst.VerifyMCVersionChangedAndReady(ctx, deployment, mc, resourceVersion)).To(Succeed(), "MC version not changed or not ready") - // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -432,10 +366,7 @@ var _ = Describe("c3appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV1 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV1) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV1 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV1) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -1522,7 +1453,6 @@ var _ = Describe("c3appfw test", func() { It("integration, c3azure, masterappframeworkazurec3, appframeworkazure: can deploy a C3 SVA with App Framework enabled for manual update", NodeTimeout(testenv.LongTimeout), func(ctx SpecContext) { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console * Create app source for Monitoring Console * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload V1 apps to Azure @@ -1553,10 +1483,8 @@ var _ = Describe("c3appfw test", func() { */ // ################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) azTestDirMC := "c3appfw-mc-" + testenv.RandomDNSName(4) uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) @@ -1611,7 +1539,7 @@ var _ = Describe("c3appfw test", func() { indexerReplicas := 3 shReplicas := 3 testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster") - cm, _, shc, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, mcName, "") + cm, _, shc, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, "", "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster with App Framework") // Ensure C3 cluster is ready @@ -1632,11 +1560,9 @@ var _ = Describe("c3appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterMasterPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: indexerReplicas, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -1663,8 +1589,6 @@ var _ = Describe("c3appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V2 apps to Azure for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1742,10 +1666,7 @@ var _ = Describe("c3appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV2 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV2 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -2149,7 +2070,6 @@ var _ = Describe("c3appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console * Create app source for Monitoring Console * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload big-size app to Azure for Indexer Cluster and Search Head Cluster @@ -2163,10 +2083,8 @@ var _ = Describe("c3appfw test", func() { */ //################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) azTestDirMC := "c3appfw-mc-" + testenv.RandomDNSName(4) uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) @@ -2231,7 +2149,7 @@ var _ = Describe("c3appfw test", func() { // Deploy C3 CRD testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster with Search Head Cluster") indexerReplicas := 3 - cm, _, _, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, mcName, "") + cm, _, _, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, "", "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster with Search Head Cluster") // Verify App installation is in progress on Cluster Manager @@ -2279,7 +2197,6 @@ var _ = Describe("c3appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console * Create app source for Monitoring Console * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload big-size app to Azure for Indexer Cluster and Search Head Cluster @@ -2293,10 +2210,8 @@ var _ = Describe("c3appfw test", func() { */ //################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) azTestDirMC := "c3appfw-mc-" + testenv.RandomDNSName(4) uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) @@ -2362,7 +2277,7 @@ var _ = Describe("c3appfw test", func() { testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster with Search Head Cluster") indexerReplicas := 3 shReplicas := 3 - cm, _, shc, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, mcName, "") + cm, _, shc, err := deployment.DeploySingleSiteClusterMasterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, "", "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster with Search Head Cluster") Expect(testcaseEnvInst.VerifyAppState(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList, enterpriseApi.AppPkgInstallComplete, enterpriseApi.AppPkgPodCopyComplete, testenv.AppStateVerificationTimeout)).To(Succeed(), "App state verification failed") diff --git a/test/appframework_az/c3/manager_appframework_azure_test.go b/test/appframework_az/c3/manager_appframework_azure_test.go index b5b27eb21..91a5065b6 100644 --- a/test/appframework_az/c3/manager_appframework_azure_test.go +++ b/test/appframework_az/c3/manager_appframework_azure_test.go @@ -58,9 +58,6 @@ var _ = Describe("c3appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console - * Create app source for Monitoring Console - * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload V1 apps to Azure for Indexer Cluster and Search Head Cluster * Create app sources for Cluster Manager and Deployer * Prepare and deploy C3 CRD with app framework and wait for the pods to be ready @@ -71,10 +68,10 @@ var _ = Describe("c3appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify V1 apps are copied, installed on Monitoring Console and on Search Heads and Indexers pods + * Verify V1 apps are copied and installed on Search Heads and Indexers pods ############### UPGRADE APPS ################ * Upload V2 apps on Azure - * Wait for Monitoring Console and C3 pods to be ready + * Wait for C3 pods to be ready ############ FINAL VERIFICATIONS ############ * Verify Apps are Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info @@ -82,49 +79,16 @@ var _ = Describe("c3appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify V2 apps are copied and upgraded on Monitoring Console and on Search Heads and Indexers pods + * Verify V2 apps are copied and upgraded on Search Heads and Indexers pods */ //################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console + // Upload V1 apps to Azure for Indexer Cluster appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "c3appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Prepare Monitoring Console spec with its own app source - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Upload V1 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) azTestDirIdxc = "c3appfw-idxc-" + testenv.RandomDNSName(4) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -143,14 +107,11 @@ var _ = Describe("c3appfw test", func() { appFrameworkSpecIdxc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameIdxc, enterpriseApi.ScopeCluster, appSourceNameIdxc, azTestDirIdxc, 60) appFrameworkSpecShc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, azTestDirShc, 60) - // get revision number of the resource - resourceVersion := testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) - // Deploy C3 CRD testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster with Search Head Cluster") indexerReplicas := 3 shReplicas := 3 - cm, _, shc, err := deployment.DeploySingleSiteClusterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, mcName, "") + cm, _, shc, err := deployment.DeploySingleSiteClusterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, "", "") Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster with Search Head Cluster") @@ -160,8 +121,6 @@ var _ = Describe("c3appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - Expect(testcaseEnvInst.VerifyMCVersionChangedAndReady(ctx, deployment, mc, resourceVersion)).To(Succeed(), "MC version not changed or not ready") - // Verify no SH in disconnected status is present on CM Expect(testcaseEnvInst.VerifyNoDisconnectedSHPresentOnCM(ctx, deployment)).To(Succeed(), "Disconnected SH found on CM") @@ -174,11 +133,9 @@ var _ = Describe("c3appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), indexerReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: indexerReplicas, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -192,9 +149,6 @@ var _ = Describe("c3appfw test", func() { Expect(azureBlobClient.DeleteFilesOnAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, uploadedApps)).To(Succeed(), "Azure file deletion failed") uploadedApps = nil - // get revision number of the resource - resourceVersion = testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) - // Upload V2 apps to Azure for Indexer Cluster appVersion = "V2" appFileList = testenv.GetAppFileList(appListV2) @@ -209,13 +163,6 @@ var _ = Describe("c3appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V2 apps to Azure for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - //uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList) @@ -225,8 +172,6 @@ var _ = Describe("c3appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - Expect(testcaseEnvInst.VerifyMCVersionChangedAndReady(ctx, deployment, mc, resourceVersion)).To(Succeed(), "MC version not changed or not ready") - // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -237,10 +182,7 @@ var _ = Describe("c3appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV2 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV2 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") diff --git a/test/appframework_az/m4/appframework_azure_test.go b/test/appframework_az/m4/appframework_azure_test.go index 09d79dae2..70b8cb03a 100644 --- a/test/appframework_az/m4/appframework_azure_test.go +++ b/test/appframework_az/m4/appframework_azure_test.go @@ -27,7 +27,6 @@ import ( enterpriseApi "github.com/splunk/splunk-operator/api/v4" splcommon "github.com/splunk/splunk-operator/pkg/splunk/common" testenv "github.com/splunk/splunk-operator/test/testenv" - corev1 "k8s.io/api/core/v1" ) var _ = Describe("m4appfw test", func() { @@ -67,9 +66,6 @@ var _ = Describe("m4appfw test", func() { /* Test Steps ################## SETUP ################## - * Upload V1 apps to Azure for Monitoring Console - * Create app source for Monitoring Console - * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload V1 apps to Azure for Indexer Cluster and Search Head Cluster * Prepare and deploy M4 CRD with app framework and wait for the pods to be ready ########## INITIAL VERIFICATIONS ########## @@ -79,10 +75,10 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and installed on Monitoring Console and on Search Heads and Indexers pods + * Verify apps are copied and installed on Search Heads and Indexers pods ############# UPGRADE APPS ################ * Upgrade apps in app sources - * Wait for Monitoring Console and M4 pod to be ready + * Wait for M4 pod to be ready ########## UPGRADE VERIFICATIONS ########## * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info @@ -90,46 +86,15 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and upgraded on Monitoring Console and on Search Heads and Indexers pods + * Verify apps are copied and upgraded on Search Heads and Indexers pods */ //################## SETUP ################## - // Upload V1 apps to Azure for Monitoring Console + // Upload V1 apps to Azure for Indexer Cluster appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework Spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - volumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, volumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Upload V1 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -145,15 +110,12 @@ var _ = Describe("m4appfw test", func() { appFrameworkSpecIdxc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameIdxc, enterpriseApi.ScopeCluster, appSourceNameIdxc, azTestDirIdxc, 60) appFrameworkSpecShc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, azTestDirShc, 60) - // get revision number of the resource - resourceVersion := testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) - // Deploy M4 CRD testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster with Search Head Cluster") siteCount := 3 shReplicas := 3 indexersPerSite := 1 - cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework") @@ -163,8 +125,6 @@ var _ = Describe("m4appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - Expect(testcaseEnvInst.VerifyMCVersionChangedAndReady(ctx, deployment, mc, resourceVersion)).To(Succeed(), "MC version not changed or not ready") - // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -174,11 +134,9 @@ var _ = Describe("m4appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: indexersPerSite, CrMultisite: true, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -206,12 +164,6 @@ var _ = Describe("m4appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V2 apps for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList) @@ -221,12 +173,6 @@ var _ = Describe("m4appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - // Verify MC is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -237,10 +183,7 @@ var _ = Describe("m4appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV2 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV2 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -255,9 +198,6 @@ var _ = Describe("m4appfw test", func() { /* Test Steps ################## SETUP ################## - * Upload V2 apps to Azure for Monitoring Console - * Create app source for Monitoring Console - * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload V2 apps to Azure for Indexer Cluster and Search Head Cluster * Prepare and deploy M4 CRD with app framework and wait for the pods to be ready ########## INITIAL VERIFICATIONS ########## @@ -267,10 +207,10 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and installed on Monitoring Console and on Search Heads and Indexers pods + * Verify apps are copied and installed on Search Heads and Indexers pods ############ DOWNGRADE APPS ############### * Downgrade apps in app sources - * Wait for Monitoring Console and M4 to be ready + * Wait for M4 to be ready ########## DOWNGRADE VERIFICATIONS ######## * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info @@ -278,46 +218,15 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and downgraded on Monitoring Console and on Search Heads and Indexers pods + * Verify apps are copied and downgraded on Search Heads and Indexers pods */ //################## SETUP ################## - // Upload V2 version of apps to Azure for Monitoring Console + // Upload V2 version of apps to Azure for Indexer Cluster appVersion := "V2" appFileList := testenv.GetAppFileList(appListV2) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework Spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - volumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, volumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console instance") - - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Upload V2 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirIdxc, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -338,7 +247,7 @@ var _ = Describe("m4appfw test", func() { siteCount := 3 shReplicas := 3 indexersPerSite := 1 - cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework") @@ -348,9 +257,6 @@ var _ = Describe("m4appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -360,11 +266,9 @@ var _ = Describe("m4appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV2, CrAppFileList: appFileList, CrReplicas: indexersPerSite, CrMultisite: true, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV2, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV2, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -393,12 +297,6 @@ var _ = Describe("m4appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V1 apps to Azure for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList) @@ -408,9 +306,6 @@ var _ = Describe("m4appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -421,10 +316,7 @@ var _ = Describe("m4appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV1 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV1) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV1 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV1) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -449,10 +341,10 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and installed on Monitoring Console and also on Search Heads and Indexers pods + * Verify apps are copied and installed on Search Heads and Indexers pods ############### SCALING UP ################ * Scale up Indexers and Search Head Cluster - * Wait for Monitoring Console and M4 to be ready + * Wait for M4 to be ready ######### SCALING UP VERIFICATIONS ######## * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info @@ -463,7 +355,7 @@ var _ = Describe("m4appfw test", func() { * Verify apps are copied and installed on new Search Heads and Indexers pods ############### SCALING DOWN ############## * Scale down Indexers and Search Head Cluster - * Wait for Monitoring Console and M4 to be ready + * Wait for M4 to be ready ######### SCALING DOWN VERIFICATIONS ###### * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info @@ -811,7 +703,6 @@ var _ = Describe("m4appfw test", func() { It("integration, m4azure, masterappframeworkazurem4, appframeworkazure: can deploy a M4 SVA with App Framework enabled for manual poll", NodeTimeout(testenv.MediumLongTimeout), func(ctx SpecContext) { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console * Create app source for Monitoring Console * Prepare and deploy Monitoring Console with app framework and wait for the pod to be ready * Upload V1 apps to Azure @@ -842,42 +733,11 @@ var _ = Describe("m4appfw test", func() { */ // ################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console + // Upload V1 apps to Azure for Indexer Cluster appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework Spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - volumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, volumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 0) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Upload V1 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -897,19 +757,14 @@ var _ = Describe("m4appfw test", func() { shReplicas := 3 indexersPerSite := 1 testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster") - cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster with App Framework") // Ensure M4 cluster is ready Expect(testcaseEnvInst.VerifyM4ClusterReady(ctx, deployment, siteCount, testcaseEnvInst.VerifyClusterManagerReady)).To(Succeed(), "M4 cluster not ready") // Verify RF SF is met - Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Get Pod age to check for pod resets later + Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) //########## INITIAL VERIFICATIONS ########## @@ -918,11 +773,9 @@ var _ = Describe("m4appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: indexersPerSite, CrMultisite: true, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -945,25 +798,14 @@ var _ = Describe("m4appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V2 apps to Azure for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Check for changes in App phase to determine if next poll has been triggered + testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList) // Ensure M4 cluster is ready Expect(testcaseEnvInst.VerifyM4ClusterReady(ctx, deployment, siteCount, testcaseEnvInst.VerifyClusterManagerReady)).To(Succeed(), "M4 cluster not ready") // Verify RF SF is met - Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // ############ VERIFICATION APPS ARE NOT UPDATED BEFORE ENABLING MANUAL POLL ############ + Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") // ############ VERIFICATION APPS ARE NOT UPDATED BEFORE ENABLING MANUAL POLL ############ appVersion = "V1" allPodNames := append(idxcPodNames, shcPodNames...) Expect(testcaseEnvInst.VerifyAppInstalled(ctx, deployment, testcaseEnvInst.GetName(), allPodNames, appListV1, true, "enabled", false, true)).To(Succeed(), "App installation verification failed") @@ -1007,16 +849,9 @@ var _ = Describe("m4appfw test", func() { Expect(err).To(Succeed(), "Unable to get config map for manual poll") testcaseEnvInst.Log.Info("Modify config map to trigger manual update") - config.Data["MonitoringConsole"] = strings.Replace(config.Data["MonitoringConsole"], "off", "on", 1) err = deployment.UpdateCR(ctx, config) Expect(err).To(Succeed(), "Unable to update config map") - // Wait for Monitoring Console to reach Ready phase - err = testcaseEnvInst.WaitForMonitoringConsolePhase(ctx, deployment, testcaseEnvInst.GetName(), mc.Name, enterpriseApi.PhaseReady, 10*time.Minute) - Expect(err).To(Succeed(), "Timed out waiting for MonitoringConsole to reach Ready phase") - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -1026,7 +861,7 @@ var _ = Describe("m4appfw test", func() { testcaseEnvInst.Log.Info(fmt.Sprintf("Verify config map set back to off after poll trigger for %s app", appVersion)) config, _ = testenv.GetAppframeworkManualUpdateConfigMap(ctx, deployment, testcaseEnvInst.GetName()) - Expect(strings.Contains(config.Data["ClusterMaster"], "status: off") && strings.Contains(config.Data["SearchHeadCluster"], "status: off") && strings.Contains(config.Data["MonitoringConsole"], "status: off")).To(Equal(true), "Config map update not complete") + Expect(strings.Contains(config.Data["ClusterMaster"], "status: off") && strings.Contains(config.Data["SearchHeadCluster"], "status: off")).To(Equal(true), "Config map update not complete") // ############ VERIFY APPS UPDATED TO V2 ############# appVersion = "V2" @@ -1036,10 +871,7 @@ var _ = Describe("m4appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV2 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV2 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -1444,7 +1276,6 @@ var _ = Describe("m4appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console * Create app source for Monitoring Console * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload big-size app to Azure for Indexer Cluster and Search Head Cluster @@ -1457,45 +1288,13 @@ var _ = Describe("m4appfw test", func() { */ //################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console - appVersion := "V1" - appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) // Prepare Monitoring Console spec with its own app source - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Download all test apps from Azure appList := append(testenv.BigSingleApp, testenv.ExtraApps...) - appFileList = testenv.GetAppFileList(appList) + appFileList := testenv.GetAppFileList(appList) containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err = testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) + err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) Expect(err).To(Succeed(), "Unable to download apps") // Upload big-size app to Azure for Cluster Manager @@ -1503,7 +1302,7 @@ var _ = Describe("m4appfw test", func() { appFileList = testenv.GetAppFileList(appList) testcaseEnvInst.Log.Info("Upload big-size app to Azure for Cluster Manager") azTestDirIdxc = "m4appfw-idxc-" + testenv.RandomDNSName(4) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), "Unable to upload big-size app to Azure test directory for Cluster Manager") uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1526,7 +1325,7 @@ var _ = Describe("m4appfw test", func() { testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster with Search Head Cluster") siteCount := 3 indexersPerSite := 1 - cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework") // Verify App installation is in progress on Cluster Manager @@ -1580,7 +1379,6 @@ var _ = Describe("m4appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console * Create app source for Monitoring Console * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready * Upload big-size app to Azure for Indexer Cluster and Search Head Cluster @@ -1594,45 +1392,13 @@ var _ = Describe("m4appfw test", func() { */ //################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console - appVersion := "V1" - appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) // Prepare Monitoring Console spec with its own app source - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Download all test apps from Azure appList := append(testenv.BigSingleApp, testenv.ExtraApps...) - appFileList = testenv.GetAppFileList(appList) + appFileList := testenv.GetAppFileList(appList) containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err = testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) + err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) Expect(err).To(Succeed(), "Unable to download apps") // Upload big-size app to Azure for Cluster Manager @@ -1640,7 +1406,7 @@ var _ = Describe("m4appfw test", func() { appFileList = testenv.GetAppFileList(appList) testcaseEnvInst.Log.Info("Upload big-size app to Azure for Cluster Manager") azTestDirIdxc = "m4appfw-idxc-" + testenv.RandomDNSName(4) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), "Unable to upload big-size app to Azure test directory for Cluster Manager") uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1664,7 +1430,7 @@ var _ = Describe("m4appfw test", func() { siteCount := 3 shReplicas := 3 indexersPerSite := 1 - cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterMasterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework") // Verify App installation is in progress @@ -1729,7 +1495,7 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and installed on Monitoring Console and on Search Heads and Indexers pods + * Verify apps are copied and installed and on Search Heads and Indexers pods */ //################## SETUP ################## @@ -1814,7 +1580,7 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and installed on Monitoring Console and on Search Heads and Indexers pods + * Verify apps are copied and installed and on Search Heads and Indexers pods */ //################## SETUP ################## @@ -1898,7 +1664,7 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and installed on Monitoring Console and on Search Heads and Indexers pods + * Verify apps are copied and installed and on Search Heads and Indexers pods ############ Upload Disabled App ########### * Download disabled app from az * Delete the app from az @@ -2382,7 +2148,7 @@ var _ = Describe("m4appfw test", func() { * Verify Apps Installed in App Deployment Info * Verify App Package is deleted from Splunk Pod * Verify bundle push is successful - * Verify apps are copied and installed on Monitoring Console and on Search Heads and Indexers pods + * Verify apps are copied and installed and on Search Heads and Indexers pods */ //################## SETUP ################## diff --git a/test/appframework_az/m4/manager_appframework_azure_test.go b/test/appframework_az/m4/manager_appframework_azure_test.go index c7541da44..7e70fd5fa 100644 --- a/test/appframework_az/m4/manager_appframework_azure_test.go +++ b/test/appframework_az/m4/manager_appframework_azure_test.go @@ -26,7 +26,6 @@ import ( enterpriseApi "github.com/splunk/splunk-operator/api/v4" splcommon "github.com/splunk/splunk-operator/pkg/splunk/common" testenv "github.com/splunk/splunk-operator/test/testenv" - corev1 "k8s.io/api/core/v1" ) var _ = Describe("m4appfw test", func() { @@ -63,6 +62,8 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("smoke, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA with App Framework enabled, install apps and upgrade them", NodeTimeout(testenv.MediumLongTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error /* Test Steps ################## SETUP ################## @@ -93,38 +94,13 @@ var _ = Describe("m4appfw test", func() { */ //################## SETUP ################## - // Upload V1 apps to Azure for Monitoring Console appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Create App Framework Spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - volumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, volumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Upload V1 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) @@ -145,14 +121,13 @@ var _ = Describe("m4appfw test", func() { appFrameworkSpecShc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, azTestDirShc, 60) // get revision number of the resource - resourceVersion := testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) // Deploy M4 CRD testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster with Search Head Cluster") siteCount := 3 shReplicas := 3 indexersPerSite := 1 - cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework") @@ -162,8 +137,6 @@ var _ = Describe("m4appfw test", func() { // Verify RF SF is met Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") - Expect(testcaseEnvInst.VerifyMCVersionChangedAndReady(ctx, deployment, mc, resourceVersion)).To(Succeed(), "MC version not changed or not ready") - // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -173,11 +146,9 @@ var _ = Describe("m4appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: indexersPerSite, CrMultisite: true, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -205,12 +176,6 @@ var _ = Describe("m4appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V2 apps for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList) @@ -221,10 +186,8 @@ var _ = Describe("m4appfw test", func() { Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") // Verify MC is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -236,10 +199,7 @@ var _ = Describe("m4appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV2 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV2 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -252,6 +212,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA with App Framework enabled, install apps and downgrade them", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP ################## * Upload V2 apps to Azure for Monitoring Console @@ -285,34 +248,14 @@ var _ = Describe("m4appfw test", func() { appVersion := "V2" appFileList := testenv.GetAppFileList(appListV2) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) // Create App Framework Spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - volumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, volumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console instance") // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Upload V2 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) @@ -337,7 +280,7 @@ var _ = Describe("m4appfw test", func() { siteCount := 3 shReplicas := 3 indexersPerSite := 1 - cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework") @@ -348,7 +291,6 @@ var _ = Describe("m4appfw test", func() { Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -359,11 +301,9 @@ var _ = Describe("m4appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV2, CrAppFileList: appFileList, CrReplicas: indexersPerSite, CrMultisite: true, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV2, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV2, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -392,12 +332,6 @@ var _ = Describe("m4appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V1 apps to Azure for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList) @@ -408,7 +342,6 @@ var _ = Describe("m4appfw test", func() { Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -420,10 +353,7 @@ var _ = Describe("m4appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV1 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV1) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV1 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV1) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -436,6 +366,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA with App Framework enabled, install apps, scale up clusters, install apps on new pods, scale down", NodeTimeout(testenv.MediumLongTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP ################## * Upload V1 apps to Azure for M4 @@ -478,7 +411,7 @@ var _ = Describe("m4appfw test", func() { appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -685,6 +618,9 @@ var _ = Describe("m4appfw test", func() { Context("Multi Site Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA and have apps installed locally on Cluster Manager and Deployer", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP #################### * Upload V1 apps to Azure @@ -714,7 +650,7 @@ var _ = Describe("m4appfw test", func() { appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -808,6 +744,9 @@ var _ = Describe("m4appfw test", func() { Context("Multi Site Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA with App Framework enabled for manual poll", NodeTimeout(testenv.MediumLongTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP #################### * Upload V1 apps to Azure for Monitoring Console @@ -845,34 +784,14 @@ var _ = Describe("m4appfw test", func() { appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) // Create App Framework Spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - volumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, volumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 0) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Upload V1 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) @@ -896,7 +815,7 @@ var _ = Describe("m4appfw test", func() { shReplicas := 3 indexersPerSite := 1 testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster") - cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster with App Framework") // Ensure M4 cluster is ready @@ -906,7 +825,6 @@ var _ = Describe("m4appfw test", func() { Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -917,11 +835,9 @@ var _ = Describe("m4appfw test", func() { shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1) cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())} deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: indexersPerSite, CrMultisite: true, CrClusterPods: idxcPodNames} shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} clusterManagerBundleHash, err := testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -944,12 +860,6 @@ var _ = Describe("m4appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Search Head Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Upload V2 apps to Azure for Monitoring Console - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList) @@ -960,7 +870,6 @@ var _ = Describe("m4appfw test", func() { Expect(testcaseEnvInst.VerifyRFSFMet(ctx, deployment)).To(Succeed(), "RF/SF not met") // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // ############ VERIFICATION APPS ARE NOT UPDATED BEFORE ENABLING MANUAL POLL ############ appVersion = "V1" @@ -1010,11 +919,7 @@ var _ = Describe("m4appfw test", func() { err = deployment.UpdateCR(ctx, config) Expect(err).To(Succeed(), "Unable to update config map") - // Wait for Monitoring Console to reach Ready phase - err = testcaseEnvInst.WaitForMonitoringConsolePhase(ctx, deployment, testcaseEnvInst.GetName(), mc.Name, enterpriseApi.PhaseReady, 10*time.Minute) - Expect(err).To(Succeed(), "Timed out waiting for MonitoringConsole to reach Ready phase") // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -1035,10 +940,7 @@ var _ = Describe("m4appfw test", func() { shcAppSourceInfo.CrAppVersion = appVersion shcAppSourceInfo.CrAppList = appListV2 shcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV2 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, clusterManagerBundleHash) Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -1050,6 +952,9 @@ var _ = Describe("m4appfw test", func() { Context("Multi Site Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA and have apps installed and updated locally on Cluster Manager and Deployer via manual poll", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP #################### * Upload V1 apps to Azure @@ -1083,7 +988,7 @@ var _ = Describe("m4appfw test", func() { appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1225,6 +1130,9 @@ var _ = Describe("m4appfw test", func() { Context("Multi Site Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("m4azure, integration, managerappframeworkazurem4, appframeworkazure: can deploy a m4 SVA with apps installed locally on Cluster Manager and Deployer, cluster-wide on Peers and Search Heads, then upgrade them via a manual poll", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP #################### * Split Applist into clusterlist and local list @@ -1262,7 +1170,7 @@ var _ = Describe("m4appfw test", func() { testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for local install (local scope)", appVersion)) azTestDirIdxcLocal = "m4appfw-" + testenv.RandomDNSName(4) localappFileList := testenv.GetAppFileList(appListLocal) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxcLocal, localappFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxcLocal, localappFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps (local scope) to Azure test directory", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1441,6 +1349,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) and App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure, azure_sanity: can deploy a M4, add new apps to app source while install is in progress and have all apps installed locally on Cluster Manager and Deployer", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP #################### * Upload V1 apps to Azure for Monitoring Console @@ -1460,35 +1371,12 @@ var _ = Describe("m4appfw test", func() { appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Prepare Monitoring Console spec with its own app source - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Download all test apps from Azure appList := append(testenv.BigSingleApp, testenv.ExtraApps...) @@ -1525,7 +1413,7 @@ var _ = Describe("m4appfw test", func() { testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster with Search Head Cluster") siteCount := 3 indexersPerSite := 1 - cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework") // Verify App installation is in progress on Cluster Manager @@ -1578,6 +1466,9 @@ var _ = Describe("m4appfw test", func() { Context("Single Site Indexer Cluster with Search Head Cluster (M4) and App Framework", func() { It("smoke, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4, add new apps to app source while install is in progress and have all apps installed cluster-wide", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP #################### * Upload V1 apps to Azure for Monitoring Console @@ -1598,35 +1489,12 @@ var _ = Describe("m4appfw test", func() { appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Prepare Monitoring Console spec with its own app source - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") // Verify Monitoring Console is ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") // Download all test apps from Azure appList := append(testenv.BigSingleApp, testenv.ExtraApps...) @@ -1664,7 +1532,7 @@ var _ = Describe("m4appfw test", func() { siteCount := 3 shReplicas := 3 indexersPerSite := 1 - cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "") + cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "") Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework") // Verify App installation is in progress @@ -1717,6 +1585,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure, azure_sanity: can deploy a M4 SVA with App Framework enabled and reset operator pod while app install is in progress", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP ################## * Upload V1 apps to Azure for Indexer Cluster and Search Head Cluster @@ -1737,13 +1608,13 @@ var _ = Describe("m4appfw test", func() { appList := append(testenv.BigSingleApp, testenv.ExtraApps...) appFileList := testenv.GetAppFileList(appList) containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) + err = testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) Expect(err).To(Succeed(), "Unable to download big-size app") // Upload V1 apps to Azure for Indexer Cluster appVersion := "V1" testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1802,6 +1673,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure, azure_sanity: can deploy a M4 SVA with App Framework enabled and reset operator pod while app download is in progress", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP ################## * Upload V1 apps to Azure for Indexer Cluster and Search Head Cluster @@ -1822,13 +1696,13 @@ var _ = Describe("m4appfw test", func() { appList := append(testenv.BigSingleApp, testenv.ExtraApps...) appFileList := testenv.GetAppFileList(appList) containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) + err = testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) Expect(err).To(Succeed(), "Unable to download big-size app") // Upload V1 apps to Azure for Indexer Cluster appVersion := "V1" testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1887,6 +1761,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA with App Framework enabled, install an app, then disable it by using a disabled version of the app and then remove it from app source", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP ################## * Upload V1 apps to Azure for Indexer Cluster and Search Head Cluster @@ -1911,7 +1788,7 @@ var _ = Describe("m4appfw test", func() { // Upload V1 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1994,6 +1871,9 @@ var _ = Describe("m4appfw test", func() { Context("Multi Site Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA, install apps via manual polling, switch to periodic polling, verify apps are not updated before the end of AppsRepoPollInterval, then updated after", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP #################### * Upload V1 apps to Azure @@ -2023,7 +1903,7 @@ var _ = Describe("m4appfw test", func() { appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -2175,6 +2055,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure, azure_sanity: can deploy a M4 SVA with App Framework enabled and update apps after app download is completed", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP ################## * Upload V1 apps to Azure for Indexer Cluster and Search Head Cluster @@ -2205,12 +2088,12 @@ var _ = Describe("m4appfw test", func() { appListV1 := []string{appListV1[0]} appFileList := testenv.GetAppFileList(appListV1) containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) + err = testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) Expect(err).To(Succeed(), "Unable to download apps") // Upload V1 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -2287,6 +2170,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("m4azure, integration, managerappframeworkazurem4, appframeworkazure, azure_sanity: can deploy a M4 SVA and install a bigger volume of apps than the operator PV disk space", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP #################### * Create a file on operator to utilize over 1G of space @@ -2306,7 +2192,7 @@ var _ = Describe("m4appfw test", func() { //################## SETUP #################### // Create a large file on Operator pod opPod := testcaseEnvInst.GetOperatorPodName() - err := testenv.CreateDummyFileOnOperator(ctx, deployment, opPod, testenv.AppDownloadVolume, "1G", "test_file.img") + err = testenv.CreateDummyFileOnOperator(ctx, deployment, opPod, testenv.AppDownloadVolume, "1G", "test_file.img") Expect(err).To(Succeed(), "Unable to create file on operator") filePresentOnOperator = true @@ -2315,7 +2201,7 @@ var _ = Describe("m4appfw test", func() { appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) azTestDirIdxc := "m4appfw-idxc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), "Unable to upload apps to Azure test directory for Indexer Cluster") uploadedApps = append(uploadedApps, uploadedFiles...) @@ -2370,6 +2256,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("integration, m4azure, managerappframeworkazurem4, appframeworkazure, azure_sanity: can deploy a M4 SVA with App Framework enabled and delete apps from app directory when download is complete", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP ################## * Upload big-size app to Azure for Indexer Cluster and Search Head Cluster @@ -2390,13 +2279,13 @@ var _ = Describe("m4appfw test", func() { appList := testenv.BigSingleApp appFileList := testenv.GetAppFileList(appList) containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) + err = testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) Expect(err).To(Succeed(), "Unable to download big-size app") // Upload big size app to Azure for Indexer Cluster appVersion := "V1" testcaseEnvInst.Log.Info("Upload big size app to Azure for Indexer Cluster") - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), "Unable to upload big size to Azure test directory for Indexer Cluster") uploadedApps = append(uploadedApps, uploadedFiles...) @@ -2458,6 +2347,9 @@ var _ = Describe("m4appfw test", func() { Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() { It("smoke, m4azure, managerappframeworkazurem4, appframeworkazure: can deploy a M4 SVA with App Framework enabled, install apps and check IsDeploymentInProgress for CM and SHC CR's", NodeTimeout(testenv.MediumTimeout), func(ctx SpecContext) { + var uploadedFiles []string + var err error + /* Test Steps ################## SETUP ################## * Upload V1 apps to Azure for Indexer Cluster and Search Head Cluster @@ -2472,7 +2364,7 @@ var _ = Describe("m4appfw test", func() { // Upload V1 apps to Azure for Indexer Cluster testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Indexer Cluster", appVersion)) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirIdxc, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Indexer Cluster", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) diff --git a/test/appframework_az/s1/appframework_azure_test.go b/test/appframework_az/s1/appframework_azure_test.go index 2d0da42cb..5d6fba79a 100644 --- a/test/appframework_az/s1/appframework_azure_test.go +++ b/test/appframework_az/s1/appframework_azure_test.go @@ -16,7 +16,6 @@ package azures1appfw import ( "fmt" "path/filepath" - "strings" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -55,13 +54,10 @@ var _ = Describe("s1appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console - * Create app source for Monitoring Console - * Prepare and deploy Monitoring Console with app framework and wait for the pod to be ready * Upload V1 apps to Azure for Standalone * Create app source for Standalone * Prepare and deploy Standalone with app framework and wait for the pod to be ready - ############ V1 APP VERIFICATION FOR STANDALONE AND MONITORING CONSOLE ########### + ############ V1 APP VERIFICATION FOR STANDALONE ########### * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info * Verify App Package is deleted from Operator Pod @@ -72,7 +68,7 @@ var _ = Describe("s1appfw test", func() { * Verify App enabled and version by running splunk cmd ############ UPGRADE V2 APPS ########### * Upload V2 apps to Azure App Source - ############ V2 APP VERIFICATION FOR STANDALONE AND MONITORING CONSOLE ########### + ############ V2 APP VERIFICATION FOR STANDALONE ########### * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info * Verify App Package is deleted from Operator Pod @@ -83,51 +79,16 @@ var _ = Describe("s1appfw test", func() { * Verify App enabled and version by running splunk cmd */ - // ################## SETUP FOR MONITORING CONSOLE #################### - - // Upload V1 apps to Azure for Monitoring Console + // ################## SETUP FOR STANDALONE #################### + // Upload V1 apps to Azure for Standalone appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - - azTestDirMC := "s1appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) + testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) + azTestDir = "s1appfw-" + testenv.RandomDNSName(4) // Maximum apps to be downloaded in parallel maxConcurrentAppDownloads := 5 - - // Create App Framework spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - appFrameworkSpecMC.MaxConcurrentAppDownloads = uint64(maxConcurrentAppDownloads) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // ################## SETUP FOR STANDALONE #################### - // Upload V1 apps to Azure for Standalone - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) - azTestDir = "s1appfw-" + testenv.RandomDNSName(4) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -142,9 +103,6 @@ var _ = Describe("s1appfw test", func() { Image: testcaseEnvInst.GetSplunkImage(), }, Volumes: []corev1.Volume{}, - MonitoringConsoleRef: corev1.ObjectReference{ - Name: mcName, - }, }, AppFrameworkConfig: appFrameworkSpec, } @@ -157,18 +115,13 @@ var _ = Describe("s1appfw test", func() { // Wait for Standalone to be in READY status Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) // ############ INITIAL VERIFICATION ########### standalonePod := []string{fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0)} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} standaloneAppSourceInfo := testenv.AppSourceInfo{CrKind: standalone.Kind, CrName: standalone.Name, CrAppSourceName: appSourceName, CrPod: standalonePod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -181,26 +134,19 @@ var _ = Describe("s1appfw test", func() { uploadedApps = nil appVersion = "V2" - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone and Monitoring Console", appVersion)) + testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) appFileList = testenv.GetAppFileList(appListV2) uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDir, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), standalone.Kind, appSourceName, appFileList) // Wait for Standalone to be in READY status Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -208,10 +154,7 @@ var _ = Describe("s1appfw test", func() { standaloneAppSourceInfo.CrAppVersion = appVersion standaloneAppSourceInfo.CrAppList = appListV2 standaloneAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV2 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{standaloneAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{standaloneAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -223,13 +166,10 @@ var _ = Describe("s1appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V2 apps to Azure for Monitoring Console - * Create app source for Monitoring Console - * Prepare and deploy Monitoring Console with app framework and wait for the pod to be ready - * Upload V2 apps to Azure for Standalone + * Upload V2 apps to Azure for Standalone * Upload V2 apps to Azure for Standalone * Create app source for Standalone * Prepare and deploy Standalone with app framework and wait for the pod to be ready - ############ INITIAL VERIFICATION FOR STANDALONE AND MONITORING CONSOLE ########### + ############ INITIAL VERIFICATION FOR STANDALONE ########### * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info * Verify App Package is deleted from Operator Pod @@ -240,8 +180,8 @@ var _ = Describe("s1appfw test", func() { * Verify App enabled and version by running splunk cmd ############# DOWNGRADE APPS ################ * Upload V1 apps on Azure - * Wait for Monitoring Console and Standalone pods to be ready - ########## DOWNGRADE VERIFICATION FOR STANDALONE AND MONITORING CONSOLE ########### + * Wait for Standalone pods to be ready + ########## DOWNGRADE VERIFICATION FOR STANDALONE ########### * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info * Verify App Package is deleted from Operator Pod @@ -263,36 +203,11 @@ var _ = Describe("s1appfw test", func() { Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "azures1appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) + testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) + uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDir, appFileList) + Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - // Create App Framework Spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Create App Framework Spec for Standalone appSourceName = "appframework-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3) appFrameworkSpec := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeName, enterpriseApi.ScopeLocal, appSourceName, azTestDir, 60) @@ -303,9 +218,6 @@ var _ = Describe("s1appfw test", func() { Image: testcaseEnvInst.GetSplunkImage(), }, Volumes: []corev1.Volume{}, - MonitoringConsoleRef: corev1.ObjectReference{ - Name: mcName, - }, }, AppFrameworkConfig: appFrameworkSpec, } @@ -318,18 +230,13 @@ var _ = Describe("s1appfw test", func() { // Wait for Standalone to be in READY status Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) //############ INITIAL VERIFICATION ########### standalonePod := []string{fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0)} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} standaloneAppSourceInfo := testenv.AppSourceInfo{CrKind: standalone.Kind, CrName: standalone.Name, CrAppSourceName: appSourceName, CrPod: standalonePod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV2, CrAppFileList: appFileList} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV2, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -341,20 +248,17 @@ var _ = Describe("s1appfw test", func() { uploadedApps = nil // get revision number of the resource - resourceVersion := testcaseEnvInst.GetResourceVersion(ctx, deployment, mc) + resourceVersion := testcaseEnvInst.GetResourceVersion(ctx, deployment, standalone) - // Upload V1 apps to Azure for Standalone and Monitoring Console + // Upload V1 apps to Azure for Standalone appVersion = "V1" - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone and Monitoring Console", appVersion)) + testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) appFileList = testenv.GetAppFileList(appListV1) uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) // Check for changes in App phase to determine if next poll has been triggered testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), standalone.Kind, appSourceName, appFileList) @@ -363,10 +267,7 @@ var _ = Describe("s1appfw test", func() { Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") // wait for custom resource resource version to change - Expect(testcaseEnvInst.VerifyCustomResourceVersionChanged(ctx, deployment, mc, resourceVersion)).To(Succeed(), "Custom resource version not changed") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") + Expect(testcaseEnvInst.VerifyCustomResourceVersionChanged(ctx, deployment, standalone, resourceVersion)).To(Succeed(), "Custom resource version not changed") // Get Pod age to check for pod resets later splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) @@ -375,10 +276,7 @@ var _ = Describe("s1appfw test", func() { standaloneAppSourceInfo.CrAppVersion = appVersion standaloneAppSourceInfo.CrAppList = appListV1 standaloneAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV1) - mcAppSourceInfo.CrAppVersion = appVersion - mcAppSourceInfo.CrAppList = appListV1 - mcAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV1) - allAppSourceInfo = []testenv.AppSourceInfo{standaloneAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo = []testenv.AppSourceInfo{standaloneAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -391,9 +289,7 @@ var _ = Describe("s1appfw test", func() { /* Test Steps ################## SETUP #################### * Upload apps on Azure - * Create 2 app sources for Monitoring Console and Standalone - * Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready - * Prepare and deploy Standalone CRD with app framework and wait for the pod to be ready + * Create 2 app sources for Standalone * Prepare and deploy Standalone CRD with app framework and wait for the pod to be ready ########## INITIAL VERIFICATION ############# * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info @@ -405,7 +301,7 @@ var _ = Describe("s1appfw test", func() { * Verify App enabled and version by running splunk cmd ############### SCALING UP ################## * Scale up Standalone - * Wait for Monitoring Console and Standalone to be ready + * Wait for Standalone to be ready ########### SCALING UP VERIFICATION ######### * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info @@ -417,7 +313,7 @@ var _ = Describe("s1appfw test", func() { * Verify App enabled and version by running splunk cmd ############## SCALING DOWN ################# * Scale down Standalone - * Wait for Monitoring Console and Standalone to be ready + * Wait for Standalone to be ready ########### SCALING DOWN VERIFICATION ####### * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info @@ -430,50 +326,14 @@ var _ = Describe("s1appfw test", func() { */ //################## SETUP #################### - // Upload V1 apps to Azure for Standalone and Monitoring Console + // Upload V1 apps to Azure for Standalone appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone and Monitoring Console", appVersion)) - - azTestDirMC := "azures1appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) - - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework Spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Upload apps to Azure for Standalone + testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) azTestDir := "azures1appfw-" + testenv.RandomDNSName(4) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) + uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) - Expect(err).To(Succeed(), "Unable to upload apps to Azure test directory") + Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) // Create App Framework Spec for Standalone @@ -486,9 +346,6 @@ var _ = Describe("s1appfw test", func() { Image: testcaseEnvInst.GetSplunkImage(), }, Volumes: []corev1.Volume{}, - MonitoringConsoleRef: corev1.ObjectReference{ - Name: mcName, - }, }, AppFrameworkConfig: appFrameworkSpec, } @@ -501,19 +358,14 @@ var _ = Describe("s1appfw test", func() { // Wait for Standalone to be in READY status Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - // Get Pod age to check for pod resets later splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) //########## INITIAL VERIFICATION ############# scaledReplicaCount := 2 standalonePod := []string{fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0)} - mcPod := []string{fmt.Sprintf(testenv.MonitoringConsolePod, deployment.GetName())} standaloneAppSourceInfo := testenv.AppSourceInfo{CrKind: standalone.Kind, CrName: standalone.Name, CrAppSourceName: appSourceName, CrPod: standalonePod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList, CrReplicas: scaledReplicaCount} - mcAppSourceInfo := testenv.AppSourceInfo{CrKind: mc.Kind, CrName: mc.Name, CrAppSourceName: appSourceNameMC, CrAppSourceVolumeName: appSourceNameMC, CrPod: mcPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo, mcAppSourceInfo} + allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo} _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -535,9 +387,6 @@ var _ = Describe("s1appfw test", func() { // Wait for Standalone to be in READY status Expect(testcaseEnvInst.VerifyStandalonePhase(ctx, deployment, enterpriseApi.PhaseReady)).To(Succeed(), "Standalone phase mismatch") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - //########### SCALING UP VERIFICATION ######### _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -559,9 +408,6 @@ var _ = Describe("s1appfw test", func() { // Wait for Standalone to be in READY status Expect(testcaseEnvInst.VerifyStandalonePhase(ctx, deployment, enterpriseApi.PhaseReady)).To(Succeed(), "Standalone phase mismatch") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - //########### SCALING DOWN VERIFICATION ####### _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") Expect(err).To(Succeed(), "Failed to verify app framework state") @@ -676,9 +522,9 @@ var _ = Describe("s1appfw test", func() { Expect(azureBlobClient.DeleteFilesOnAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, uploadedApps)).To(Succeed(), "Azure file deletion failed") uploadedApps = nil - // Upload V2 apps to Azure for Standalone and Monitoring Console + // Upload V2 apps to Azure for Standalone appVersion = "V2" - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone and Monitoring Console", appVersion)) + testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) appFileList = testenv.GetAppFileList(appListV2) uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDir, appFileList) @@ -886,10 +732,7 @@ var _ = Describe("s1appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console - * Create app source for Monitoring Console - * Prepare and deploy Monitoring Console with app framework and wait for the pod to be ready - * Create app source for Standalone + * Upload V1 apps to Azure for Standalone * Create app source for Standalone * Prepare and deploy Standalone with app framework(MANUAL POLL) and wait for the pod to be ready ############### VERIFICATION ################ * Verify Apps Downloaded in App Deployment Info @@ -906,7 +749,7 @@ var _ = Describe("s1appfw test", func() { * Verify Apps are not updated ############ ENABLE MANUAL POLL ############ * Verify Manual Poll disabled after the check - ############ V2 APP VERIFICATION FOR STANDALONE AND MONITORING CONSOLE ########### + ############ V2 APP VERIFICATION FOR STANDALONE ########### * Verify Apps Downloaded in App Deployment Info * Verify Apps Copied in App Deployment Info * Verify App Package is deleted from Operator Pod @@ -919,545 +762,13 @@ var _ = Describe("s1appfw test", func() { //################## SETUP #################### - // Upload V1 apps to Azure for Monitoring Console - appVersion := "V1" - appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "azures1appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 0) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Upload V1 apps to Azure - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework Spec - appSourceName = "appframework-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3) - appFrameworkSpec := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeName, enterpriseApi.ScopeLocal, appSourceName, azTestDir, 0) - - spec := enterpriseApi.StandaloneSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - MonitoringConsoleRef: corev1.ObjectReference{ - Name: mcName, - }, - }, - AppFrameworkConfig: appFrameworkSpec, - } - - // Create Standalone Deployment with App Framework - standalone, err := deployment.DeployStandaloneWithGivenSpec(ctx, deployment.GetName(), spec) - Expect(err).To(Succeed(), "Unable to deploy standalone instance with App Framework") - - // Wait for Standalone to be in READY status - Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Get Pod age to check for pod resets later - splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) - - //############### VERIFICATION ################ - standalonePod := []string{fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0)} - standaloneAppSourceInfo := testenv.AppSourceInfo{CrKind: standalone.Kind, CrName: standalone.Name, CrAppSourceName: appSourceName, CrPod: standalonePod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appListV1, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo} - _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") - Expect(err).To(Succeed(), "Failed to verify app framework state") - - //############### UPGRADE APPS ################ - - //Delete apps on Azure for new Apps - azureBlobClient := &testenv.AzureBlobClient{} - Expect(azureBlobClient.DeleteFilesOnAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, uploadedApps)).To(Succeed(), "Azure file deletion failed") - uploadedApps = nil - - //Upload new Versioned Apps to Azure - appVersion = "V2" - appFileList = testenv.GetAppFileList(appListV2) - - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDir, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV2, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Check for changes in App phase to determine if next poll has been triggered - testcaseEnvInst.WaitforPhaseChange(ctx, deployment, deployment.GetName(), standalone.Kind, appSourceName, appFileList) - - // Wait for Standalone to be in READY status - Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // ############ VERIFICATION APPS ARE NOT UPDATED BEFORE ENABLING MANUAL POLL ############ - appVersion = "V1" - _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") - Expect(err).To(Succeed(), "Failed to verify app framework state") - - // ############ ENABLE MANUAL POLL ############ - appVersion = "V2" - testcaseEnvInst.Log.Info("Get config map for triggering manual update") - config, err := testenv.GetAppframeworkManualUpdateConfigMap(ctx, deployment, testcaseEnvInst.GetName()) - Expect(err).To(Succeed(), "Unable to get config map for manual poll") - testcaseEnvInst.Log.Info("Config map data for", "Standalone", config.Data["Standalone"]) - - testcaseEnvInst.Log.Info("Modify config map to trigger manual update") - config.Data["Standalone"] = strings.Replace(config.Data["Standalone"], "off", "on", 1) - config.Data["MonitoringConsole"] = strings.Replace(config.Data["Standalone"], "off", "on", 1) - err = deployment.UpdateCR(ctx, config) - Expect(err).To(Succeed(), "Unable to update config map") - - // Wait for Standalone to be in READY status - Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // Get Pod age to check for pod resets later - splunkPodUIDs = testenv.GetPodUIDs(testcaseEnvInst.GetName()) - - //Verify config map set back to off after poll trigger - testcaseEnvInst.Log.Info(fmt.Sprintf("Verify config map set back to off after poll trigger for %s app", appVersion)) - config, _ = testenv.GetAppframeworkManualUpdateConfigMap(ctx, deployment, testcaseEnvInst.GetName()) - Expect(strings.Contains(config.Data["Standalone"], "status: off") && strings.Contains(config.Data["MonitoringConsole"], "status: off")).To(Equal(true), "Config map update not complete") - - //############### VERIFICATION FOR UPGRADE ################ - standaloneAppSourceInfo.CrAppVersion = appVersion - standaloneAppSourceInfo.CrAppList = appListV2 - standaloneAppSourceInfo.CrAppFileList = testenv.GetAppFileList(appListV2) - allAppSourceInfo = []testenv.AppSourceInfo{standaloneAppSourceInfo} - _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") - Expect(err).To(Succeed(), "Failed to verify app framework state") - }) - }) - - Context("Standalone deployment (S1) with App Framework", func() { - It("integration, s1azure, appframeworkazures1, appframework: can deploy Several standalone CRs in the same namespace with App Framework enabled", NodeTimeout(testenv.ShortTimeout), func(ctx SpecContext) { - - /* Test Steps - ################## SETUP #################### - * Add more apps than usual on Azure for this test - * Split the App list into 2 segments with a common apps and uncommon apps for each Standalone - * Create app source for 2 Standalones - * Prepare and deploy Standalones with app framework and wait for the pod to be ready - ############### VERIFICATION ################ - * Verify Apps Downloaded in App Deployment Info - * Verify Apps Copied in App Deployment Info - * Verify App Package is deleted from Operator Pod - * Verify Apps Installed in App Deployment Info - * Verify App Package is deleted from Splunk Pod - * Verify App Directory in under splunk path - * Verify App enabled and version by running splunk cmd - */ - - //################## SETUP #################### - - // Creating a list of apps to be installed on both standalone - appList1 := append(appListV1, testenv.RestartNeededApps[len(testenv.RestartNeededApps)/2:]...) - appList2 := append(appListV1, testenv.RestartNeededApps[:len(testenv.RestartNeededApps)/2]...) - appVersion := "V1" - - // Download apps from Azure - testcaseEnvInst.Log.Info("Download the extra apps from Azure for this test") - appFileList := testenv.GetAppFileList(testenv.RestartNeededApps) - containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) - Expect(err).To(Succeed(), "Unable to download apps files") - - // Upload apps to Azure for first Standalone - testcaseEnvInst.Log.Info("Upload apps to Azure for 1st Standalone") - appFileListStandalone1 := testenv.GetAppFileList(appList1) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileListStandalone1) - Expect(err).To(Succeed(), "Unable to upload apps to Azure test directory") - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Upload apps to Azure for second Standalone - testcaseEnvInst.Log.Info("Upload apps to Azure for 2nd Standalone") - azTestDirStandalone2 := "azures1appfw-2-" + testenv.RandomDNSName(4) - appFileListStandalone2 := testenv.GetAppFileList(appList2) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirStandalone2, appFileListStandalone2) - Expect(err).To(Succeed(), "Unable to upload apps to Azure test directory") - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework Spec - appSourceName = "appframework-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3) - appFrameworkSpec := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeName, enterpriseApi.ScopeLocal, appSourceName, azTestDir, 60) - spec := enterpriseApi.StandaloneSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpec, - } - - // Create App Framework Spec - appSourceNameStandalone2 := "appframework-2-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3) - appSourceVolumeNameStandalone2 := "appframework-test-volume-2-" + testenv.RandomDNSName(3) - appFrameworkSpecStandalone2 := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameStandalone2, enterpriseApi.ScopeLocal, appSourceNameStandalone2, azTestDirStandalone2, 60) - specStandalone2 := enterpriseApi.StandaloneSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecStandalone2, - } - - // Deploy Standalone - testcaseEnvInst.Log.Info("Deploy 1st Standalone") - standalone, err := deployment.DeployStandaloneWithGivenSpec(ctx, deployment.GetName(), spec) - Expect(err).To(Succeed(), "Unable to deploy 1st Standalone instance") - testcaseEnvInst.Log.Info("Deploy 2nd Standalone") - standalone2Name := deployment.GetName() + testenv.RandomDNSName(3) - standalone2, err := deployment.DeployStandaloneWithGivenSpec(ctx, standalone2Name, specStandalone2) - Expect(err).To(Succeed(), "Unable to deploy 2nd Standalone instance") - - // Wait for Standalone to be in READY status - Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone2)).To(Succeed(), "Standalone not ready") - - // Get Pod age to check for pod resets later - splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) - - //############### VERIFICATION ################ - standalonePod := []string{fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0)} - standaloneAppSourceInfo := testenv.AppSourceInfo{CrKind: standalone.Kind, CrName: standalone.Name, CrAppSourceName: appSourceName, CrPod: standalonePod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appList1, CrAppFileList: appFileListStandalone1} - standalone2Pod := []string{fmt.Sprintf(testenv.StandalonePod, standalone2Name, 0)} - standalone2AppSourceInfo := testenv.AppSourceInfo{CrKind: standalone2.Kind, CrName: standalone2Name, CrAppSourceName: appSourceNameStandalone2, CrPod: standalone2Pod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appList2, CrAppFileList: appFileListStandalone2} - allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo, standalone2AppSourceInfo} - _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") - Expect(err).To(Succeed(), "Failed to verify app framework state") - }) - }) - - Context("Standalone deployment (S1) with App Framework", func() { - It("integration, s1azure, appframeworkazures1, appframework: can add new apps to app source while install is in progress and have all apps installed", NodeTimeout(testenv.LongTimeout), func(ctx SpecContext) { - - /* Test Steps - ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console - * Create app source for Monitoring Console - * Prepare and deploy Monitoring Console with app framework and wait for the pod to be ready - * Upload big-size app to Azure for Standalone - * Create app source for Standalone - * Prepare and deploy Standalone - ############## VERIFICATIONS ################ - * Verify App installation is in progress on Standalone - * Upload more apps from Azure during bigger app install - * Wait for polling interval to pass - * Verify all apps are installed on Standalone - */ - - // ################## SETUP FOR MONITORING CONSOLE #################### - // Upload V1 apps to Azure for Monitoring Console - appVersion := "V1" - appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - azTestDirMC := "azures1appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // ################## SETUP FOR STANDALONE #################### - // Download all test apps from Azure - appList := append(testenv.BigSingleApp, testenv.ExtraApps...) - appFileList = testenv.GetAppFileList(appList) - containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err = testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) - Expect(err).To(Succeed(), "Unable to download apps") - - // Upload big-size app to Azure for Standalone - appList = testenv.BigSingleApp - appFileList = testenv.GetAppFileList(appList) - testcaseEnvInst.Log.Info("Upload big-size app to Azure for Standalone") - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) - Expect(err).To(Succeed(), "Unable to upload big-size app to Azure test directory for Standalone") - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework spec for Standalone - appSourceName = "appframework-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3) - appFrameworkSpec := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeName, enterpriseApi.ScopeLocal, appSourceName, azTestDir, 60) - spec := enterpriseApi.StandaloneSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - MonitoringConsoleRef: corev1.ObjectReference{ - Name: mcName, - }, - }, - AppFrameworkConfig: appFrameworkSpec, - } - - // Deploy Standalone - testcaseEnvInst.Log.Info("Deploy Standalone") - standalone, err := deployment.DeployStandaloneWithGivenSpec(ctx, deployment.GetName(), spec) - Expect(err).To(Succeed(), "Unable to deploy Standalone instance with App Framework") - - // Verify App installation is in progress on Standalone - Expect(testcaseEnvInst.VerifyAppState(ctx, deployment, deployment.GetName(), standalone.Kind, appSourceName, appFileList, enterpriseApi.AppPkgInstallComplete, enterpriseApi.AppPkgPodCopyComplete, testenv.AppStateVerificationTimeout)).To(Succeed(), "App state verification failed") - - // Upload more apps to Azure for Standalone - appList = testenv.ExtraApps - appFileList = testenv.GetAppFileList(appList) - testcaseEnvInst.Log.Info("Upload more apps to Azure for Standalone") - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) - Expect(err).To(Succeed(), "Unable to upload more apps to Azure test directory for Standalone") - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Wait for Standalone to be in READY status - Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - - // Wait for polling interval to pass - testcaseEnvInst.WaitForAppInstall(ctx, deployment, deployment.GetName(), standalone.Kind, appSourceName, appFileList) - - // Verify all apps are installed on Standalone - appList = append(testenv.BigSingleApp, testenv.ExtraApps...) - standalonePodName := fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0) - testcaseEnvInst.Log.Info(fmt.Sprintf("Verify all apps %v are installed on Standalone", appList)) - Expect(testcaseEnvInst.VerifyAppInstalled(ctx, deployment, testcaseEnvInst.GetName(), []string{standalonePodName}, appList, true, "enabled", false, false)).To(Succeed(), "App installation verification failed") - }) - }) - - Context("Standalone deployment (S1) with App Framework", func() { - It("integration, s1azure, appframeworkazures1, appframework: Deploy a Standalone instance with App Framework enabled and reset operator pod while app install is in progress", NodeTimeout(testenv.LongTimeout), func(ctx SpecContext) { - - /* Test Steps - ################## SETUP #################### - * Upload big-size app to Azure for Standalone - * Create app source for Standalone - * Prepare and deploy Standalone - * While app install is in progress, restart the operator - ############## VERIFICATIONS ################ - * Verify App installation is in progress on Standalone - * Upload more apps from Azure during bigger app install - * Wait for polling interval to pass - * Verify all apps are installed on Standalone - */ - - // ################## SETUP FOR STANDALONE #################### - // Download all test apps from Azure - appVersion := "V1" - appList := append(testenv.BigSingleApp, testenv.ExtraApps...) - appFileList := testenv.GetAppFileList(appList) - containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) - Expect(err).To(Succeed(), "Unable to download apps") - - // Upload big-size app to Azure for Standalone - testcaseEnvInst.Log.Info("Upload big-size app to Azure for Standalone") - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) - - Expect(err).To(Succeed(), "Unable to upload big-size app to Azure test directory for Standalone") - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework spec for Standalone - appSourceName = "appframework-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3) - appFrameworkSpec := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeName, enterpriseApi.ScopeLocal, appSourceName, azTestDir, 60) - spec := enterpriseApi.StandaloneSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpec, - } - - // Deploy Standalone - testcaseEnvInst.Log.Info("Deploy Standalone") - standalone, err := deployment.DeployStandaloneWithGivenSpec(ctx, deployment.GetName(), spec) - Expect(err).To(Succeed(), "Unable to deploy Standalone instance with App Framework") - - // Verify App installation is in progress on Standalone - Expect(testcaseEnvInst.VerifyAppState(ctx, deployment, deployment.GetName(), standalone.Kind, appSourceName, appFileList, enterpriseApi.AppPkgInstallComplete, enterpriseApi.AppPkgInstallPending, testenv.AppStateVerificationTimeout)).To(Succeed(), "App state verification failed") - - // Delete Operator pod while Install in progress - Expect(testcaseEnvInst.DeleteOperatorPod()).To(Succeed(), "Failed to delete operator pod") - - // Wait for Standalone to be in READY status - Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - - // Get Pod age to check for pod resets later - splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) - - // ############ VERIFICATION ########### - standalonePod := []string{fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0)} - standaloneAppSourceInfo := testenv.AppSourceInfo{CrKind: standalone.Kind, CrName: standalone.Name, CrAppSourceName: appSourceName, CrPod: standalonePod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appList, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo} - _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") - Expect(err).To(Succeed(), "Failed to verify app framework state") - }) - }) - - Context("Standalone deployment (S1) with App Framework", func() { - It("integration, s1azure, appframeworkazures1, appframework: Deploy a Standalone instance with App Framework enabled and reset operator pod while app download is in progress", NodeTimeout(testenv.LongTimeout), func(ctx SpecContext) { - - /* Test Steps - ################## SETUP #################### - * Upload big-size app to Azure for Standalone - * Create app source for Standalone - * Prepare and deploy Standalone - * While app download is in progress, restart the operator - ############## VERIFICATIONS ################ - * Verify App download is in progress on Standalone - * Upload more apps from Azure during bigger app install - * Wait for polling interval to pass - * Verify all apps are installed on Standalone - */ - - // ################## SETUP FOR STANDALONE #################### - // Download all test apps from Azure - appVersion := "V1" - appList := append(testenv.BigSingleApp, testenv.ExtraApps...) - appFileList := testenv.GetAppFileList(appList) - containerName := "/" + AzureDataContainer + "/" + testenv.AppLocationV1 - err := testenv.DownloadFilesFromAzure(ctx, testenv.GetAzureEndpoint(ctx), testenv.StorageAccountKey, testenv.StorageAccount, downloadDirV1, containerName, appFileList) - Expect(err).To(Succeed(), "Unable to download apps") - - // Upload big-size app to Azure for Standalone - testcaseEnvInst.Log.Info("Upload big-size app to Azure for Standalone") - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) - - Expect(err).To(Succeed(), "Unable to upload big-size app to Azure test directory for Standalone") - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework spec for Standalone - appSourceName = "appframework-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3) - appFrameworkSpec := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeName, enterpriseApi.ScopeLocal, appSourceName, azTestDir, 60) - spec := enterpriseApi.StandaloneSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpec, - } - - // Deploy Standalone - testcaseEnvInst.Log.Info("Deploy Standalone") - standalone, err := deployment.DeployStandaloneWithGivenSpec(ctx, deployment.GetName(), spec) - Expect(err).To(Succeed(), "Unable to deploy Standalone instance with App Framework") - - // Verify App download is in progress on Standalone - Expect(testcaseEnvInst.VerifyAppState(ctx, deployment, deployment.GetName(), standalone.Kind, appSourceName, appFileList, enterpriseApi.AppPkgDownloadComplete, enterpriseApi.AppPkgDownloadPending, testenv.AppStateVerificationTimeout)).To(Succeed(), "App state verification failed") - - // Delete Operator pod while Install in progress - Expect(testcaseEnvInst.DeleteOperatorPod()).To(Succeed(), "Failed to delete operator pod") - - // Wait for Standalone to be in READY status - Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - - // Get Pod age to check for pod resets later - splunkPodUIDs := testenv.GetPodUIDs(testcaseEnvInst.GetName()) - - // ############ VERIFICATION ########### - standalonePod := []string{fmt.Sprintf(testenv.StandalonePod, deployment.GetName(), 0)} - standaloneAppSourceInfo := testenv.AppSourceInfo{CrKind: standalone.Kind, CrName: standalone.Name, CrAppSourceName: appSourceName, CrPod: standalonePod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeLocal, CrAppList: appList, CrAppFileList: appFileList} - allAppSourceInfo := []testenv.AppSourceInfo{standaloneAppSourceInfo} - _, err = testcaseEnvInst.VerifyAppFrameworkState(ctx, deployment, allAppSourceInfo, splunkPodUIDs, "") - Expect(err).To(Succeed(), "Failed to verify app framework state") - }) - }) - - Context("Standalone deployment (S1) with App Framework", func() { - It("integration, s1azure, appframeworkazures1, appframework: can deploy a Standalone instance with App Framework enabled, install an app, then disable it by using a disabled version of the app and then remove it from app source", NodeTimeout(testenv.ShortTimeout), func(ctx SpecContext) { - - /* Test Steps - ################## SETUP #################### - * Upload V1 apps to Azure for Standalone - * Create app source for Standalone - * Prepare and deploy Standalone with app framework and wait for the pod to be ready - ############ VERIFICATION########### - * Verify Apps Downloaded in App Deployment Info - * Verify Apps Copied in App Deployment Info - * Verify App Package is deleted from Operator Pod - * Verify Apps Installed in App Deployment Info - * Verify App Package is deleted from Splunk Pod - * Verify App Directory in under splunk path - * Verify no pod resets triggered due to app install - * Verify App enabled and version by running splunk cmd - ############ Upload Disabled App ########### - * Download disabled app from Azure - * Delete the app from Azure - * Check for repo state in App Deployment Info - */ - - // ################## SETUP FOR STANDALONE #################### // Upload V1 apps to Azure for Standalone appVersion := "V1" appFileList := testenv.GetAppFileList(appListV1) testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) + azTestDir = "azures1appfw-" + testenv.RandomDNSName(4) uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) + Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) uploadedApps = append(uploadedApps, uploadedFiles...) @@ -1912,65 +1223,14 @@ var _ = Describe("s1appfw test", func() { /* Test Steps ################## SETUP #################### - * Upload V1 apps to Azure for Monitoring Console - * Create app source for Monitoring Console - * Prepare and deploy Monitoring Console with app framework - * Check isDeploymentInProgress is set for Monitoring Console CR - * Wait for the pod to be ready + * Upload V1 apps to Azure for Standalone * Wait for the pod to be ready * Upload V1 apps to Azure for Standalone * Create app source for Standalone - * Prepare and deploy Standalone with app framework - * Check isDeploymentInProgress is set for Monitoring Console CR - * Wait for the pod to be ready + * Prepare and deploy Standalone with app framework * Wait for the pod to be ready */ // ################## SETUP FOR MONITORING CONSOLE #################### - // Upload V1 apps to Azure for Monitoring Console - appVersion := "V1" - appFileList := testenv.GetAppFileList(appListV1) - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Monitoring Console", appVersion)) - - azTestDirMC := "azures1appfw-mc-" + testenv.RandomDNSName(4) - uploadedFiles, err := testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDirMC, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Monitoring Console", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - - // Create App Framework spec for Monitoring Console - appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3) - appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3) - appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, azTestDirMC, 60) - mcSpec := enterpriseApi.MonitoringConsoleSpec{ - CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{ - Spec: enterpriseApi.Spec{ - ImagePullPolicy: "Always", - Image: testcaseEnvInst.GetSplunkImage(), - }, - Volumes: []corev1.Volume{}, - }, - AppFrameworkConfig: appFrameworkSpecMC, - } - - // Deploy Monitoring Console - testcaseEnvInst.Log.Info("Deploy Monitoring Console") - mcName := deployment.GetName() - mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec) - Expect(err).To(Succeed(), "Unable to deploy Monitoring Console") - - // Verify IsDeploymentInProgress Flag is set to true for Monitroing Console CR - testcaseEnvInst.Log.Info("Checking isDeploymentInProgressFlag") - Expect(testcaseEnvInst.VerifyIsDeploymentInProgressFlagIsSet(ctx, deployment, mcName, mc.Kind)).To(Succeed(), "IsDeploymentInProgress flag not set") - - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - - // ################## SETUP FOR STANDALONE #################### - // Upload V1 apps to Azure for Standalone - testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to Azure for Standalone", appVersion)) - uploadedFiles, err = testenv.UploadFilesToAzure(ctx, testenv.StorageAccount, testenv.StorageAccountKey, downloadDirV1, azTestDir, appFileList) - Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to Azure test directory for Standalone", appVersion)) - uploadedApps = append(uploadedApps, uploadedFiles...) - // Maximum apps to be downloaded in parallel maxConcurrentAppDownloads := 5 @@ -1985,9 +1245,6 @@ var _ = Describe("s1appfw test", func() { Image: testcaseEnvInst.GetSplunkImage(), }, Volumes: []corev1.Volume{}, - MonitoringConsoleRef: corev1.ObjectReference{ - Name: mcName, - }, }, AppFrameworkConfig: appFrameworkSpec, } @@ -2003,9 +1260,6 @@ var _ = Describe("s1appfw test", func() { // Wait for Standalone to be in READY status Expect(testcaseEnvInst.VerifyStandaloneReady(ctx, deployment, deployment.GetName(), standalone)).To(Succeed(), "Standalone not ready") - // Verify Monitoring Console is Ready and stays in ready state - Expect(testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)).To(Succeed(), "Monitoring Console not ready") - }) }) })