From patchwork Fri Jun 26 17:00:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harper X-Patchwork-Id: 32589 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 n5QH1UO6023489 for ; Fri, 26 Jun 2009 17:01:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759526AbZFZRBH (ORCPT ); Fri, 26 Jun 2009 13:01:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758916AbZFZRBG (ORCPT ); Fri, 26 Jun 2009 13:01:06 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:42787 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757362AbZFZRBF (ORCPT ); Fri, 26 Jun 2009 13:01:05 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e34.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n5QGvtOS010482 for ; Fri, 26 Jun 2009 10:57:55 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n5QH0tRh220342 for ; Fri, 26 Jun 2009 11:00:55 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n5QH0sdH029795 for ; Fri, 26 Jun 2009 11:00:54 -0600 Received: from localhost.localdomain (sig-9-49-145-135.mts.ibm.com [9.49.145.135]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n5QH0pug029630; Fri, 26 Jun 2009 11:00:53 -0600 From: Ryan Harper To: autotest@test.kernel.org Cc: Ryan Harper , kvm@vger.kernel.org Subject: [KVM-AUTOTEST][PATCH 1/2] Add parse_results_file method to scan_results.py Date: Fri, 26 Jun 2009 12:00:50 -0500 Message-Id: <1246035651-29508-2-git-send-email-ryanh@us.ibm.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1246035651-29508-1-git-send-email-ryanh@us.ibm.com> References: <1246035651-29508-1-git-send-email-ryanh@us.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org o Add a new method, parse_results_file which takes a file, reads the data and invokes the parse_results method. o Refactor main() method to use parse_results_file. Signed-off-by: Ryan Harper --- client/tests/kvm/scan_results.py | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/tests/kvm/scan_results.py b/client/tests/kvm/scan_results.py index 95507bd..175744a 100755 --- a/client/tests/kvm/scan_results.py +++ b/client/tests/kvm/scan_results.py @@ -42,6 +42,13 @@ def parse_results(text): return result_list +def parse_results_file(resfile): + f = file(resfile) + text = f.read() + f.close() + return parse_results(text) + + def print_result(result): """Nicely print a single Autotest result. @@ -55,11 +62,7 @@ def main(resfile): print_result(('test', 'status', 'seconds', 'info')) print_result(('----', '------', '-------', '----')) - f = file(resfile) - text = f.read() - f.close() - - results = parse_results(text) + results = parse_results_file(resfile) map(print_result, results)