Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
116fb16f
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,发现更多精彩内容 >>
提交
116fb16f
编写于
7月 19, 2016
作者:
C
Cong Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu.tests: Add new case of live snapshot under stress.
Signed-off-by:
N
Cong Li
<
coli@redhat.com
>
上级
610c0a4a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
99 addition
and
0 deletion
+99
-0
qemu/tests/cfg/live_snapshot.cfg
qemu/tests/cfg/live_snapshot.cfg
+27
-0
qemu/tests/live_snapshot_stress.py
qemu/tests/live_snapshot_stress.py
+72
-0
未找到文件。
qemu/tests/cfg/live_snapshot.cfg
浏览文件 @
116fb16f
...
...
@@ -42,3 +42,30 @@
dd_cmd = "dd if=/dev/zero of=%s bs=4K count=1024 oflag=dsync"
dd_timeout = 600
copy_file_timeout = 600
- with_payload:
type = live_snapshot_stress
variants:
- stress:
Windows:
timeout = 600
autostress = yes
stress_test = win_heavyload
install_path = "C:\Program Files (x86)\JAM Software\HeavyLoad"
config_cmd = 'setx -m path "%PATH%;${install_path};"'
install_cmd = "start /wait DRIVE:\HeavyLoadSetup.exe /verysilent"
check_cmd = 'tasklist | findstr /I "heavyload.exe"'
stop_cmd = "taskkill /T /F /IM heavyload.exe"
x86_64:
install_path = "C:\Program Files (x86)\JAM Software\HeavyLoad"
i386, i686:
install_path = "C:\Program Files\JAM Software\HeavyLoad"
Linux:
stress_test = autotest_control
test_control_file = stress.control
# Use a low stress to make sure guest can response during stress
control_args = "--cpu 4 --io 4 --vm 2 --vm-bytes 256M"
test_timeout = 1800
check_cmd = 'pgrep stress'
stop_cmd = "killall -g stress"
before_start = "load_stress"
after_finished = "unload_stress reboot verify_alive"
qemu/tests/live_snapshot_stress.py
0 → 100644
浏览文件 @
116fb16f
import
logging
from
virttest
import
utils_misc
from
virttest
import
utils_test
from
autotest.client.shared
import
error
from
qemu.tests
import
live_snapshot_basic
class
LiveSnapshotStress
(
live_snapshot_basic
.
LiveSnapshot
):
def
__init__
(
self
,
test
,
params
,
env
,
tag
):
super
(
LiveSnapshotStress
,
self
).
__init__
(
test
,
params
,
env
,
tag
)
@
error
.
context_aware
def
load_stress
(
self
):
"""
load IO/CPU/Memory stress in guest;
"""
error
.
context
(
"launch stress app in guest"
,
logging
.
info
)
args
=
(
self
.
test
,
self
.
params
,
self
.
env
,
self
.
params
[
"stress_test"
])
bg_test
=
utils_test
.
BackgroundTest
(
utils_test
.
run_virt_sub_test
,
args
)
bg_test
.
start
()
if
not
utils_misc
.
wait_for
(
bg_test
.
is_alive
,
first
=
10
,
step
=
3
,
timeout
=
100
):
raise
error
.
TestFail
(
"background test start failed"
)
if
not
utils_misc
.
wait_for
(
self
.
stress_app_running
,
timeout
=
360
,
step
=
5
):
raise
error
.
TestFail
(
"stress app isn't running"
)
def
unload_stress
(
self
):
"""
stop stress app
"""
def
_unload_stress
():
session
=
self
.
get_session
()
cmd
=
self
.
params
.
get
(
"stop_cmd"
)
session
.
sendline
(
cmd
)
return
not
self
.
stress_app_running
()
error
.
context
(
"stop stress app in guest"
,
logging
.
info
)
utils_misc
.
wait_for
(
_unload_stress
,
first
=
2.0
,
text
=
"wait stress app quit"
,
step
=
1.0
,
timeout
=
120
)
def
stress_app_running
(
self
):
"""
check stress app really run in background;
"""
session
=
self
.
get_session
()
cmd
=
self
.
params
.
get
(
"check_cmd"
)
status
=
session
.
cmd_status
(
cmd
,
timeout
=
120
)
return
status
==
0
@
error
.
context_aware
def
run
(
test
,
params
,
env
):
"""
live_snapshot_stress test:
1). load stress in guest.
2). do live snapshot during stress.
3). quit stress app, reboot guest(optional);
4). verify guest can response correctly.
:param test: QEMU test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
tag
=
params
.
get
(
"source_image"
,
"image1"
)
stress_test
=
LiveSnapshotStress
(
test
,
params
,
env
,
tag
)
try
:
stress_test
.
action_before_start
()
stress_test
.
create_snapshot
()
stress_test
.
action_after_finished
()
finally
:
stress_test
.
clean
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录