提交 5c72b517 编写于 作者: L Lucas Meneghel Rodrigues

Merge pull request #299 from ruda/fix_bad_input_for_remote_vm

Fix garbage output on remote and vm plugins.
...@@ -43,8 +43,9 @@ class RemoteTestRunner(TestRunner): ...@@ -43,8 +43,9 @@ class RemoteTestRunner(TestRunner):
avocado_cmd = ('cd %s; avocado run --force-job-id %s --json - --archive %s' % avocado_cmd = ('cd %s; avocado run --force-job-id %s --json - --archive %s' %
(self.remote_test_dir, self.result.stream.job_unique_id, " ".join(urls))) (self.remote_test_dir, self.result.stream.job_unique_id, " ".join(urls)))
result = self.result.remote.run(avocado_cmd, ignore_status=True) result = self.result.remote.run(avocado_cmd, ignore_status=True)
json_output = result.stdout.splitlines()[0]
try: try:
results = json.loads(result.stdout) results = json.loads(json_output)
except Exception, details: except Exception, details:
raise ValueError('Error loading JSON ' raise ValueError('Error loading JSON '
'(full output below): %s\n"""\n%s\n"""' % '(full output below): %s\n"""\n%s\n"""' %
......
...@@ -43,8 +43,9 @@ class VMTestRunner(TestRunner): ...@@ -43,8 +43,9 @@ class VMTestRunner(TestRunner):
avocado_cmd = ('cd %s; avocado run --force-job-id %s --json - --archive %s' % avocado_cmd = ('cd %s; avocado run --force-job-id %s --json - --archive %s' %
(self.remote_test_dir, self.result.stream.job_unique_id, " ".join(urls))) (self.remote_test_dir, self.result.stream.job_unique_id, " ".join(urls)))
result = self.result.vm.remote.run(avocado_cmd, ignore_status=True) result = self.result.vm.remote.run(avocado_cmd, ignore_status=True)
xunit_output = result.stdout.splitlines()[0]
try: try:
results = json.loads(result.stdout) results = json.loads(xunit_output)
except Exception, details: except Exception, details:
raise ValueError('Error loading JSON ' raise ValueError('Error loading JSON '
'(full output below): %s\n"""\n%s\n"""' % '(full output below): %s\n"""\n%s\n"""' %
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册