Skip to content

Commit

Permalink
new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sipriyaa committed Aug 1, 2024
1 parent 1d907a2 commit a59eed0
Showing 1 changed file with 65 additions and 37 deletions.
102 changes: 65 additions & 37 deletions tests/e2e/csi_snapshot_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -1507,8 +1509,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -1669,7 +1673,6 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
ginkgo.By("Create storage class")
storageclass, err = createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())

defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand Down Expand Up @@ -1923,8 +1926,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create pvc")
Expand Down Expand Up @@ -2005,8 +2010,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -2111,8 +2118,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -2233,8 +2242,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
sc, err := client.StorageV1().StorageClasses().Create(ctx, scSpec, metav1.CreateOptions{})
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, sc.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, sc.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Creating service")
Expand Down Expand Up @@ -2463,8 +2474,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -2556,8 +2569,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", true, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -2969,8 +2984,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
"", "", true, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -3108,8 +3125,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", true, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -3276,8 +3295,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", true, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -3495,8 +3516,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -3624,8 +3647,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Creating PVCs using the Storage Class")
Expand Down Expand Up @@ -3864,8 +3889,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -4567,8 +4594,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create PVC")
Expand Down Expand Up @@ -4794,8 +4823,10 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
if vanillaCluster {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}()

ginkgo.By("Create volume snapshot class")
Expand Down Expand Up @@ -4950,7 +4981,6 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
ginkgo.By("Create storage class")
storageclass, err := createStorageClass(client, scParameters, nil, "", "", true, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())

defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand Down Expand Up @@ -5253,7 +5283,6 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
ginkgo.By("Create storage class")
storageclass, err := createStorageClass(client, scParameters, nil, "", "", true, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())

defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand Down Expand Up @@ -5383,7 +5412,6 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
ginkgo.By("Create storage class")
storageclass, err := createStorageClass(client, scParameters, nil, "", "", true, scName)
gomega.Expect(err).NotTo(gomega.HaveOccurred())

defer func() {
err := client.StorageV1().StorageClasses().Delete(ctx, storageclass.Name, *metav1.NewDeleteOptions(0))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand Down Expand Up @@ -7329,7 +7357,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
pandoraSyncWaitTime, fcdID))
time.Sleep(time.Duration(pandoraSyncWaitTime) * time.Second)

ginkgo.By("Create CNS register volume with above created FCD ")
ginkgo.By("Create CNS register volume with above created FCD")
cnsRegisterVolume := getCNSRegisterVolumeSpec(ctx, namespace, fcdID, "", pvcName, v1.ReadWriteOnce)
err = createCNSRegisterVolume(ctx, restConfig, cnsRegisterVolume)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand Down

0 comments on commit a59eed0

Please sign in to comment.