提交 bd749276 编写于 作者: L Lukáš Doktor 提交者: Cleber Rosa

avocado.core.remote: Handle urls without assigned files

The remote runner url=>file is rather simple, it takes the url and if
the file does not exists, it uses test_dir + url. Fabric should copy
that file, but it silently ignores missing files, therefor (unless the
file already exists on the remote machine) it fails later in the code
with "Unable to discover ...".

This patch adds check to make sure the mapped file exists. If not it
raises exception.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 d388faae
......@@ -61,6 +61,9 @@ class RemoteTestRunner(TestRunner):
url = self.job.urls[i]
if not os.path.exists(url): # use test_dir path + py
url = os.path.join(data_dir.get_test_dir(), url)
if not os.path.exists(url):
raise exceptions.JobError("Unable to map test id '%s' to file"
% self.job.urls[i])
url = os.path.abspath(url) # always use abspath; avoid clashes
# modify url to remote_path + abspath
paths.add(url)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册