Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
def8e663
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
def8e663
编写于
3月 24, 2020
作者:
L
Longxiang Lyu
提交者:
GitHub
3月 24, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2162 from lolyu/rebase_support_block_device
commit_snapshot_to_raw_backing: add switch for size check
上级
45522d60
643c66d2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
11 deletion
+16
-11
qemu/tests/cfg/commit_snapshot_to_raw_backing.cfg
qemu/tests/cfg/commit_snapshot_to_raw_backing.cfg
+1
-0
qemu/tests/commit_snapshot_to_raw_backing.py
qemu/tests/commit_snapshot_to_raw_backing.py
+15
-11
未找到文件。
qemu/tests/cfg/commit_snapshot_to_raw_backing.cfg
浏览文件 @
def8e663
...
...
@@ -21,6 +21,7 @@
dd_total_size = "${dd_bs_val} * ${dd_bs_count} * 1024 ** 2"
file_create_cmd = "dd if=/dev/urandom of=%s bs=${dd_bs_val}M count=${dd_bs_count}"
guest_file_name = ${tmp_file_name}
snapshot_size_check_after_commit = yes
Windows:
guest_file_name = C:\testfile
x86_64:
...
...
qemu/tests/commit_snapshot_to_raw_backing.py
浏览文件 @
def8e663
...
...
@@ -82,18 +82,22 @@ def run(test, params, env):
else
:
logging
.
info
(
"Commit snapshot image %s back to %s."
,
snapshot
,
base
)
org_size
=
json
.
loads
(
sn_img
.
info
(
output
=
"json"
))[
"actual-size"
]
size_check
=
params
.
get
(
"snapshot_size_check_after_commit"
)
==
"yes"
if
size_check
:
org_size
=
json
.
loads
(
sn_img
.
info
(
output
=
"json"
))[
"actual-size"
]
sn_img
.
commit
(
cache_mode
=
cache_mode
)
remain_size
=
json
.
loads
(
sn_img
.
info
(
output
=
"json"
))[
"actual-size"
]
"""Verify the snapshot file whether emptied after committing"""
logging
.
info
(
"Verify the snapshot file whether emptied after committing"
)
commit_size
=
org_size
-
remain_size
dd_size
=
eval
(
params
[
"dd_total_size"
])
if
commit_size
>=
dd_size
:
logging
.
info
(
"The snapshot file was emptied!"
)
else
:
test
.
fail
(
"The snapshot file was not emptied, check pls!"
)
if
size_check
:
remain_size
=
json
.
loads
(
sn_img
.
info
(
output
=
"json"
))[
"actual-size"
]
# Verify the snapshot file whether emptied after committing
logging
.
info
(
"Verify the snapshot file whether emptied after committing"
)
commit_size
=
org_size
-
remain_size
dd_size
=
eval
(
params
[
"dd_total_size"
])
if
commit_size
>=
dd_size
:
logging
.
info
(
"The snapshot file was emptied!"
)
else
:
test
.
fail
(
"The snapshot file was not emptied, check pls!"
)
base_qit
=
QemuImgTest
(
test
,
params
,
env
,
base
)
base_qit
.
start_vm
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录