Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
fc393718
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,发现更多精彩内容 >>
提交
fc393718
编写于
8月 10, 2017
作者:
Y
yduan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
balloon_stress: add support for Linux guest
Signed-off-by:
N
yduan
<
yduan@redhat.com
>
上级
41f1ab44
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
47 addition
and
36 deletion
+47
-36
qemu/tests/balloon_stress.py
qemu/tests/balloon_stress.py
+23
-16
qemu/tests/cfg/balloon_in_use.cfg
qemu/tests/cfg/balloon_in_use.cfg
+1
-1
qemu/tests/cfg/balloon_stress.cfg
qemu/tests/cfg/balloon_stress.cfg
+22
-18
qemu/tests/cfg/driver_load_stress.cfg
qemu/tests/cfg/driver_load_stress.cfg
+1
-1
未找到文件。
qemu/tests/balloon_stress.py
浏览文件 @
fc393718
...
...
@@ -5,6 +5,7 @@ from virttest import utils_misc
from
virttest
import
utils_test
from
virttest
import
error_context
from
qemu.tests.balloon_check
import
BallooningTestWin
from
qemu.tests.balloon_check
import
BallooningTestLinux
@
error_context
.
context_aware
...
...
@@ -12,24 +13,26 @@ def run(test, params, env):
"""
Qemu balloon device stress test:
1) boot guest with balloon device
2) enable driver verifier in guest
3) reboot guest (optional)
4) check device using right driver in guest.
5) play video in background repeatly
6) balloon memory in monitor in loop
2) enable driver verifier in guest (Windows only)
3) run stress in background repeatly
4) balloon memory in monitor in loop
:param test: QEMU test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
def
run_
video
(
):
def
run_
stress
(
test
,
params
,
env
,
vm
):
"""
Run
video
in background
Run
stress
in background
"""
while
True
:
utils_test
.
run_virt_sub_test
(
test
,
params
,
env
,
params
.
get
(
"video_test"
))
if
params
[
'os_type'
]
==
'windows'
:
utils_test
.
run_virt_sub_test
(
test
,
params
,
env
,
params
.
get
(
"stress_test"
))
else
:
stress_bg
=
utils_test
.
VMStress
(
vm
,
"stress"
)
stress_bg
.
load_stress_tool
()
error_context
.
context
(
"Boot guest with balloon device"
,
logging
.
info
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
...
...
@@ -38,15 +41,19 @@ def run(test, params, env):
timeout
=
float
(
params
.
get
(
"login_timeout"
,
360
))
session
=
vm
.
wait_for_login
(
timeout
=
timeout
)
driver_name
=
params
[
"driver_name"
]
utils_test
.
qemu
.
setup_win_driver_verifier
(
driver_name
,
vm
,
timeout
)
if
params
[
'os_type'
]
==
'windows'
:
driver_name
=
params
[
"driver_name"
]
utils_test
.
qemu
.
setup_win_driver_verifier
(
driver_name
,
vm
,
timeout
)
error_context
.
context
(
"Run video background"
,
logging
.
info
)
bg
=
utils_misc
.
InterruptedThread
(
run_video
)
balloon_test
=
BallooningTestWin
(
test
,
params
,
env
)
else
:
balloon_test
=
BallooningTestLinux
(
test
,
params
,
env
)
error_context
.
context
(
"Run stress background"
,
logging
.
info
)
bg
=
utils_misc
.
InterruptedThread
(
run_stress
,
(
test
,
params
,
env
,
vm
))
bg
.
start
()
repeat_times
=
int
(
params
.
get
(
"repeat_times"
,
500
))
balloon_test
=
BallooningTestWin
(
test
,
params
,
env
)
repeat_times
=
int
(
params
.
get
(
"repeat_times"
,
1000
))
min_sz
,
max_sz
=
balloon_test
.
get_memory_boundary
()
error_context
.
context
(
"balloon vm memory in loop"
,
logging
.
info
)
...
...
@@ -55,7 +62,7 @@ def run(test, params, env):
logging
.
info
(
"repeat times: %d"
%
i
)
balloon_test
.
balloon_memory
(
int
(
random
.
uniform
(
min_sz
,
max_sz
)))
if
not
bg
.
is_alive
():
test
.
error
(
"Background
video process is not playing
"
)
test
.
error
(
"Background
stress process is not alive
"
)
finally
:
if
session
:
session
.
close
()
qemu/tests/cfg/balloon_in_use.cfg
浏览文件 @
fc393718
...
...
@@ -12,7 +12,7 @@
kill_vm_on_error = yes
check_guest_bsod = yes
run_bgstress = balloon_stress
video
_test = win_video_play
stress
_test = win_video_play
bg_stress_run_flag = balloon_test
set_bg_stress_flag = yes
free_mem_cmd = wmic os get FreePhysicalMemory
...
...
qemu/tests/cfg/balloon_stress.cfg
浏览文件 @
fc393718
- balloon_stress:
type = balloon_stress
virt_test_type = qemu
only Windows
kill_vm = yes
repeat_times =
5
00
repeat_times =
10
00
balloon_timeout = 600
video_test = win_video_play
balloon = balloon0
balloon_dev_devid = balloon0
balloon_dev_add_bus = yes
video_url = http://FILESHARE.COM/pub/section2/kvmauto/video/big_buck_bunny_480p_stereo.avi
x86_64:
program_files = "%ProgramFiles(x86)%"
i386:
program_files = "%ProgramFiles%"
driver_name = "balloon.sys"
#Disable first startup guide for windows media player
wmplayer_reg_cmd = "reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer /v GroupPrivacyAcceptance /t REG_DWORD /f /d 00000001"
wmplayer_path = "${program_files}\Windows Media Player\wmplayer.exe"
#Install kmplayer if wmplayer is not installed default
kmplayer_install_cmd = "start /wait WIN_UTILS:\kmplayer\%s\KMPlayer-setup.exe /SP- /VERYSILENT"
kmplayer_path = "${program_files}\KMPlayer\kmplayer.exe"
play_video_cmd = '"%s" "%s" /play /fullscreen'
time_for_video = 1200
guest_alias = "Win2008-sp2-32:2k8\x86,Win2008-sp2-64:2k8\amd64,Win2008-r2-64:2k8\amd64,Win2012-64:2k12\amd64,Win2012-64r2:2k12\amd64"
Windows:
stress_test = win_video_play
video_url = http://FILESHARE.COM/pub/section2/kvmauto/video/big_buck_bunny_480p_stereo.avi
x86_64:
program_files = "%ProgramFiles(x86)%"
i386:
program_files = "%ProgramFiles%"
driver_name = "balloon.sys"
#Disable first startup guide for windows media player
wmplayer_reg_cmd = "reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer /v GroupPrivacyAcceptance /t REG_DWORD /f /d 00000001"
wmplayer_path = "${program_files}\Windows Media Player\wmplayer.exe"
#Install kmplayer if wmplayer is not installed default
kmplayer_install_cmd = "start /wait WIN_UTILS:\kmplayer\%s\KMPlayer-setup.exe /SP- /VERYSILENT"
kmplayer_path = "${program_files}\KMPlayer\kmplayer.exe"
play_video_cmd = '"%s" "%s" /play /fullscreen'
time_for_video = 1200
guest_alias = "Win2008-sp2-32:2k8\x86,Win2008-sp2-64:2k8\amd64,Win2008-r2-64:2k8\amd64,Win2012-64:2k12\amd64,Win2012-64r2:2k12\amd64"
Linux:
# Use a low stress to make sure guest can response during stress
stress_args = "--cpu 4 --io 4 --vm 2 --vm-bytes 256M"
test_timeout = 1800
qemu/tests/cfg/driver_load_stress.cfg
浏览文件 @
fc393718
...
...
@@ -105,7 +105,7 @@
wait_bg_time = 180
free_mem_cmd = wmic os get FreePhysicalMemory
session_cmd_timeout = 240
video
_test = win_video_play
stress
_test = win_video_play
x86_64:
program_files = "%ProgramFiles(x86)%"
i386:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录