Skip to content

Commit

Permalink
make sure migration is being rejected for vmi with shared and non-sha…
Browse files Browse the repository at this point in the history
…red disks

Signed-off-by: Vladik Romanovsky <[email protected]>
  • Loading branch information
vladikr committed Dec 13, 2018
1 parent cb95cca commit bd7e91f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,28 @@ var _ = Describe("Migrations", func() {
// create a new PV and PVC (PVs can't be reused)
tests.DeletePvAndPvc(pvName)
}, 60)
It("should reject migration specs with shared and non-shared disks", func() {
// Start the VirtualMachineInstance with PVC and Ephemeral Disks
vmi := tests.NewRandomVMIWithPVC(pvName)
image := tests.ContainerDiskFor(tests.ContainerDiskAlpine)
tests.AddEphemeralDisk(vmi, "myephemeral", "virtio", image)

By("Starting the VirtualMachineInstance")
vmi = runVMIAndExpectLaunch(vmi, 120)

By("Checking that the VirtualMachineInstance console has expected output")
expecter, err := tests.LoggedInAlpineExpecter(vmi)
Expect(err).To(BeNil())
expecter.Close()

By("Starting a Migration and expecting it to be rejected")
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
Eventually(func() error {
_, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration)
fmt.Println(err)
return err
}, 120, 1*time.Second).Should(HaveOccurred())
})
It("should be successfully migrated multiple times", func() {

// Start the VirtualMachineInstance with the PVC attached
Expand Down

0 comments on commit bd7e91f

Please sign in to comment.