Skip to content

Commit 91e66b4

Browse files
CSPL-1598: Delete apps from init-apps while app installation is in progress
1 parent c49085f commit 91e66b4

File tree

5 files changed

+290
-15
lines changed

5 files changed

+290
-15
lines changed

.github/workflows/int-test-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- develop
66
- master
7-
- cspl-1740
7+
- CSPL-1598
88
jobs:
99
int-tests:
1010
strategy:

test/c3/appframework/appframework_test.go

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,4 +2885,100 @@ var _ = Describe("c3appfw test", func() {
28852885
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
28862886
})
28872887
})
2888+
2889+
Context("Single Site Indexer Cluster with Search Head Cluster (C3) and App Framework", func() {
2890+
It("integration, c3, appframeworkc3, appframework: can deploy a C3 SVA with App Framework enabled and delete apps from init-apps when download is compelte", func() {
2891+
2892+
/* Test Steps
2893+
################## SETUP ####################
2894+
* Upload V1 apps to S3 for Indexer Cluster and Search Head Cluster
2895+
* Create app sources for Cluster Manager and Deployer
2896+
* Prepare and deploy C3 CRD with app framework and wait for the pods to be ready
2897+
* When app download is complete, delete apps from init-apps
2898+
######### VERIFICATIONS #############
2899+
* Verify Apps are Downloaded in App Deployment Info
2900+
* Verify Apps Copied in App Deployment Info
2901+
* Verify App Package is deleted from Operator Pod
2902+
* Verify Apps Installed in App Deployment Info
2903+
* Verify App Package is deleted from Splunk Pod
2904+
* Verify bundle push is successful
2905+
* Verify V1 apps are copied, installed on Monitoring Console and on Search Heads and Indexers pods
2906+
*/
2907+
2908+
//################## SETUP ####################
2909+
// Download all apps from S3
2910+
appList := testenv.BigSingleApp
2911+
appFileList := testenv.GetAppFileList(appList)
2912+
err := testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
2913+
Expect(err).To(Succeed(), "Unable to download big-size app")
2914+
2915+
// Upload V1 apps to S3 for Indexer Cluster
2916+
appVersion := "V1"
2917+
testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Indexer Cluster", appVersion))
2918+
s3TestDirIdxc = "c3appfw-idxc-" + testenv.RandomDNSName(4)
2919+
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
2920+
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Indexer Cluster", appVersion))
2921+
uploadedApps = append(uploadedApps, uploadedFiles...)
2922+
2923+
// Upload V1 apps to S3 for Search Head Cluster
2924+
testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Search Head Cluster", appVersion))
2925+
s3TestDirShc = "c3appfw-shc-" + testenv.RandomDNSName(4)
2926+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirShc, appFileList, downloadDirV1)
2927+
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Search Head Cluster", appVersion))
2928+
uploadedApps = append(uploadedApps, uploadedFiles...)
2929+
2930+
// Create App framework Spec for C3
2931+
appSourceNameIdxc = "appframework-idxc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
2932+
appSourceNameShc = "appframework-shc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
2933+
appSourceVolumeNameIdxc := "appframework-test-volume-idxc-" + testenv.RandomDNSName(3)
2934+
appSourceVolumeNameShc := "appframework-test-volume-shc-" + testenv.RandomDNSName(3)
2935+
appFrameworkSpecIdxc := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeNameIdxc, enterpriseApi.ScopeCluster, appSourceNameIdxc, s3TestDirIdxc, 60)
2936+
appFrameworkSpecShc := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, s3TestDirShc, 60)
2937+
2938+
// Deploy C3 CRD
2939+
testcaseEnvInst.Log.Info("Deploy Single Site Indexer Cluster with Search Head Cluster")
2940+
indexerReplicas := 3
2941+
shReplicas := 3
2942+
cm, _, shc, err := deployment.DeploySingleSiteClusterWithGivenAppFrameworkSpec(ctx, deployment.GetName(), indexerReplicas, true, appFrameworkSpecIdxc, appFrameworkSpecShc, "", "")
2943+
Expect(err).To(Succeed(), "Unable to deploy Single Site Indexer Cluster with Search Head Cluster")
2944+
2945+
// Verify App Download is completed on Cluster Manager
2946+
testenv.VerifyAppState(ctx, deployment, testcaseEnvInst, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList, enterpriseApi.AppPkgPodCopyComplete, enterpriseApi.AppPkgPodCopyPending)
2947+
2948+
//Delete apps from init-apps while app installation is in progress
2949+
cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())}
2950+
podDownloadPath := testenv.AppStagingLocOnPod + appSourceVolumeNameIdxc + testenv.AppInfo[appList[0]]["filename"]
2951+
err = testenv.DeleteFilesOnPod(ctx, deployment, testcaseEnvInst.GetName(), cmPod[0], []string{podDownloadPath})
2952+
Expect(err).To(Succeed(), "Unable to delete file on pod")
2953+
2954+
// Ensure Cluster Manager goes to Ready phase
2955+
testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst)
2956+
2957+
// Ensure Indexers go to Ready phase
2958+
testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst)
2959+
2960+
// Ensure Search Head Cluster go to Ready phase
2961+
testenv.SearchHeadClusterReady(ctx, deployment, testcaseEnvInst)
2962+
2963+
// Verify RF SF is met
2964+
testenv.VerifyRFSFMet(ctx, deployment, testcaseEnvInst)
2965+
2966+
// Get Pod age to check for pod resets later
2967+
splunkPodAge := testenv.GetPodsStartTime(testcaseEnvInst.GetName())
2968+
2969+
//######### VERIFICATIONS #############
2970+
var idxcPodNames, shcPodNames []string
2971+
idxcPodNames = testenv.GeneratePodNameSlice(testenv.IndexerPod, deployment.GetName(), indexerReplicas, false, 1)
2972+
shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), indexerReplicas, false, 1)
2973+
deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())}
2974+
cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appList, CrAppFileList: appFileList, CrReplicas: indexerReplicas, CrClusterPods: idxcPodNames}
2975+
shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appList, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames}
2976+
allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo}
2977+
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
2978+
2979+
// Verify no pods reset by checking the pod age
2980+
testenv.VerifyNoPodReset(ctx, deployment, testcaseEnvInst, testcaseEnvInst.GetName(), splunkPodAge, nil)
2981+
2982+
})
2983+
})
28882984
})

