From patchwork Fri Jun 26 17:00:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harper X-Patchwork-Id: 32590 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 n5QH1UO7023489 for ; Fri, 26 Jun 2009 17:01:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760187AbZFZRBN (ORCPT ); Fri, 26 Jun 2009 13:01:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760160AbZFZRBM (ORCPT ); Fri, 26 Jun 2009 13:01:12 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:59703 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759111AbZFZRBK (ORCPT ); Fri, 26 Jun 2009 13:01:10 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e33.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n5QGx6Sh010287 for ; Fri, 26 Jun 2009 10:59:06 -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 n5QH0u7R205974 for ; Fri, 26 Jun 2009 11:00:56 -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 n5QH0t4i029872 for ; Fri, 26 Jun 2009 11:00:56 -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 n5QH0puh029630; Fri, 26 Jun 2009 11:00:54 -0600 From: Ryan Harper To: autotest@test.kernel.org Cc: Ryan Harper , kvm@vger.kernel.org Subject: [KVM-AUTOTEST][PATCH 2/2] Parse guest autotest results from status file Date: Fri, 26 Jun 2009 12:00:51 -0500 Message-Id: <1246035651-29508-3-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 Recently the autotest runs in the guest would pass but we would fail to parse the results and indicate a failure. This is probably due to the logging change as the stdout output includes the [$date DEBUG] info which breaks scan_results.py:parse_results(). Rather than trying to parse the output from the ssh connection parse the status file that the autotest run in the guest generates. To do this, move the guest_results scp operation up and then use the new parse_results_file() method. Signed-off-by: Ryan Harper --- client/tests/kvm/kvm_tests.py | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py index 54d2a7a..8fe0fab 100644 --- a/client/tests/kvm/kvm_tests.py +++ b/client/tests/kvm/kvm_tests.py @@ -312,8 +312,17 @@ def run_autotest(test, params, env): session.close() - # Parse test results - result_list = scan_results.parse_results(output) + # Copy test results to the local bindir/guest_results + logging.info("Copying results back from guest...") + guest_results_dir = os.path.join(test.outputdir, "guest_results") + if not os.path.exists(guest_results_dir): + os.mkdir(guest_results_dir) + if not vm.scp_from_remote("autotest/results/default/*", guest_results_dir): + logging.error("Could not copy results back from guest") + + # Parse the test results file the guest generated + guest_results_file = os.path.join(guest_results_dir, "status") + result_list = scan_results.parse_results_file(guest_results_file) # Report test results and check for FAIL/ERROR status logging.info("Results (test, status, duration, info):") @@ -338,14 +347,6 @@ def run_autotest(test, params, env): message_error = "Test '%s' ended with ABORT" " (info: '%s')" % (result[0], result[3]) - # Copy test results to the local bindir/guest_results - logging.info("Copying results back from guest...") - guest_results_dir = os.path.join(test.outputdir, "guest_results") - if not os.path.exists(guest_results_dir): - os.mkdir(guest_results_dir) - if not vm.scp_from_remote("autotest/results/default/*", guest_results_dir): - logging.error("Could not copy results back from guest") - # Fail the test if necessary if status_fail: raise error.TestFail(message_fail)