Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 17 additions & 28 deletions tests/e2e/tkgs_ha.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,6 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
}

defer func() {
if snapshotContentCreated {
err = deleteVolumeSnapshotContent(ctx, snapshotContent, snapc, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}

if snapshotCreated {
framework.Logf("Deleting volume snapshot")
deleteVolumeSnapshotWithPandoraWait(ctx, snapc, namespace, volumeSnapshot.Name, pandoraSyncWaitTime)
Expand All @@ -323,6 +318,10 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
*volumeSnapshot.Status.BoundVolumeSnapshotContentName, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
if snapshotContentCreated {
err = deleteVolumeSnapshotContent(ctx, snapshotContent, snapc, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Restore PVC using dynamic snapshot")
Expand Down Expand Up @@ -1060,11 +1059,6 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
staticPvc, volumeID, diskSize, false)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
if snapshotContentCreated {
err = deleteVolumeSnapshotContent(ctx, snapshotContent, snapc, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}

if snapshotCreated {
framework.Logf("Deleting volume snapshot")
deleteVolumeSnapshotWithPandoraWait(ctx, snapc, namespace, volumeSnapshot.Name,
Expand All @@ -1075,6 +1069,10 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
*volumeSnapshot.Status.BoundVolumeSnapshotContentName, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
if snapshotContentCreated {
err = deleteVolumeSnapshotContent(ctx, snapshotContent, snapc, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Restore PVC using dynamic volume snapshot")
Expand Down Expand Up @@ -1231,11 +1229,6 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
pvclaim, volHandle, "1Gi", false)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
if snapshotContentCreated {
err = deleteVolumeSnapshotContent(ctx, snapshotContent, snapc, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}

if snapshotCreated {
framework.Logf("Deleting volume snapshot")
deleteVolumeSnapshotWithPandoraWait(ctx, snapc, namespace, volumeSnapshot.Name, pandoraSyncWaitTime)
Expand All @@ -1245,6 +1238,10 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
*volumeSnapshot.Status.BoundVolumeSnapshotContentName, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
if snapshotContentCreated {
err = deleteVolumeSnapshotContent(ctx, snapshotContent, snapc, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

framework.Logf("Get volume snapshot handle from Supervisor Cluster")
Expand Down Expand Up @@ -1361,14 +1358,6 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
deleteService(namespace, client, service)
}()

ginkgo.By("Decrease SVC storage policy resource quota")
setStoragePolicyQuota(ctx, restConfig, storageclass.Name, namespace, "10Mi")
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
setStoragePolicyQuota(ctx, restConfig, storageclass.Name, namespace, rqLimit)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}()

ginkgo.By("Create statefulset with parallel pod management policy with replica 1")
statefulset := GetStatefulSetFromManifest(namespace)
ginkgo.By("Creating statefulset")
Expand Down Expand Up @@ -1529,11 +1518,6 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
pvclaim, volHandle, diskSize, false)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
if snapshotContentCreated {
err = deleteVolumeSnapshotContent(ctx, snapshotContent, snapc, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}

if snapshotCreated {
framework.Logf("Deleting volume snapshot")
deleteVolumeSnapshotWithPandoraWait(ctx, snapc, namespace, volumeSnapshot.Name, pandoraSyncWaitTime)
Expand All @@ -1543,6 +1527,11 @@ var _ = ginkgo.Describe("[csi-tkgs-ha] Tkgs-HA-SanityTests", func() {
*volumeSnapshot.Status.BoundVolumeSnapshotContentName, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
if snapshotContentCreated {
err = deleteVolumeSnapshotContent(ctx, snapshotContent, snapc, pandoraSyncWaitTime)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}

}()

framework.Logf("Get volume snapshot handle from Supervisor Cluster")
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tkgs_ha_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func verifyOnlineVolumeExpansionOnGc(client clientset.Interface, namespace strin
var err error
if !windowsEnv {
rand.New(rand.NewSource(time.Now().Unix()))
testdataFile := fmt.Sprintf("/tmp/testdata_%v_%v", time.Now().Unix(), rand.Intn(1000))
testdataFile = fmt.Sprintf("/tmp/testdata_%v_%v", time.Now().Unix(), rand.Intn(1000))
ginkgo.By(fmt.Sprintf("Creating a 512mb test data file %v", testdataFile))
op, err = exec.Command("dd", "if=/dev/urandom", fmt.Sprintf("of=%v", testdataFile),
"bs=64k", "count=8000").Output()
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/vsan_stretched_cluster_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func createFaultDomainMap(ctx context.Context, vs *vSphere) map[string]string {
hostInfo := host.Common.InventoryPath
hostIpInfo := strings.Split(hostInfo, "/")
hostCluster := hostIpInfo[len(hostIpInfo)-2]
if !strings.Contains(hostCluster, "EdgeMgmtCluster") {
if !strings.Contains(hostCluster, "EdgeMgmtCluster") || !strings.Contains(hostCluster, "mgmt") {
hostsInVsanStretchCluster = append(hostsInVsanStretchCluster, host)
}

Expand Down