Skip to contentSkip to conversation

kvm-autotest: log test failed execption string

PATCH Applied Ryan Harper 2 participants 2 messages Mar 25, 2009 – Mar 29, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm-autotest: log test failed execption string

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'...

Signature · 12 lines
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
[email protected]


diffstat output:
 kvm_runtest_2.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Signed-off-by: Ryan Harper <[email protected]>
---
client/tests/kvm_runtest_2/kvm_runtest_2.py +2 -2
index 9add48a..cf6b699 100644
@@ -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
Applied
#1 lore raw
Quoted 9 lines · Ryan Harper

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'...

Quoted 10 lines

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'...

Applied, Thanks.