Skip to content

Commit

Permalink
Output peers in assets.conf for MC, add sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
akondur committed Jul 17, 2024
1 parent 60dbb91 commit a29bf44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions test/monitoring_console/manager_monitoring_console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ var _ = Describe("Monitoring Console test", func() {
// Check Search Head Pods in Monitoring Console Config Map
shPods := testenv.GeneratePodNameSlice(testenv.SearchHeadPod, deployment.GetName(), defaultSHReplicas, false, 0)
testenv.VerifyPodsInMCConfigMap(ctx, deployment, testcaseEnvInst, shPods, "SPLUNK_SEARCH_HEAD_URL", mcName, true)

// Add a sleep here in case MC pod restarts to add peers
time.Sleep(300 * time.Second)

// Check Monitoring console Pod is configured with all search head
testenv.VerifyPodsInMCConfigString(ctx, deployment, testcaseEnvInst, shPods, mcName, true, false)

Expand Down Expand Up @@ -651,6 +655,9 @@ var _ = Describe("Monitoring Console test", func() {
// Verify Monitoring Console is Ready and stays in ready state
testenv.VerifyMonitoringConsoleReady(ctx, deployment, deployment.GetName(), mc, testcaseEnvInst)

// Adding a sleep, in case MC restarts to update peers list
time.Sleep(300 * time.Second)

// Check Monitoring console Pod is configured with all search head
testenv.VerifyPodsInMCConfigString(ctx, deployment, testcaseEnvInst, shPods, mcName, true, false)

Expand Down
3 changes: 2 additions & 1 deletion test/testenv/mcutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func CheckMCPodReady(ns string) bool {
func GetConfiguredPeers(ns string, mcName string) []string {
podName := fmt.Sprintf(MonitoringConsolePod, mcName)
var peerList []string
var output []byte
if len(podName) > 0 {
peerFile := "/opt/splunk/etc/apps/splunk_monitoring_console/local/splunk_monitoring_console_assets.conf"
output, err := exec.Command("kubectl", "exec", "-n", ns, podName, "--", "cat", peerFile).Output()
Expand All @@ -100,7 +101,7 @@ func GetConfiguredPeers(ns string, mcName string) []string {
}
}
}
logf.Log.Info("Peer List found on MC Pod", "MC POD", podName, "Configured Peers", peerList)
logf.Log.Info("Peer List found on MC Pod", "MC POD", podName, "Configured Peers", peerList, "splunk_monitoring_console_assets.conf output", output)
return peerList
}

Expand Down

0 comments on commit a29bf44

Please sign in to comment.