Re-align restart test for RunStrategy=manual with test plan
@@ -874,6 +874,38 @@ var _ = Describe("[rfe_id:1177][crit:medium][vendor:cnv-qe@redhat.com][level:com
virtualMachine := newVirtualMachineWithRunStrategy(v1.RunStrategyManual)
startCommand := tests.NewRepeatableVirtctlCommand(vm.COMMAND_START, "--namespace", virtualMachine.Namespace, virtualMachine.Name)
+ stopCommand := tests.NewRepeatableVirtctlCommand(vm.COMMAND_STOP, "--namespace", virtualMachine.Namespace, virtualMachine.Name)
+ restartCommand := tests.NewRepeatableVirtctlCommand(vm.COMMAND_RESTART, "--namespace", virtualMachine.Namespace, virtualMachine.Name)
+
+ By("Invoking virtctl restart")
+ err = restartCommand()
+ Expect(err).ToNot(HaveOccurred())
+
+ By("Waiting for VMI to be ready")
+ Eventually(func() bool {
+ virtualMachine, err = virtClient.VirtualMachine(virtualMachine.Namespace).Get(virtualMachine.Name, &v12.GetOptions{})
+ Expect(err).ToNot(HaveOccurred())
+ return virtualMachine.Status.Ready
+ }, 240*time.Second, 1*time.Second).Should(BeTrue())
+
+ By("Invoking virtctl stop")
+ err = stopCommand()
+ Expect(err).ToNot(HaveOccurred())
+
+ By("Ensuring the VirtualMachineInstance is stopped")
+ Eventually(func() bool {
+ _, err = virtClient.VirtualMachineInstance(virtualMachine.Namespace).Get(virtualMachine.Name, &v12.GetOptions{})
+ if err != nil {
+ // A 404 is the expected end result
+ if !errors.IsNotFound(err) {
+ Expect(err).ToNot(HaveOccurred())
+ }
+ return true
+ }
+ return false
+ }, 240*time.Second, 1*time.Second).Should(BeTrue())
+
+ By("Invoking virtctl start")
err = startCommand()
Expect(err).ToNot(HaveOccurred())
@@ -890,7 +922,6 @@ var _ = Describe("[rfe_id:1177][crit:medium][vendor:cnv-qe@redhat.com][level:com
currentUUID := virtualMachine.UID
By("Invoking virtctl restart")
- restartCommand := tests.NewRepeatableVirtctlCommand(vm.COMMAND_RESTART, "--namespace", virtualMachine.Namespace, virtualMachine.Name)
err = restartCommand()
Expect(err).ToNot(HaveOccurred())
