Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
f2dbedcd
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,发现更多精彩内容 >>
提交
f2dbedcd
编写于
9月 18, 2017
作者:
X
Xu Han
提交者:
GitHub
9月 18, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #964 from yanan-fu/win_heavyload
qemu.tests.win_heavyload: Improve stop heavyload strategy
上级
cbeb39e2
7dbd00fd
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
16 addition
and
16 deletion
+16
-16
qemu/tests/win_heavyload.py
qemu/tests/win_heavyload.py
+16
-16
未找到文件。
qemu/tests/win_heavyload.py
浏览文件 @
f2dbedcd
...
@@ -7,14 +7,14 @@ try:
...
@@ -7,14 +7,14 @@ try:
except
ImportError
:
except
ImportError
:
from
virttest
import
aexpect
from
virttest
import
aexpect
from
autotest.client.shared
import
error
from
autotest.client
import
utils
from
autotest.client
import
utils
from
virttest
import
error_context
from
virttest
import
utils_misc
from
virttest
import
utils_misc
from
virttest
import
data_dir
from
virttest
import
data_dir
@
error
.
context_aware
@
error
_context
.
context_aware
def
run
(
test
,
params
,
env
):
def
run
(
test
,
params
,
env
):
"""
"""
KVM guest stop test:
KVM guest stop test:
...
@@ -81,14 +81,14 @@ def run(test, params, env):
...
@@ -81,14 +81,14 @@ def run(test, params, env):
if
download_url
:
if
download_url
:
dst
=
r
"c:\\"
dst
=
r
"c:\\"
pkg_md5sum
=
params
[
"pkg_md5sum"
]
pkg_md5sum
=
params
[
"pkg_md5sum"
]
error
.
context
(
"Download HeavyLoadSetup.exe"
,
logging
.
info
)
error
_context
.
context
(
"Download HeavyLoadSetup.exe"
,
logging
.
info
)
pkg
=
utils
.
unmap_url_cache
(
tmp_dir
,
pkg
=
utils
.
unmap_url_cache
(
tmp_dir
,
download_url
,
pkg_md5sum
)
download_url
,
pkg_md5sum
)
vm
.
copy_files_to
(
pkg
,
dst
)
vm
.
copy_files_to
(
pkg
,
dst
)
else
:
else
:
dst
=
r
"%s:\\"
%
utils_misc
.
get_winutils_vol
(
session
)
dst
=
r
"%s:\\"
%
utils_misc
.
get_winutils_vol
(
session
)
error
.
context
(
"Install HeavyLoad in guest"
,
logging
.
info
)
error
_context
.
context
(
"Install HeavyLoad in guest"
,
logging
.
info
)
install_cmd
=
params
[
"install_cmd"
]
install_cmd
=
params
[
"install_cmd"
]
install_cmd
=
re
.
sub
(
r
"DRIVE:\\+"
,
dst
,
install_cmd
)
install_cmd
=
re
.
sub
(
r
"DRIVE:\\+"
,
dst
,
install_cmd
)
session
.
cmd
(
install_cmd
)
session
.
cmd
(
install_cmd
)
...
@@ -96,7 +96,7 @@ def run(test, params, env):
...
@@ -96,7 +96,7 @@ def run(test, params, env):
if
config_cmd
:
if
config_cmd
:
session
.
cmd
(
config_cmd
)
session
.
cmd
(
config_cmd
)
error
.
context
(
"Start heavyload in guest"
,
logging
.
info
)
error
_context
.
context
(
"Start heavyload in guest"
,
logging
.
info
)
# genery heavyload command automaticly
# genery heavyload command automaticly
if
params
.
get
(
"autostress"
)
==
"yes"
:
if
params
.
get
(
"autostress"
)
==
"yes"
:
free_mem
=
utils_misc
.
get_free_mem
(
session
,
"windows"
)
free_mem
=
utils_misc
.
get_free_mem
(
session
,
"windows"
)
...
@@ -111,37 +111,37 @@ def run(test, params, env):
...
@@ -111,37 +111,37 @@ def run(test, params, env):
test_timeout
=
int
(
params
.
get
(
"timeout"
,
"60"
))
test_timeout
=
int
(
params
.
get
(
"timeout"
,
"60"
))
steping
=
60
steping
=
60
if
test_timeout
<
60
:
if
test_timeout
<
60
:
logging
.
warn
(
"Heavyload use min
is as unit of timeout,
"
logging
.
warn
(
"Heavyload use min
s as unit of timeout, given timeout
"
"
values is too small, use default: 60s"
)
"
is too small (%ss), force set to 60s"
,
test_timeout
)
test_timeout
=
60
test_timeout
=
60
steping
=
30
steping
=
30
test_timeout
=
test_timeout
/
60
start_cmd
=
add_option
(
start_cmd
,
'DURATION'
,
test_timeout
/
60
)
start_cmd
=
add_option
(
start_cmd
,
'DURATION'
,
test_timeout
)
start_cmd
=
add_option
(
start_cmd
,
'START'
,
''
)
start_cmd
=
add_option
(
start_cmd
,
'START'
,
''
)
start_cmd
=
add_option
(
start_cmd
,
'AUTOEXIT'
,
''
)
start_cmd
=
add_option
(
start_cmd
,
'AUTOEXIT'
,
''
)
logging
.
info
(
"heavyload cmd: %s"
%
start_cmd
)
logging
.
info
(
"heavyload cmd: %s"
%
start_cmd
)
session
.
sendline
(
start_cmd
)
session
.
sendline
(
start_cmd
)
if
not
loop_session_cmd
(
session
,
check_running_cmd
):
if
not
loop_session_cmd
(
session
,
check_running_cmd
):
raise
error
.
TestE
rror
(
"heavyload process is not started"
)
test
.
e
rror
(
"heavyload process is not started"
)
sleep_before_migration
=
int
(
params
.
get
(
"sleep_before_migration"
,
sleep_before_migration
=
int
(
params
.
get
(
"sleep_before_migration"
,
"0"
))
"0"
))
time
.
sleep
(
sleep_before_migration
)
time
.
sleep
(
sleep_before_migration
)
error
.
context
(
"Verify vm is alive"
,
logging
.
info
)
error
_context
.
context
(
"Verify vm is alive"
,
logging
.
info
)
utils_misc
.
wait_for
(
vm
.
verify_alive
,
utils_misc
.
wait_for
(
vm
.
verify_alive
,
timeout
=
test_timeout
,
step
=
steping
)
timeout
=
test_timeout
,
step
=
steping
)
finally
:
finally
:
# in migration test, no need to stop heavyload on src host
# in migration test, no need to stop heavyload on src host
cleanup_in_the_end
=
params
.
get
(
"unload_stress_in_the_end"
,
"yes"
)
cleanup_in_the_end
=
params
.
get
(
"unload_stress_in_the_end"
,
"yes"
)
if
cleanup_in_the_end
==
"yes"
:
if
cleanup_in_the_end
==
"yes"
:
error
.
context
(
"Stop load and clean tmp files"
,
logging
.
info
)
error
_context
.
context
(
"Stop load and clean tmp files"
,
logging
.
info
)
if
not
installed
and
download_url
:
if
not
installed
and
download_url
:
utils
.
system
(
"rm -f %s/HeavyLoad*.exe"
%
tmp_dir
)
utils
.
system
(
"rm -f %s/HeavyLoad*.exe"
%
tmp_dir
)
session
.
cmd
(
"del /f /s %sHeavyLoad*.exe"
%
dst
)
session
.
cmd
(
"del /f /s %sHeavyLoad*.exe"
%
dst
)
if
loop_session_cmd
(
session
,
check_running_cmd
):
if
not
session
.
cmd_status
(
check_running_cmd
):
if
not
loop_session_cmd
(
session
,
stop_cmd
):
try
:
raise
error
.
TestFail
(
"Unable to terminate heavyload "
session
.
cmd
(
stop_cmd
,
timeout
=
120
)
"process"
)
except
:
logging
.
warn
(
"Unable to terminate heavyload process"
)
if
session
:
if
session
:
session
.
close
()
session
.
close
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录