Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
d75d39a6
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,发现更多精彩内容 >>
提交
d75d39a6
编写于
12月 29, 2014
作者:
F
Feng Yang
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #207 from FengYang/vlan
qemu.test.vlan: Fix logic error.
上级
3deca7b5
4508dde4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
8 deletion
+12
-8
generic/tests/vlan.py
generic/tests/vlan.py
+12
-8
未找到文件。
generic/tests/vlan.py
浏览文件 @
d75d39a6
...
...
@@ -76,10 +76,8 @@ def run(test, params, env):
err_msg
=
"Unexpected vlan operation command: %s, "
%
cmd_type
err_msg
+=
"only support 'ip' and 'vconfig' now"
raise
error
.
TestError
(
err_msg
)
send_cmd
=
"[ -e /proc/net/vlan/%s ] && %s"
%
(
v_iface
,
rem_vlan_cmd
)
error
.
context
(
"Remove vlan interface '%s'."
%
v_iface
,
logging
.
info
)
return
session
.
cmd_status
(
send
_cmd
)
return
session
.
cmd_status
(
rem_vlan
_cmd
)
def
nc_transfer
(
src
,
dst
):
"""
...
...
@@ -121,8 +119,10 @@ def run(test, params, env):
# does not have the other method to interrupt the process in
# the guest rather than close the session.
"""
error
.
context
(
"Flood ping from %s interface %s to %s"
%
(
vms
[
src
].
name
,
ifname
[
src
],
vlan_ip
[
dst
]),
logging
.
info
)
txt
=
"Flood ping from %s interface %s to %s"
%
(
vms
[
src
].
name
,
ifname
[
src
],
vlan_ip
[
dst
])
error
.
context
(
txt
,
logging
.
info
)
session_flood
=
vms
[
src
].
wait_for_login
(
timeout
=
60
)
utils_test
.
ping
(
vlan_ip
[
dst
],
flood
=
True
,
interface
=
ifname
[
src
],
...
...
@@ -194,7 +194,8 @@ def run(test, params, env):
dest
=
"."
.
join
((
subnet
,
str
(
vlan2
),
ip_unit
[(
vm_index
+
1
)
%
2
]))
status
,
output
=
utils_test
.
ping
(
dest
,
count
=
2
,
interface
=
interface
,
session
=
sessions
[
vm_index
],
interface
=
interface
,
session
=
sessions
[
vm_index
],
timeout
=
30
)
if
((
vlan
==
vlan2
)
^
(
status
==
0
)):
err_msg
=
"%s ping %s unexpected, "
%
(
interface
,
dest
)
...
...
@@ -219,7 +220,10 @@ def run(test, params, env):
error
.
base_context
(
"Remove vlan"
)
for
vm_index
,
vm
in
enumerate
(
vms
):
for
vlan
in
range
(
1
,
vlan_num
+
1
):
rem_vlan
(
sessions
[
vm_index
],
vlan
,
ifname
[
vm_index
],
cmd_type
)
status
=
rem_vlan
(
sessions
[
vm_index
],
vlan
,
ifname
[
vm_index
],
cmd_type
)
if
status
:
logging
.
error
(
"Remove vlan %s failed"
%
vlan
)
# Plumb/unplumb maximal number of vlan interfaces
if
params
.
get
(
"do_maximal_test"
,
"no"
)
==
"yes"
:
...
...
@@ -233,7 +237,7 @@ def run(test, params, env):
raise
error
.
TestFail
(
"Maximal interface plumb test failed"
)
finally
:
for
vlan_index
in
range
(
1
,
vlan_added
+
1
):
if
not
rem_vlan
(
sessions
[
0
],
vlan_index
,
ifname
[
0
],
cmd_type
):
if
rem_vlan
(
sessions
[
0
],
vlan_index
,
ifname
[
0
],
cmd_type
):
logging
.
error
(
"Remove vlan %s failed"
%
vlan_index
)
sessions
.
extend
(
session_ctl
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录