[PATCH] Add two parameters for wait_for_login

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sometimes we need login to guest using different start_time and step_time.

Signed-off-by: Yolkfull Chow <yzhou@xxxxxxxxxx>
---
 client/tests/kvm/kvm_test_utils.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/client/tests/kvm/kvm_test_utils.py b/client/tests/kvm/kvm_test_utils.py
index 601b350..0983003 100644
--- a/client/tests/kvm/kvm_test_utils.py
+++ b/client/tests/kvm/kvm_test_utils.py
@@ -43,7 +43,7 @@ def get_living_vm(env, vm_name):
     return vm
 
 
-def wait_for_login(vm, nic_index=0, timeout=240):
+def wait_for_login(vm, nic_index=0, timeout=240, start=0, step=2):
     """
     Try logging into a VM repeatedly.  Stop on success or when timeout expires.
 
@@ -54,8 +54,8 @@ def wait_for_login(vm, nic_index=0, timeout=240):
     """
     logging.info("Waiting for guest '%s' to be up..." % vm.name)
     session = kvm_utils.wait_for(lambda: vm.remote_login(nic_index=nic_index),
-                                 timeout, 0, 2)
+                                 timeout, start, step)
     if not session:
         raise error.TestFail("Could not log into guest '%s'" % vm.name)
-    logging.info("Logged in")
+    logging.info("Logged in '%s'" % vm.name)
     return session
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux