Skip to content

Conversation

jambrosiano
Copy link
Contributor

@jambrosiano jambrosiano commented Mar 20, 2021

Test to verify changes to CR spec are applied to the pod, for Indexer and SH clusters environments

SVA Covered:

  • C3 and M4

Test Scenario:

  • Deploy the SVA
  • Update CPU Value in CR Spec of Indexer Cluster and apply
  • Update CPU Value in CR Spec of Search Head Cluster and apply
  • Verify CPU is updated on Indexer Pods
  • Verify CPU is updated on Search Head Pods

Test Run

image

@jambrosiano jambrosiano changed the title CSPL-909 CSPL-909: Add test cases to verify changes to CR spec are applied to clustered environments Mar 20, 2021
testenv.VerifyIndexerClusterPhase(deployment, testenvInstance, splcommon.PhaseUpdating, idxcName)

// Verify Indexers go to ready state
testenv.VerifyIndexerClusterPhase(deployment, testenvInstance, splcommon.PhaseReady, idxcName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use testenv.SingleSiteIndexersReady(deployment, testenvInstance) instead.

Comment on lines 241 to 275
// Verify CPU limits on Search Heads before updating the CR
SearchHeadPodName := fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), 0)
testenv.VerifyCPULimits(deployment, testenvInstance.GetName(), SearchHeadPodName, defaultCPULimits)
SearchHeadPodName = fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), 1)
testenv.VerifyCPULimits(deployment, testenvInstance.GetName(), SearchHeadPodName, defaultCPULimits)
SearchHeadPodName = fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), 2)
testenv.VerifyCPULimits(deployment, testenvInstance.GetName(), SearchHeadPodName, defaultCPULimits)

// Change CPU limits to trigger CR update
shc := &enterprisev1.SearchHeadCluster{}
instanceName := fmt.Sprintf("%s-shc", deployment.GetName())
err = deployment.GetInstance(instanceName, shc)
if err != nil {
testenvInstance.Log.Error(err, "Unable to fetch Search Head Cluster deployment")
}

shc.Spec.Resources.Limits = corev1.ResourceList{
"cpu": resource.MustParse(newCPULimits),
}
err = deployment.UpdateCR(shc)
Expect(err).To(Succeed(), "Unable to deploy Search Head Cluster with updated CR")

// Verify Search Head Cluster is updating
testenv.VerifySearchHeadClusterPhase(deployment, testenvInstance, splcommon.PhaseUpdating)

// Verify Search Head go to ready state
testenv.SearchHeadClusterReady(deployment, testenvInstance)

// Verify CPU limits after updating the CR
SearchHeadPodName = fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), 0)
testenv.VerifyCPULimits(deployment, testenvInstance.GetName(), SearchHeadPodName, newCPULimits)
SearchHeadPodName = fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), 1)
testenv.VerifyCPULimits(deployment, testenvInstance.GetName(), SearchHeadPodName, newCPULimits)
SearchHeadPodName = fmt.Sprintf(testenv.SearchHeadPod, deployment.GetName(), 2)
testenv.VerifyCPULimits(deployment, testenvInstance.GetName(), SearchHeadPodName, newCPULimits)
Copy link
Contributor

@pdhanoya-splunk pdhanoya-splunk Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not need to repeat this here as SHC update is already covered in C3 deployment. This is just to ensure test cases get executed in resonable time.

})
})

Context("Multisite cluster deployment (M13 - Multisite indexer cluster, Search head cluster)", func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change deployment type to M4.

@smohan-splunk smohan-splunk merged commit a7c9494 into develop Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants