Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
fe12a8b1
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,发现更多精彩内容 >>
未验证
提交
fe12a8b1
编写于
10月 10, 2018
作者:
H
Haotong Chen
提交者:
GitHub
10月 10, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1371 from kimi1978wy/1510750
set_link: fix problem of packets lost during ping on windows guest
上级
ddcbe6c4
b39f88e2
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
40 addition
and
1 deletion
+40
-1
qemu/tests/cfg/set_link.cfg
qemu/tests/cfg/set_link.cfg
+1
-1
qemu/tests/set_link.py
qemu/tests/set_link.py
+39
-0
未找到文件。
qemu/tests/cfg/set_link.cfg
浏览文件 @
fe12a8b1
- set_link: install setup image_copy unattended_install.cdrom
requires_root = yes
type = set_link
test_timeout = 2
0
00
test_timeout = 2
5
00
filesize = 4000
transfer_timeout = 1000
kill_vm =yes
...
...
qemu/tests/set_link.py
浏览文件 @
fe12a8b1
...
...
@@ -140,6 +140,43 @@ def run(test, params, env):
finally
:
session
.
close
()
def
check_interface_ip_routine
(
session
,
mac_addr
):
"""
The routine to check the ip of interface.
:param session: a session to send check commands
:param mac_addr: the interface mac address
"""
ip_addr
=
utils_net
.
get_net_if_addrs_win
(
session
,
mac_addr
)
guest_ipv4
=
ip_addr
[
"ipv4"
]
for
ip
in
guest_ipv4
:
logging
.
debug
(
"Check address: %s"
%
ip
)
if
len
(
ip
)
!=
0
and
not
ip
.
startswith
(
"169.254"
):
return
True
return
False
def
check_interface_ip
(
timeout
=
600
):
"""
Check whether the vm has got the available ip address.
The check will be performed repeatedly until a correct ip address
is detected or after the specified time is expired.
:param timeout: total checking time allowed
"""
error_context
.
context
(
"Start checking guest ip"
,
logging
.
info
)
session
=
vm
.
wait_for_serial_login
()
mac_addr
=
vm
.
get_mac_address
()
try
:
if
not
utils_misc
.
wait_for
(
lambda
:
check_interface_ip_routine
(
session
,
mac_addr
),
timeout
,
step
=
5.0
):
err_msg
=
"Can't get valid ip in %s seconds"
%
timeout
test
.
fail
(
err_msg
)
finally
:
session
.
close
()
def
set_link_test
(
linkid
,
link_up
,
expect_status
,
operstate_always_up
=
False
,
change_queues
=
False
):
"""
...
...
@@ -165,6 +202,8 @@ def run(test, params, env):
expect_status
=
win_media_connected
guest_interface_operstate_check
(
expect_status
,
guest_ifname
,
change_queues
)
if
params
.
get
(
"os_type"
)
==
"windows"
:
check_interface_ip
()
error_context
.
context
(
"Check if guest network connective"
,
logging
.
info
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录