From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Harper Subject: [PATCH] kvm-autotest: log test failed execption string Date: Wed, 25 Mar 2009 11:43:22 -0500 Message-ID: <20090325164322.GM27104@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: kvm@vger.kernel.org Return-path: Received: from e4.ny.us.ibm.com ([32.97.182.144]:54571 "EHLO e4.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbZCYQn0 (ORCPT ); Wed, 25 Mar 2009 12:43:26 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n2PGeNMn024160 for ; Wed, 25 Mar 2009 12:40:23 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n2PGhONU183280 for ; Wed, 25 Mar 2009 12:43:24 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n2PGhOcS015160 for ; Wed, 25 Mar 2009 12:43:24 -0400 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d01av01.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n2PGhOGC015150 for ; Wed, 25 Mar 2009 12:43:24 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: When a test case fails and throws an execption, we don't log the exception details, only that it occured. reboot: DEBUG: remote_login: Got password prompt; sending '123456' reboot: DEBUG: remote_login: Got shell prompt -- logged in reboot: Logged in reboot: DEBUG: run_once: Test failed; postprocessing on error... reboot: DEBUG: postprocess_vm: Postprocessing VM 'vm1'... The attached patch includes the exception text from the failure which makes it easier to debug. reboot: DEBUG: remote_login: Got password prompt; sending '123456' reboot: DEBUG: remote_login: Got shell prompt -- logged in reboot: Logged in reboot: DEBUG: run_once: Test failed (invalid syntax (kvm_tests.py, line 34)); postprocessing on error... reboot: DEBUG: postprocess_vm: Postprocessing VM 'vm1'... -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx ryanh@us.ibm.com diffstat output: kvm_runtest_2.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Signed-off-by: Ryan Harper --- diff --git a/client/tests/kvm_runtest_2/kvm_runtest_2.py b/client/tests/kvm_runtest_2/kvm_runtest_2.py index 9add48a..cf6b699 100644 --- a/client/tests/kvm_runtest_2/kvm_runtest_2.py +++ b/client/tests/kvm_runtest_2/kvm_runtest_2.py @@ -91,8 +91,8 @@ class kvm_runtest_2(test.test): routine_obj.routine(self, params, env) env.sync() - except: - kvm_log.debug("Test failed; postprocessing on error...") + except Exception, e: + kvm_log.debug("Test failed (%s); postprocessing on error..." %(str(e))) kvm_preprocessing.postprocess_on_error(self, params, env) env.sync() raise