Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
8a0c740d
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看板
提交
8a0c740d
编写于
7月 23, 2016
作者:
L
Lukáš Doktor
提交者:
Cleber Rosa
7月 25, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avocado.core.remote: Style fixes in runner
Signed-off-by:
N
Lukáš Doktor
<
ldoktor@redhat.com
>
上级
dc289b48
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
11 deletion
+33
-11
avocado/core/remote/runner.py
avocado/core/remote/runner.py
+33
-11
未找到文件。
avocado/core/remote/runner.py
浏览文件 @
8a0c740d
...
...
@@ -45,6 +45,11 @@ class RemoteTestRunner(TestRunner):
remote_version_re
=
re
.
compile
(
r
'^Avocado (\d+)\.(\d+)$'
,
re
.
MULTILINE
)
def
__init__
(
self
,
job
,
test_result
):
super
(
RemoteTestRunner
,
self
).
__init__
(
job
,
test_result
)
#: remoter connection to the remote machine
self
.
remote
=
None
def
_copy_files
(
self
):
"""
Gather test directories and copy them recursively to
...
...
@@ -87,13 +92,14 @@ class RemoteTestRunner(TestRunner):
self
.
job
.
args
.
remote_hostname
,
self
.
job
.
args
.
remote_port
,
self
.
job
.
args
.
remote_timeout
)
self
.
remote
=
remoter
.
Remote
(
hostname
=
self
.
job
.
args
.
remote_hostname
,
username
=
self
.
job
.
args
.
remote_username
,
password
=
self
.
job
.
args
.
remote_password
,
key_filename
=
self
.
job
.
args
.
remote_key_file
,
port
=
self
.
job
.
args
.
remote_port
,
timeout
=
self
.
job
.
args
.
remote_timeout
,
env_keep
=
self
.
job
.
args
.
env_keep
)
self
.
remote
=
remoter
.
Remote
(
hostname
=
self
.
job
.
args
.
remote_hostname
,
username
=
self
.
job
.
args
.
remote_username
,
password
=
self
.
job
.
args
.
remote_password
,
key_filename
=
self
.
job
.
args
.
remote_key_file
,
port
=
self
.
job
.
args
.
remote_port
,
timeout
=
self
.
job
.
args
.
remote_timeout
,
env_keep
=
self
.
job
.
args
.
env_keep
)
def
check_remote_avocado
(
self
):
"""
...
...
@@ -122,7 +128,7 @@ class RemoteTestRunner(TestRunner):
return
(
False
,
None
)
try
:
return
(
True
,
tuple
(
map
(
int
,
match
[
0
])
))
return
(
True
,
tuple
(
int
(
_
)
for
_
in
match
[
0
]
))
except
IndexError
:
return
(
False
,
None
)
...
...
@@ -185,7 +191,8 @@ class RemoteTestRunner(TestRunner):
return
json_result
def
run_suite
(
self
,
test_suite
,
mux
,
timeout
,
replay_map
=
None
,
test_result_total
=
0
):
def
run_suite
(
self
,
test_suite
,
mux
,
timeout
=
0
,
replay_map
=
None
,
test_result_total
=
0
):
"""
Run one or more tests and report with test result.
...
...
@@ -227,8 +234,8 @@ class RemoteTestRunner(TestRunner):
self
.
setup
()
avocado_installed
,
_
=
self
.
check_remote_avocado
()
if
not
avocado_installed
:
raise
exceptions
.
JobError
(
'Remote machine does not seem to
have
'
'avocado installed'
)
raise
exceptions
.
JobError
(
'Remote machine does not seem to'
'
have
avocado installed'
)
self
.
_copy_files
()
except
Exception
as
details
:
stacktrace
.
log_exc_info
(
sys
.
exc_info
(),
logger
=
'avocado.test'
)
...
...
@@ -276,7 +283,19 @@ class RemoteTestRunner(TestRunner):
class
VMTestRunner
(
RemoteTestRunner
):
"""
Test runner to run tests using libvirt domain
"""
def
__init__
(
self
,
job
,
test_result
):
super
(
VMTestRunner
,
self
).
__init__
(
job
,
test_result
)
#: VM used during testing
self
.
vm
=
None
def
setup
(
self
):
"""
Initialize VM and establish connection
"""
# Super called after VM is found and initialized
self
.
job
.
log
.
info
(
"DOMAIN : %s"
,
self
.
job
.
args
.
vm_domain
)
self
.
vm
=
virt
.
vm_connect
(
self
.
job
.
args
.
vm_domain
,
...
...
@@ -313,6 +332,9 @@ class VMTestRunner(RemoteTestRunner):
super
(
VMTestRunner
,
self
).
setup
()
def
tear_down
(
self
):
"""
Stop VM and restore snapshot (if asked for it)
"""
super
(
VMTestRunner
,
self
).
tear_down
()
if
(
self
.
job
.
args
.
vm_cleanup
is
True
and
isinstance
(
getattr
(
self
,
'vm'
,
None
),
virt
.
VM
)):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录