Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
9ac0940c
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,发现更多精彩内容 >>
提交
9ac0940c
编写于
7月 01, 2016
作者:
W
Wei Jiangang
提交者:
GitHub
7月 01, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #612 from PandaWei/netstress_kill_guest
Netstress kill guest
上级
3e6779a9
59fd6adf
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
19 deletion
+9
-19
generic/tests/netstress_kill_guest.py
generic/tests/netstress_kill_guest.py
+8
-18
qemu/tests/trace_cmd_boot.py
qemu/tests/trace_cmd_boot.py
+1
-1
未找到文件。
generic/tests/netstress_kill_guest.py
浏览文件 @
9ac0940c
import
logging
import
os
import
time
from
autotest.client.shared
import
error
...
...
@@ -48,19 +47,12 @@ def run(test, params, env):
return
set
(
modules
)
def
kill_and_check
(
vm
):
vm_pid
=
vm
.
get_pid
()
vm
.
destroy
(
gracefully
=
False
)
time
.
sleep
(
2
)
try
:
os
.
kill
(
vm_pid
,
0
)
logging
.
error
(
"VM is not dead"
)
raise
error
.
TestFail
(
"VM is not dead after sending signal 0 to it"
)
except
OSError
:
if
not
vm
.
wait_until_dead
(
timeout
=
60
):
raise
error
.
TestFail
(
"VM is not dead after destroy operation"
)
logging
.
info
(
"VM is dead as expected"
)
def
netload_kill_problem
(
session_serial
):
setup_cmd
=
params
.
get
(
"setup_cmd"
)
clean_cmd
=
params
.
get
(
"clean_cmd"
)
firewall_flush
=
params
.
get
(
"firewall_flush"
,
"service iptables stop"
)
error
.
context
(
"Stop firewall in guest and host."
,
logging
.
info
)
try
:
...
...
@@ -104,21 +96,19 @@ def run(test, params, env):
pass
def
netdriver_kill_problem
(
session_serial
):
r_time
=
int
(
params
.
get
(
"repeat_times"
,
5
0
))
times
=
int
(
params
.
get
(
"repeat_times"
,
1
0
))
modules
=
get_ethernet_driver
(
session_serial
)
logging
.
debug
(
"Guest network driver(s): %s"
%
modules
)
msg
=
"Repeatedly load/unload network driver(s) for %s times."
%
r_time
msg
=
"Repeatedly load/unload network driver(s) for %s times."
%
times
error
.
context
(
msg
,
logging
.
info
)
for
round
in
range
(
r_time
):
for
i
in
range
(
times
):
for
module
in
modules
:
error
.
context
(
"Unload driver %s. Repeat: %s/%s"
%
(
module
,
round
,
r_time
))
i
,
times
))
session_serial
.
cmd_output_safe
(
"rmmod %s"
%
module
)
for
module
in
modules
:
error
.
context
(
"Load driver %s. Repeat: %s/%s"
%
(
module
,
round
,
r_time
))
i
,
times
))
session_serial
.
cmd_output_safe
(
"modprobe %s"
%
module
)
error
.
context
(
"Check that we can kill VM with signal 0."
,
logging
.
info
)
...
...
qemu/tests/trace_cmd_boot.py
浏览文件 @
9ac0940c
...
...
@@ -71,7 +71,7 @@ def run(test, params, env):
error
.
context
(
txt
,
logging
.
info
)
os
.
kill
(
trace_job
.
sp
.
pid
,
signal
.
SIGINT
)
if
not
utils_misc
.
wait_for
(
lambda
:
not
find_trace_cmd
(),
1
8
0
,
60
,
3
):
1
2
0
,
60
,
3
):
logging
.
warn
(
"trace-cmd could not finish after 120s."
)
trace_job
=
None
utils
.
system
(
trace_report_cmd
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录