Skip to content

Commit

Permalink
Migrate Phase 3 app structure to develop (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdhanoya-splunk authored Dec 9, 2021
1 parent 3c827de commit 7242f39
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 80 deletions.
8 changes: 4 additions & 4 deletions test/c3/appframework/appframework_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ var (
appListV2 []string
testDataS3Bucket = os.Getenv("TEST_BUCKET")
testS3Bucket = os.Getenv("TEST_INDEXES_S3_BUCKET")
s3AppDirV1 = "appframework/regressionappsv1/"
s3AppDirV2 = "appframework/regressionappsv2/"
s3AppDirV1 = testenv.AppLocationV1
s3AppDirV2 = testenv.AppLocationV2
currDir, _ = os.Getwd()
downloadDirV1 = filepath.Join(currDir, "c3appfwV1-"+testenv.RandomDNSName(4))
downloadDirV2 = filepath.Join(currDir, "c3appfwV2-"+testenv.RandomDNSName(4))
Expand All @@ -65,15 +65,15 @@ var _ = BeforeSuite(func() {

// Create a list of apps to upload to S3
appListV1 = testenv.BasicApps
appFileList := testenv.GetAppFileList(appListV1, 1)
appFileList := testenv.GetAppFileList(appListV1)

// Download V1 Apps from S3
err = testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
Expect(err).To(Succeed(), "Unable to download V1 app files")

// Create a list of apps to upload to S3 after poll period
appListV2 = append(appListV1, testenv.NewAppsAddedBetweenPolls...)
appFileList = testenv.GetAppFileList(appListV2, 2)
appFileList = testenv.GetAppFileList(appListV2)

// Download V2 Apps from S3
err = testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV2, downloadDirV2, appFileList)
Expand Down
52 changes: 26 additions & 26 deletions test/c3/appframework/appframework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var _ = Describe("c3appfw test", func() {
//################## SETUP ####################
// Upload V1 apps to S3 for Monitoring Console
appVersion := "V1"
appFileList := testenv.GetAppFileList(appListV1, 1)
appFileList := testenv.GetAppFileList(appListV1)
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Monitoring Console", appVersion))
s3TestDirMC := "c3appfw-mc-" + testenv.RandomDNSName(4)
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirMC, appFileList, downloadDirV1)
Expand Down Expand Up @@ -214,7 +214,7 @@ var _ = Describe("c3appfw test", func() {

// Upload V2 apps to S3 for Indexer Cluster
appVersion = "V2"
appFileList = testenv.GetAppFileList(appListV2, 2)
appFileList = testenv.GetAppFileList(appListV2)
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Indexer Cluster", appVersion))
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV2)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Indexer Cluster", appVersion))
Expand Down Expand Up @@ -312,7 +312,7 @@ var _ = Describe("c3appfw test", func() {
//################## SETUP ####################
// Upload V2 apps to S3 for Monitoring Console
appVersion := "V2"
appFileList := testenv.GetAppFileList(appListV2, 2)
appFileList := testenv.GetAppFileList(appListV2)
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Monitoring Console", appVersion))
s3TestDirMC := "c3appfw-mc-" + testenv.RandomDNSName(4)
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirMC, appFileList, downloadDirV2)
Expand Down Expand Up @@ -445,7 +445,7 @@ var _ = Describe("c3appfw test", func() {

// Upload V1 apps to S3 for Indexer Cluster
appVersion = "V1"
appFileList = testenv.GetAppFileList(appListV1, 1)
appFileList = testenv.GetAppFileList(appListV1)
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Indexers", appVersion))
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Indexers", appVersion))
Expand Down Expand Up @@ -546,7 +546,7 @@ var _ = Describe("c3appfw test", func() {
// Upload V1 apps to S3 for Indexer Cluster
appVersion := "V1"
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Indexer Cluster", appVersion))
appFileList := testenv.GetAppFileList(appListV1, 1)
appFileList := testenv.GetAppFileList(appListV1)
s3TestDirIdxc = "c3appfw-idxc-" + testenv.RandomDNSName(4)
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Indexer Cluster", appVersion))
Expand Down Expand Up @@ -771,7 +771,7 @@ var _ = Describe("c3appfw test", func() {
// Upload V1 apps to S3 for Indexer Cluster
appVersion := "V1"
s3TestDirIdxc = "c3appfw-idxc-" + testenv.RandomDNSName(4)
appFileList := testenv.GetAppFileList(appListV1, 1)
appFileList := testenv.GetAppFileList(appListV1)
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Indexer Cluster", appVersion))
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Indexer Cluster", appVersion))
Expand Down Expand Up @@ -842,7 +842,7 @@ var _ = Describe("c3appfw test", func() {
// Upload V2 apps to S3
appVersion = "V2"
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3", appVersion))
appFileList = testenv.GetAppFileList(appListV2, 2)
appFileList = testenv.GetAppFileList(appListV2)
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV2)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Indexer Cluster", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)
Expand Down Expand Up @@ -903,7 +903,7 @@ var _ = Describe("c3appfw test", func() {
// Download ES app from S3
testenvInstance.Log.Info("Download ES app from S3")
esApp := []string{"SplunkEnterpriseSecuritySuite"}
appFileList := testenv.GetAppFileList(esApp, 1)
appFileList := testenv.GetAppFileList(esApp)
err := testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
Expect(err).To(Succeed(), "Unable to download ES app file from S3")

Expand Down Expand Up @@ -1018,15 +1018,15 @@ var _ = Describe("c3appfw test", func() {
// Upload appListLocal list of apps to S3 (to be used for local install)
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for local install (local scope)", appVersion))
s3TestDir := "c3appfw-" + testenv.RandomDNSName(4)
appFileList := testenv.GetAppFileList(appListLocal, 1)
appFileList := testenv.GetAppFileList(appListLocal)
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDir, appFileList, downloadDirV1)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps (local scope) to S3 test directory", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)

// Upload appListCluster list of apps to S3 (to be used for cluster-wide install)
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for cluster-wide install (cluster scope)", appVersion))
s3TestDirCluster := "c3appfw-cluster-" + testenv.RandomDNSName(4)
clusterappFileList := testenv.GetAppFileList(appListCluster, 1)
clusterappFileList := testenv.GetAppFileList(appListCluster)
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirCluster, clusterappFileList, downloadDirV1)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps (cluster scope) to S3 test directory", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)
Expand Down Expand Up @@ -1077,13 +1077,13 @@ var _ = Describe("c3appfw test", func() {
// Verify V1 apps with local scope are downloaded
initContDownloadLocation := "/init-apps/" + appSourceNameLocal
downloadPodNames := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName()), fmt.Sprintf(testenv.DeployerPod, deployment.GetName())}
appFileList = testenv.GetAppFileList(appListLocal, 1)
appFileList = testenv.GetAppFileList(appListLocal)
testenvInstance.Log.Info(fmt.Sprintf("Verify %s apps with local scope are downloaded (App list: %s)", appVersion, appFileList))
testenv.VerifyAppsDownloadedByInitContainer(deployment, testenvInstance, testenvInstance.GetName(), downloadPodNames, appFileList, initContDownloadLocation)

// Verify V1 apps with cluster scope are downloaded
initContDownloadLocation = "/init-apps/" + appSourceNameCluster
appFileList = testenv.GetAppFileList(appListCluster, 1)
appFileList = testenv.GetAppFileList(appListCluster)
testenvInstance.Log.Info(fmt.Sprintf("Verify %s apps with cluster scope are downloaded (App list: %s)", appVersion, appFileList))
testenv.VerifyAppsDownloadedByInitContainer(deployment, testenvInstance, testenvInstance.GetName(), downloadPodNames, appFileList, initContDownloadLocation)

Expand Down Expand Up @@ -1123,13 +1123,13 @@ var _ = Describe("c3appfw test", func() {
// Upload appListLocal list of V2 apps to S3 (to be used for local install)
appVersion = "V2"
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for local install (local scope)", appVersion))
appFileList = testenv.GetAppFileList(appListLocal, 2)
appFileList = testenv.GetAppFileList(appListLocal)
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDir, appFileList, downloadDirV2)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for local install", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)

// Upload appListCluster list of V2 apps to S3 (to be used for cluster-wide install)
clusterappFileList = testenv.GetAppFileList(appListCluster, 2)
clusterappFileList = testenv.GetAppFileList(appListCluster)
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirCluster, clusterappFileList, downloadDirV2)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for cluster-wide install", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)
Expand All @@ -1152,13 +1152,13 @@ var _ = Describe("c3appfw test", func() {
//########## UPGRADE VERIFICATION #############
// Verify apps with local scope are downloaded
initContDownloadLocation = "/init-apps/" + appSourceNameLocal
appFileList = testenv.GetAppFileList(appListLocal, 2)
appFileList = testenv.GetAppFileList(appListLocal)
testenvInstance.Log.Info(fmt.Sprintf("Verify %s apps with local scope are downloaded (App list: %s)", appVersion, appFileList))
testenv.VerifyAppsDownloadedByInitContainer(deployment, testenvInstance, testenvInstance.GetName(), downloadPodNames, appFileList, initContDownloadLocation)

// Verify apps with cluster scope are downloaded
initContDownloadLocation = "/init-apps/" + appSourceNameCluster
appFileList = testenv.GetAppFileList(appListCluster, 2)
appFileList = testenv.GetAppFileList(appListCluster)
testenvInstance.Log.Info(fmt.Sprintf("Verify %s apps with cluster scope are downloaded (App list: %s)", appVersion, appFileList))
testenv.VerifyAppsDownloadedByInitContainer(deployment, testenvInstance, testenvInstance.GetName(), downloadPodNames, appFileList, initContDownloadLocation)

Expand Down Expand Up @@ -1205,15 +1205,15 @@ var _ = Describe("c3appfw test", func() {
// Upload appListLocal to S3
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for local install (local scope)", appVersion))
s3TestDir := "c3appfw-" + testenv.RandomDNSName(4)
appFileList := testenv.GetAppFileList(appListLocal, 2)
appFileList := testenv.GetAppFileList(appListLocal)
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDir, appFileList, downloadDirV2)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s local apps to S3 test directory", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)

// Upload appListCluster list of apps to S3 (to be used for cluster-wide install)
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for cluster-wide install (cluster scope)", appVersion))
s3TestDirCluster := "c3appfw-cluster-" + testenv.RandomDNSName(4)
clusterappFileList := testenv.GetAppFileList(appListCluster, 2)
clusterappFileList := testenv.GetAppFileList(appListCluster)
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirCluster, clusterappFileList, downloadDirV2)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s cluster apps to S3 test directory", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)
Expand Down Expand Up @@ -1264,13 +1264,13 @@ var _ = Describe("c3appfw test", func() {
// Verify V2 apps with local scope are downloaded
initContDownloadLocation := "/init-apps/" + appSourceNameLocal
downloadPodNames := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName()), fmt.Sprintf(testenv.DeployerPod, deployment.GetName())}
appFileList = testenv.GetAppFileList(appListLocal, 2)
appFileList = testenv.GetAppFileList(appListLocal)
testenvInstance.Log.Info(fmt.Sprintf("Verify %s apps with local scope are downloaded (App list: %s)", appVersion, appFileList))
testenv.VerifyAppsDownloadedByInitContainer(deployment, testenvInstance, testenvInstance.GetName(), downloadPodNames, appFileList, initContDownloadLocation)

// Verify V2 apps with cluster scope are downloaded
initContDownloadLocation = "/init-apps/" + appSourceNameCluster
appFileList = testenv.GetAppFileList(appListCluster, 2)
appFileList = testenv.GetAppFileList(appListCluster)
testenvInstance.Log.Info(fmt.Sprintf("Verify %s apps with cluster scope are downloaded (App list: %s)", appVersion, appFileList))
testenv.VerifyAppsDownloadedByInitContainer(deployment, testenvInstance, testenvInstance.GetName(), downloadPodNames, appFileList, initContDownloadLocation)

Expand Down Expand Up @@ -1314,13 +1314,13 @@ var _ = Describe("c3appfw test", func() {
// Upload appListLocal list of V1 apps to S3 (to be used for local install)
appVersion = "V1"
testenvInstance.Log.Info(fmt.Sprintf("Upload %s apps to S3 for local install (local scope)", appVersion))
appFileList = testenv.GetAppFileList(appListLocal, 1)
appFileList = testenv.GetAppFileList(appListLocal)
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDir, appFileList, downloadDirV1)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps for local install to S3 test directory", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)

// Upload appListCluster list of V1 apps to S3 (to be used for cluster-wide install)
clusterappFileList = testenv.GetAppFileList(appListCluster, 1)
clusterappFileList = testenv.GetAppFileList(appListCluster)
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirCluster, clusterappFileList, downloadDirV1)
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps for cluster-wide install to S3 test directory", appVersion))
uploadedApps = append(uploadedApps, uploadedFiles...)
Expand All @@ -1343,13 +1343,13 @@ var _ = Describe("c3appfw test", func() {
//########## DOWNGRADE VERIFICATION ###########
// Verify apps with local scope are downloaded
initContDownloadLocation = "/init-apps/" + appSourceNameLocal
appFileList = testenv.GetAppFileList(appListLocal, 1)
appFileList = testenv.GetAppFileList(appListLocal)
testenvInstance.Log.Info(fmt.Sprintf("Verify %s apps with local scope are downloaded (App list: %s)", appVersion, appFileList))
testenv.VerifyAppsDownloadedByInitContainer(deployment, testenvInstance, testenvInstance.GetName(), downloadPodNames, appFileList, initContDownloadLocation)

// Verify apps with cluster scope are downloaded
initContDownloadLocation = "/init-apps/" + appSourceNameCluster
appFileList = testenv.GetAppFileList(appListCluster, 1)
appFileList = testenv.GetAppFileList(appListCluster)
testenvInstance.Log.Info(fmt.Sprintf("Verify %s apps with cluster scope are downloaded (App list: %s)", appVersion, appFileList))
testenv.VerifyAppsDownloadedByInitContainer(deployment, testenvInstance, testenvInstance.GetName(), downloadPodNames, appFileList, initContDownloadLocation)

Expand Down Expand Up @@ -1384,7 +1384,7 @@ var _ = Describe("c3appfw test", func() {
//################## SETUP ####################
// Creating a bigger list of apps to be installed than the default one
appList := []string{"splunk_app_db_connect", "splunk_app_aws", "Splunk_TA_microsoft-cloudservices", "Splunk_ML_Toolkit", "Splunk_Security_Essentials"}
appFileList := testenv.GetAppFileList(appList, 1)
appFileList := testenv.GetAppFileList(appList)

// Download apps from S3
testenvInstance.Log.Info("Download bigger amount of apps from S3 for this test")
Expand All @@ -1393,7 +1393,7 @@ var _ = Describe("c3appfw test", func() {

// Create consolidated list of app files
appList = append(appListV1, appList...)
appFileList = testenv.GetAppFileList(appList, 1)
appFileList = testenv.GetAppFileList(appList)

// Upload app to S3 for Indexer Cluster
s3TestDirIdxc = "c3appfw-idxc-" + testenv.RandomDNSName(4)
Expand Down
8 changes: 4 additions & 4 deletions test/licensemanager/lm_c3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ var _ = Describe("Licensemanager test", func() {
appListV2 []string
testS3Bucket = os.Getenv("TEST_INDEXES_S3_BUCKET")
testDataS3Bucket = os.Getenv("TEST_BUCKET")
s3AppDirV1 = "appframework/regressionappsv1/"
s3AppDirV2 = "appframework/regressionappsv2/"
s3AppDirV1 = testenv.AppLocationV1
s3AppDirV2 = testenv.AppLocationV2
currDir, _ = os.Getwd()
downloadDirV1 = filepath.Join(currDir, "lmV1-"+testenv.RandomDNSName(4))
downloadDirV2 = filepath.Join(currDir, "lmV2-"+testenv.RandomDNSName(4))
Expand All @@ -121,7 +121,7 @@ var _ = Describe("Licensemanager test", func() {

// Create a list of apps to upload to S3
appListV1 = testenv.BasicApps
appFileList := testenv.GetAppFileList(appListV1, 1)
appFileList := testenv.GetAppFileList(appListV1)

// Download V1 Apps from S3
err := testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
Expand Down Expand Up @@ -205,7 +205,7 @@ var _ = Describe("Licensemanager test", func() {

// Create a list of apps to upload to S3 after poll period
appListV2 = append(appListV1, testenv.NewAppsAddedBetweenPolls...)
appFileList = testenv.GetAppFileList(appListV2, 2)
appFileList = testenv.GetAppFileList(appListV2)

// Download V2 Apps from S3
err = testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV2, downloadDirV2, appFileList)
Expand Down
8 changes: 4 additions & 4 deletions test/m4/appframework/appframework_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ var (
appListV2 []string
testDataS3Bucket = os.Getenv("TEST_BUCKET")
testS3Bucket = os.Getenv("TEST_INDEXES_S3_BUCKET")
s3AppDirV1 = "appframework/regressionappsv1/"
s3AppDirV2 = "appframework/regressionappsv2/"
s3AppDirV1 = testenv.AppLocationV1
s3AppDirV2 = testenv.AppLocationV2
currDir, _ = os.Getwd()
downloadDirV1 = filepath.Join(currDir, "m4appfwV1-"+testenv.RandomDNSName(4))
downloadDirV2 = filepath.Join(currDir, "m4appfwV2-"+testenv.RandomDNSName(4))
Expand All @@ -65,15 +65,15 @@ var _ = BeforeSuite(func() {

// Create a list of apps to upload to S3
appListV1 = testenv.BasicApps
appFileList := testenv.GetAppFileList(appListV1, 1)
appFileList := testenv.GetAppFileList(appListV1)

// Download V1 Apps from S3
err = testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV1, downloadDirV1, appFileList)
Expect(err).To(Succeed(), "Unable to download V1 app files")

// Create a list of apps to upload to S3 after poll period
appListV2 = append(appListV1, testenv.NewAppsAddedBetweenPolls...)
appFileList = testenv.GetAppFileList(appListV2, 2)
appFileList = testenv.GetAppFileList(appListV2)

// Download V2 Apps from S3
err = testenv.DownloadFilesFromS3(testDataS3Bucket, s3AppDirV2, downloadDirV2, appFileList)
Expand Down
Loading

0 comments on commit 7242f39

Please sign in to comment.