Skip to content

Commit

Permalink
Adjust vmclone tests to pass with wffc snapshotable storageclass
Browse files Browse the repository at this point in the history
Signed-off-by: Shelly Kagan <[email protected]>
  • Loading branch information
ShellyKa13 committed Mar 17, 2024
1 parent fc8de30 commit 5dd4cd2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/clone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,13 @@ var _ = Describe("[Serial]VirtualMachineClone Tests", Serial, func() {
})

It("with a simple clone", func() {
sourceVM = createVMWithStorageClass(snapshotStorageClass, false)
running := false
if libstorage.IsStorageClassBindingModeWaitForFirstConsumer(snapshotStorageClass) {
// with wffc need to start the virtual machine
// in order for the pvc to be populated
running = true
}
sourceVM = createVMWithStorageClass(snapshotStorageClass, running)
vmClone = generateCloneFromVM()

createCloneAndWaitForFinish(vmClone)
Expand Down Expand Up @@ -732,14 +738,25 @@ var _ = Describe("[Serial]VirtualMachineClone Tests", Serial, func() {
return vmclone
}

sourceVM = createVMWithStorageClass(snapshotStorageClass, false)
running := false
wffcSC := libstorage.IsStorageClassBindingModeWaitForFirstConsumer(snapshotStorageClass)
if wffcSC {
// with wffc need to start the virtual machine
// in order for the pvc to be populated
running = true
}
sourceVM = createVMWithStorageClass(snapshotStorageClass, running)
vmClone = generateCloneWithFilters(sourceVM, targetVMName)

createCloneAndWaitForFinish(vmClone)

By(fmt.Sprintf("Getting the target VM %s", targetVMName))
targetVM, err = virtClient.VirtualMachine(sourceVM.Namespace).Get(context.Background(), targetVMName, &v1.GetOptions{})
Expect(err).ShouldNot(HaveOccurred())
if wffcSC {
// run the virtual machine for the clone dv to be populated
expectVMRunnable(targetVM)
}

By("Creating another clone from the target VM")
const cloneFromCloneName = "vm-clone-from-clone"
Expand Down

0 comments on commit 5dd4cd2

Please sign in to comment.