Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
1a8591b1
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,发现更多精彩内容 >>
未验证
提交
1a8591b1
编写于
5月 09, 2020
作者:
Y
YongxueHong
提交者:
GitHub
5月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2223 from aliang123/1831968
blockdev_snapshot_install:snapshot during guest installation
上级
e2ecf560
8979d74b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
88 addition
and
0 deletion
+88
-0
qemu/tests/blockdev_snapshot_install.py
qemu/tests/blockdev_snapshot_install.py
+58
-0
qemu/tests/cfg/blockdev_snapshot_install.cfg
qemu/tests/cfg/blockdev_snapshot_install.cfg
+30
-0
未找到文件。
qemu/tests/blockdev_snapshot_install.py
0 → 100644
浏览文件 @
1a8591b1
import
time
import
logging
import
random
from
virttest
import
utils_test
from
virttest
import
utils_misc
from
virttest.tests
import
unattended_install
from
provider.blockdev_snapshot_base
import
BlockDevSnapshotTest
def
run
(
test
,
params
,
env
):
"""
Backup VM disk test when VM reboot
1) Install guest
2) Do snapshot during guest
3) Rebase snapshot to base after installation finished
4) Start guest with snapshot
:param test: test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
def
tag_for_install
(
vm
,
tag
):
if
vm
.
serial_console
:
serial_output
=
vm
.
serial_console
.
get_output
()
if
tag
in
serial_output
:
return
True
logging
.
info
(
"VM has not started yet"
)
return
False
base_image
=
params
.
get
(
"images"
,
"image1"
).
split
()[
0
]
params
.
update
(
{
"image_format_%s"
%
base_image
:
params
[
"image_format"
]})
snapshot_test
=
BlockDevSnapshotTest
(
test
,
params
,
env
)
args
=
(
test
,
params
,
env
)
bg
=
utils_test
.
BackgroundTest
(
unattended_install
.
run
,
args
)
bg
.
start
()
if
bg
.
is_alive
():
tag
=
params
[
"tag_for_install_start"
]
if
utils_misc
.
wait_for
(
lambda
:
tag_for_install
(
snapshot_test
.
main_vm
,
tag
),
120
,
10
,
5
):
logging
.
info
(
"sleep random time before do snapshots"
)
time
.
sleep
(
random
.
randint
(
120
,
600
))
snapshot_test
.
pre_test
()
try
:
snapshot_test
.
create_snapshot
()
try
:
bg
.
join
(
timeout
=
1200
)
except
Exception
:
raise
snapshot_test
.
verify_snapshot
()
snapshot_test
.
clone_vm
.
wait_for_login
()
finally
:
snapshot_test
.
post_test
()
else
:
test
.
fail
(
"Failed to install guest"
)
else
:
test
.
fail
(
"Background process:installation not started"
)
qemu/tests/cfg/blockdev_snapshot_install.cfg
0 → 100644
浏览文件 @
1a8591b1
- blockdev_snapshot_install:
type = blockdev_snapshot_install
virt_test_type = qemu
need_install = yes
start_vm = no
image_name_image1 = "images/snapshot_install"
medium = cdrom
installation = cdrom
kernel = vmlinuz
initrd = initrd.img
force_create_image_image1 = yes
image_aio = threads
unattended_delivery_method = cdrom
cdroms += " unattended"
index_enable = no
kill_vm = yes
tag_for_install_start = "Starting Login Service"
storage_type_default = "directory"
storage_pool = default
snapshot_tag = sn1
image_format_sn1 = qcow2
image_name_sn1 = images/sn1
device = "drive_image1"
base_tag = "image1"
rebase_mode = unsafe
only Linux
node = "drive_image1"
overlay = "drive_sn1"
qemu_force_use_drive_expression = no
no RHEL.5 RHEL.6 RHEL.7 RHEL.8.0 RHEL8.1
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录