Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
d9bf87b9
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,发现更多精彩内容 >>
未验证
提交
d9bf87b9
编写于
4月 02, 2018
作者:
X
Xu Han
提交者:
GitHub
4月 02, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1135 from xiangchunfu/seabios_boot_list
testcase:boot_menu_list is NULL
上级
8c0c8a80
6515ed48
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
23 deletion
+22
-23
qemu/tests/seabios.py
qemu/tests/seabios.py
+22
-23
未找到文件。
qemu/tests/seabios.py
浏览文件 @
d9bf87b9
import
re
import
logging
from
autotest.client.shared
import
error
from
virttest
import
error_context
from
virttest
import
utils_misc
@
error
.
context_aware
@
error
_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
KVM Seabios test:
...
...
@@ -34,7 +34,7 @@ def run(test, params, env):
return
(
len
(
re
.
findall
(
boot_menu_hint
,
get_output
(
seabios_session
)))
>
1
)
error
.
context
(
"Start guest with sga bios"
)
error
_context
.
context
(
"Start guest with sga bios"
,
logging
.
info
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
# Since the seabios is displayed in the beginning of guest boot,
# booting guest here so that we can check all of sgabios/seabios
...
...
@@ -51,7 +51,7 @@ def run(test, params, env):
seabios_session
=
vm
.
logsessions
[
'seabios'
]
if
sgabios_info
:
error
.
context
(
"Display and check the SGABIOS info"
,
logging
.
info
)
error
_context
.
context
(
"Display and check the SGABIOS info"
,
logging
.
info
)
def
info_check
():
return
re
.
search
(
sgabios_info
,
...
...
@@ -60,13 +60,13 @@ def run(test, params, env):
if
not
utils_misc
.
wait_for
(
info_check
,
timeout
,
1
):
err_msg
=
"Cound not get sgabios message. The output"
err_msg
+=
" is %s"
%
get_output
(
vm
.
serial_console
)
raise
error
.
TestF
ail
(
err_msg
)
test
.
f
ail
(
err_msg
)
if
restart_key
:
error
.
context
(
"Restart vm and check it's ok"
,
logging
.
info
)
if
not
(
boot_menu_hint
and
utils_misc
.
wait_for
(
boot_menu
,
timeout
,
1
))
:
test
.
fail
(
"Could not get boot menu message."
)
if
not
(
boot_menu_hint
and
utils_misc
.
wait_for
(
boot_menu
,
timeout
,
1
))
:
raise
error
.
TestFail
(
"Could not get boot menu message."
)
if
restart_key
:
error_context
.
context
(
"Restart vm and check it's ok"
,
logging
.
info
)
seabios_text
=
get_output
(
seabios_session
)
headline
=
seabios_text
.
split
(
"
\n
"
)[
0
]
+
"
\n
"
...
...
@@ -74,21 +74,20 @@ def run(test, params, env):
vm
.
send_key
(
restart_key
)
if
not
(
boot_menu_hint
and
utils_misc
.
wait_for
(
boot_menu
,
timeout
,
1
)):
test
.
fail
(
"Could not get boot menu message after rebooting"
)
# Send boot menu key in monitor.
vm
.
send_key
(
boot_menu_key
)
def
reboot_check
():
return
get_output
(
seabios_session
).
count
(
headline
)
>
headline_count
if
not
utils_misc
.
wait_for
(
reboot_check
,
timeout
,
1
):
raise
error
.
TestF
ail
(
"Could not restart the vm"
)
test
.
f
ail
(
"Could not restart the vm"
)
utils_misc
.
wait_for
(
boot_menu_check
,
timeout
,
1
)
error
.
context
(
"Display and check the boot menu order"
,
logging
.
info
)
if
not
(
boot_menu_hint
and
utils_misc
.
wait_for
(
boot_menu
,
timeout
,
1
)):
raise
error
.
TestFail
(
"Could not get boot menu message."
)
# Send boot menu key in monitor.
vm
.
send_key
(
boot_menu_key
)
error_context
.
context
(
"Display and check the boot menu order"
,
logging
.
info
)
def
get_list
():
return
re
.
findall
(
"^\d+\. (.*)\s"
,
get_output
(
seabios_session
),
re
.
M
)
...
...
@@ -96,19 +95,19 @@ def run(test, params, env):
boot_list
=
utils_misc
.
wait_for
(
get_list
,
timeout
,
1
)
if
not
boot_list
:
raise
error
.
TestF
ail
(
"Could not get boot entries list."
)
test
.
f
ail
(
"Could not get boot entries list."
)
logging
.
info
(
"Got boot menu entries: '%s'"
,
boot_list
)
for
i
,
v
in
enumerate
(
boot_list
,
start
=
1
):
if
re
.
search
(
boot_device
,
v
,
re
.
I
):
error
.
context
(
"Start guest from boot entry '%s'"
%
v
,
logging
.
info
)
error
_context
.
context
(
"Start guest from boot entry '%s'"
%
v
,
logging
.
info
)
vm
.
send_key
(
str
(
i
))
break
else
:
raise
error
.
TestF
ail
(
"Could not get any boot entry match "
"pattern '%s'"
%
boot_device
)
test
.
f
ail
(
"Could not get any boot entry match "
"pattern '%s'"
%
boot_device
)
error
.
context
(
"Log into the guest to verify it's up"
)
error
_context
.
context
(
"Log into the guest to verify it's up"
)
session
=
vm
.
wait_for_login
(
timeout
=
timeout
)
session
.
close
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录