From patchwork Wed Mar 25 16:43:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harper X-Patchwork-Id: 14367 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 n2PGhSeG011140 for ; Wed, 25 Mar 2009 16:43:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753323AbZCYQn1 (ORCPT ); Wed, 25 Mar 2009 12:43:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753679AbZCYQn1 (ORCPT ); Wed, 25 Mar 2009 12:43:27 -0400 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 Received: by localhost.localdomain (Postfix, from userid 1000) id 79B3E1BF80; Wed, 25 Mar 2009 11:43:22 -0500 (CDT) Date: Wed, 25 Mar 2009 11:43:22 -0500 From: Ryan Harper To: kvm@vger.kernel.org Subject: [PATCH] kvm-autotest: log test failed execption string Message-ID: <20090325164322.GM27104@us.ibm.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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'... 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