Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
d7aeabff
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,发现更多精彩内容 >>
未验证
提交
d7aeabff
编写于
4月 14, 2020
作者:
Y
YongxueHong
提交者:
GitHub
4月 14, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2182 from aliang123/1820491
Commit during guest reboot
上级
c2aefbfc
dadbe528
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
80 addition
and
1 deletion
+80
-1
provider/blockdev_commit_base.py
provider/blockdev_commit_base.py
+13
-1
qemu/tests/blockdev_commit_reboot.py
qemu/tests/blockdev_commit_reboot.py
+38
-0
qemu/tests/cfg/blockdev_commit_reboot.cfg
qemu/tests/cfg/blockdev_commit_reboot.cfg
+29
-0
未找到文件。
provider/blockdev_commit_base.py
浏览文件 @
d7aeabff
...
...
@@ -94,6 +94,18 @@ class BlockDevCommitTest(object):
return
kname
return
None
def
configure_disk
(
self
,
tag
):
"""
support configuration on both system and data disk
"""
if
tag
==
self
.
params
[
"images"
].
split
()[
0
]:
self
.
configure_system_disk
(
tag
)
else
:
self
.
configure_data_disk
(
tag
)
def
configure_system_disk
(
self
,
tag
):
self
.
disks_info
.
append
([
""
,
self
.
params
[
"mount_point"
],
tag
])
def
configure_data_disk
(
self
,
tag
):
os_type
=
self
.
params
[
"os_type"
]
disk_params
=
self
.
params
.
object_params
(
tag
)
...
...
@@ -132,7 +144,7 @@ class BlockDevCommitTest(object):
device_params
=
self
.
params
.
object_params
(
device
)
snapshot_tags
=
device_params
[
"snapshot_tags"
].
split
()
self
.
device_node
=
self
.
get_node_name
(
device
)
self
.
configure_d
ata_d
isk
(
device
)
self
.
configure_disk
(
device
)
self
.
prepare_snapshot_file
(
snapshot_tags
)
self
.
create_snapshots
(
snapshot_tags
,
device
)
...
...
qemu/tests/blockdev_commit_reboot.py
0 → 100644
浏览文件 @
d7aeabff
from
provider
import
backup_utils
from
provider
import
job_utils
from
provider.blockdev_commit_base
import
BlockDevCommitTest
class
BlockdevCommitReboot
(
BlockDevCommitTest
):
def
commit_snapshots
(
self
):
device
=
self
.
params
.
get
(
"device_tag"
)
device_params
=
self
.
params
.
object_params
(
device
)
snapshot_tags
=
device_params
[
"snapshot_tags"
].
split
()
self
.
device_node
=
self
.
get_node_name
(
device
)
options
=
[
"base-node"
,
"top-node"
,
"speed"
]
arguments
=
self
.
params
.
copy_from_keys
(
options
)
arguments
[
"base-node"
]
=
self
.
get_node_name
(
device
)
arguments
[
"top-node"
]
=
self
.
get_node_name
(
snapshot_tags
[
-
2
])
device
=
self
.
get_node_name
(
snapshot_tags
[
-
1
])
commit_cmd
=
backup_utils
.
block_commit_qmp_cmd
cmd
,
args
=
commit_cmd
(
device
,
**
arguments
)
self
.
main_vm
.
monitor
.
cmd
(
cmd
,
args
)
job_id
=
args
.
get
(
"job-id"
,
device
)
self
.
main_vm
.
reboot
(
method
=
"system_reset"
)
job_utils
.
wait_until_block_job_completed
(
self
.
main_vm
,
job_id
)
def
run
(
test
,
params
,
env
):
"""
Block commit base Test
1. boot guest with data disk
2. create 4 snapshots and save file in each snapshot
3. commit snapshot 4 to snapshot 3
4. during commit, reboot guest
5. verify files's md5 after commit
"""
block_test
=
BlockdevCommitReboot
(
test
,
params
,
env
)
block_test
.
run_test
()
qemu/tests/cfg/blockdev_commit_reboot.cfg
0 → 100644
浏览文件 @
d7aeabff
- blockdev_commit_reboot:
type = blockdev_commit_reboot
virt_test_type = qemu
only Linux
start_vm = yes
kill_vm = yes
storage_pools = default
storage_type_default = "directory"
storage_pool = default
snapshot_tags = sn1 sn2 sn3 sn4
image_name_sn1 = sn1
image_format_sn1 = qcow2
image_name_sn2 = sn2
image_format_sn2 = qcow2
image_name_sn3 = sn3
image_format_sn3 = qcow2
image_name_sn4 = sn4
image_format_sn4 = qcow2
device_tag = "image1"
rebase_mode = unsafe
mount_point = "/tmp"
qemu_force_use_drive_expression = no
Windows:
mount_point = "C:\\"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录