Skip to content

Commit

Permalink
new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sipriyaa committed Oct 15, 2024
1 parent 6e3d922 commit 5c9c6a1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 17 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/csi_snapshot_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -4849,8 +4849,8 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
4. Volume restore
5. snapshot create/delete workflow
*/
ginkgo.It("[block-vanilla-snapshot][tkg-snapshot][supervisor-snapshot] Scale-up creation of snapshots across multiple "+
"volumes", ginkgo.Label(p0, block, vanilla, snapshot, tkg, stable), func() {
ginkgo.It("[block-vanilla-snapshot][tkg-snapshot][supervisor-snapshot] Scale-up creation of snapshots "+
"across multiple volumes", ginkgo.Label(p0, block, vanilla, snapshot, tkg, stable), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Expand Down
57 changes: 42 additions & 15 deletions tests/e2e/snapshot_vmservice_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
11. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Taking snapshot of a vm service vm attached to a dynamic volume", func() {
ginkgo.It("Taking snapshot of a vm service vm attached "+
"to a dynamic volume", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -378,7 +380,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
12. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Taking snapshot of a vm service vm attached to a static volume", func() {
ginkgo.It("Taking snapshot of a vm service vm attached "+
"to a static volume", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -515,7 +519,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Restoring snapshot and attaching it to a vm service vm", func() {
ginkgo.It("Restoring snapshot and attaching it to a "+
"vm service vm", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -690,7 +696,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
17. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Restoring multiple snapshots and attaching it to a single vm service vm", func() {
ginkgo.It("Restoring multiple snapshots and attaching "+
"it to a single vm service vm", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -896,7 +904,8 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
19. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Offline volume expansion and later attaching it to a vm service vm", func() {
ginkgo.It("Offline volume expansion and later attaching "+
"it to a vm service vm", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Expand Down Expand Up @@ -1138,7 +1147,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
17. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Attaching new restore snapshots to vm service vms", func() {
ginkgo.It("Attaching new restore snapshots to vm service "+
"vms", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -1449,7 +1460,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
Confirm that the Pod reaches the running state and that read and write operations can be performed on the volume.
Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/
ginkgo.It("Attaching same volume to a pod and vm service vm", func() {
ginkgo.It("Attaching same volume to a pod and vm service "+
"vm", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -1649,7 +1662,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
18. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Power on and off operation on a vm service vm with snapshot", func() {
ginkgo.It("Power on and off operation on a vm service "+
"vm with snapshot", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -1867,7 +1882,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
25. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("vCenter services down operation during snapshot creation and restoration taken for a vm service vm", func() {
ginkgo.It("vCenter services down operation during snapshot creation "+
"and restoration taken for a vm service vm", ginkgo.Label(p1, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -2113,7 +2130,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Storage vmotion of a vm from one datastore to another with snapshot", func() {
ginkgo.It("Storage vmotion of a vm from one datastore to another "+
"with snapshot", ginkgo.Label(p1, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -2266,7 +2285,7 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
ginkgo.By("Relocate FCD to another datastore")
dsRefDest = getDsMoRefFromURL(ctx, destDsUrl)
_, err = e2eVSphere.cnsRelocateVolume(e2eVSphere, ctx, restoreVolHandle, dsRefDest, true)
//gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Create volume snapshot")
volumeSnapshot2, snapshotContent2, snapshotCreated2,
Expand Down Expand Up @@ -2359,7 +2378,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
14. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Creation of multiple vm service vms and attaching it to restore snapshots", func() {
ginkgo.It("Creation of multiple vm service vms and attaching "+
"it to restore snapshots", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -2645,7 +2666,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
21. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("Recurring taking snapshots of a vm service vm", func() {
ginkgo.It("Recurring taking snapshots of a vm service "+
"vm", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -2891,7 +2914,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("[stretched-svc] Taking snapshot of a vm service vm in a stretched supervsior cluster", ginkgo.Label(p0, wcp, core), func() {
ginkgo.It("[stretched-svc] Taking snapshot of a vm service vm "+
"in a stretched supervisor cluster", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()
topologyHaMap := GetAndExpectStringEnvVar(topologyHaMap)
Expand Down Expand Up @@ -3111,7 +3136,9 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
25. Cleanup: Execute and verify the steps mentioned in the Delete snapshot mandatory checks
*/

ginkgo.It("[stretched-svc] Restoring snapshots and attaching it to a new vm service vms in a stretched supervisor env", ginkgo.Label(p0, wcp, core), func() {
ginkgo.It("[stretched-svc] Restoring snapshots and attaching it to a new vm service"+
"vms in a stretched supervisor env", ginkgo.Label(p0, block, wcp, snapshot), func() {

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/vmservice_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,14 @@ func performVolumeLifecycleActionForVmServiceVM(ctx context.Context, client clie
[]*v1.PersistentVolumeClaim{pvc})).NotTo(gomega.HaveOccurred())
}

/*
updateVmWithNewPvc util updates vm volume attachment list byt adding new
volumes to the vm
*/
func updateVmWithNewPvc(ctx context.Context, vmopC ctlrclient.Client, vmName string,
namespace string, newPvc *v1.PersistentVolumeClaim) error {

// Fetch the existing VM
vm := &vmopv1.VirtualMachine{}
err := vmopC.Get(ctx, ctlrclient.ObjectKey{Name: vmName, Namespace: namespace}, vm)
Expand Down

0 comments on commit 5c9c6a1

Please sign in to comment.