提交 8103dca1 编写于 作者: C Cleber Rosa

remote test execution: check avocado earlier and copy tests conditionally

run_suite() actually happens earlier, and is only called once, so it seems
to be a better place for the check of Avocado on the remote system. If this
condition holds true, then copy the requested tests to the remote system.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 76f987c9
......@@ -71,11 +71,6 @@ class RemoteTestRunner(TestRunner):
:param urls: a string with test URLs.
:return: a dictionary with test results.
"""
avocado_installed_version = self.check_remote_avocado()
if not avocado_installed_version[0]:
raise exceptions.JobError('Remote machine does not seem to have '
'avocado installed')
urls_str = " ".join(urls)
avocado_check_urls_cmd = ('cd %s; avocado list %s '
'--paginator=off' % (self.remote_test_dir,
......@@ -157,6 +152,11 @@ class RemoteTestRunner(TestRunner):
try:
try:
self.result.setup()
avocado_installed, _ = self.check_remote_avocado()
if not avocado_installed:
raise exceptions.JobError('Remote machine does not seem to have '
'avocado installed')
self.result.copy_tests()
except Exception, details:
stacktrace.log_exc_info(sys.exc_info(), logger='avocado.test')
raise exceptions.JobError(details)
......
......@@ -87,6 +87,7 @@ _=/usr/bin/env''', exit_status=0)
stream=stream, timeout=None,
args=flexmock(show_job_log=False))
Results.should_receive('setup').once().ordered()
Results.should_receive('copy_tests').once().ordered()
Results.should_receive('start_tests').once().ordered()
args = {'status': u'PASS', 'whiteboard': '', 'time_start': 0,
'name': u'sleeptest.1', 'class_name': 'RemoteTest',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册