Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
45c1b23b
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
45c1b23b
编写于
4月 13, 2018
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'ldoktor/yaml_loader-replay2'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
197e62c2
d1e1b952
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
64 addition
and
0 deletion
+64
-0
avocado/core/tree.py
avocado/core/tree.py
+3
-0
optional_plugins/loader_yaml/tests/.data/two_tests.yaml
optional_plugins/loader_yaml/tests/.data/two_tests.yaml
+5
-0
optional_plugins/loader_yaml/tests/__init__.py
optional_plugins/loader_yaml/tests/__init__.py
+0
-0
optional_plugins/loader_yaml/tests/test_yaml_loader.py
optional_plugins/loader_yaml/tests/test_yaml_loader.py
+56
-0
未找到文件。
avocado/core/tree.py
浏览文件 @
45c1b23b
...
...
@@ -129,6 +129,9 @@ class TreeNodeEnvOnly(object):
return
False
return
True
def
fingerprint
(
self
):
return
"%s%s"
%
(
self
.
path
,
self
.
environment
)
def
get_environment
(
self
):
return
self
.
environment
...
...
optional_plugins/loader_yaml/tests/.data/two_tests.yaml
0 → 100644
浏览文件 @
45c1b23b
!mux
instrumented
:
test_reference
:
passtest.py
simple
:
test_reference
:
passtest.sh
optional_plugins/loader_yaml/tests/__init__.py
0 → 100644
浏览文件 @
45c1b23b
optional_plugins/loader_yaml/tests/test_yaml_loader.py
0 → 100644
浏览文件 @
45c1b23b
import
os
import
tempfile
import
shutil
import
unittest
from
avocado.core
import
exit_codes
from
avocado.utils
import
process
BASEDIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'..'
,
'..'
,
'..'
)
BASEDIR
=
os
.
path
.
abspath
(
BASEDIR
)
AVOCADO
=
os
.
environ
.
get
(
"UNITTEST_AVOCADO_CMD"
,
"./scripts/avocado"
)
class
YamlLoaderTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
tmpdir
=
tempfile
.
mkdtemp
(
prefix
=
'avocado_'
+
__name__
)
def
run_and_check
(
self
,
cmd_line
,
expected_rc
,
stdout_strings
=
None
):
os
.
chdir
(
BASEDIR
)
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
,
"Command %s did not return rc "
"%d:
\n
%s"
%
(
cmd_line
,
expected_rc
,
result
))
if
stdout_strings
is
not
None
:
for
exp
in
stdout_strings
:
self
.
assertIn
(
exp
,
result
.
stdout
,
"%s not in stdout:"
"
\n
%s"
%
(
exp
,
result
))
return
result
def
test_replay
(
self
):
# Run source job
tests
=
[
b
"passtest.py:PassTest.test"
,
b
"passtest.sh"
]
cmd
=
(
'%s run --sysinfo=off --job-results-dir %s -- '
'optional_plugins/loader_yaml/tests/.data/two_tests.yaml'
%
(
AVOCADO
,
self
.
tmpdir
))
res
=
self
.
run_and_check
(
cmd
,
exit_codes
.
AVOCADO_ALL_OK
,
tests
)
# Run replay job
for
line
in
res
.
stdout
.
splitlines
():
if
line
.
startswith
(
b
"JOB LOG"
):
srcjob
=
line
[
13
:]
break
else
:
self
.
fail
(
"Unable to find 'JOB LOG' in:
\n
%s"
%
res
)
cmd
=
(
'%s run --sysinfo=off --job-results-dir %s '
'--replay %s'
%
(
AVOCADO
,
self
.
tmpdir
,
srcjob
.
decode
(
'utf-8'
)))
self
.
run_and_check
(
cmd
,
exit_codes
.
AVOCADO_ALL_OK
,
tests
)
def
tearDown
(
self
):
shutil
.
rmtree
(
self
.
tmpdir
)
if
__name__
==
'__main__'
:
unittest
.
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录