Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
472dd8c9
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,发现更多精彩内容 >>
未验证
提交
472dd8c9
编写于
6月 18, 2020
作者:
Y
Yanan Fu
提交者:
GitHub
6月 18, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2262 from huangyum/nvdimm_hotplug
nvdimm_hotplug: add new case to test hotplug nvdimm device
上级
a2a19c40
2e3ac3ac
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
5 deletion
+20
-5
qemu/tests/cfg/nvdimm.cfg
qemu/tests/cfg/nvdimm.cfg
+4
-1
qemu/tests/nvdimm.py
qemu/tests/nvdimm.py
+16
-4
未找到文件。
qemu/tests/cfg/nvdimm.cfg
浏览文件 @
472dd8c9
...
...
@@ -26,7 +26,7 @@
post_command = "rm -rf ${nv_backend}"
mem_devs = mem1
size_mem = 1G
share_mem =
on
share_mem =
yes
nv_file = "${mount_dir}/nv0"
variants:
...
...
@@ -83,3 +83,6 @@
del dev_path
del format_command
del mount_command
- nvdimm_hotplug:
del mem_devs
target_mems = mem1
qemu/tests/nvdimm.py
浏览文件 @
472dd8c9
import
os
import
logging
import
time
from
avocado.utils
import
process
from
virttest
import
env_process
from
virttest
import
error_context
from
virttest.utils_test.qemu
import
MemoryHotplugTest
class
NvdimmTest
(
object
):
...
...
@@ -37,13 +39,15 @@ class NvdimmTest(object):
self
.
test
.
fail
(
"Execute command '%s' failed, output: %s"
%
(
cmd
,
output
))
return
output
.
strip
()
def
verify_nvdimm
(
self
,
vm
):
def
verify_nvdimm
(
self
,
vm
,
mems
):
"""
verify nvdimm in monitor and guest
:params vm: VM object
:params mems: memory objects
"""
dimms_expect
=
set
([
"dimm-%s"
%
dev
for
dev
in
self
.
params
.
objects
(
"mem_devs"
)])
dimms_expect
=
set
(
"dimm-%s"
%
mem
for
mem
in
mems
)
logging
.
info
(
"Check if dimm %s in memory-devices"
%
dimms_expect
)
dimms_monitor
=
set
([
info
[
"data"
][
"id"
]
for
info
in
vm
.
monitor
.
info
(
"memory-devices"
)])
if
not
dimms_expect
.
issubset
(
dimms_monitor
):
invisible_dimms
=
dimms_expect
-
dimms_monitor
...
...
@@ -139,8 +143,16 @@ def run(test, params, env):
error_context
.
context
(
"Login to the guest"
,
logging
.
info
)
login_timeout
=
int
(
params
.
get
(
"login_timeout"
,
360
))
nvdimm_test
.
session
=
vm
.
wait_for_login
(
timeout
=
login_timeout
)
mems
=
params
.
objects
(
"mem_devs"
)
target_mems
=
params
.
objects
(
"target_mems"
)
if
target_mems
:
hotplug_test
=
MemoryHotplugTest
(
test
,
params
,
env
)
for
mem
in
target_mems
:
hotplug_test
.
hotplug_memory
(
vm
,
mem
)
time
.
sleep
(
10
)
mems
+=
target_mems
error_context
.
context
(
"Verify nvdimm in monitor and guest"
,
logging
.
info
)
nvdimm_test
.
verify_nvdimm
(
vm
)
nvdimm_test
.
verify_nvdimm
(
vm
,
mems
)
error_context
.
context
(
"Format and mount nvdimm in guest"
,
logging
.
info
)
nvdimm_test
.
mount_nvdimm
()
nv_file
=
params
.
get
(
"nv_file"
,
"/mnt/nv"
)
...
...
@@ -152,7 +164,7 @@ def run(test, params, env):
nvdimm_test
.
umount_nvdimm
()
nvdimm_test
.
session
=
vm
.
reboot
()
error_context
.
context
(
"Verify nvdimm after reboot"
,
logging
.
info
)
nvdimm_test
.
verify_nvdimm
(
vm
)
nvdimm_test
.
verify_nvdimm
(
vm
,
mems
)
nvdimm_test
.
mount_nvdimm
(
format_device
=
"no"
)
new_md5
=
nvdimm_test
.
md5_hash
(
nv_file
)
error_context
.
context
(
"Compare current md5 to original md5"
,
logging
.
info
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录