test/m4/appframework/appframework_test.go

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,4 +2453,98 @@ var _ = Describe("m4appfw test", func() {
24532453
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
24542454
})
24552455
})
2456+
2457+
Context("Multisite Indexer Cluster with Search Head Cluster (m4) with App Framework", func() {
2458+
It("integration, m4, appframeworkm4, appframework: can deploy a M4 SVA with App Framework enabled and delete apps from init-apps when download is compelte", func() {
2459+
2460+
/* Test Steps
2461+
################## SETUP ##################
2462+
* Upload V1 apps to S3 for Indexer Cluster and Search Head Cluster
2463+
* Prepare and deploy M4 CRD with app framework and wait for the pods to be ready
2464+
* When app download is complete, delete apps from init-apps
2465+
########## VERIFICATIONS ##########
2466+
* Verify Apps Downloaded in App Deployment Info
2467+
* Verify Apps Copied in App Deployment Info
2468+
* Verify App Package is deleted from Operator Pod
2469+
* Verify Apps Installed in App Deployment Info
2470+
* Verify App Package is deleted from Splunk Pod
2471+
* Verify bundle push is successful
2472+
* Verify apps are copied and installed on Monitoring Console and on Search Heads and Indexers pods
2473+
*/
2474+
2475+
//################## SETUP ##################
2476+
// Download all apps from S3
2477+
appList := append(testenv.BigSingleApp, testenv.ExtraApps...)
2478+
appFileList := testenv.GetAppFileList(appList)
2479+
err := testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
2480+
Expect(err).To(Succeed(), "Unable to download big-size app")
2481+
2482+
// Upload V1 apps to S3 for Indexer Cluster
2483+
appVersion := "V1"
2484+
testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Indexer Cluster", appVersion))
2485+
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
2486+
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Indexer Cluster", appVersion))
2487+
uploadedApps = append(uploadedApps, uploadedFiles...)
2488+
2489+
// Upload V1 apps to S3 for Search Head Cluster
2490+
testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Search Head Cluster", appVersion))
2491+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirShc, appFileList, downloadDirV1)
2492+
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Search Head Cluster", appVersion))
2493+
uploadedApps = append(uploadedApps, uploadedFiles...)
2494+
2495+
// Create App framework Spec for M4
2496+
appSourceNameIdxc = "appframework-idxc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
2497+
appSourceNameShc = "appframework-shc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
2498+
appFrameworkSpecIdxc := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeNameIdxc, enterpriseApi.ScopeCluster, appSourceNameIdxc, s3TestDirIdxc, 60)
2499+
appFrameworkSpecShc := testenv.GenerateAppFrameworkSpec(testcaseEnvInst, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, s3TestDirShc, 60)
2500+
2501+
// Deploy M4 CRD
2502+
testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster with Search Head Cluster")
2503+
siteCount := 3
2504+
shReplicas := 3
2505+
indexersPerSite := 1
2506+
cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, "", "")
2507+
Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App framework")
2508+
2509+
// Verify App Download is completed on Cluster Manager
2510+
testenv.VerifyAppState(ctx, deployment, testcaseEnvInst, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList, enterpriseApi.AppPkgPodCopyComplete, enterpriseApi.AppPkgPodCopyPending)
2511+
2512+
//Delete apps from init-apps while app installation is in progress
2513+
cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())}
2514+
podDownloadPath := testenv.AppStagingLocOnPod + appSourceVolumeNameIdxc + testenv.AppInfo[appList[0]]["filename"]
2515+
err = testenv.DeleteFilesOnPod(ctx, deployment, testcaseEnvInst.GetName(), cmPod[0], []string{podDownloadPath})
2516+
Expect(err).To(Succeed(), "Unable to delete file on pod")
2517+
2518+
// Ensure that the Cluster Manager goes to Ready phase
2519+
testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst)
2520+
2521+
// Ensure the Indexers of all sites go to Ready phase
2522+
testenv.IndexersReady(ctx, deployment, testcaseEnvInst, siteCount)
2523+
2524+
// Ensure Indexer Cluster configured as Multisite
2525+
testenv.IndexerClusterMultisiteStatus(ctx, deployment, testcaseEnvInst, siteCount)
2526+
2527+
// Ensure Search Head Cluster go to Ready phase
2528+
testenv.SearchHeadClusterReady(ctx, deployment, testcaseEnvInst)
2529+
2530+
// Verify RF SF is met
2531+
testenv.VerifyRFSFMet(ctx, deployment, testcaseEnvInst)
2532+
2533+
// Get Pod age to check for pod resets later
2534+
splunkPodAge := testenv.GetPodsStartTime(testcaseEnvInst.GetName())
2535+
2536+
//########## VERIFICATIONS ##########
2537+
var idxcPodNames, shcPodNames []string
2538+
idxcPodNames = testenv.GeneratePodNameSlice(testenv.MultiSiteIndexerPod, deployment.GetName(), 1, true, siteCount)
2539+
shcPodNames = testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1)
2540+
deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())}
2541+
cmAppSourceInfo := testenv.AppSourceInfo{CrKind: cm.Kind, CrName: cm.Name, CrAppSourceName: appSourceNameIdxc, CrAppSourceVolumeName: appSourceVolumeNameIdxc, CrPod: cmPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appList, CrAppFileList: appFileList, CrReplicas: indexersPerSite, CrMultisite: true, CrClusterPods: idxcPodNames}
2542+
shcAppSourceInfo := testenv.AppSourceInfo{CrKind: shc.Kind, CrName: shc.Name, CrAppSourceName: appSourceNameShc, CrAppSourceVolumeName: appSourceVolumeNameShc, CrPod: deployerPod, CrAppVersion: appVersion, CrAppScope: enterpriseApi.ScopeCluster, CrAppList: appList, CrAppFileList: appFileList, CrReplicas: shReplicas, CrClusterPods: shcPodNames}
2543+
allAppSourceInfo := []testenv.AppSourceInfo{cmAppSourceInfo, shcAppSourceInfo}
2544+
testenv.AppFrameWorkVerifications(ctx, deployment, testcaseEnvInst, allAppSourceInfo, splunkPodAge, "")
2545+
2546+
// Verify no pods reset by checking the pod age
2547+
testenv.VerifyNoPodReset(ctx, deployment, testcaseEnvInst, testcaseEnvInst.GetName(), splunkPodAge, nil)
2548+
})
2549+
})
24562550
})

0 commit comments

Comments
 (0)