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.
[Tests]Remove usage of WithRunning as it is deprecated
Use WithRunStrategy instead to create a running VM in the recommended way. Signed-off-by: bmordeha <[email protected]>
- Loading branch information
Showing
15 changed files
with
30 additions
and
47 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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -686,7 +686,7 @@ var _ = Describe("[crit:medium][vendor:[email protected]][level:component][sig-c | |
Expect(err).ToNot(HaveOccurred()) | ||
|
||
By("Creating and starting the VM and expecting a failure") | ||
newVM := libvmi.NewVirtualMachine(vmi, libvmi.WithRunning(), libvmi.WithInstancetype(instancetype.Name)) | ||
newVM := libvmi.NewVirtualMachine(vmi, libvmi.WithRunStrategy(virtv1.RunStrategyAlways), libvmi.WithInstancetype(instancetype.Name)) | ||
newVM, err = virtClient.VirtualMachine(testsuite.GetTestNamespace(vm)).Create(context.Background(), newVM, metav1.CreateOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
|
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -997,7 +997,7 @@ var _ = Describe("[rfe_id:1177][crit:medium][vendor:[email protected]][level:com | |
} | ||
|
||
It("[test_id:243][posneg:negative]should create VM only once", decorators.Conformance, func() { | ||
vm, vmJson := createVMAndGenerateJson(libvmi.WithRunning()) | ||
vm, vmJson := createVMAndGenerateJson(libvmi.WithRunStrategy(v1.RunStrategyAlways)) | ||
|
||
By("Creating VM with DataVolumeTemplate entry with k8s client binary") | ||
_, _, err := clientcmd.RunCommand(testsuite.GetTestNamespace(nil), k8sClient, "create", "-f", vmJson) | ||
|
@@ -1016,7 +1016,7 @@ var _ = Describe("[rfe_id:1177][crit:medium][vendor:[email protected]][level:com | |
|
||
DescribeTable("[release-blocker][test_id:299]should create VM via command line using all supported API versions", decorators.Conformance, func(version string) { | ||
vmi := libvmifact.NewAlpine() | ||
vm := libvmi.NewVirtualMachine(vmi, libvmi.WithRunning()) | ||
vm := libvmi.NewVirtualMachine(vmi, libvmi.WithRunStrategy(v1.RunStrategyAlways)) | ||
vm.Namespace = testsuite.GetTestNamespace(vm) | ||
vm.APIVersion = version | ||
|
||
|
@@ -1100,7 +1100,7 @@ var _ = Describe("[rfe_id:1177][crit:medium][vendor:[email protected]][level:com | |
}) | ||
|
||
DescribeTable("when stopping a VM", func(gracePeriod *int64) { | ||
vm, vmJson := createVMAndGenerateJson(libvmi.WithRunning()) | ||
vm, vmJson := createVMAndGenerateJson(libvmi.WithRunStrategy(v1.RunStrategyAlways)) | ||
|
||
By("Creating VM using k8s client binary") | ||
_, _, err := clientcmd.RunCommand(testsuite.GetTestNamespace(nil), k8sClient, "create", "-f", vmJson) | ||
|
@@ -1150,7 +1150,7 @@ var _ = Describe("[rfe_id:1177][crit:medium][vendor:[email protected]][level:com | |
) | ||
|
||
It("[test_id:7528]when restarting a VM", func() { | ||
vm, vmJson := createVMAndGenerateJson(libvmi.WithRunning()) | ||
vm, vmJson := createVMAndGenerateJson(libvmi.WithRunStrategy(v1.RunStrategyAlways)) | ||
|
||
By("Creating VM using k8s client binary") | ||
_, _, err := clientcmd.RunCommand(testsuite.GetTestNamespace(nil), k8sClient, "create", "-f", vmJson) | ||
|
@@ -1182,7 +1182,7 @@ var _ = Describe("[rfe_id:1177][crit:medium][vendor:[email protected]][level:com | |
}) | ||
|
||
It("[test_id:232]should create same manifest twice via command line", func() { | ||
vm, vmJson := createVMAndGenerateJson(libvmi.WithRunning()) | ||
vm, vmJson := createVMAndGenerateJson(libvmi.WithRunStrategy(v1.RunStrategyAlways)) | ||
|
||
By("Creating VM using k8s client binary") | ||
_, _, err := clientcmd.RunCommand(testsuite.GetTestNamespace(nil), k8sClient, "create", "-f", vmJson) | ||
|
@@ -1350,7 +1350,7 @@ var _ = Describe("[rfe_id:1177][crit:medium][vendor:[email protected]][level:com | |
|
||
BeforeEach(func() { | ||
vmi = libvmifact.NewGuestless() | ||
vm = libvmi.NewVirtualMachine(vmi, libvmi.WithRunning()) | ||
vm = libvmi.NewVirtualMachine(vmi, libvmi.WithRunStrategy(v1.RunStrategyAlways)) | ||
Expect(vm.Finalizers).To(BeEmpty()) | ||
vm.Finalizers = append(vm.Finalizers, customFinalizer) | ||
}) | ||
|
@@ -1562,7 +1562,7 @@ func createVM(virtClient kubecli.KubevirtClient, template *v1.VirtualMachineInst | |
|
||
func createRunningVM(virtClient kubecli.KubevirtClient, template *v1.VirtualMachineInstance) *v1.VirtualMachine { | ||
By("Creating running VirtualMachine") | ||
vm := libvmi.NewVirtualMachine(template, libvmi.WithRunning()) | ||
vm := libvmi.NewVirtualMachine(template, libvmi.WithRunStrategy(v1.RunStrategyAlways)) | ||
vm, err := virtClient.VirtualMachine(testsuite.GetTestNamespace(vm)).Create(context.Background(), vm, metav1.CreateOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
return vm | ||
|