Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
0924b645
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,发现更多精彩内容 >>
未验证
提交
0924b645
编写于
11月 02, 2018
作者:
X
Xu Han
提交者:
GitHub
11月 02, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1229 from lijinlijin/balloon_small
balloon_small:Reset memory size to very small during runtime
上级
f3db11cf
ad1a4446
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
48 addition
and
4 deletion
+48
-4
qemu/tests/balloon_check.py
qemu/tests/balloon_check.py
+21
-4
qemu/tests/cfg/balloon_minimum.cfg
qemu/tests/cfg/balloon_minimum.cfg
+27
-0
未找到文件。
qemu/tests/balloon_check.py
浏览文件 @
0924b645
...
...
@@ -114,6 +114,7 @@ class BallooningTest(MemoryBaseTest):
elif
new_mem
==
0
:
compare_mem
=
self
.
current_mmem
elif
new_mem
<=
100
:
self
.
_balloon_post_action
()
self
.
current_mmem
=
self
.
get_ballooned_memory
()
compare_mem
=
self
.
current_mmem
else
:
...
...
@@ -158,7 +159,7 @@ class BallooningTest(MemoryBaseTest):
qemu_quit_after_test
=
0
return
qemu_quit_after_test
def
_mem_state
(
self
):
def
_mem_state
(
self
,
threshold
):
"""
A generator to get guest memory until it does not change
"""
...
...
@@ -167,7 +168,7 @@ class BallooningTest(MemoryBaseTest):
while
True
:
yield
stable
cur_mem
=
self
.
get_memory_status
()
stable
=
abs
(
cur_mem
-
ori_mem
)
<
100
stable
=
abs
(
cur_mem
-
ori_mem
)
<
threshold
ori_mem
=
cur_mem
def
wait_for_balloon_complete
(
self
,
timeout
):
...
...
@@ -175,8 +176,10 @@ class BallooningTest(MemoryBaseTest):
Wait until guest memory don't change
"""
logging
.
info
(
"Wait until guest memory don't change"
)
is_stable
=
self
.
_mem_state
()
utils_misc
.
wait_for
(
lambda
:
next
(
is_stable
),
timeout
,
step
=
10.0
)
threshold
=
int
(
self
.
params
.
get
(
"guest_stable_threshold"
,
100
))
is_stable
=
self
.
_mem_state
(
threshold
)
utils_misc
.
wait_for
(
lambda
:
next
(
is_stable
),
timeout
,
step
=
float
(
self
.
params
.
get
(
"guest_check_step"
,
10.0
)))
def
get_memory_boundary
(
self
,
balloon_type
=
''
):
"""
...
...
@@ -310,12 +313,24 @@ class BallooningTest(MemoryBaseTest):
"""
pass
def
_balloon_post_action
(
self
):
"""
Wait for guest memory goes into stable status
"""
pass
class
BallooningTestWin
(
BallooningTest
):
"""
Windows memory ballooning test
"""
def
_balloon_post_action
(
self
):
"""
Wait for guest memory goes into stable status
"""
balloon_timeout
=
float
(
self
.
params
.
get
(
"balloon_timeout"
,
240
))
self
.
wait_for_balloon_complete
(
balloon_timeout
)
def
error_report
(
self
,
step
,
expect_value
,
monitor_value
,
guest_value
):
"""
...
...
@@ -496,6 +511,8 @@ def run(test, params, env):
balloon_type
=
params_tag
[
'balloon_type'
]
min_sz
,
max_sz
=
balloon_test
.
get_memory_boundary
(
balloon_type
)
expect_mem
=
int
(
random
.
uniform
(
min_sz
,
max_sz
))
if
params_tag
.
get
(
'minimum_value_check'
,
'no'
)
==
'yes'
:
expect_mem
=
int
(
min_sz
)
quit_after_test
=
balloon_test
.
run_ballooning_test
(
expect_mem
,
tag
)
if
params
.
get
(
"balloon_opt_deflate_on_oom"
)
==
"yes"
:
...
...
qemu/tests/cfg/balloon_minimum.cfg
0 → 100644
浏览文件 @
0924b645
- balloon_minimum: install setup image_copy unattended_install.cdrom
virt_test_type = qemu
no Win2000, Fedora.8, Fedora.9, Fedora.10, RHEL.3, RHEL.4
type = balloon_check
balloon = balloon0
balloon_dev_devid = balloon0
balloon_dev_add_bus = yes
minimum_value_check = yes
balloon_type = evict
test_tags = "evict"
kill_vm_on_error = yes
variants:
- negative:
only Windows
backup_image_before_testing = yes
restore_image_after_testing = yes
expect_memory = 10
balloon_timeout = 900
guest_check_step = 60.0
guest_stable_threshold = 25
check_guest_bsod = yes
- boundary:
run_sub_test_after_balloon = yes
sub_test_after_balloon_evict = "boot"
Windows:
guest_compare_threshold = 300
reboot_method = shell
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录