avocado.plugins.vm: Provide better debug info on failures to load JSON

Provide the full output of the avocado execution, so we
understand better what was the actual failure.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 20d39422
...@@ -52,7 +52,12 @@ class VMTestRunner(TestRunner): ...@@ -52,7 +52,12 @@ class VMTestRunner(TestRunner):
""" """
avocado_cmd = 'avocado --json run --archive "%s"' % urls avocado_cmd = 'avocado --json run --archive "%s"' % urls
stdout = self.result.vm.remote.run(avocado_cmd) stdout = self.result.vm.remote.run(avocado_cmd)
results = json.loads(stdout) try:
results = json.loads(stdout)
except Exception, details:
raise ValueError('Error loading JSON '
'(full output below): %s\n"""\n%s\n"""' %
(details, stdout))
return results return results
def run(self, params_list): def run(self, params_list):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册