Skip to content

Commit 3a9e5c3

Browse files
authored
Fix the test issues (#3769)
1 parent 84c894a commit 3a9e5c3

File tree

1 file changed

+36
-18
lines changed

1 file changed

+36
-18
lines changed

tests/e2e/mgmt_wrkld_domain_isolation_tkg.go

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ var _ bool = ginkgo.Describe("[tkg-domain-isolation] TKG-Management-Workload-Dom
197197
allowedTopologies)
198198
gomega.Expect(err).NotTo(gomega.HaveOccurred())
199199

200-
ginkgo.By("Mark zone-2 for removal SVC namespace")
200+
ginkgo.By("Mark zone-3 for removal SVC namespace")
201201
err = markZoneForRemovalFromWcpNs(vcRestSessionId, svcNamespace,
202-
zone2)
202+
zone3)
203203
gomega.Expect(err).NotTo(gomega.HaveOccurred())
204204

205205
// Increase the replica count from 3 to 6.
@@ -311,8 +311,8 @@ var _ bool = ginkgo.Describe("[tkg-domain-isolation] TKG-Management-Workload-Dom
311311
}
312312
}()
313313

314-
// Now mark zone-3 also for removal.
315-
statusCode := markZoneForRemovalFromNs(svcNamespace, zone3, vcRestSessionId)
314+
// Now mark zone-2 also for removal.
315+
statusCode := markZoneForRemovalFromNs(svcNamespace, zone2, vcRestSessionId)
316316
gomega.Expect(statusCode).Should(gomega.BeNumerically("==", status_code_failure))
317317

318318
framework.Logf("Get volume snapshot handle from Supervisor Cluster")
@@ -395,8 +395,21 @@ var _ bool = ginkgo.Describe("[tkg-domain-isolation] TKG-Management-Workload-Dom
395395
}()
396396

397397
ginkgo.By("Creating statefulset")
398-
statefulset := createCustomisedStatefulSets(ctx, client, namespace, true, replicas, true, allowedTopologies,
399-
true, true, "", "", storageclass, storageclass.Name)
398+
statefulset := createCustomisedStatefulSets(
399+
ctx,
400+
client,
401+
namespace,
402+
true,
403+
replicas,
404+
false,
405+
nil,
406+
false,
407+
true,
408+
"",
409+
"",
410+
storageclass,
411+
storageclass.Name,
412+
)
400413
defer func() {
401414
fss.DeleteAllStatefulSets(ctx, client, namespace)
402415
}()
@@ -437,24 +450,24 @@ var _ bool = ginkgo.Describe("[tkg-domain-isolation] TKG-Management-Workload-Dom
437450
gomega.Expect(err).NotTo(gomega.HaveOccurred())
438451
}
439452

440-
ginkgo.By("Creating pvc with requested topology annotation set to zone4")
441-
pvclaim1, err := createPvcWithRequestedTopology(ctx, client, namespace, nil, "", storageclassWffc, "", zone3)
453+
ginkgo.By("Creating pvc with requested topology annotation set to zone2")
454+
pvclaim1, err := createPvcWithRequestedTopology(ctx, client, namespace, nil, "", storageclassWffc, "", zone2)
442455
gomega.Expect(err).NotTo(gomega.HaveOccurred())
443456

444457
ginkgo.By("Creating another pvc with requested topology annotation set to zone3")
445458
pvclaim2, err := createPvcWithRequestedTopology(ctx, client, namespace, nil, "", storageclass, "", zone3)
446459
gomega.Expect(err).NotTo(gomega.HaveOccurred())
447460

448-
ginkgo.By("Wait for PVC to reach Bound state.")
449-
_, err = fpv.WaitForPVClaimBoundPhase(ctx, client,
450-
[]*v1.PersistentVolumeClaim{pvclaim2}, framework.ClaimProvisionTimeout)
451-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
452-
453461
ginkgo.By("Create Pod to attach to Pvc-1")
454462
pod1, err := createPod(ctx, client, namespace, nil, []*v1.PersistentVolumeClaim{pvclaim1}, false,
455463
execRWXCommandPod1)
456464
gomega.Expect(err).NotTo(gomega.HaveOccurred())
457465

466+
ginkgo.By("Wait for PVC to reach Bound state.")
467+
_, err = fpv.WaitForPVClaimBoundPhase(ctx, client,
468+
[]*v1.PersistentVolumeClaim{pvclaim1}, framework.ClaimProvisionTimeout)
469+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
470+
458471
ginkgo.By("Verify svc pv affinity, pvc annotation and pod node affinity")
459472
err = verifyPvcAnnotationPvAffinityPodAnnotationInSvc(ctx, client, nil, pod1, nil, namespace,
460473
allowedTopologies)
@@ -465,6 +478,11 @@ var _ bool = ginkgo.Describe("[tkg-domain-isolation] TKG-Management-Workload-Dom
465478
execRWXCommandPod1)
466479
gomega.Expect(err).NotTo(gomega.HaveOccurred())
467480

481+
ginkgo.By("Wait for PVC to reach Bound state.")
482+
_, err = fpv.WaitForPVClaimBoundPhase(ctx, client,
483+
[]*v1.PersistentVolumeClaim{pvclaim2}, framework.ClaimProvisionTimeout)
484+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
485+
468486
ginkgo.By("Verify svc pv affinity, pvc annotation and pod node affinity")
469487
err = verifyPvcAnnotationPvAffinityPodAnnotationInSvc(ctx, client, nil, pod2, nil, namespace,
470488
allowedTopologies)
@@ -544,7 +562,7 @@ var _ bool = ginkgo.Describe("[tkg-domain-isolation] TKG-Management-Workload-Dom
544562
replicas = 3
545563

546564
ginkgo.By("Read shared storage policy tagged to wcp namespace")
547-
spWffc := zonal2StroragePolicyName + "-latebinding"
565+
spWffc := sharedStoragePolicyNameWffc
548566
storageclass, err := client.StorageV1().StorageClasses().Get(ctx, spWffc, metav1.GetOptions{})
549567
if !apierrors.IsNotFound(err) {
550568
gomega.Expect(err).NotTo(gomega.HaveOccurred())
@@ -557,13 +575,13 @@ var _ bool = ginkgo.Describe("[tkg-domain-isolation] TKG-Management-Workload-Dom
557575
}()
558576

559577
framework.Logf("Create StatefulSet with node selector set to zone-2")
560-
topValStartIndex := 1
561-
topValEndIndex := 2
562-
allowedTopologies = setSpecificAllowedTopology(allowedTopologies, topkeyStartIndex, topValStartIndex,
578+
topValStartIndex := 0
579+
topValEndIndex := 1
580+
allowedTopologiesz1 := setSpecificAllowedTopology(allowedTopologies, topkeyStartIndex, topValStartIndex,
563581
topValEndIndex)
564582

565583
ginkgo.By("Creating statefulset")
566-
statefulset := createCustomisedStatefulSets(ctx, client, namespace, true, replicas, true, allowedTopologies,
584+
statefulset := createCustomisedStatefulSets(ctx, client, namespace, true, replicas, true, allowedTopologiesz1,
567585
false, true, "", "", storageclass, storageclass.Name)
568586
defer func() {
569587
fss.DeleteAllStatefulSets(ctx, client, namespace)

0 commit comments

Comments
 (0)