Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-libvirt
提交
0d569ea6
T
tp-libvirt
项目概览
openeuler
/
tp-libvirt
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tp-libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
0d569ea6
编写于
7月 29, 2020
作者:
D
dzhengfy
提交者:
GitHub
7月 29, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2834 from jinqi7/nvdimm_lifecycle
Add nvdimm lifecycle test case
上级
e72d00ed
3adf6226
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
2 deletion
+30
-2
libvirt/tests/cfg/memory/nvdimm.cfg
libvirt/tests/cfg/memory/nvdimm.cfg
+4
-0
libvirt/tests/src/memory/nvdimm.py
libvirt/tests/src/memory/nvdimm.py
+26
-2
未找到文件。
libvirt/tests/cfg/memory/nvdimm.cfg
浏览文件 @
0d569ea6
...
...
@@ -30,6 +30,10 @@
setvm_vcpu = 4
setvm_placement = static
qemu_checks = -numa node,nodeid=1,cpus=2-3,mem=512`mem-path=${nvdimm_file},share=yes,size=536870912`label-size=262144
variants:
- no_other_check:
- check_life_cycle:
check_life_cycle = "yes"
- no_label:
check = back_file
cpuxml_mode = host-model
...
...
libvirt/tests/src/memory/nvdimm.py
浏览文件 @
0d569ea6
...
...
@@ -96,6 +96,16 @@ def run(test, params, env):
return
mem_xml
.
copy
()
def
check_nvdimm_file
(
file_name
):
"""
check if the file exists in nvdimm memory device
:param file_name: the file name in nvdimm device
"""
vm_session
=
vm
.
wait_for_login
()
if
test_str
not
in
vm_session
.
cmd
(
'cat /mnt/%s '
%
file_name
):
test
.
fail
(
'"%s" should be in output'
%
test_str
)
bkxml
=
vm_xml
.
VMXML
.
new_from_inactive_dumpxml
(
vm_name
)
try
:
...
...
@@ -187,7 +197,7 @@ def run(test, params, env):
libvirt
.
check_qemu_cmd_line
(
'mem-path=/tmp/nvdimm,share=no'
)
private_str
=
'This is a test for foo-private
!
'
private_str
=
'This is a test for foo-private'
vm_session
.
cmd
(
'mount -o dax /dev/pmem0 /mnt/'
)
file_private
=
'foo-private'
...
...
@@ -222,7 +232,7 @@ def run(test, params, env):
test_str
=
'This is a test with label'
vm_session
.
cmd
(
'echo "%s" >/mnt/foo-label'
%
test_str
)
if
test_str
not
in
vm_session
.
cmd
(
'cat /mnt/foo-label '
):
test
.
fail
(
'"%s" should be in
output
'
%
test_str
)
test
.
fail
(
'"%s" should be in
the output of cat cmd
'
%
test_str
)
# Reboot the guest, and remount the nvdimm device in the guest.
# Check the file foo-label is exited
...
...
@@ -234,6 +244,20 @@ def run(test, params, env):
if
test_str
not
in
vm_session
.
cmd
(
'cat /mnt/foo-label '
):
test
.
fail
(
'"%s" should be in output'
%
test_str
)
if
params
.
get
(
'check_life_cycle'
,
'no'
)
==
'yes'
:
virsh
.
managedsave
(
vm_name
,
ignore_status
=
False
,
debug
=
True
)
vm
.
start
()
check_nvdimm_file
(
'foo-label'
)
vm_s1
=
vm_name
+
".s1"
virsh
.
save
(
vm_name
,
vm_s1
,
ignore_status
=
False
,
debug
=
True
)
virsh
.
restore
(
vm_s1
,
ignore_status
=
False
,
debug
=
True
)
check_nvdimm_file
(
'foo-label'
)
virsh
.
snapshot_create_as
(
vm_name
,
vm_s1
,
ignore_status
=
False
,
debug
=
True
)
virsh
.
snapshot_revert
(
vm_name
,
vm_s1
,
ignore_status
=
False
,
debug
=
True
)
virsh
.
snapshot_delete
(
vm_name
,
vm_s1
,
ignore_status
=
False
,
debug
=
True
)
if
check
==
'hot_plug'
:
# Create file for 2nd nvdimm device
nvdimm_file_2
=
params
.
get
(
'nvdimm_file_2'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录