Skip to content

Commit 64cf023

Browse files
committed
CSPL-3775 Restoring accidentally removed test cases
1 parent c04eae9 commit 64cf023

1 file changed

Lines changed: 273 additions & 0 deletions

File tree

test/appframework_aws/m4/manager_appframework_test.go

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,279 @@ var _ = Describe("m4appfw test", func() {
12371237
})
12381238
})
12391239

1240+
Context("Multisite Indexer Cluster with Search Head Cluster (M4) and App Framework", func() {
1241+
It("integration, m4, managerappframeworkm4, appframework: 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", func() {
1242+
1243+
/* Test Steps
1244+
################## SETUP ####################
1245+
* Upload V1 apps to S3 for Monitoring Console
1246+
* Create app source for Monitoring Console
1247+
* Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready
1248+
* Upload big-size app to S3 for Indexer Cluster and Search Head Cluster
1249+
* Create app sources for Cluster Manager and Deployer
1250+
* Prepare and deploy M4 CRD with app framework
1251+
* Verify app installation is in progress on Cluster Manager and Deployer
1252+
* Upload more apps from S3 during bigger app install
1253+
* Wait for polling interval to pass
1254+
* Verify all apps are installed on Cluster Manager and Deployer
1255+
*/
1256+
1257+
//################## SETUP ####################
1258+
// Upload V1 apps to S3 for Monitoring Console
1259+
appVersion := "V1"
1260+
appFileList := testenv.GetAppFileList(appListV1)
1261+
testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Monitoring Console", appVersion))
1262+
s3TestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4)
1263+
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirMC, appFileList, downloadDirV1)
1264+
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Monitoring Console", appVersion))
1265+
uploadedApps = append(uploadedApps, uploadedFiles...)
1266+
1267+
// Prepare Monitoring Console spec with its own app source
1268+
appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3)
1269+
appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3)
1270+
appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, s3TestDirMC, 60)
1271+
1272+
mcSpec := enterpriseApi.MonitoringConsoleSpec{
1273+
CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{
1274+
Spec: enterpriseApi.Spec{
1275+
ImagePullPolicy: "IfNotPresent",
1276+
Image: testcaseEnvInst.GetSplunkImage(),
1277+
},
1278+
Volumes: []corev1.Volume{},
1279+
},
1280+
AppFrameworkConfig: appFrameworkSpecMC,
1281+
}
1282+
1283+
// Deploy Monitoring Console
1284+
testcaseEnvInst.Log.Info("Deploy Monitoring Console")
1285+
mcName := deployment.GetName()
1286+
mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec)
1287+
Expect(err).To(Succeed(), "Unable to deploy Monitoring Console")
1288+
1289+
// Verify Monitoring Console is ready and stays in ready state
1290+
testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)
1291+
1292+
// Download all test apps from S3
1293+
appList := append(testenv.BigSingleApp, testenv.ExtraApps...)
1294+
appFileList = testenv.GetAppFileList(appList)
1295+
err = testenv.DownloadFilesFromS3(testDataS3Bucket, testenv.AppLocationV1, downloadDirV1, appFileList)
1296+
Expect(err).To(Succeed(), "Unable to download apps")
1297+
1298+
// Upload big-size app to S3 for Cluster Manager
1299+
appList = testenv.BigSingleApp
1300+
appFileList = testenv.GetAppFileList(appList)
1301+
testcaseEnvInst.Log.Info("Upload big-size app to S3 for Cluster Manager")
1302+
s3TestDirIdxc = "m4appfw-idxc-" + testenv.RandomDNSName(4)
1303+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
1304+
Expect(err).To(Succeed(), "Unable to upload big-size app to S3 test directory for Cluster Manager")
1305+
uploadedApps = append(uploadedApps, uploadedFiles...)
1306+
1307+
// Upload big-size app to S3 for Search Head Cluster
1308+
testcaseEnvInst.Log.Info("Upload big-size app to S3 for Search Head Cluster")
1309+
s3TestDirShc = "m4appfw-shc-" + testenv.RandomDNSName(4)
1310+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirShc, appFileList, downloadDirV1)
1311+
Expect(err).To(Succeed(), "Unable to upload big-size app to S3 test directory for Search Head Cluster")
1312+
uploadedApps = append(uploadedApps, uploadedFiles...)
1313+
1314+
// Create App Framework Spec for M4
1315+
appSourceNameIdxc = "appframework-idxc-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3)
1316+
appSourceNameShc = "appframework-shc-" + enterpriseApi.ScopeLocal + testenv.RandomDNSName(3)
1317+
appSourceVolumeNameIdxc := "appframework-test-volume-idxc-" + testenv.RandomDNSName(3)
1318+
appSourceVolumeNameShc := "appframework-test-volume-shc-" + testenv.RandomDNSName(3)
1319+
appFrameworkSpecIdxc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameIdxc, enterpriseApi.ScopeLocal, appSourceNameIdxc, s3TestDirIdxc, 60)
1320+
appFrameworkSpecShc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameShc, enterpriseApi.ScopeLocal, appSourceNameShc, s3TestDirShc, 60)
1321+
1322+
// Deploy M4 CRD
1323+
testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster with Search Head Cluster")
1324+
siteCount := 3
1325+
indexersPerSite := 1
1326+
cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "")
1327+
Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework")
1328+
1329+
// Verify App installation is in progress on Cluster Manager
1330+
testcaseEnvInst.VerifyAppState(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList, enterpriseApi.AppPkgInstallComplete, enterpriseApi.AppPkgPodCopyComplete)
1331+
1332+
// Upload more apps to S3 for Cluster Manager
1333+
appList = testenv.ExtraApps
1334+
appFileList = testenv.GetAppFileList(appList)
1335+
testcaseEnvInst.Log.Info("Upload more apps to S3 for Cluster Manager")
1336+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
1337+
Expect(err).To(Succeed(), "Unable to upload more apps to S3 test directory for Cluster Manager")
1338+
uploadedApps = append(uploadedApps, uploadedFiles...)
1339+
1340+
// Upload more apps to S3 for Deployer
1341+
testcaseEnvInst.Log.Info("Upload more apps to S3 for Deployer")
1342+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirShc, appFileList, downloadDirV1)
1343+
Expect(err).To(Succeed(), "Unable to upload more apps to S3 test directory for Deployer")
1344+
uploadedApps = append(uploadedApps, uploadedFiles...)
1345+
1346+
// Ensure Cluster Manager goes to Ready phase
1347+
testcaseEnvInst.VerifyClusterManagerReady(ctx, deployment)
1348+
1349+
// Wait for polling interval to pass
1350+
testcaseEnvInst.WaitForAppInstall(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList)
1351+
1352+
// Verify all apps are installed on Cluster Manager
1353+
appList = append(testenv.BigSingleApp, testenv.ExtraApps...)
1354+
appFileList = testenv.GetAppFileList(appList)
1355+
cmPod := []string{fmt.Sprintf(testenv.ClusterManagerPod, deployment.GetName())}
1356+
testcaseEnvInst.Log.Info(fmt.Sprintf("Verify all apps %v are installed on Cluster Manager", appList))
1357+
testcaseEnvInst.VerifyAppInstalled(ctx, deployment, testcaseEnvInst.GetName(), cmPod, appList, true, "enabled", false, false)
1358+
1359+
// Ensure Search Head Cluster go to Ready phase
1360+
testcaseEnvInst.VerifySearchHeadClusterReady(ctx, deployment)
1361+
1362+
// Wait for SearchHeadCluster to reach Ready phase
1363+
err = testcaseEnvInst.WaitForSearchHeadClusterPhase(ctx, deployment, testcaseEnvInst.GetName(), shc.Name, enterpriseApi.PhaseReady, 60*time.Second)
1364+
Expect(err).To(Succeed(), "Timed out waiting for SearchHeadCluster to reach Ready phase")
1365+
1366+
// Wait for polling interval to pass
1367+
testcaseEnvInst.WaitForAppInstall(ctx, deployment, deployment.GetName()+"-shc", shc.Kind, appSourceNameShc, appFileList)
1368+
1369+
// Verify all apps are installed on Deployer
1370+
deployerPod := []string{fmt.Sprintf(testenv.DeployerPod, deployment.GetName())}
1371+
testcaseEnvInst.Log.Info(fmt.Sprintf("Verify all apps %v are installed on Deployer", appList))
1372+
testcaseEnvInst.VerifyAppInstalled(ctx, deployment, testcaseEnvInst.GetName(), deployerPod, appList, true, "enabled", false, false)
1373+
})
1374+
})
1375+
1376+
Context("Single Site Indexer Cluster with Search Head Cluster (M4) and App Framework", func() {
1377+
It("smoke, m4, managerappframeworkm4, appframework: can deploy a M4, add new apps to app source while install is in progress and have all apps installed cluster-wide", func() {
1378+
1379+
/* Test Steps
1380+
################## SETUP ####################
1381+
* Upload V1 apps to S3 for Monitoring Console
1382+
* Create app source for Monitoring Console
1383+
* Prepare and deploy Monitoring Console CRD with app framework and wait for the pod to be ready
1384+
* Upload big-size app to S3 for Indexer Cluster and Search Head Cluster
1385+
* Create app sources for Cluster Manager and Deployer
1386+
* Prepare and deploy M4 CRD with app framework and wait for the pods to be ready
1387+
############## VERIFICATIONS ################
1388+
* Verify App installation is in progress on Cluster Manager and Deployer
1389+
* Upload more apps from S3 during bigger app install
1390+
* Wait for polling interval to pass
1391+
* Verify all apps are installed on Cluster Manager and Deployer
1392+
*/
1393+
1394+
//################## SETUP ####################
1395+
// Upload V1 apps to S3 for Monitoring Console
1396+
appVersion := "V1"
1397+
appFileList := testenv.GetAppFileList(appListV1)
1398+
testcaseEnvInst.Log.Info(fmt.Sprintf("Upload %s apps to S3 for Monitoring Console", appVersion))
1399+
s3TestDirMC := "m4appfw-mc-" + testenv.RandomDNSName(4)
1400+
uploadedFiles, err := testenv.UploadFilesToS3(testS3Bucket, s3TestDirMC, appFileList, downloadDirV1)
1401+
Expect(err).To(Succeed(), fmt.Sprintf("Unable to upload %s apps to S3 test directory for Monitoring Console", appVersion))
1402+
uploadedApps = append(uploadedApps, uploadedFiles...)
1403+
1404+
// Prepare Monitoring Console spec with its own app source
1405+
appSourceNameMC := "appframework-" + enterpriseApi.ScopeLocal + "mc-" + testenv.RandomDNSName(3)
1406+
appSourceVolumeNameMC := "appframework-test-volume-mc-" + testenv.RandomDNSName(3)
1407+
appFrameworkSpecMC := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameMC, enterpriseApi.ScopeLocal, appSourceNameMC, s3TestDirMC, 60)
1408+
1409+
mcSpec := enterpriseApi.MonitoringConsoleSpec{
1410+
CommonSplunkSpec: enterpriseApi.CommonSplunkSpec{
1411+
Spec: enterpriseApi.Spec{
1412+
ImagePullPolicy: "IfNotPresent",
1413+
Image: testcaseEnvInst.GetSplunkImage(),
1414+
},
1415+
Volumes: []corev1.Volume{},
1416+
},
1417+
AppFrameworkConfig: appFrameworkSpecMC,
1418+
}
1419+
1420+
// Deploy Monitoring Console
1421+
testcaseEnvInst.Log.Info("Deploy Monitoring Console")
1422+
mcName := deployment.GetName()
1423+
mc, err := deployment.DeployMonitoringConsoleWithGivenSpec(ctx, testcaseEnvInst.GetName(), mcName, mcSpec)
1424+
Expect(err).To(Succeed(), "Unable to deploy Monitoring Console")
1425+
1426+
// Verify Monitoring Console is ready and stays in ready state
1427+
testcaseEnvInst.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc)
1428+
1429+
// Download all test apps from S3
1430+
appList := append(testenv.BigSingleApp, testenv.ExtraApps...)
1431+
appFileList = testenv.GetAppFileList(appList)
1432+
err = testenv.DownloadFilesFromS3(testDataS3Bucket, testenv.AppLocationV1, downloadDirV1, appFileList)
1433+
Expect(err).To(Succeed(), "Unable to download apps")
1434+
1435+
// Upload big-size app to S3 for Cluster Manager
1436+
appList = testenv.BigSingleApp
1437+
appFileList = testenv.GetAppFileList(appList)
1438+
testcaseEnvInst.Log.Info("Upload big-size app to S3 for Cluster Manager")
1439+
s3TestDirIdxc = "m4appfw-idxc-" + testenv.RandomDNSName(4)
1440+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
1441+
Expect(err).To(Succeed(), "Unable to upload big-size app to S3 test directory for Cluster Manager")
1442+
uploadedApps = append(uploadedApps, uploadedFiles...)
1443+
1444+
// Upload big-size app to S3 for Search Head Cluster
1445+
testcaseEnvInst.Log.Info("Upload big-size app to S3 for Search Head Cluster")
1446+
s3TestDirShc = "m4appfw-shc-" + testenv.RandomDNSName(4)
1447+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirShc, appFileList, downloadDirV1)
1448+
Expect(err).To(Succeed(), "Unable to upload big-size app to S3 test directory for Search Head Cluster")
1449+
uploadedApps = append(uploadedApps, uploadedFiles...)
1450+
1451+
// Create App Framework Spec for M4
1452+
appSourceNameIdxc = "appframework-idxc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
1453+
appSourceNameShc = "appframework-shc-" + enterpriseApi.ScopeCluster + testenv.RandomDNSName(3)
1454+
appSourceVolumeNameIdxc := "appframework-test-volume-idxc-" + testenv.RandomDNSName(3)
1455+
appSourceVolumeNameShc := "appframework-test-volume-shc-" + testenv.RandomDNSName(3)
1456+
appFrameworkSpecIdxc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameIdxc, enterpriseApi.ScopeCluster, appSourceNameIdxc, s3TestDirIdxc, 60)
1457+
appFrameworkSpecShc := testcaseEnvInst.GenerateAppFrameworkSpec(ctx, appSourceVolumeNameShc, enterpriseApi.ScopeCluster, appSourceNameShc, s3TestDirShc, 60)
1458+
1459+
// Deploy M4 CRD
1460+
testcaseEnvInst.Log.Info("Deploy Multisite Indexer Cluster with Search Head Cluster")
1461+
siteCount := 3
1462+
shReplicas := 3
1463+
indexersPerSite := 1
1464+
cm, _, shc, err := deployment.DeployMultisiteClusterWithSearchHeadAndAppFramework(ctx, deployment.GetName(), indexersPerSite, siteCount, appFrameworkSpecIdxc, appFrameworkSpecShc, true, mcName, "")
1465+
Expect(err).To(Succeed(), "Unable to deploy Multisite Indexer Cluster and Search Head Cluster with App Framework")
1466+
1467+
// Verify App installation is in progress
1468+
testcaseEnvInst.VerifyAppState(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList, enterpriseApi.AppPkgInstallComplete, enterpriseApi.AppPkgPodCopyComplete)
1469+
1470+
// Upload more apps to S3 for Cluster Manager
1471+
appList = testenv.ExtraApps
1472+
appFileList = testenv.GetAppFileList(appList)
1473+
testcaseEnvInst.Log.Info("Upload more apps to S3 for Cluster Manager")
1474+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirIdxc, appFileList, downloadDirV1)
1475+
Expect(err).To(Succeed(), "Unable to upload more apps to S3 test directory for Cluster Manager")
1476+
uploadedApps = append(uploadedApps, uploadedFiles...)
1477+
1478+
// Upload more apps to S3 for Deployer
1479+
testcaseEnvInst.Log.Info("Upload more apps to S3 for Deployer")
1480+
uploadedFiles, err = testenv.UploadFilesToS3(testS3Bucket, s3TestDirShc, appFileList, downloadDirV1)
1481+
Expect(err).To(Succeed(), "Unable to upload more apps to S3 test directory for Deployer")
1482+
uploadedApps = append(uploadedApps, uploadedFiles...)
1483+
1484+
// Ensure Cluster Manager goes to Ready phase
1485+
testcaseEnvInst.VerifyClusterManagerReady(ctx, deployment)
1486+
1487+
// Wait for polling interval to pass
1488+
testcaseEnvInst.WaitForAppInstall(ctx, deployment, deployment.GetName(), cm.Kind, appSourceNameIdxc, appFileList)
1489+
1490+
// Ensure the Indexers of all sites go to Ready phase
1491+
testcaseEnvInst.VerifyIndexersReady(ctx, deployment, siteCount)
1492+
1493+
// Verify all apps are installed on indexers
1494+
appList = append(testenv.BigSingleApp, testenv.ExtraApps...)
1495+
appFileList = testenv.GetAppFileList(appList)
1496+
idxcPodNames := testenv.GeneratePodNameSlice(testenv.MultiSiteIndexerPod, deployment.GetName(), indexersPerSite, true, siteCount)
1497+
testcaseEnvInst.Log.Info(fmt.Sprintf("Verify all apps %v are installed on indexers", appList))
1498+
testcaseEnvInst.VerifyAppInstalled(ctx, deployment, testcaseEnvInst.GetName(), idxcPodNames, appList, true, "enabled", false, true)
1499+
1500+
// Ensure Search Head Cluster go to Ready phase
1501+
testcaseEnvInst.VerifySearchHeadClusterReady(ctx, deployment)
1502+
1503+
// Wait for polling interval to pass
1504+
testcaseEnvInst.WaitForAppInstall(ctx, deployment, deployment.GetName()+"-shc", shc.Kind, appSourceNameShc, appFileList)
1505+
1506+
// Verify all apps are installed on Search Heads
1507+
shcPodNames := testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), shReplicas, false, 1)
1508+
testcaseEnvInst.Log.Info(fmt.Sprintf("Verify all apps %v are installed on Search Heads", appList))
1509+
testcaseEnvInst.VerifyAppInstalled(ctx, deployment, testcaseEnvInst.GetName(), shcPodNames, appList, true, "enabled", false, true)
1510+
})
1511+
})
1512+
12401513
Context("Multisite Indexer Cluster with Search Head Cluster (M4) with App Framework", func() {
12411514
It("integration, m4, managerappframeworkm4, appframework: 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", func() {
12421515

0 commit comments

Comments
 (0)