Skip to content

Commit

Permalink
Add combined case 3 in the lazy activation policy tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammed Affan <mohammed.affan.727@gmail.com>
  • Loading branch information
Affan-7 committed Jun 12, 2024
1 parent 049ddc6 commit 33e19a3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/e2e/lazy_activation_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ var _ = ginkgo.Describe("Lazy activation policy testing", func() {

ginkgo.DeferCleanup(func() {
framework.RemovePropagationPolicyIfExist(karmadaClient, namespace, policyName)
framework.RemovePropagationPolicyIfExist(karmadaClient, namespace, policyHigherPriorityName)
framework.RemoveDeployment(kubeClient, namespace, deploymentName)
framework.WaitDeploymentDisappearOnCluster(originalCluster, namespace, deploymentName)
framework.WaitDeploymentDisappearOnCluster(modifiedCluster, namespace, deploymentName)
Expand Down Expand Up @@ -192,6 +193,21 @@ var _ = ginkgo.Describe("Lazy activation policy testing", func() {
})
})

// Combined Case 3 (Policy preemption)
// refer: https://github.com/karmada-io/karmada/blob/release-1.9/docs/proposals/scheduling/activation-preference/lazy-activation-preference.md#combined-case-3-policy-preemption

ginkgo.It("Combined Case 3 (Policy preemption)", func() {
ginkgo.By("step 1: deployment propagate success when policy created before it", func() {
waitDeploymentPresentOnCluster(originalCluster, namespace, deploymentName)
})

ginkgo.By("step 2: create PP2 (match nginx, cluster=member2, lazy, priority=2, preemption=true)", func() {
policyHigherPriority.Spec.ActivationPreference = ""
framework.CreatePropagationPolicy(karmadaClient, policyHigherPriority)
waitDeploymentPresentOnCluster(modifiedCluster, namespace, deploymentName)
})
})

ginkgo.Context("Propagate dependencies", func() {
ginkgo.BeforeEach(func() {
policy.Spec.PropagateDeps = true
Expand Down

0 comments on commit 33e19a3

Please sign in to comment.