Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
2e5d2b9f
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,发现更多精彩内容 >>
提交
2e5d2b9f
编写于
4月 10, 2015
作者:
L
Lucas Meneghel Rodrigues
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
selftests/functional/output_tests.py: Use --job-results-dir
Signed-off-by:
N
Lucas Meneghel Rodrigues
<
lmr@redhat.com
>
上级
e4cdcd0a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
13 deletion
+31
-13
selftests/all/functional/avocado/output_tests.py
selftests/all/functional/avocado/output_tests.py
+31
-13
未找到文件。
selftests/all/functional/avocado/output_tests.py
浏览文件 @
2e5d2b9f
...
...
@@ -23,9 +23,12 @@ from avocado.core.output import TermSupport
class
OutputTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
tmpdir
=
tempfile
.
mkdtemp
()
def
test_output_doublefree
(
self
):
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --
sysinfo=off doublefree'
cmd_line
=
'./scripts/avocado run --
job-results-dir %s --sysinfo=off doublefree'
%
self
.
tmpdir
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
expected_rc
=
0
output
=
result
.
stdout
+
result
.
stderr
...
...
@@ -37,9 +40,15 @@ class OutputTest(unittest.TestCase):
"Libc double free can be seen in avocado "
"doublefree output:
\n
%s"
%
output
)
def
tearDown
(
self
):
shutil
.
rmtree
(
self
.
tmpdir
)
class
OutputPluginTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
tmpdir
=
tempfile
.
mkdtemp
()
def
check_output_files
(
self
,
debug_log
):
base_dir
=
os
.
path
.
dirname
(
debug_log
)
json_output
=
os
.
path
.
join
(
base_dir
,
'results.json'
)
...
...
@@ -52,7 +61,7 @@ class OutputPluginTest(unittest.TestCase):
def
test_output_incompatible_setup
(
self
):
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --
sysinfo=off --xunit - --json - passtest'
cmd_line
=
'./scripts/avocado run --
job-results-dir %s --sysinfo=off --xunit - --json - passtest'
%
self
.
tmpdir
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
expected_rc
=
2
output
=
result
.
stdout
+
result
.
stderr
...
...
@@ -65,7 +74,7 @@ class OutputPluginTest(unittest.TestCase):
def
test_output_incompatible_setup_2
(
self
):
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --
sysinfo=off --html - passtest'
cmd_line
=
'./scripts/avocado run --
job-results-dir %s --sysinfo=off --html - passtest'
%
self
.
tmpdir
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
expected_rc
=
2
output
=
result
.
stdout
+
result
.
stderr
...
...
@@ -79,7 +88,8 @@ class OutputPluginTest(unittest.TestCase):
def
test_output_compatible_setup
(
self
):
tmpfile
=
tempfile
.
mktemp
()
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --sysinfo=off --journal --xunit %s --json - passtest'
%
tmpfile
cmd_line
=
(
'./scripts/avocado run --job-results-dir %s --sysinfo=off --journal --xunit %s --json - passtest'
%
(
self
.
tmpdir
,
tmpfile
))
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
output
=
result
.
stdout
+
result
.
stderr
expected_rc
=
0
...
...
@@ -99,7 +109,8 @@ class OutputPluginTest(unittest.TestCase):
def
test_output_compatible_setup_2
(
self
):
tmpfile
=
tempfile
.
mktemp
()
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --sysinfo=off --xunit - --json %s passtest'
%
tmpfile
cmd_line
=
(
'./scripts/avocado run --job-results-dir %s --sysinfo=off --xunit - --json %s passtest'
%
(
self
.
tmpdir
,
tmpfile
))
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
output
=
result
.
stdout
+
result
.
stderr
expected_rc
=
0
...
...
@@ -125,8 +136,8 @@ class OutputPluginTest(unittest.TestCase):
tmpdir
=
tempfile
.
mkdtemp
()
tmpfile3
=
tempfile
.
mktemp
(
dir
=
tmpdir
)
os
.
chdir
(
basedir
)
cmd_line
=
(
'./scripts/avocado run --sysinfo=off --xunit %s --json %s --html %s passtest'
%
(
tmpfile
,
tmpfile2
,
tmpfile3
))
cmd_line
=
(
'./scripts/avocado run --
job-results-dir %s --
sysinfo=off --xunit %s --json %s --html %s passtest'
%
(
self
.
tmpdir
,
tmpfile
,
tmpfile2
,
tmpfile3
))
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
output
=
result
.
stdout
+
result
.
stderr
expected_rc
=
0
...
...
@@ -156,7 +167,8 @@ class OutputPluginTest(unittest.TestCase):
tmpfile
=
tempfile
.
mktemp
()
tmpfile2
=
tempfile
.
mktemp
()
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --sysinfo=off --silent --xunit %s --json %s passtest'
%
(
tmpfile
,
tmpfile2
)
cmd_line
=
(
'./scripts/avocado run --job-results-dir %s --sysinfo=off --silent --xunit %s --json %s passtest'
%
(
self
.
tmpdir
,
tmpfile
,
tmpfile2
))
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
output
=
result
.
stdout
+
result
.
stderr
expected_rc
=
0
...
...
@@ -180,7 +192,7 @@ class OutputPluginTest(unittest.TestCase):
def
test_show_job_log
(
self
):
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --
sysinfo=off passtest --show-job-log'
cmd_line
=
'./scripts/avocado run --
job-results-dir %s --sysinfo=off passtest --show-job-log'
%
self
.
tmpdir
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
expected_rc
=
0
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
,
...
...
@@ -195,7 +207,8 @@ class OutputPluginTest(unittest.TestCase):
def
test_silent_trumps_show_job_log
(
self
):
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --sysinfo=off passtest --show-job-log --silent'
cmd_line
=
(
'./scripts/avocado run --job-results-dir %s --sysinfo=off passtest --show-job-log --silent'
%
self
.
tmpdir
)
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
output
=
result
.
stdout
+
result
.
stderr
expected_rc
=
0
...
...
@@ -206,7 +219,7 @@ class OutputPluginTest(unittest.TestCase):
def
test_default_enabled_plugins
(
self
):
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --
sysinfo=off passtest'
cmd_line
=
'./scripts/avocado run --
job-results-dir %s --sysinfo=off passtest'
%
self
.
tmpdir
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
output
=
result
.
stdout
+
result
.
stderr
expected_rc
=
0
...
...
@@ -222,7 +235,8 @@ class OutputPluginTest(unittest.TestCase):
tmpfile
=
tempfile
.
mktemp
()
try
:
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --sysinfo=off whiteboard --json %s'
%
tmpfile
cmd_line
=
(
'./scripts/avocado run --job-results-dir %s --sysinfo=off whiteboard --json %s'
%
(
self
.
tmpdir
,
tmpfile
))
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
)
expected_rc
=
0
self
.
assertEqual
(
result
.
exit_status
,
expected_rc
,
...
...
@@ -246,7 +260,8 @@ class OutputPluginTest(unittest.TestCase):
redirected_output_path
=
tempfile
.
mktemp
()
try
:
os
.
chdir
(
basedir
)
cmd_line
=
'./scripts/avocado run --sysinfo=off passtest > %s'
%
redirected_output_path
cmd_line
=
(
'./scripts/avocado run --job-results-dir %s --sysinfo=off passtest > %s'
%
(
self
.
tmpdir
,
redirected_output_path
))
result
=
process
.
run
(
cmd_line
,
ignore_status
=
True
,
shell
=
True
)
output
=
result
.
stdout
+
result
.
stderr
expected_rc
=
0
...
...
@@ -266,6 +281,9 @@ class OutputPluginTest(unittest.TestCase):
except
OSError
:
pass
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录