Skip to content

Commit 73ae2a3

Browse files
author
Valeriy Khorunzhin
committed
remove useless wrapper
Signed-off-by: Valeriy Khorunzhin <[email protected]>
1 parent 2b27937 commit 73ae2a3

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

test/e2e/internal/util/vm.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,6 @@ func CheckExternalConnectivity(f *framework.Framework, vmName, host, expectedHTT
111111
Expect(strings.TrimSpace(httpCode)).To(Equal(expectedHTTPCode), "HTTP response code from %s should be %s, got %s", host, expectedHTTPCode, httpCode)
112112
}
113113

114-
func UntilVirtualMachineStopped(key client.ObjectKey, timeout time.Duration) {
115-
GinkgoHelper()
116-
117-
Eventually(func() error {
118-
vm := &v1alpha2.VirtualMachine{}
119-
err := framework.GetClients().GenericClient().Get(context.Background(), key, vm)
120-
if err != nil {
121-
return err
122-
}
123-
if vm.Status.Phase == v1alpha2.MachineStopped {
124-
return nil
125-
}
126-
return fmt.Errorf("virtual machine %s is not stopped (phase: %s)", key.Name, vm.Status.Phase)
127-
}).WithTimeout(timeout).WithPolling(time.Second).Should(Succeed())
128-
}
129-
130114
func RebootVirtualMachineFromOS(f *framework.Framework, vm *v1alpha2.VirtualMachine) error {
131115
_, err := f.SSHCommand(vm.Name, vm.Namespace, "sudo reboot")
132116
if err != nil && strings.Contains(err.Error(), "unexpected EOF") {

test/e2e/vmop/restore.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,13 @@ func (r *restoreModeTest) GetDataFromVMBDA() string {
308308
func (r *restoreModeTest) RemoveDisks() {
309309
GinkgoHelper()
310310

311-
// Stop VM and remove all disks to test Strict restore mode.
312311
err := util.StopVirtualMachineFromOS(r.Framework, r.VM)
313312
Expect(err).NotTo(HaveOccurred())
314-
util.UntilVirtualMachineStopped(crclient.ObjectKeyFromObject(r.VM), framework.ShortTimeout)
313+
util.UntilObjectPhase(string(v1alpha2.MachineStopped), framework.ShortTimeout, r.VM)
315314

316-
err = r.Framework.Delete(context.Background(), r.VDRoot)
317-
Expect(err).NotTo(HaveOccurred())
318-
err = r.Framework.Delete(context.Background(), r.VDBlank)
315+
err = r.Framework.Delete(context.Background(), r.VDRoot, r.VDBlank)
319316
Expect(err).NotTo(HaveOccurred())
320317

321-
// Wait for disks to be fully deleted before proceeding with restore
322318
Eventually(func(g Gomega) {
323319
var vdRootLocal v1alpha2.VirtualDisk
324320
err = r.Framework.Clients.GenericClient().Get(context.Background(), types.NamespacedName{

0 commit comments

Comments
 (0)