From patchwork Sun Jan 17 15:08:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 73506 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0HF8lZX018189 for ; Sun, 17 Jan 2010 15:08:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754050Ab0AQPIp (ORCPT ); Sun, 17 Jan 2010 10:08:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754036Ab0AQPIp (ORCPT ); Sun, 17 Jan 2010 10:08:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14069 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753993Ab0AQPIo (ORCPT ); Sun, 17 Jan 2010 10:08:44 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0HF8gNk013670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 17 Jan 2010 10:08:42 -0500 Received: from localhost.localdomain (vpn-8-173.rdu.redhat.com [10.11.8.173]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0HF8eO0005804; Sun, 17 Jan 2010 10:08:40 -0500 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH] KVM test: Unattended install logging improvements Date: Sun, 17 Jan 2010 13:08:38 -0200 Message-Id: <1263740918-3789-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py index d33d4f1..18561f6 100644 --- a/client/tests/kvm/tests/unattended_install.py +++ b/client/tests/kvm/tests/unattended_install.py @@ -15,15 +15,18 @@ def run_unattended_install(test, params, env): """ vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) - logging.info("Starting unattended install watch process") server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(('', 12323)) server.listen(1) - end_time = time.time() + float(params.get("timeout", 3000)) + install_timeout = params.get("timeout", 3000) + logging.info("Starting unattended install watch process. " + "Timeout set to %ss (%s min)", install_timeout, + install_timeout/60) + start_time = time.time() while True: - server.settimeout(end_time - time.time()) + server.settimeout(float(install_timeout)) try: (client, addr) = server.accept() except socket.timeout: @@ -33,7 +36,10 @@ def run_unattended_install(test, params, env): msg = client.recv(1024) logging.debug("Received '%s' from %s", msg, addr) if msg == 'done': - logging.info('Guest reported successful installation') + end_time = time.time() + time_elapsed = int(end_time - start_time) + logging.info('Guest reported successful installation after %ss ' + '(%s min)', time_elapsed, time_elapsed/60) server.close() break else: