Skip to content

Commit 1ff9172

Browse files
author
sipriyaa
committed
topology parallel testcases execution code fix
1 parent a6b433d commit 1ff9172

3 files changed

+12
-4
lines changed

tests/e2e/provision_with_multiple_zones.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ var _ = ginkgo.Describe("[csi-topology-vanilla] Topology-Aware-Provisioning-With
198198

199199
// Creating StorageClass with multiple zone and region topology details
200200
ginkgo.By("Creating StorageClass for Statefulset")
201-
scSpec := getVSphereStorageClassSpec(defaultNginxStorageClassName, nil, allowedTopologies, "", "", false)
201+
scSpec := getVSphereStorageClassSpec("", nil, allowedTopologies, "", "", false)
202202
sc, err := client.StorageV1().StorageClasses().Create(ctx, scSpec, metav1.CreateOptions{})
203203
gomega.Expect(err).NotTo(gomega.HaveOccurred())
204204
defer func() {
@@ -215,6 +215,10 @@ var _ = ginkgo.Describe("[csi-topology-vanilla] Topology-Aware-Provisioning-With
215215
// Creating statefulset with 3 replicas
216216
ginkgo.By("Creating statefulset with 3 replica")
217217
statefulset := GetStatefulSetFromManifest(namespace)
218+
statefulset.Spec.VolumeClaimTemplates[len(statefulset.Spec.VolumeClaimTemplates)-1].
219+
Spec.StorageClassName = &sc.Name
220+
statefulset.Spec.VolumeClaimTemplates[len(statefulset.Spec.VolumeClaimTemplates)-1].
221+
Spec.StorageClassName = &sc.Name
218222
ginkgo.By("Creating statefulset")
219223
var replica int32 = 3
220224
statefulset.Spec.Replicas = &replica

tests/e2e/statefulset_with_topology.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var _ = ginkgo.Describe("[csi-topology-vanilla] Topology-Aware-Provisioning-With
8383
defer cancel()
8484

8585
ginkgo.By("Creating StorageClass for Statefulset")
86-
scSpec := getVSphereStorageClassSpec(defaultNginxStorageClassName, nil, allowedTopologies, "", "", false)
86+
scSpec := getVSphereStorageClassSpec("", nil, allowedTopologies, "", "", false)
8787
sc, err := client.StorageV1().StorageClasses().Create(ctx, scSpec, metav1.CreateOptions{})
8888
gomega.Expect(err).NotTo(gomega.HaveOccurred())
8989
defer func() {
@@ -158,7 +158,7 @@ var _ = ginkgo.Describe("[csi-topology-vanilla] Topology-Aware-Provisioning-With
158158

159159
// Creating StorageClass with topology details
160160
ginkgo.By("Creating StorageClass for Statefulset")
161-
scSpec := getVSphereStorageClassSpec(defaultNginxStorageClassName, nil, allowedTopologies, "", "", false)
161+
scSpec := getVSphereStorageClassSpec("", nil, allowedTopologies, "", "", false)
162162
sc, err := client.StorageV1().StorageClasses().Create(ctx, scSpec, metav1.CreateOptions{})
163163
gomega.Expect(err).NotTo(gomega.HaveOccurred())
164164
defer func() {
@@ -175,6 +175,8 @@ var _ = ginkgo.Describe("[csi-topology-vanilla] Topology-Aware-Provisioning-With
175175
// Creating statefulset with 3 replicas
176176
ginkgo.By("Creating statefulset with 3 replica")
177177
statefulset := GetStatefulSetFromManifest(namespace)
178+
statefulset.Spec.VolumeClaimTemplates[len(statefulset.Spec.VolumeClaimTemplates)-1].
179+
Spec.StorageClassName = &sc.Name
178180
ginkgo.By("Creating statefulset")
179181
CreateStatefulSet(namespace, statefulset, client)
180182
replicas := *(statefulset.Spec.Replicas)

tests/e2e/topology_aware_node_poweroff.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var _ = ginkgo.Describe("[csi-topology-vanilla] Topology-Aware-Provisioning-With
106106
GetAndExpectStringEnvVar(envRegionZoneWithSharedDS))
107107

108108
ginkgo.By("Creating StorageClass for Statefulset")
109-
scSpec := getVSphereStorageClassSpec(defaultNginxStorageClassName, nil, allowedTopologies, "", "", false)
109+
scSpec := getVSphereStorageClassSpec("", nil, allowedTopologies, "", "", false)
110110
sc, err := client.StorageV1().StorageClasses().Create(ctx, scSpec, metav1.CreateOptions{})
111111
gomega.Expect(err).NotTo(gomega.HaveOccurred())
112112
defer func() {
@@ -116,6 +116,8 @@ var _ = ginkgo.Describe("[csi-topology-vanilla] Topology-Aware-Provisioning-With
116116

117117
ginkgo.By("Creating statefulset with single replica")
118118
statefulset, service, err := createStatefulSetWithOneReplica(client, manifestPath, namespace)
119+
statefulset.Spec.VolumeClaimTemplates[len(statefulset.Spec.VolumeClaimTemplates)-1].
120+
Spec.StorageClassName = &sc.Name
119121
gomega.Expect(err).NotTo(gomega.HaveOccurred())
120122
defer func() {
121123
deleteService(namespace, client, service)

0 commit comments

Comments
 (0)