Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
a934ff9b
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 搜索 >>
未验证
提交
a934ff9b
编写于
12月 10, 2018
作者:
Q
Qianqian Zhu
提交者:
GitHub
12月 10, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1578 from ldoktor/smbios
qemu..smbios: q35 and py3 fixes
上级
9fd1e112
051184ed
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
31 addition
and
6 deletion
+31
-6
qemu/tests/cfg/smbios.cfg
qemu/tests/cfg/smbios.cfg
+7
-0
qemu/tests/smbios_table.py
qemu/tests/smbios_table.py
+24
-6
未找到文件。
qemu/tests/cfg/smbios.cfg
浏览文件 @
a934ff9b
...
...
@@ -5,6 +5,10 @@
type = smbios_table
requires_root = yes
start_vm = no
# Remove extra pci_controllers as they only make sense for q35 but we
# might be booting i440fx machines as well which would require PCIE
# bridge
pcie_extra_root_port = 0
SKU_System = "KVM"
Family_System = "VIRT"
dmikeyword_Bios = Vendor Version Date
...
...
@@ -14,6 +18,9 @@
# Different systems may have different outputs for the item that is not set
# Please update these parameters based on your guest os system
notset_output = "Not Specified"
# RHEL uses different entries
Host_RHEL:
smbios_system_version = rhel
variants:
- type0:
smbios_type = Bios
...
...
qemu/tests/smbios_table.py
浏览文件 @
a934ff9b
import
logging
import
re
from
avocado.utils
import
process
from
virttest
import
error_context
from
virttest
import
env_process
from
virttest
import
utils_misc
from
virttest.compat_52lts
import
decode_to_text
@
error_context
.
context_aware
...
...
@@ -39,8 +41,8 @@ def run(test, params, env):
dmidecode_key
=
dmidecode_key
.
split
()
for
key
in
dmidecode_key
:
cmd
=
(
dmidecode_exp
%
(
smbios_type_number
,
key
))
default_key_para
=
process
.
system_output
(
cmd
,
shell
=
True
).
strip
()
default_key_para
=
decode_to_text
(
process
.
system_output
(
cmd
,
shell
=
True
).
strip
()
)
smbios_key_para_set
=
params
.
object_params
(
sm_type
).
get
(
key
,
default_key_para
)
smbios
+=
",%s='%s'"
%
(
key
.
lower
(),
smbios_key_para_set
)
...
...
@@ -64,7 +66,14 @@ def run(test, params, env):
for
m_type
in
support_machine_types
]
failures
=
[]
rhel_system_version
=
params
.
get
(
'smbios_system_version'
)
==
'rhel'
if
not
rhel_system_version
:
re_pc_lt_2
=
re
.
compile
(
r
'^pc-(i440fx-)?[01].\d+$'
)
host_dmidecode_system_version
=
decode_to_text
(
process
.
system_output
(
"dmidecode -s system-version"
))
for
m_type
in
support_machine_types
:
if
m_type
in
(
"isapc"
,
"xenfv"
,
"xenpv"
):
continue
params
[
"machine_type"
]
=
m_type
params
[
"start_vm"
]
=
"yes"
...
...
@@ -87,14 +96,23 @@ def run(test, params, env):
for
key
in
dmidecode_key
:
cmd
=
(
dmidecode_exp
%
(
smbios_type_number
,
key
))
smbios_get_para
=
session
.
cmd
(
cmd
).
strip
()
default_key_para
=
process
.
system_output
(
cmd
,
shell
=
True
).
strip
()
default_key_para
=
decode_to_text
(
process
.
system_output
(
cmd
,
shell
=
True
).
strip
()
)
if
params
.
get
(
"smbios_type_disable"
,
"no"
)
==
"no"
:
smbios_set_para
=
params
.
object_params
(
sm_type
).
get
(
key
,
default_key_para
)
else
:
# The System.Version is different on RHEL and upstream
if
(
rhel_system_version
or
sm_type
!=
'System'
or
key
!=
'Version'
):
key_index
=
support_machine_types
.
index
(
m_type
)
smbios_set_para
=
expect_system_versions
[
key_index
]
elif
re_pc_lt_2
.
match
(
m_type
):
# pc<2.0 inherits host system-version
smbios_set_para
=
host_dmidecode_system_version
else
:
# Newer use machine-type
smbios_set_para
=
m_type
if
smbios_get_para
==
notset_output
:
smbios_get_para
=
default_key_para
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录