Sometimes we need the output of failed command 'pre/post-command'
when raising error.TestError. Take an example that using post-command
to check images of qcow2 format, it will simply tell command failed
rather than show '%d errors were found on the image'.

Signed-off-by: Yolkfull Chow <yz...@redhat.com>
---
 client/tests/kvm/kvm_preprocessing.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/client/tests/kvm/kvm_preprocessing.py 
b/client/tests/kvm/kvm_preprocessing.py
index 4e45c76..53fa2cb 100644
--- a/client/tests/kvm/kvm_preprocessing.py
+++ b/client/tests/kvm/kvm_preprocessing.py
@@ -148,9 +148,11 @@ def process_command(test, params, env, command, 
command_timeout,
                                              logging.debug, "(command) ",
                                              timeout=command_timeout)
     if status != 0:
-        logging.warn("Custom processing command failed: '%s'" % command)
+        logging.warn("Custom processing command failed: '%s'; Output is: %s" %
+                                                            (command, output))
         if not command_noncritical:
-            raise error.TestError("Custom processing command failed")
+            raise error.TestError("Custom processing command failed: %s" %
+                                                                   output)
 
 
 def process(test, params, env, image_func, vm_func):
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to