Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
4c43136a
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,发现更多精彩内容 >>
提交
4c43136a
编写于
6月 27, 2016
作者:
X
Xu Tian
提交者:
GitHub
6月 27, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #611 from xutian/hotplug_repeat
Add hotplug/unplug memory in loop test
上级
4deb3b85
bb4d4b2c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
124 addition
and
0 deletion
+124
-0
qemu/tests/cfg/hotplug_mem_repeat.cfg
qemu/tests/cfg/hotplug_mem_repeat.cfg
+46
-0
qemu/tests/hotplug_mem_repeat.py
qemu/tests/hotplug_mem_repeat.py
+78
-0
未找到文件。
qemu/tests/cfg/hotplug_mem_repeat.cfg
0 → 100644
浏览文件 @
4c43136a
# Notes:
# Before start testing, please ensure systemd is your guest OS
# is support memory hotplug;
- hotplug_memory_repeat:
type = hotplug_mem_repeat
only Linux
no Host_RHEL.m6
no RHEL.5 RHEL.6
threshold = 210
slots_mem = 4
size_mem = 128M
mem_fixed = 1024
maxmem_mem = 32G
target_mem = mem1
login_timeout = 600
variants:
- policy_default:
policy_mem = default
- policy_bind:
policy_mem = bind
host-nodes = 0
- policy_interleave:
policy_mem = interleave
host-nodes = 0
- policy_preferred:
policy_mem = preferred
host-nodes = 0
- no_policy:
del policy_mem
variants:
- backend_ram:
backend_mem = memory-backend-ram
- backend_file:
backend_mem = memory-backend-file
setup_hugepages = yes
mem-path = /mnt/kvm_hugepage
target_hugepages = 2058
pre_command = "echo 3 > /proc/sys/vm/drop_caches"
pre_command_noncritical = yes
variants:
- @repeat_256:
repeats = 256
scalability_test = no
- scalability_test:
scalability_test = yes
slots_mem = 256
qemu/tests/hotplug_mem_repeat.py
0 → 100644
浏览文件 @
4c43136a
import
time
import
logging
from
virttest.utils_test.qemu
import
MemoryHotplugTest
try
:
from
virttest
import
error_context
as
step_engine
except
ImportError
:
from
autotest.client.shared.error
import
step_engine
class
MemoryHotplugRepeat
(
MemoryHotplugTest
):
def
start_test
(
self
):
"""
Prepare reqired test params, then start memory
hotplug/unplug tests in turn. And this is test entry.
"""
target_mem
=
self
.
params
[
"target_mem"
]
vm
=
self
.
env
.
get_vm
(
self
.
params
[
"main_vm"
])
max_slots
=
int
(
self
.
params
.
get
(
"slots_mem"
,
4
))
scalability_test
=
self
.
params
.
get
(
"scalability_test"
)
==
"yes"
repeats
=
scalability_test
and
max_slots
or
self
.
params
[
"repeats"
]
original_mem
=
self
.
get_guest_total_mem
(
vm
)
for
repeat
in
xrange
(
int
(
repeats
)):
extra_params
=
(
scalability_test
and
[{
'slot_dimm'
:
repeat
}]
or
[
None
])[
0
]
step_engine
.
context
(
"Hotplug/unplug loop '%d'"
%
repeat
,
logging
.
info
)
self
.
turn
(
vm
,
target_mem
,
extra_params
)
current_mem
=
self
.
get_guest_total_mem
(
vm
)
if
current_mem
!=
original_mem
:
raise
error
.
TestFailed
(
"Guest memory changed about repeat "
"hotpug/unplug memory %d times"
%
repeat
)
time
.
sleep
(
1.5
)
vm
.
verify_alive
()
vm
.
reboot
()
def
turn
(
self
,
vm
,
target_mem
,
extra_params
=
None
):
"""
Hotplug/Unplug memory in turn
:param vm: qemu target VM object
:param target_mem: memory name of target VM object
:param extra_params: params dict, that you want to update
"""
memorys
=
self
.
get_all_memorys
(
vm
)
if
extra_params
:
self
.
params
.
update
(
extra_params
)
self
.
hotplug_memory
(
vm
,
target_mem
)
memorys_added
=
self
.
get_all_memorys
(
vm
)
-
memorys
offline_memorys
=
self
.
get_offline_memorys
(
vm
)
time
.
sleep
(
1.5
)
for
memory
in
offline_memorys
:
# Online memory to movable zone maybe failed, see details
# in redhat Bug 1314306
self
.
memory_operate
(
vm
,
memory
,
'online_movable'
)
for
memory
in
memorys_added
:
self
.
memory_operate
(
vm
,
memory
,
'offline'
)
time
.
sleep
(
1.5
)
self
.
unplug_memory
(
vm
,
target_mem
)
@
step_engine
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Qemu memory hotplug test:
1) Boot guest with -m option
2) Hotplug/unplug memory in turn
3) Reboot VM
:param test: QEMU test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
hotplug_test
=
MemoryHotplugRepeat
(
test
,
params
,
env
)
hotplug_test
.
start_test
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录