Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
8f0cd7c5
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,发现更多精彩内容 >>
未验证
提交
8f0cd7c5
编写于
5月 29, 2020
作者:
Y
Yu Yihuang
提交者:
GitHub
5月 29, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2242 from PaulYuuu/ppc_cpu_mmu
ppc_check_cpu_and_mmu: New case to check CPU and MMU of host and guest
上级
3280268c
e0368981
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
0 deletion
+55
-0
qemu/tests/cfg/ppc_check_cpu_and_mmu.cfg
qemu/tests/cfg/ppc_check_cpu_and_mmu.cfg
+10
-0
qemu/tests/ppc_check_cpu_and_mmu.py
qemu/tests/ppc_check_cpu_and_mmu.py
+45
-0
未找到文件。
qemu/tests/cfg/ppc_check_cpu_and_mmu.cfg
0 → 100644
浏览文件 @
8f0cd7c5
- ppc_check_cpu_and_mmu:
type = ppc_check_cpu_and_mmu
only ppc64le
# Older kernel versions do not support get MMU mode from cpuinfo
no RHEL.6, RHEL.7
no Host_RHEL.7
auto_cpu_model = no
cpu_model = host
kill_vm_on_error = yes
kernel_extra_params_remove = disable_radix
qemu/tests/ppc_check_cpu_and_mmu.py
0 → 100644
浏览文件 @
8f0cd7c5
import
re
import
logging
from
avocado.utils
import
process
from
virttest
import
error_context
@
error_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Check the CPU model and MMU mode of host and guest are matched.
1) Launch a guest.
2) Get CPU information both of host and guest.
3) Assert that CPU model and MMU node are matched.
:param test: the test object.
:param params: the test params.
:param env: test environment.
"""
def
get_cpu_mmu
(
session
=
None
):
cmd_func
=
session
.
cmd
if
session
else
process
.
getoutput
cpu_info
=
cmd_func
(
"tail -n 11 /proc/cpuinfo"
)
cpu_info
=
re
.
findall
(
r
"(?:cpu\s+:\s+(\w+\d+)).*(?:MMU\s+:\s+(\w+))"
,
cpu_info
,
re
.
S
)
if
cpu_info
:
return
cpu_info
[
0
]
test
.
error
(
"Unable to get the CPU information of this system."
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
guest_session
=
vm
.
wait_for_login
()
error_context
.
base_context
(
"Get CPU information of host and guest."
,
logging
.
info
)
host_cpu_model
,
host_mmu_mode
=
get_cpu_mmu
()
guest_cpu_model
,
guest_mmu_mode
=
get_cpu_mmu
(
guest_session
)
error_context
.
context
(
"Assert CPU model and MMU mode of host and guest."
,
logging
.
info
)
assert
(
guest_cpu_model
==
host_cpu_model
),
(
"The CPU model of the host "
"and guest do not match"
)
assert
(
guest_mmu_mode
==
host_mmu_mode
),
(
"The MMU mode of the host and "
"guest do not match"
)
logging
.
info
(
"CPU model and MMU mode of host and guest are matched."
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录