Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
0487365a
T
tp-qemu
项目概览
openeuler
/
tp-qemu
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tp-qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0487365a
编写于
9月 19, 2017
作者:
C
Cong
提交者:
GitHub
9月 19, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1102 from hereischen/negative
Add usb hub negative tests
上级
7f53aaca
939a681d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
3 deletion
+47
-3
qemu/tests/cfg/usb_device_check.cfg
qemu/tests/cfg/usb_device_check.cfg
+12
-1
qemu/tests/usb_device_check.py
qemu/tests/usb_device_check.py
+2
-2
qemu/tests/usb_device_check_negative.py
qemu/tests/usb_device_check_negative.py
+33
-0
未找到文件。
qemu/tests/cfg/usb_device_check.cfg
浏览文件 @
0487365a
...
...
@@ -53,9 +53,20 @@
# usb topology
variants:
- hub_speed_mismatch:
only usb-ehci
type = usb_device_check_negative
usb_topology = '{"usb-hub":1}'
error_info = "Warning: speed mismatch trying to attach usb device"
- multi_hubs_in_series:
no usb-ehci
usb_topology = '{"usb-hub":5}'
variants:
- 5_layer:
usb_topology = '{"usb-hub":5}'
- 6_layer:
type = usb_device_check_negative
usb_topology = '{"usb-hub":6}'
error_info = "usb hub chain too deep"
- multi_hubs_in_parallel:
no usb-ehci
usb_topology = '{"usb-hub":9}'
...
...
qemu/tests/usb_device_check.py
浏览文件 @
0487365a
...
...
@@ -27,10 +27,10 @@ def run(test, params, env):
else
:
test
.
fail
(
output
)
# parse the usb toplogy from cfg
# parse the usb top
o
logy from cfg
parsed_devs
=
parse_usb_topology
(
params
)
logging
.
info
(
"starting vm according to the usb toplogy"
)
logging
.
info
(
"starting vm according to the usb top
o
logy"
)
env_process
.
process
(
test
,
params
,
env
,
env_process
.
preprocess_image
,
env_process
.
preprocess_vm
)
...
...
qemu/tests/usb_device_check_negative.py
0 → 100644
浏览文件 @
0487365a
import
logging
from
virttest
import
(
env_process
,
error_context
,
virt_vm
)
from
qemu.tests.usb_common
import
parse_usb_topology
@
error_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
The usb devices negative test
1) Boot guest with invalid usb devices
2) Verify QEMU error info
:param test: QEMU test object.
:param params: Dictionary with the test parameters.
:param env: Dictionary with test environment.
"""
# parse the usb topology from cfg
parse_usb_topology
(
params
)
logging
.
info
(
"starting vm according to the usb topology"
)
error_info
=
params
[
"error_info"
]
error_context
.
context
((
"verify [%s] is reported by QEMU..."
%
error_info
),
logging
.
info
)
try
:
env_process
.
process
(
test
,
params
,
env
,
env_process
.
preprocess_image
,
env_process
.
preprocess_vm
)
except
virt_vm
.
VMCreateError
,
e
:
if
error_info
not
in
e
.
output
:
test
.
fail
(
"%s is not reported by QEMU"
%
error_info
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录