From patchwork Wed Sep 30 07:29:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yolkfull Chow X-Patchwork-Id: 50660 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8U7TB4C002853 for ; Wed, 30 Sep 2009 07:29:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751905AbZI3H3F (ORCPT ); Wed, 30 Sep 2009 03:29:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752658AbZI3H3F (ORCPT ); Wed, 30 Sep 2009 03:29:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39728 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbZI3H3F (ORCPT ); Wed, 30 Sep 2009 03:29:05 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8U7T7Fj012086; Wed, 30 Sep 2009 03:29:08 -0400 Received: from localhost.localdomain (dhcp-65-181.nay.redhat.com [10.66.65.181]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8U7T419023710; Wed, 30 Sep 2009 03:29:05 -0400 From: Yolkfull Chow To: kvm@vger.kernel.org, autotest@test.kernel.com Cc: autotest@test.kernel.org, Yolkfull Chow Subject: [PATCH] Add two parameters for wait_for_login Date: Wed, 30 Sep 2009 15:29:48 +0800 Message-Id: <1254295788-18390-1-git-send-email-yzhou@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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