Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
c74ac37a
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,发现更多精彩内容 >>
提交
c74ac37a
编写于
8月 25, 2016
作者:
C
Cong
提交者:
GitHub
8月 25, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #734 from CongLi/system_wakeup
qemu.tests.qmp_event_notification: add "system_wakeup" event check.
上级
78977d9a
54e7ecf0
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
11 addition
and
5 deletion
+11
-5
qemu/tests/cfg/qmp_event_notification.cfg
qemu/tests/cfg/qmp_event_notification.cfg
+2
-0
qemu/tests/qmp_event_notification.py
qemu/tests/qmp_event_notification.py
+9
-5
未找到文件。
qemu/tests/cfg/qmp_event_notification.cfg
浏览文件 @
c74ac37a
...
...
@@ -58,6 +58,8 @@
event_check = "SUSPEND"
event_cmd_options = "ignore_all_errors=True"
extra_params += " -global PIIX4_PM.disable_s3=0"
post_event_cmd = system_wakeup
post_event_cmd_type = qmp_cmd
- qmp_disk_suspend:
no Windows
usbs = ""
...
...
qemu/tests/qmp_event_notification.py
浏览文件 @
c74ac37a
...
...
@@ -34,30 +34,33 @@ def run(test, params, env):
"monitor_cmd"
:
humam_monitor
.
send_args_cmd
,
"qmp_cmd"
:
qmp_monitor
.
send_args_cmd
}
def
send_cmd
(
cmd
,
options
=
{}):
def
send_cmd
(
cmd
,
cmd_type
,
options
=
{}):
if
cmd_type
in
callback
.
keys
():
return
callback
[
cmd_type
](
cmd
,
**
options
)
else
:
raise
error
.
TestError
(
"cmd_type is not supported"
)
cmd_type
=
params
[
"event_cmd_type"
]
pre_event_cmd
=
params
.
get
(
"pre_event_cmd"
,
""
)
pre_event_cmd_type
=
params
.
get
(
"pre_event_cmd_type"
,
cmd_type
)
pre_event_cmd_options
=
eval
(
"dict({0})"
.
format
(
params
.
get
(
"pre_event_cmd_options"
,
""
)))
event_cmd
=
params
.
get
(
"event_cmd"
)
event_cmd_options
=
eval
(
"dict({0})"
.
format
(
params
.
get
(
"event_cmd_options"
,
""
)))
post_event_cmd
=
params
.
get
(
"post_event_cmd"
,
""
)
post_event_cmd_type
=
params
.
get
(
"post_event_cmd_type"
,
cmd_type
)
post_event_cmd_options
=
eval
(
"dict({0})"
.
format
(
params
.
get
(
"post_event_cmd_options"
,
""
)))
cmd_type
=
params
.
get
(
"event_cmd_type"
)
event_check
=
params
.
get
(
"event_check"
)
timeout
=
int
(
params
.
get
(
"check_timeout"
,
360
))
action_check
=
params
.
get
(
"action_check"
)
if
pre_event_cmd
:
send_cmd
(
pre_event_cmd
,
pre_event_cmd_options
)
send_cmd
(
pre_event_cmd
,
pre_event_cmd_type
,
pre_event_cmd_options
)
send_cmd
(
event_cmd
,
event_cmd_options
)
send_cmd
(
event_cmd
,
cmd_type
,
event_cmd_options
)
end_time
=
time
.
time
()
+
timeout
qmp_monitors
=
vm
.
get_monitors_by_type
(
"qmp"
)
...
...
@@ -87,6 +90,7 @@ def run(test, params, env):
%
event_check
)
if
post_event_cmd
:
send_cmd
(
post_event_cmd
,
post_event_cmd_options
)
send_cmd
(
post_event_cmd
,
post_event_cmd_type
,
post_event_cmd_options
)
if
session
:
session
.
close
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录