Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
9d142bef
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,发现更多精彩内容 >>
提交
9d142bef
编写于
3月 02, 2016
作者:
X
Xu Tian
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #519 from CongSmile/balloon_hotplug
tp-qemu: Add case for balloon hotplug.
上级
4c237473
78194b88
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
86 addition
and
0 deletion
+86
-0
qemu/tests/balloon_hotplug.py
qemu/tests/balloon_hotplug.py
+70
-0
qemu/tests/cfg/balloon_hotplug.cfg
qemu/tests/cfg/balloon_hotplug.cfg
+16
-0
未找到文件。
qemu/tests/balloon_hotplug.py
0 → 100644
浏览文件 @
9d142bef
import
logging
import
time
from
virttest.qemu_devices
import
qdevices
from
virttest
import
error_context
from
qemu.tests
import
balloon_check
from
avocado.core
import
exceptions
@
error_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Test hotplug of balloon devices.
1) Boot up guest w/o balloon device.
2) Hoplug balloon device and check hotplug successfully or not.
3) Do memory balloon.
4) Unplug balloon device and check unplug successfully or not.
:param test: QEMU test object.
:param params: Dictionary with the test parameters.
:param env: Dictionary with test environment.
"""
pause
=
float
(
params
.
get
(
"virtio_balloon_pause"
,
3.0
))
idx
=
0
err
=
""
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
error_context
.
context
(
"Hotplug and unplug balloon device in a loop"
,
logging
.
info
)
for
i
in
xrange
(
int
(
params
.
get
(
"balloon_repeats"
,
3
))):
vm
.
devices
.
set_dirty
()
new_dev
=
qdevices
.
QDevice
(
"virtio-balloon-pci"
,
{
'id'
:
'balloon%d'
%
idx
},
parent_bus
=
{
'aobject'
:
'pci.0'
})
error_context
.
context
(
"Hotplug balloon device for %d times"
%
(
i
+
1
),
logging
.
info
)
out
=
new_dev
.
hotplug
(
vm
.
monitor
)
if
out
:
err
+=
"
\n
Hotplug monitor output: %s"
%
out
# Pause
time
.
sleep
(
pause
)
ver_out
=
new_dev
.
verify_hotplug
(
out
,
vm
.
monitor
)
if
not
ver_out
:
err
+=
(
"
\n
Device is not in qtree %ss after hotplug:
\n
%s"
%
(
pause
,
vm
.
monitor
.
info
(
"qtree"
)))
error_context
.
context
(
"Check whether balloon device work after hotplug"
,
logging
.
info
)
balloon_check
.
run
(
test
,
params
,
env
)
error_context
.
context
(
"Unplug balloon device for %d times"
%
(
i
+
1
),
logging
.
info
)
out
=
new_dev
.
unplug
(
vm
.
monitor
)
if
out
:
err
+=
"
\n
Unplug monitor output: %s"
%
out
# Pause
time
.
sleep
(
pause
)
ver_out
=
new_dev
.
verify_unplug
(
out
,
vm
.
monitor
)
if
not
ver_out
:
err
+=
(
"
\n
Device is still in qtree %ss after unplug:
\n
%s"
%
(
pause
,
vm
.
monitor
.
info
(
"qtree"
)))
if
err
:
logging
.
error
(
vm
.
monitor
.
info
(
"qtree"
))
raise
exceptions
.
TestFail
(
"Error occurred while hotpluging "
"virtio-pci. Iteration %s, monitor "
"output:%s"
%
(
i
,
err
))
qemu/tests/cfg/balloon_hotplug.cfg
0 → 100644
浏览文件 @
9d142bef
- balloon_hotplug: install setup image_copy unattended_install.cdrom
virt_test_type = qemu libvirt
type = balloon_hotplug
monitor_type = qmp
monitors = qmp1
balloon_repeats = 5
virtio_balloon_pause = 10.0
free_mem_cmd = cat /proc/meminfo |grep MemFree
Linux:
ratio = 1
Windows:
ratio = 0.5
run_sub_test_after_balloon = no
test_tags = "evict enlarge"
balloon_type_evict = evict
balloon_type_enlarge = enlarge
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录