Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-libvirt
提交
c18c8290
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 搜索 >>
未验证
提交
c18c8290
编写于
8月 13, 2020
作者:
D
dzhengfy
提交者:
GitHub
8月 13, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2919 from smitterl/add_loadparm_test
Add test cases for boot/loadparm
上级
e376c231
e10c5ecf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
2 deletion
+22
-2
libvirt/tests/cfg/bios/virsh_boot.cfg
libvirt/tests/cfg/bios/virsh_boot.cfg
+10
-0
libvirt/tests/src/bios/virsh_boot.py
libvirt/tests/src/bios/virsh_boot.py
+12
-2
未找到文件。
libvirt/tests/cfg/bios/virsh_boot.cfg
浏览文件 @
c18c8290
...
...
@@ -15,6 +15,16 @@
driver_type = "qcow2"
os_version = "EXAMPLE_OS_VERSION"
variants:
- loadparm:
only s390-virtio
boot_ref = "order"
boot_order = 1
boot_loadparm = 2
start_vm = "yes"
test_cmd = "lsreipl"
expected_output = Loadparm:\s+"2"
with_loader = "no"
with_boot = "yes"
- by_ovmf:
only q35
boot_type = "ovmf"
...
...
libvirt/tests/src/bios/virsh_boot.py
浏览文件 @
c18c8290
...
...
@@ -599,6 +599,7 @@ def set_boot_dev_or_boot_order(vmxml, **kwargs):
boot_order
=
kwargs
.
get
(
"boot_order"
,
"1"
)
target_dev
=
kwargs
.
get
(
"target_dev"
,
"vdb"
)
two_same_boot_dev
=
kwargs
.
get
(
"two_same_boot_dev"
,
False
)
boot_loadparm
=
kwargs
.
get
(
"loadparm"
,
None
)
if
boot_ref
==
"dev"
:
boot_list
=
[]
boot_list
.
append
(
boot_dev
)
...
...
@@ -607,7 +608,8 @@ def set_boot_dev_or_boot_order(vmxml, **kwargs):
boot_list
.
append
(
boot_dev
)
vmxml
.
set_os_attrs
(
**
{
"boots"
:
boot_list
})
elif
boot_ref
==
"order"
:
vmxml
.
set_boot_order_by_target_dev
(
target_dev
,
boot_order
)
vmxml
.
set_boot_attrs_by_target_dev
(
target_dev
,
order
=
boot_order
,
loadparm
=
boot_loadparm
)
def
run
(
test
,
params
,
env
):
...
...
@@ -627,6 +629,7 @@ def run(test, params, env):
username
=
params
.
get
(
"username"
,
"root"
)
password
=
params
.
get
(
"password"
,
"redhat"
)
test_cmd
=
params
.
get
(
"test_cmd"
,
""
)
expected_output
=
params
.
get
(
"expected_output"
,
""
)
check_point
=
params
.
get
(
"checkpoint"
,
""
)
status_error
=
"yes"
==
params
.
get
(
"status_error"
,
"no"
)
boot_iso_file
=
os
.
path
.
join
(
data_dir
.
get_tmp_dir
(),
"boot.iso"
)
...
...
@@ -646,6 +649,7 @@ def run(test, params, env):
vol_name
=
params
.
get
(
"vol_name"
)
brick_path
=
os
.
path
.
join
(
test
.
virtdir
,
"gluster-pool"
)
boot_type
=
params
.
get
(
"boot_type"
,
"seabios"
)
boot_loadparm
=
params
.
get
(
"boot_loadparm"
,
None
)
# Prepare result checkpoint list
check_points
=
[]
...
...
@@ -670,7 +674,8 @@ def run(test, params, env):
boot_kwargs
=
{
"boot_ref"
:
boot_ref
,
"boot_dev"
:
boot_dev
,
"boot_order"
:
boot_order
,
"target_dev"
:
target_dev
}
"target_dev"
:
target_dev
,
"loadparm"
:
boot_loadparm
}
if
"yes"
==
params
.
get
(
"two_same_boot_dev"
,
"no"
):
boot_kwargs
.
update
({
"two_same_boot_dev"
:
True
})
set_boot_dev_or_boot_order
(
vmxml
,
**
boot_kwargs
)
...
...
@@ -717,6 +722,11 @@ def run(test, params, env):
if
test_cmd
:
status
,
output
=
remote_session
.
cmd_status_output
(
test_cmd
)
logging
.
debug
(
"CMD '%s' running result is:
\n
%s"
,
test_cmd
,
output
)
if
expected_output
:
if
not
re
.
search
(
expected_output
,
output
):
test
.
fail
(
"Expected '%s' to match '%s'"
" but failed."
%
(
output
,
expected_output
))
if
status
:
test
.
fail
(
"Failed to boot %s from %s"
%
(
vm_name
,
vmxml
.
xml
))
remote_session
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录