From: Michael Goldish Subject: [KVM-AUTOTEST PATCH 1/5] KVM test: remote_login(): if rss.exe says "Please wait", wait Date: Tue, 23 Mar 2010 21:09:57 +0200 Message-ID: <1269371401-9341-1-git-send-email-mgoldish@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: autotest@test.kernel.org, kvm@vger.kernel.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org Recognize rss.exe's "Please wait" message and give the login procedure more time to complete. The message is sent before spawning cmd.exe, which may take some time under heavy load. Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_utils.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index 5834539..8531c79 100644 --- a/client/tests/kvm/kvm_utils.py +++ b/client/tests/kvm/kvm_utils.py @@ -482,7 +482,8 @@ def remote_login(command, password, prompt, linesep="\n", timeout=10): while True: (match, text) = sub.read_until_last_line_matches( [r"[Aa]re you sure", r"[Pp]assword:\s*$", r"^\s*[Ll]ogin:\s*$", - r"[Cc]onnection.*closed", r"[Cc]onnection.*refused", prompt], + r"[Cc]onnection.*closed", r"[Cc]onnection.*refused", + r"[Pp]lease wait", prompt], timeout=timeout, internal_timeout=0.5) if match == 0: # "Are you sure you want to continue connecting" logging.debug("Got 'Are you sure...'; sending 'yes'") @@ -510,7 +511,11 @@ def remote_login(command, password, prompt, linesep="\n", timeout=10): logging.debug("Got 'Connection refused'") sub.close() return None - elif match == 5: # prompt + elif match == 5: # "Please wait" + logging.debug("Got 'Please wait'") + timeout = 30 + continue + elif match == 6: # prompt logging.debug("Got shell prompt -- logged in") return sub else: # match == None -- 1.5.4.1