Add RunMigration() (and not expect completion) function
@@ -49,6 +49,13 @@ func expectMigrationSuccessWithOffset(offset int, virtClient kubecli.KubevirtCli
}
func RunMigrationAndExpectCompletion(virtClient kubecli.KubevirtClient, migration *v1.VirtualMachineInstanceMigration, timeout int) string {
+ By("Starting a Migration")
+ migration = RunMigration(virtClient, migration, timeout)
+
+ return ExpectMigrationSuccess(virtClient, migration, timeout)
+}
+
+func RunMigration(virtClient kubecli.KubevirtClient, migration *v1.VirtualMachineInstanceMigration, timeout int) *v1.VirtualMachineInstanceMigration {
By("Starting a Migration")
var err error
var migrationCreated *v1.VirtualMachineInstanceMigration
@@ -56,9 +63,8 @@ func RunMigrationAndExpectCompletion(virtClient kubecli.KubevirtClient, migratio
migrationCreated, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{})
return err
}, timeout, 1*time.Second).Should(Succeed(), "migration creation should succeed")
- migration = migrationCreated
- return ExpectMigrationSuccess(virtClient, migration, timeout)
+ return migrationCreated
}
func ConfirmVMIPostMigration(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance, migrationUID string) *v1.VirtualMachineInstance {
