verify migration with writeback disk cache
@@ -528,6 +528,39 @@ var _ = Describe("[Serial][rfe_id:393][crit:high][vendor:cnv-qe@redhat.com][leve
By("Waiting for VMI to disappear")
tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
})
+ It("should be successfully migrate with a WriteBack disk cache", func() {
+ vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskCirros))
+ vmi.Spec.Domain.Devices.Disks[0].Cache = v1.CacheWriteBack
+ tests.AddUserData(vmi, "cloud-init", "#!/bin/bash\necho 'hello'\n")
+
+ By("Starting the VirtualMachineInstance")
+ vmi = runVMIAndExpectLaunch(vmi, 240)
+
+ By("Checking that the VirtualMachineInstance console has expected output")
+ Expect(libnet.WithIPv6(console.LoginToCirros)(vmi)).To(Succeed())
+
+ By("starting the migration")
+ migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace)
+ migrationUID := tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime)
+
+ // check VMI, confirm migration state
+ tests.ConfirmVMIPostMigration(virtClient, vmi, migrationUID)
+
+ runningVMISpec, err := tests.GetRunningVMIDomainSpec(vmi)
+ Expect(err).ToNot(HaveOccurred())
+
+ disks := runningVMISpec.Devices.Disks
+ By("checking if requested cache 'writeback' has been set")
+ Expect(disks[0].Alias.GetName()).To(Equal("disk0"))
+ Expect(disks[0].Driver.Cache).To(Equal(string(v1.CacheWriteBack)))
+
+ // delete VMI
+ By("Deleting the VMI")
+ Expect(virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})).To(Succeed())
+
+ By("Waiting for VMI to disappear")
+ tests.WaitForVirtualMachineToDisappearWithTimeout(vmi, 240)
+ })
It("[test_id:6970]should migrate vmi with cdroms on various bus types", func() {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskCirros))
