Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
402cc057
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,发现更多精彩内容 >>
提交
402cc057
编写于
1月 23, 2017
作者:
X
Xu Tian
提交者:
GitHub
1月 23, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #881 from suqinhuang/balloon_stress
Update video play code in balloon_stress
上级
2d14d4eb
1ad79d90
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
35 deletion
+29
-35
qemu/tests/balloon_check.py
qemu/tests/balloon_check.py
+2
-0
qemu/tests/balloon_stress.py
qemu/tests/balloon_stress.py
+15
-22
qemu/tests/cfg/balloon_stress.cfg
qemu/tests/cfg/balloon_stress.cfg
+12
-13
未找到文件。
qemu/tests/balloon_check.py
浏览文件 @
402cc057
...
@@ -78,9 +78,11 @@ class BallooningTest(MemoryBaseTest):
...
@@ -78,9 +78,11 @@ class BallooningTest(MemoryBaseTest):
:param new_mem: New desired memory.
:param new_mem: New desired memory.
:type new_mem: int
:type new_mem: int
"""
"""
env
[
"balloon_test"
]
=
0
error
.
context
(
"Change VM memory to %s"
%
new_mem
,
logging
.
info
)
error
.
context
(
"Change VM memory to %s"
%
new_mem
,
logging
.
info
)
try
:
try
:
self
.
vm
.
balloon
(
new_mem
)
self
.
vm
.
balloon
(
new_mem
)
env
[
"balloon_test"
]
=
1
except
Exception
,
e
:
except
Exception
,
e
:
if
self
.
params
.
get
(
'illegal_value_check'
,
'no'
)
==
'no'
and
new_mem
!=
self
.
get_ballooned_memory
():
if
self
.
params
.
get
(
'illegal_value_check'
,
'no'
)
==
'no'
and
new_mem
!=
self
.
get_ballooned_memory
():
raise
error
.
TestFail
(
"Balloon memory fail with error message: %s"
%
e
)
raise
error
.
TestFail
(
"Balloon memory fail with error message: %s"
%
e
)
...
...
qemu/tests/balloon_stress.py
浏览文件 @
402cc057
import
time
import
logging
import
logging
import
random
import
random
from
autotest.client.shared
import
error
from
virttest
import
utils_misc
from
virttest
import
utils_misc
from
virttest
import
utils_test
from
virttest
import
utils_test
from
virttest
import
error_context
from
avocado.core
import
exceptions
from
qemu.tests.balloon_check
import
BallooningTestWin
from
qemu.tests.balloon_check
import
BallooningTestWin
@
error
.
context_aware
@
error
_context
.
context_aware
def
run
(
test
,
params
,
env
):
def
run
(
test
,
params
,
env
):
"""
"""
Qemu balloon device stress test:
Qemu balloon device stress test:
...
@@ -25,45 +25,38 @@ def run(test, params, env):
...
@@ -25,45 +25,38 @@ def run(test, params, env):
:param env: Dictionary with test environment.
:param env: Dictionary with test environment.
"""
"""
error
.
context
(
"Boot guest with balloon device"
,
logging
.
info
)
error
_context
.
context
(
"Boot guest with balloon device"
,
logging
.
info
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
vm
.
verify_alive
()
default_memory
=
int
(
params
.
get
(
"default_memory"
,
params
[
'mem'
]))
timeout
=
float
(
params
.
get
(
"login_timeout"
,
360
))
timeout
=
float
(
params
.
get
(
"login_timeout"
,
360
))
session
=
vm
.
wait_for_login
(
timeout
=
timeout
)
session
=
vm
.
wait_for_login
(
timeout
=
timeout
)
# for media player configuration
if
params
.
get
(
"pre_cmd"
):
session
.
cmd
(
params
.
get
(
"pre_cmd"
))
driver_name
=
params
[
"driver_name"
]
driver_name
=
params
[
"driver_name"
]
utils_test
.
qemu
.
setup_win_driver_verifier
(
driver_name
,
vm
,
timeout
)
utils_test
.
qemu
.
setup_win_driver_verifier
(
driver_name
,
vm
,
timeout
)
balloon_test
=
BallooningTestWin
(
test
,
params
,
env
)
balloon_test
=
BallooningTestWin
(
test
,
params
,
env
)
error
.
context
(
"Play video in guest"
,
logging
.
info
)
video_play
=
utils_misc
.
InterruptedThread
(
play_video_cmd
=
params
[
"play_video_cmd"
]
utils_test
.
run_virt_sub_test
,
(
test
,
params
,
env
),
session
.
sendline
(
play_video_cmd
)
{
"sub_type"
:
params
.
get
(
"sub_test"
)}
)
# need to wait for wmplayer loading remote video
video_play
.
start
()
time
.
sleep
(
float
(
params
.
get
(
"loading_timeout"
,
60
))
)
error_context
.
context
(
"Run video background"
,
logging
.
info
)
check_playing_cmd
=
params
[
"check_playing_cmd"
]
check_playing_cmd
=
params
[
"check_playing_cmd"
]
running
=
utils_misc
.
wait_for
(
lambda
:
utils_misc
.
get_guest_cmd_status_output
(
running
=
utils_misc
.
wait_for
(
vm
,
check_playing_cmd
)[
0
]
==
0
,
first
=
5.0
,
timeout
=
600
)
lambda
:
utils_misc
.
get_guest_cmd_status_output
(
vm
,
check_playing_cmd
)[
0
]
==
0
,
first
=
60
,
timeout
=
600
)
if
not
running
:
if
not
running
:
raise
e
rror
.
TestError
(
"Video is not playing"
)
raise
e
xceptions
.
TestError
(
"Video is not playing"
)
#for case:balloon_in_use to call
error_context
.
context
(
"balloon vm memory in loop"
,
logging
.
info
)
env
[
"balloon_test"
]
=
0
error
.
context
(
"balloon vm memory in loop"
,
logging
.
info
)
repeat_times
=
int
(
params
.
get
(
"repeat_times"
,
10
))
repeat_times
=
int
(
params
.
get
(
"repeat_times"
,
10
))
logging
.
info
(
"repeat times: %d"
%
repeat_times
)
logging
.
info
(
"repeat times: %d"
%
repeat_times
)
min_sz
,
max_sz
=
balloon_test
.
get_memory_boundary
()
min_sz
,
max_sz
=
balloon_test
.
get_memory_boundary
()
while
repeat_times
:
while
repeat_times
:
balloon_test
.
balloon_memory
(
int
(
random
.
uniform
(
min_sz
,
max_sz
)))
balloon_test
.
balloon_memory
(
int
(
random
.
uniform
(
min_sz
,
max_sz
)))
env
[
"balloon_test"
]
=
1
repeat_times
-=
1
repeat_times
-=
1
error
.
context
(
"verify guest still alive"
,
logging
.
info
)
error_context
.
context
(
"verify guest still alive"
,
logging
.
info
)
session
.
cmd
(
params
[
"stop_player_cmd"
])
vm
.
verify_alive
()
vm
.
verify_alive
()
if
session
:
if
session
:
session
.
close
()
session
.
close
()
qemu/tests/cfg/balloon_stress.cfg
浏览文件 @
402cc057
- balloon_stress:
- balloon_stress:
type = balloon_stress
type = balloon_stress
virt_test_type = qemu
only Windows
only Windows
kill_vm = yes
kill_vm = yes
repeat_times = 10000
repeat_times = 10000
virt_test_type = qemu
sub_test = win_video_play
extra_params += " -balloon virtio"
extra_params += " -balloon virtio"
video_url = http://FILESHARE.COM/pub/section2/kvmauto/video/big_buck_bunny_480p_stereo.avi
video_url = http://FILESHARE.COM/pub/section2/kvmauto/video/big_buck_bunny_480p_stereo.avi
x86_64:
x86_64:
program_files = "%ProgramFiles(x86)%"
program_files = "%ProgramFiles(x86)%"
i386:
i386:
program_files = "%ProgramFiles%"
program_files = "%ProgramFiles%"
Windows:
check_playing_cmd = "tasklist|findstr /I mplayer"
session_cmd_timeout = 240
driver_name = "balloon.sys"
# disable first startup guide for windows media player
#Disable first startup guide for windows media player
pre_cmd = "reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer /v GroupPrivacyAcceptance /t REG_DWORD /f /d 00000001"
wmplayer_reg_cmd = "reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer /v GroupPrivacyAcceptance /t REG_DWORD /f /d 00000001"
# enable repeat mode of windows media player
wmplayer_path = "${program_files}\Windows Media Player\wmplayer.exe"
pre_cmd += " & reg add HKCU\Software\Microsoft\MediaPlayer\Preferences /v ModeLoop /t REG_DWORD /d 1 /f"
#Install kmplayer if wmplayer is not installed default
play_video_cmd = taskkill /IM wmplayer.exe /F & "${program_files}\Windows Media Player\wmplayer.exe" "${video_url}" /play /fullscreen
kmplayer_install_cmd = "start /wait WIN_UTILS:\kmplayer\%s\KMPlayer-setup.exe /SP- /VERYSILENT"
check_playing_cmd = "tasklist|findstr /I wmplayer"
kmplayer_path = "${program_files}\KMPlayer\kmplayer.exe"
driver_name = "balloon.sys"
play_video_cmd = '"%s" "%s" /play /fullscreen'
stop_player_cmd = "taskkill /IM wmplayer.exe /F"
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"
# reset media player play mode
post_cmd += "reg add HKCU\Software\Microsoft\MediaPlayer\Preferences /v ModeLoop /t REG_DWORD /d 0 /f"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录