Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
6b47bac8
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,发现更多精彩内容 >>
未验证
提交
6b47bac8
编写于
6月 21, 2019
作者:
A
apahim
提交者:
GitHub
6月 21, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3164 from clebergnu/drop_example_bsod
examples/tests/gendata.py: drop "bsod" example tests
上级
75574fa6
d54f4ba9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
25 deletion
+4
-25
examples/tests/gendata.py
examples/tests/gendata.py
+0
-22
selftests/functional/test_basic.py
selftests/functional/test_basic.py
+4
-3
未找到文件。
examples/tests/gendata.py
浏览文件 @
6b47bac8
...
...
@@ -4,7 +4,6 @@ import os
from
avocado
import
Test
from
avocado
import
main
from
avocado.utils
import
genio
class
GenDataTest
(
Test
):
...
...
@@ -13,27 +12,6 @@ class GenDataTest(Test):
Simple test that generates data to be persisted after the test is run
"""
def
test_bsod
(
self
):
try
:
from
PIL
import
Image
from
PIL
import
ImageDraw
except
ImportError
:
self
.
cancel
(
"PIL not available"
)
text
=
[
"DREADED BLUE SCREEN OF DEATH"
]
dmesg_path
=
os
.
path
.
join
(
self
.
job
.
logdir
,
"sysinfo"
,
"pre"
,
"dmesg_-c"
)
self
.
log
.
info
(
"dmesg_path: %s"
,
dmesg_path
)
if
os
.
path
.
exists
(
dmesg_path
):
text
=
genio
.
read_all_lines
(
dmesg_path
)[
0
:
50
]
bsod
=
Image
.
new
(
"RGB"
,
(
640
,
480
),
"blue"
)
draw
=
ImageDraw
.
Draw
(
bsod
)
y
=
2
for
line
in
text
:
draw
.
text
((
2
,
y
),
line
)
y
+=
12
bsod
.
save
(
os
.
path
.
join
(
self
.
outputdir
,
"bsod.png"
))
def
test_json
(
self
):
import
json
output_path
=
os
.
path
.
join
(
self
.
outputdir
,
"test.json"
)
...
...
selftests/functional/test_basic.py
浏览文件 @
6b47bac8
...
...
@@ -502,6 +502,7 @@ class RunnerOperationTest(unittest.TestCase):
"--mux-inject foo:1 bar:2 baz:3 foo:foo:a "
"foo:bar:b foo:baz:c bar:bar:bar "
"-- passtest.py failtest.py gendata.py "
%
AVOCADO
)
number_of_tests
=
3
result
=
json
.
loads
(
process
.
run
(
cmd
).
stdout_text
)
debuglog
=
result
[
'debuglog'
]
log
=
genio
.
read_file
(
debuglog
)
...
...
@@ -510,8 +511,8 @@ class RunnerOperationTest(unittest.TestCase):
self
.
assertIn
(
tempfile
.
gettempdir
(),
debuglog
)
# Use tmp dir, not default location
self
.
assertEqual
(
result
[
'job_id'
],
u
'0'
*
40
)
# Check if all tests were skipped
self
.
assertEqual
(
result
[
'cancel'
],
4
)
for
i
in
range
(
4
):
self
.
assertEqual
(
result
[
'cancel'
],
number_of_tests
)
for
i
in
range
(
number_of_tests
):
test
=
result
[
'tests'
][
i
]
self
.
assertEqual
(
test
[
'fail_reason'
],
u
'Test cancelled due to --dry-run'
)
...
...
@@ -520,7 +521,7 @@ class RunnerOperationTest(unittest.TestCase):
# from test.
for
line
in
(
"/:foo ==> 1"
,
"/:baz ==> 3"
,
"/foo:foo ==> a"
,
"/foo:bar ==> b"
,
"/foo:baz ==> c"
,
"/bar:bar ==> bar"
):
self
.
assertEqual
(
log
.
count
(
line
),
4
,
self
.
assertEqual
(
log
.
count
(
line
),
number_of_tests
,
"Avocado log count for param '%s' not as expected:
\n
%s"
%
(
line
,
log
))
def
test_invalid_python
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录