diff mbox

Add two parameters for wait_for_login

Message ID 1254295788-18390-1-git-send-email-yzhou@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yolkfull Chow Sept. 30, 2009, 7:29 a.m. UTC
None
diff mbox

Patch

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