Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
b441c7b0
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b441c7b0
编写于
4月 21, 2015
作者:
L
Lucas Meneghel Rodrigues
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #562 from ldoktor/remotefix
avocado.remote: Accept "timeout" arg
上级
07cbf19c
7ed98e7a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
17 deletion
+9
-17
avocado/plugins/remote.py
avocado/plugins/remote.py
+0
-4
avocado/plugins/vm.py
avocado/plugins/vm.py
+0
-4
avocado/remote/result.py
avocado/remote/result.py
+0
-2
avocado/remote/runner.py
avocado/remote/runner.py
+7
-5
selftests/all/unit/avocado/remote_unittest.py
selftests/all/unit/avocado/remote_unittest.py
+2
-2
未找到文件。
avocado/plugins/remote.py
浏览文件 @
b441c7b0
...
...
@@ -61,10 +61,6 @@ class RunRemote(plugin.Plugin):
action
=
'store_true'
,
help
=
"Don't copy tests and use the "
"exact uri on guest machine."
)
self
.
remote_parser
.
add_argument
(
'--remote-timeout'
,
type
=
float
,
help
=
"Host timeout before the "
"connection is cut off and test "
"set as failed."
)
self
.
configured
=
True
@
staticmethod
...
...
avocado/plugins/vm.py
浏览文件 @
b441c7b0
...
...
@@ -67,10 +67,6 @@ class RunVM(plugin.Plugin):
action
=
'store_true'
,
help
=
"Don't copy tests and use the "
"exact uri on VM machine."
)
self
.
vm_parser
.
add_argument
(
'--vm-timeout'
,
type
=
float
,
help
=
"Host timeout before the "
"connection is cut off and test "
"set as failed."
)
self
.
configured
=
True
@
staticmethod
...
...
avocado/remote/result.py
浏览文件 @
b441c7b0
...
...
@@ -43,7 +43,6 @@ class RemoteTestResult(HumanTestResult):
self
.
remote
=
None
# Remote runner initialized during setup
self
.
output
=
'-'
self
.
command_line_arg_name
=
'--remote-hostname'
self
.
timeout
=
getattr
(
args
,
'remote_timeout'
,
None
)
def
_copy_tests
(
self
):
"""
...
...
@@ -99,7 +98,6 @@ class VMTestResult(RemoteTestResult):
"""
def
__init__
(
self
,
stream
,
args
):
args
.
remote_timeout
=
getattr
(
args
,
'vm_timeout'
,
None
)
super
(
VMTestResult
,
self
).
__init__
(
stream
,
args
)
self
.
vm
=
None
self
.
command_line_arg_name
=
'--vm-domain'
...
...
avocado/remote/runner.py
浏览文件 @
b441c7b0
...
...
@@ -56,7 +56,7 @@ class RemoteTestRunner(TestRunner):
return
(
True
,
tuple
(
map
(
int
,
match
.
groups
())))
def
run_test
(
self
,
urls
):
def
run_test
(
self
,
urls
,
timeout
):
"""
Run tests.
...
...
@@ -84,11 +84,11 @@ class RemoteTestRunner(TestRunner):
urls_str
))
try
:
result
=
self
.
result
.
remote
.
run
(
avocado_cmd
,
ignore_status
=
True
,
timeout
=
self
.
result
.
timeout
)
timeout
=
timeout
)
except
CommandTimeout
:
raise
exceptions
.
JobError
(
"Remote execution took longer than "
"specified timeout (%s). Interrupting."
%
(
self
.
result
.
timeout
))
%
(
timeout
))
json_result
=
None
for
json_output
in
result
.
stdout
.
splitlines
():
# We expect dictionary:
...
...
@@ -112,7 +112,7 @@ class RemoteTestRunner(TestRunner):
return
json_result
def
run_suite
(
self
,
test_suite
,
mux
):
def
run_suite
(
self
,
test_suite
,
mux
,
timeout
):
"""
Run one or more tests and report with test result.
...
...
@@ -123,9 +123,11 @@ class RemoteTestRunner(TestRunner):
"""
del
test_suite
# using self.result.urls instead
del
mux
# we're not using multiplexation here
if
not
timeout
:
# avoid timeout = 0
timeout
=
None
failures
=
[]
self
.
result
.
setup
()
results
=
self
.
run_test
(
self
.
result
.
urls
)
results
=
self
.
run_test
(
self
.
result
.
urls
,
timeout
)
remote_log_dir
=
os
.
path
.
dirname
(
results
[
'debuglog'
])
self
.
result
.
start_tests
()
for
tst
in
results
[
'tests'
]:
...
...
selftests/all/unit/avocado/remote_unittest.py
浏览文件 @
b441c7b0
...
...
@@ -50,7 +50,7 @@ class RemoteTestRunnerTest(unittest.TestCase):
args
=
(
"cd ~/avocado/tests; avocado run --force-job-id sleeptest.1 "
"--json - --archive sleeptest"
)
(
Remote
.
should_receive
(
'run'
)
.
with_args
(
args
,
timeout
=
None
,
ignore_status
=
True
)
.
with_args
(
args
,
timeout
=
61
,
ignore_status
=
True
)
.
once
().
and_return
(
test_results
))
Results
=
flexmock
(
remote
=
Remote
,
urls
=
[
'sleeptest'
],
stream
=
stream
,
timeout
=
None
)
...
...
@@ -85,7 +85,7 @@ class RemoteTestRunnerTest(unittest.TestCase):
def
test_run_suite
(
self
):
""" Test RemoteTestRunner.run_suite() """
self
.
remote
.
run_suite
(
None
,
None
)
self
.
remote
.
run_suite
(
None
,
None
,
61
)
flexmock_teardown
()
# Checks the expectations
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录