From 383a85d582299e95907ef32c9805f38ec72acc88 Mon Sep 17 00:00:00 2001 From: Elena Gershkovich Date: Thu, 23 May 2024 16:13:54 +0530 Subject: [PATCH] Adjust tests for deletion of NF MW after unfence Signed-off-by: Elena Gershkovich --- controllers/drplacementcontrol_controller_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/controllers/drplacementcontrol_controller_test.go b/controllers/drplacementcontrol_controller_test.go index 174f2e994..b0e3044d6 100644 --- a/controllers/drplacementcontrol_controller_test.go +++ b/controllers/drplacementcontrol_controller_test.go @@ -1467,12 +1467,16 @@ func runFailoverAction(placementObj client.Object, fromCluster, toCluster string // resource is cleaned up or not, number of MW may change. if !isSyncDR { Expect(getManifestWorkCount(toCluster)).Should(BeElementOf(3, 4)) // MW for VRG+DRCluster+NS - Expect(getManifestWorkCount(fromCluster)).Should(Equal(2)) // DRCluster + NS MW } else { - Expect(getManifestWorkCount(toCluster)).Should(Equal(4)) // MW for VRG+DRCluster + NS + NF - Expect(getManifestWorkCount(fromCluster)).Should(Equal(2)) // NS + DRCluster MW + if manualFence { + Expect(getManifestWorkCount(toCluster)).Should(Equal(3)) // MW for VRG+DRCluster + NS + } else { + Expect(getManifestWorkCount(toCluster)).Should(Equal(4)) // MW for VRG+DRCluster + NS + NF + } } + Expect(getManifestWorkCount(fromCluster)).Should(Equal(2)) // DRCluster + NS MW + drpc := getLatestDRPC(placementObj.GetNamespace()) // At this point expect the DRPC status condition to have 2 types // {Available and PeerReady} @@ -1700,7 +1704,7 @@ func verifyFailoverToSecondary(placementObj client.Object, toCluster string, // MW for VRG+NS+DRCluster Eventually(getManifestWorkCount, timeout, interval).WithArguments(toCluster).Should(BeElementOf(3, 4)) } else { - Expect(getManifestWorkCount(toCluster)).Should(Equal(4)) // MW for VRG+NS+DRCluster+NF + Expect(getManifestWorkCount(toCluster)).Should(BeElementOf(3, 4)) // MW for VRG+NS+DRCluster+NF } Expect(getManifestWorkCount(East1ManagedCluster)).Should(Equal(2)) // DRClustern+NS