@@ -18,11 +18,14 @@ import (
1818 "fmt"
1919 "strings"
2020
21+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
2123 "github.com/onsi/ginkgo/types"
2224 . "github.com/onsi/ginkgo/v2"
2325 . "github.com/onsi/gomega"
2426
2527 enterpriseApi "github.com/splunk/splunk-operator/api/v4"
28+ "github.com/splunk/splunk-operator/pkg/splunk/enterprise"
2629
2730 "github.com/splunk/splunk-operator/test/testenv"
2831)
@@ -33,6 +36,8 @@ var _ = Describe("indingsep test", func() {
3336 var deployment * testenv.Deployment
3437
3538 var cmSpec enterpriseApi.ClusterManagerSpec
39+ var s3TestDir string
40+ var appSourceVolumeName string
3641
3742 ctx := context .TODO ()
3843
@@ -54,6 +59,8 @@ var _ = Describe("indingsep test", func() {
5459 },
5560 },
5661 }
62+ s3TestDir = "s1appfw-" + testenv .RandomDNSName (4 )
63+ appSourceVolumeName = "appframework-test-volume-" + testenv .RandomDNSName (3 )
5764 })
5865
5966 AfterEach (func () {
@@ -118,41 +125,93 @@ var _ = Describe("indingsep test", func() {
118125 })
119126 })
120127
121- // Context("Ingestor and Indexer deployment", func() {
122- // It("indingsep, smoke, indingsep: Splunk Operator can deploy Ingestors and Indexers with additional configurations", func() {
123- // // Create Service Account
124- // testcaseEnvInst.Log.Info("Create Service Account")
125- // testcaseEnvInst.CreateServiceAccount(serviceAccountName)
126-
127- // // Deploy Ingestor Cluster
128- // testcaseEnvInst.Log.Info("Deploy Ingestor Cluster")
129- // _, err := deployment.DeployIngestorCluster(ctx, deployment.GetName()+"-ingest", 3, bus, pipelineConfig, serviceAccountName)
130- // Expect(err).To(Succeed(), "Unable to deploy Ingestor Cluster")
131-
132- // // Deploy Cluster Manager
133- // testcaseEnvInst.Log.Info("Deploy Cluster Manager")
134- // _, err = deployment.DeployClusterManagerWithGivenSpec(ctx, deployment.GetName(), cmSpec)
135- // Expect(err).To(Succeed(), "Unable to deploy Cluster Manager")
136-
137- // // Deploy Indexer Cluster
138- // testcaseEnvInst.Log.Info("Deploy Indexer Cluster")
139- // _, err = deployment.DeployIndexerCluster(ctx, deployment.GetName()+"-idxc", "", 3, deployment.GetName(), "", bus, pipelineConfig, serviceAccountName)
140- // Expect(err).To(Succeed(), "Unable to deploy Indexer Cluster")
141-
142- // // Ensure that Ingestor Cluster is in Ready phase
143- // testcaseEnvInst.Log.Info("Ensure that Ingestor Cluster is in Ready phase")
144- // testenv.IngestorReady(ctx, deployment, testcaseEnvInst)
145-
146- // // Ensure that Cluster Manager is in Ready phase
147- // testcaseEnvInst.Log.Info("Ensure that Cluster Manager is in Ready phase")
148- // testenv.ClusterManagerReady(ctx, deployment, testcaseEnvInst)
149-
150- // // Ensure that Indexer Cluster is in Ready phase
151- // testcaseEnvInst.Log.Info("Ensure that Indexer Cluster is in Ready phase")
152- // testenv.SingleSiteIndexersReady(ctx, deployment, testcaseEnvInst)
153-
154- // })
155- // })
128+ Context ("Ingestor and Indexer deployment" , func () {
129+ It ("indingsep, smoke, indingsep: Splunk Operator can deploy Ingestors and Indexers with additional configurations" , func () {
130+ // Create Service Account
131+ testcaseEnvInst .Log .Info ("Create Service Account" )
132+ testcaseEnvInst .CreateServiceAccount (serviceAccountName )
133+
134+ // Deploy Ingestor Cluster with additional configurations (similar to standalone app framework test)
135+ appSourceName := "appframework-" + enterpriseApi .ScopeLocal + testenv .RandomDNSName (3 )
136+ appFrameworkSpec := testenv .GenerateAppFrameworkSpec (ctx , testcaseEnvInst , appSourceVolumeName , enterpriseApi .ScopeLocal , appSourceName , s3TestDir , 60 )
137+ appFrameworkSpec .MaxConcurrentAppDownloads = uint64 (5 )
138+ ic := & enterpriseApi.IngestorCluster {
139+ ObjectMeta : metav1.ObjectMeta {
140+ Name : deployment .GetName () + "-ingest" ,
141+ Namespace : testcaseEnvInst .GetName (),
142+ },
143+ Spec : enterpriseApi.IngestorClusterSpec {
144+ CommonSplunkSpec : enterpriseApi.CommonSplunkSpec {
145+ ServiceAccount : serviceAccountName ,
146+ LivenessInitialDelaySeconds : 600 ,
147+ ReadinessInitialDelaySeconds : 50 ,
148+ StartupProbe : & enterpriseApi.Probe {
149+ InitialDelaySeconds : 40 ,
150+ TimeoutSeconds : 30 ,
151+ PeriodSeconds : 30 ,
152+ FailureThreshold : 12 ,
153+ },
154+ LivenessProbe : & enterpriseApi.Probe {
155+ InitialDelaySeconds : 400 ,
156+ TimeoutSeconds : 30 ,
157+ PeriodSeconds : 30 ,
158+ FailureThreshold : 12 ,
159+ },
160+ ReadinessProbe : & enterpriseApi.Probe {
161+ InitialDelaySeconds : 20 ,
162+ TimeoutSeconds : 30 ,
163+ PeriodSeconds : 30 ,
164+ FailureThreshold : 12 ,
165+ },
166+ Spec : enterpriseApi.Spec {
167+ ImagePullPolicy : "Always" ,
168+ Image : testcaseEnvInst .GetSplunkImage (),
169+ },
170+ },
171+ PushBus : bus ,
172+ PipelineConfig : pipelineConfig ,
173+ Replicas : 3 ,
174+ AppFrameworkConfig : appFrameworkSpec ,
175+ },
176+ }
177+
178+ testcaseEnvInst .Log .Info ("Deploy Ingestor Cluster with additional configurations" )
179+ _ , err := deployment .DeployIngestorClusterWithAdditionalConfiguration (ctx , ic )
180+ Expect (err ).To (Succeed (), "Unable to deploy Ingestor Cluster" )
181+
182+ // Ensure that Ingestor Cluster is in Ready phase
183+ testcaseEnvInst .Log .Info ("Ensure that Ingestor Cluster is in Ready phase" )
184+ testenv .IngestorReady (ctx , deployment , testcaseEnvInst )
185+
186+ // Verify Ingestor Cluster Pods have apps installed
187+ testcaseEnvInst .Log .Info ("Verify Ingestor Cluster Pods have apps installed" )
188+ ingestorPod := []string {fmt .Sprintf (testenv .IngestorPod , deployment .GetName ()+ "-ingest" , 0 )}
189+ ingestorAppSourceInfo := testenv.AppSourceInfo {
190+ CrKind : ic .Kind ,
191+ CrName : ic .Name ,
192+ CrAppSourceName : appSourceName ,
193+ CrPod : ingestorPod ,
194+ CrAppVersion : "V1" ,
195+ CrAppScope : enterpriseApi .ScopeLocal ,
196+ CrAppList : testenv .BasicApps ,
197+ CrAppFileList : testenv .GetAppFileList (testenv .BasicApps ),
198+ CrReplicas : 3 ,
199+ }
200+ allAppSourceInfo := []testenv.AppSourceInfo {ingestorAppSourceInfo }
201+ splunkPodAge := testenv .GetPodsStartTime (testcaseEnvInst .GetName ())
202+ testenv .AppFrameWorkVerifications (ctx , deployment , testcaseEnvInst , allAppSourceInfo , splunkPodAge , "" )
203+
204+ // Verify probe configuration
205+ testcaseEnvInst .Log .Info ("Get config map for probes" )
206+ ConfigMapName := enterprise .GetProbeConfigMapName (testcaseEnvInst .GetName ())
207+ _ , err = testenv .GetConfigMap (ctx , deployment , testcaseEnvInst .GetName (), ConfigMapName )
208+ Expect (err ).To (Succeed (), "Unable to get config map for probes" , "ConfigMap" , ConfigMapName )
209+ testcaseEnvInst .Log .Info ("Verify probe configurations on Ingestor pods" )
210+ scriptsNames := []string {enterprise .GetLivenessScriptName (), enterprise .GetReadinessScriptName (), enterprise .GetStartupScriptName ()}
211+ allPods := testenv .DumpGetPods (testcaseEnvInst .GetName ())
212+ testenv .VerifyFilesInDirectoryOnPod (ctx , deployment , testcaseEnvInst , testcaseEnvInst .GetName (), allPods , scriptsNames , enterprise .GetProbeMountDirectory (), false , true )
213+ })
214+ })
156215
157216 Context ("Ingestor and Indexer deployment" , func () {
158217 It ("indingsep, integration, indingsep: Splunk Operator can deploy Ingestors and Indexers with correct setup" , func () {
0 commit comments