KVM-test: Log the output of failed executed command 'pre/post-command'
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 <yzhou@redhat.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4185 592f7852-d20e-0410-864c-8624ca9c26a4
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 @@
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):