Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
97edb72c
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,发现更多精彩内容 >>
未验证
提交
97edb72c
编写于
1月 24, 2018
作者:
X
Xu Han
提交者:
GitHub
1月 24, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1203 from sitoliu/bootorder2
boot_order_check: fix bug
上级
b897e5db
c340eb14
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
28 deletion
+15
-28
qemu/tests/boot_order_check.py
qemu/tests/boot_order_check.py
+15
-26
qemu/tests/cfg/boot_order_check.cfg
qemu/tests/cfg/boot_order_check.cfg
+0
-2
未找到文件。
qemu/tests/boot_order_check.py
浏览文件 @
97edb72c
import
logging
import
re
import
time
from
autotest.client
import
utils
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 Autotest set boot order for multiple NIC and block devices
...
...
@@ -21,7 +20,8 @@ def run(test, params, env):
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment
"""
error
.
context
(
"Boot vm by passing boot order decided"
,
logging
.
info
)
error_context
.
context
(
"Boot vm by passing boot order decided"
,
logging
.
info
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
...
...
@@ -36,11 +36,11 @@ def run(test, params, env):
timeout
=
int
(
params
.
get
(
"login_timeout"
,
240
))
bootorder_type
=
params
.
get
(
"bootorder_type"
)
backspace_char
=
params
.
get
(
"backspace_char"
)
boot_fail_infos
=
params
.
get
(
"boot_fail_infos"
)
bootorder
=
params
.
get
(
"bootorder"
)
nic_addr_filter
=
params
.
get
(
"nic_addr_filter"
)
output
=
None
result
=
None
list_nic_addr
=
[]
# As device id in the last line of info pci output
...
...
@@ -74,25 +74,14 @@ def run(test, params, env):
list_nic_addr
[
1
][
0
],
list_nic_addr
[
2
][
0
])
error
.
context
(
"Check the guest boot result"
,
logging
.
info
)
if
bootorder_type
==
"type2"
:
session_serial
=
vm
.
wait_for_serial_login
(
timeout
=
timeout
)
output
=
vm
.
serial_console
.
get_stripped_output
()
session_serial
.
close
()
else
:
output
=
vm
.
serial_console
.
get_stripped_output
()
utils_misc
.
wait_for
(
lambda
:
re
.
search
(
"No bootable device."
,
output
),
timeout
,
1
)
error_context
.
context
(
"Check the guest boot result"
,
logging
.
info
)
start
=
time
.
time
()
while
True
:
output
=
vm
.
serial_console
.
get_stripped_output
()
# find and replace some ascii characters to non-ascii char,
# like as: '\b' (backspace)
if
backspace_char
:
data
=
re
.
sub
(
r
".%s"
%
backspace_char
,
""
,
output
)
else
:
data
=
output
result
=
re
.
findall
(
boot_fail_infos
,
data
,
re
.
S
|
re
.
M
|
re
.
I
)
result
=
re
.
findall
(
boot_fail_infos
,
output
,
re
.
S
|
re
.
I
)
if
result
or
time
.
time
()
>
start
+
timeout
:
break
time
.
sleep
(
1
)
if
not
result
:
raise
error
.
TestFail
(
"Got a wrong boot order,
"
"Excepted order: '%s'"
%
bootorder
)
test
.
fail
(
"Timeout when try to get expected boot order:
"
"'%s', actual result: '%s'"
%
(
bootorder
,
output
)
)
qemu/tests/cfg/boot_order_check.cfg
浏览文件 @
97edb72c
...
...
@@ -25,8 +25,6 @@
image_size_stg2 = 2G
force_create_image_stg2 = yes
remove_image_stg2 = yes
# Char: '\b' (backspace)
backspace_char = '\x08'
nic_addr_filter = "%s.*?Bus\s+\d+,\s+device\s+(\d+)"
variants:
- bootorder0:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录