Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
ec736b10
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,发现更多精彩内容 >>
提交
ec736b10
编写于
12月 29, 2015
作者:
X
Xu Tian
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #492 from spcui/migration_multi_host_with_stress
qemu.tests: Add new case migration_multi_host_with_stress
上级
51aa09e0
bcdede10
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
103 addition
and
0 deletion
+103
-0
qemu/tests/cfg/multi_host.cfg
qemu/tests/cfg/multi_host.cfg
+7
-0
qemu/tests/migration_multi_host_with_stress.py
qemu/tests/migration_multi_host_with_stress.py
+96
-0
未找到文件。
qemu/tests/cfg/multi_host.cfg
浏览文件 @
ec736b10
...
...
@@ -125,6 +125,13 @@
#Count of migration during file transfer.
migrate_count = 3
regain_ip_cmd = ""
- with_stress:
type = migration_multi_host_with_stress
bg_stress_test = autotest_control
test_control_file = stress.control
control_args = "--cpu 4 --io 4 --vm 2 --vm-bytes 128M --timeout 120s"
check_running_cmd = "pgrep stress"
need_cleanup = no
- downtime:
only after_login_vm
sub_type = downtime
...
...
qemu/tests/migration_multi_host_with_stress.py
0 → 100644
浏览文件 @
ec736b10
import
logging
from
autotest.client.shared
import
error
from
autotest.client.shared
import
utils
from
virttest
import
utils_misc
from
virttest
import
utils_test
@
error
.
context_aware
def
run
(
test
,
params
,
env
):
"""
KVM multi-host migration test:
Migration execution progress is described in documentation
for migrate method in class MultihostMigration.
steps:
1) boot vm and login, load stress in guest
2) do migration
3) wait for a while and stop stress
4) login guest when migrate done
:param test: kvm test object.
:param params: Dictionary with test parameters.
:param env: Dictionary with the test environment.
"""
preprocess_env
=
params
.
get
(
"preprocess_env"
,
"yes"
)
==
"yes"
mig_protocol
=
params
.
get
(
"mig_protocol"
,
"tcp"
)
mig_type
=
utils_test
.
qemu
.
MultihostMigration
if
mig_protocol
==
"exec"
:
mig_type
=
utils_test
.
qemu
.
MultihostMigrationExec
if
"rdma"
in
mig_protocol
:
mig_type
=
utils_test
.
qemu
.
MultihostMigrationRdma
class
TestMultihostMigration
(
mig_type
):
def
__init__
(
self
,
test
,
params
,
env
):
super
(
TestMultihostMigration
,
self
).
__init__
(
test
,
params
,
env
,
preprocess_env
)
self
.
srchost
=
self
.
params
.
get
(
"hosts"
)[
0
]
self
.
dsthost
=
self
.
params
.
get
(
"hosts"
)[
1
]
self
.
is_src
=
params
[
"hostid"
]
==
self
.
srchost
self
.
vms
=
params
[
"vms"
].
split
()
self
.
login_timeout
=
int
(
params
.
get
(
"login_timeout"
,
360
))
self
.
need_cleanup
=
params
.
get
(
"need_cleanup"
,
"yes"
)
==
"yes"
def
migration_scenario
(
self
):
def
clean_up
(
vm
):
kill_bg_stress_cmd
=
params
.
get
(
"kill_bg_stress_cmd"
,
"killall -9 stress"
)
logging
.
info
(
"Kill the background test in guest."
)
session
=
vm
.
wait_for_login
(
timeout
=
self
.
login_timeout
)
s
=
session
.
cmd_status
(
kill_bg_stress_cmd
)
if
s
:
raise
error
.
TestFail
(
"Failed to kill the background"
" test in guest."
)
session
.
close
()
@
error
.
context_aware
def
start_worker
(
mig_data
):
logging
.
info
(
"Try to login guest before migration test."
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
session
=
vm
.
wait_for_login
(
timeout
=
self
.
login_timeout
)
error
.
context
(
"Do stress test before migration."
,
logging
.
info
)
bg_stress_test
=
params
.
get
(
"bg_stress_test"
)
check_running_cmd
=
params
.
get
(
"check_running_cmd"
)
bg
=
utils
.
InterruptedThread
(
utils_test
.
run_virt_sub_test
,
args
=
(
test
,
params
,
env
,),
kwargs
=
{
"sub_type"
:
bg_stress_test
})
bg
.
start
()
def
check_running
():
return
session
.
cmd_status
(
check_running_cmd
)
==
0
if
check_running_cmd
:
if
not
utils_misc
.
wait_for
(
check_running
,
timeout
=
360
):
raise
error
.
TestFail
(
"Failed to start %s in guest."
%
bg_stress_test
)
def
check_worker
(
mig_data
):
if
not
self
.
is_src
and
self
.
need_cleanup
:
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
clean_up
(
vm
)
if
params
.
get
(
"check_vm_before_migration"
,
"yes"
)
==
"no"
:
params
[
"check_vm_needs_restart"
]
=
"no"
self
.
migrate_wait
(
self
.
vms
,
self
.
srchost
,
self
.
dsthost
,
start_worker
,
check_worker
)
mig
=
TestMultihostMigration
(
test
,
params
,
env
)
mig
.
run
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录