tests: update the `StartVmOnNode` method to return the started VMI
@@ -3820,7 +3820,7 @@ func SkipIfOpenShift4(message string) {
}
// StartVmOnNode starts a VMI on the specified node
-func StartVmOnNode(vmi *v1.VirtualMachineInstance, nodeName string) {
+func StartVmOnNode(vmi *v1.VirtualMachineInstance, nodeName string) *v1.VirtualMachineInstance {
virtClient, err := kubecli.GetKubevirtClient()
PanicOnError(err)
@@ -3838,9 +3838,10 @@ func StartVmOnNode(vmi *v1.VirtualMachineInstance, nodeName string) {
},
}
- _, err = virtClient.VirtualMachineInstance(NamespaceTestDefault).Create(vmi)
+ vmi, err = virtClient.VirtualMachineInstance(NamespaceTestDefault).Create(vmi)
ExpectWithOffset(1, err).ToNot(HaveOccurred())
WaitForSuccessfulVMIStart(vmi)
+ return vmi
}
// RunCommandOnVmiPod runs specified command on the virt-launcher pod
