Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
c4c943f8
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,发现更多精彩内容 >>
未验证
提交
c4c943f8
编写于
8月 11, 2020
作者:
Q
Qianqian Zhu
提交者:
GitHub
8月 11, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2332 from leidwang/uefi_check_boot_option
new case:Verify Boot Option Support under UEFI environment
上级
e0a56968
a1367811
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
102 addition
and
0 deletion
+102
-0
qemu/tests/cfg/uefi_check_boot_option.cfg
qemu/tests/cfg/uefi_check_boot_option.cfg
+35
-0
qemu/tests/uefi_check_boot_option.py
qemu/tests/uefi_check_boot_option.py
+67
-0
未找到文件。
qemu/tests/cfg/uefi_check_boot_option.cfg
0 → 100644
浏览文件 @
c4c943f8
- uefi_check_boot_option:
only q35
only ovmf
type = uefi_check_boot_option
start_vm = no
boot_menu = on
del boot_once
del boot_order
del boot_strict
splash_time_pattern = "SetVariable\(Timeout,\s%d\)"
variants:
- splash_time_10:
boot_splash_time = 10000
- splash_time_12:
boot_splash_time = 12000
- bootindex:
cdroms = "test"
cdrom_test = "/tmp/test.iso"
cd_format_test = ahci
images = "stg"
image_name_stg = "images/stg"
image_size_stg = 100M
force_create_image_stg = yes
remove_image_stg = yes
drive_format_stg = scsi-hd
image_boot = no
variants:
- hard_disk:
bootindex_stg = 0
bootindex_test = 1
boot_entry_info = "Booting UEFI QEMU QEMU HARDDISK"
- cd_rom:
bootindex_stg = 1
bootindex_test = 0
boot_entry_info = "Booting UEFI QEMU DVD-ROM"
qemu/tests/uefi_check_boot_option.py
0 → 100644
浏览文件 @
c4c943f8
import
re
import
os
import
logging
from
avocado.utils
import
process
from
virttest
import
utils_misc
from
virttest
import
env_process
from
virttest
import
error_context
@
error_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Verify UEFI config setting in the GUI screen:
1) Boot up a guest.
2) If boot_splash_time not None, check splash-time in log output
3) If check_boot_info not None, check boot entry info in log output
:param test: QEMU test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
def
info_check
(
info
):
"""
Check log info
"""
logs
=
vm
.
logsessions
[
'seabios'
].
get_output
()
result
=
re
.
search
(
info
,
logs
,
re
.
S
)
return
result
def
create_cdroms
(
cdrom_test
):
"""
Create 'test' cdrom with one file on it
"""
logging
.
info
(
"creating test cdrom"
)
process
.
run
(
"dd if=/dev/urandom of=test bs=10M count=1"
)
process
.
run
(
"mkisofs -o %s test"
%
cdrom_test
)
process
.
run
(
"rm -f test"
)
boot_splash_time
=
params
.
get
(
"boot_splash_time"
)
check_boot_info
=
params
.
get
(
"boot_entry_info"
)
timeout
=
int
(
params
.
get
(
"check_timeout"
,
360
))
cdrom_test
=
params
.
get
(
"cdrom_test"
)
if
cdrom_test
:
create_cdroms
(
cdrom_test
)
params
[
"start_vm"
]
=
"yes"
env_process
.
process
(
test
,
params
,
env
,
env_process
.
preprocess_image
,
env_process
.
preprocess_vm
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
try
:
if
check_boot_info
:
expect_result
=
check_boot_info
elif
boot_splash_time
:
splash_time_pattern
=
params
.
get
(
"splash_time_pattern"
)
expect_result
=
(
splash_time_pattern
%
(
int
(
boot_splash_time
)
//
1000
))
if
not
utils_misc
.
wait_for
(
lambda
:
info_check
(
expect_result
),
timeout
):
test
.
fail
(
"Does not get expected result from bios log: %s"
%
expect_result
)
finally
:
if
params
.
get
(
"cdroms"
)
==
"test"
:
logging
.
info
(
"cleaning up temp cdrom images"
)
os
.
remove
(
cdrom_test
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录