forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubevirt#8722 from RamLavi/align_migration_tests
tests, network: Replace run migration function
- Loading branch information
Showing
1 changed file
with
4 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -820,26 +820,6 @@ var _ = SIGDescribe("[rfe_id:694][crit:medium][vendor:[email protected]][level:c | |
return pod, nil | ||
} | ||
|
||
runMigrationAndExpectCompletion := func(migration *v1.VirtualMachineInstanceMigration, timeout int) { | ||
migration, err = virtClient.VirtualMachineInstanceMigration(migration.Namespace).Create(migration, &metav1.CreateOptions{}) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
Eventually(func() error { | ||
migration, err := virtClient.VirtualMachineInstanceMigration(migration.Namespace).Get(migration.Name, &metav1.GetOptions{}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
Expect(migration.Status.Phase).ToNot(Equal(v1.MigrationFailed)) | ||
|
||
if migration.Status.Phase == v1.MigrationSucceeded { | ||
return nil | ||
} | ||
return fmt.Errorf("Migration is in phase %s", migration.Status.Phase) | ||
|
||
}, timeout, time.Second).Should(Succeed(), fmt.Sprintf("migration should succeed after %d s", timeout)) | ||
} | ||
|
||
BeforeEach(func() { | ||
checks.SkipIfMigrationIsNotPossible() | ||
}) | ||
|
@@ -877,9 +857,9 @@ var _ = SIGDescribe("[rfe_id:694][crit:medium][vendor:[email protected]][level:c | |
podIP := libnet.GetPodIPByFamily(virtHandlerPod, k8sv1.IPv4Protocol) | ||
Expect(ping(podIP)).To(Succeed()) | ||
|
||
By("Execute migration") | ||
By("starting the migration") | ||
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace) | ||
runMigrationAndExpectCompletion(migration, tests.MigrationWaitTime) | ||
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime) | ||
|
||
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
@@ -919,9 +899,9 @@ var _ = SIGDescribe("[rfe_id:694][crit:medium][vendor:[email protected]][level:c | |
podIP := libnet.GetPodIPByFamily(virtHandlerPod, k8sv1.IPv6Protocol) | ||
Expect(ping(podIP)).To(Succeed()) | ||
|
||
By("Execute migration") | ||
By("starting the migration") | ||
migration := tests.NewRandomMigration(vmi.Name, vmi.Namespace) | ||
runMigrationAndExpectCompletion(migration, tests.MigrationWaitTime) | ||
tests.RunMigrationAndExpectCompletion(virtClient, migration, tests.MigrationWaitTime) | ||
|
||
vmi, err = virtClient.VirtualMachineInstance(vmi.Namespace).Get(vmi.Name, &metav1.GetOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|