From patchwork Sun Jan 17 21:05:53 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: 73542 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 o0HL70r2016660 for ; Sun, 17 Jan 2010 21:07:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754836Ab0AQVGS (ORCPT ); Sun, 17 Jan 2010 16:06:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754816Ab0AQVGC (ORCPT ); Sun, 17 Jan 2010 16:06:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32231 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754812Ab0AQVF7 (ORCPT ); Sun, 17 Jan 2010 16:05:59 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0HL5v7A003545 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 17 Jan 2010 16:05:57 -0500 Received: from localhost.localdomain (vpn-8-173.rdu.redhat.com [10.11.8.173]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0HL5tQ4020122; Sun, 17 Jan 2010 16:05:56 -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 19:05:53 -0200 Message-Id: <1263762353-3270-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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..e3df72a 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 = float(params.get("timeout", 3000)) + logging.info("Starting unattended install watch process. " + "Timeout set to %ds (%d min)", install_timeout, + install_timeout/60) + start_time = time.time() while True: - server.settimeout(end_time - time.time()) + server.settimeout(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 %ds ' + '(%d min)', time_elapsed, time_elapsed/60) server.close() break else: