Skip to content

Commit

Permalink
vsan stretch TKG sanity testcase automation (#2917)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aishwarya-Hebbar authored Sep 13, 2024
1 parent 195a2da commit ce2fff1
Show file tree
Hide file tree
Showing 24 changed files with 1,066 additions and 295 deletions.
1 change: 1 addition & 0 deletions tests/e2e/e2e_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
nginxImage = "registry.k8s.io/nginx-slim:0.26"
nginxImage4upg = "registry.k8s.io/nginx-slim:0.27"
retainClaimPolicy = "Retain"
cloudInitLabel = "CloudInit"
configSecret = "vsphere-config-secret"
contollerClusterKubeConfig = "CONTROLLER_CLUSTER_KUBECONFIG"
controlPlaneLabel = "node-role.kubernetes.io/control-plane"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/file_volume_statefulsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ var _ = ginkgo.Describe("[csi-file-vanilla] File Volume statefulset", func() {
}()
ginkgo.By("Creating statefulset with replica 3")
statefulset, _, volumesBeforeScaleUp := createStsDeployment(ctx, client, namespace, sc, false,
false, 0, "", v1.ReadWriteMany)
false, 3, "", 0, v1.ReadWriteMany)
replicas := *(statefulset.Spec.Replicas)

//List volume responses will show up in the interval of every 1 minute.
Expand Down
20 changes: 10 additions & 10 deletions tests/e2e/gc_rwx_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Basic File Volume Provision Test", func()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verify the volume is accessible and Read/write is possible")
Expand Down Expand Up @@ -255,12 +255,12 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Basic File Volume Provision Test", func()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

// Create a Pod to use this PVC, and verify volume has been attached
Expand All @@ -281,12 +281,12 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Basic File Volume Provision Test", func()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verify the volume is accessible and Read/write is possible")
Expand Down Expand Up @@ -397,7 +397,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Basic File Volume Provision Test", func()
}()

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verify the volume is accessible and Read/write is possible")
Expand All @@ -424,7 +424,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Basic File Volume Provision Test", func()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)

// Create a Pod to use this PVC, and verify volume has been attached
Expand All @@ -445,12 +445,12 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Basic File Volume Provision Test", func()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+volHandle,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+volHandle,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verify the volume is accessible and Read/write is possible")
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/gc_rwx_deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] File Volume Provision with Deployments",
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod with pvc1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, ddpod.Spec.NodeName+"-"+pvc1NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, ddpod.Spec.NodeName+"-"+pvc1NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod with pvc2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, ddpod.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, ddpod.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)
}

Expand Down Expand Up @@ -314,11 +314,11 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] File Volume Provision with Deployments",
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod with pvc1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, ddpod.Spec.NodeName+"-"+pvc1NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, ddpod.Spec.NodeName+"-"+pvc1NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod with pvc2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, ddpod.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, ddpod.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)
}

Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/gc_rwx_destructive.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ var _ = ginkgo.Describe("[rwm-csi-destructive-tkg] Statefulsets with File Volume
persistentvolume, tempPod)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, sspod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, sspod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

// Verify using CNS Query API if VolumeID retrieved from PV is present.
Expand Down Expand Up @@ -343,7 +343,7 @@ var _ = ginkgo.Describe("[rwm-csi-destructive-tkg] Statefulsets with File Volume
fcdIDInCNS := getVolumeIDFromSupervisorCluster(pvcNameInSV)
gomega.Expect(fcdIDInCNS).NotTo(gomega.BeEmpty())
ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, sspod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, sspod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)
}
}
Expand Down Expand Up @@ -487,11 +487,11 @@ var _ = ginkgo.Describe("[rwm-csi-destructive-tkg] Statefulsets with File Volume
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod with pvc1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, ddpod.Spec.NodeName+"-"+pvc1NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, ddpod.Spec.NodeName+"-"+pvc1NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod with pvc2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, ddpod.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, ddpod.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)
}

Expand Down Expand Up @@ -562,11 +562,11 @@ var _ = ginkgo.Describe("[rwm-csi-destructive-tkg] Statefulsets with File Volume
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod with pvc1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, ddpod.Spec.NodeName+"-"+pvc1NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, ddpod.Spec.NodeName+"-"+pvc1NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod with pvc2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, ddpod.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, ddpod.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)
}

Expand Down
14 changes: 7 additions & 7 deletions tests/e2e/gc_rwx_multi_gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Volume Provision Across TKG clusters", fu
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

//Add a check to validate CnsVolumeMetadata crd
Expand Down Expand Up @@ -315,12 +315,12 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Volume Provision Across TKG clusters", fu
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

oldKubeConfig := framework.TestContext.KubeConfig
Expand Down Expand Up @@ -563,12 +563,12 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Volume Provision Across TKG clusters", fu
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

oldKubeConfig := framework.TestContext.KubeConfig
Expand Down Expand Up @@ -798,7 +798,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Volume Provision Across TKG clusters", fu
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+pvc2NameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+pvc2NameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()
})
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/gc_rwx_multi_ns_gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Volume Provision Across Namespace", func(
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

Expand All @@ -324,7 +324,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] Volume Provision Across Namespace", func(
crdVersion, crdGroup, true, pv2.Spec.CSI.VolumeHandle, false, nil, false)

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod2")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod2.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod2.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verify the volume is accessible and Read/write is possible from pod2")
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/gc_rwx_operation_storm.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] File Volume Operation storm Test", func()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}()

Expand All @@ -203,7 +203,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] File Volume Operation storm Test", func()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is created or not for Pod1")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, pod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, pod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)

ginkgo.By("Verify the volume is accessible and Read/write is possible")
Expand Down Expand Up @@ -268,7 +268,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] File Volume Operation storm Test", func()

ginkgo.By(fmt.Sprintf("Verifying whether the CnsFileAccessConfig CRD %s is created or not for Pod %s",
tempPod.Spec.NodeName+"-"+pvcNameInSV, multipod.Name))
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, tempPod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, tempPod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)
}

Expand Down Expand Up @@ -308,7 +308,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] File Volume Operation storm Test", func()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Verifying whether the CnsFileAccessConfig CRD is Deleted or not for Pod")
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, multiPod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, multiPod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, false)
}
})
Expand Down Expand Up @@ -460,7 +460,7 @@ var _ = ginkgo.Describe("[rwm-csi-tkg] File Volume Operation storm Test", func()
gomega.Expect(fcdIDInCNS).NotTo(gomega.BeEmpty())

framework.Logf("Searching for file access config crd %s", tempPod.Spec.NodeName+"-"+pvcNameInSV)
verifyCNSFileAccessConfigCRDInSupervisor(ctx, f, tempPod.Spec.NodeName+"-"+pvcNameInSV,
verifyCNSFileAccessConfigCRDInSupervisor(ctx, tempPod.Spec.NodeName+"-"+pvcNameInSV,
crdCNSFileAccessConfig, crdVersion, crdGroup, true)
fileAccessCRD = append(fileAccessCRD, tempPod.Spec.NodeName+"-"+pvcNameInSV)
}
Expand Down
Loading

0 comments on commit ce2fff1

Please sign in to comment.