Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
610c0a4a
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,发现更多精彩内容 >>
提交
610c0a4a
编写于
8月 01, 2016
作者:
X
Xu Tian
提交者:
GitHub
8月 01, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #702 from pingl2016/1234303
multi_vms_nic: fix packet lose during command ping.
上级
61b0065f
d11ae285
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
61 addition
and
3 deletion
+61
-3
qemu/tests/cfg/multi_vms_nic.cfg
qemu/tests/cfg/multi_vms_nic.cfg
+6
-0
qemu/tests/multi_vms_nics.py
qemu/tests/multi_vms_nics.py
+55
-3
未找到文件。
qemu/tests/cfg/multi_vms_nic.cfg
浏览文件 @
610c0a4a
...
@@ -11,8 +11,14 @@
...
@@ -11,8 +11,14 @@
type = multi_vms_nics
type = multi_vms_nics
ping_counts = 10
ping_counts = 10
file_create_cmd = "dd if=/dev/urandom of=/tmp/1 bs=100M count=1"
file_create_cmd = "dd if=/dev/urandom of=/tmp/1 bs=100M count=1"
check_irqbalance_cmd = "service irqbalance status"
stop_irqbalance_cmd = "service irqbalance stop"
start_irqbalance_cmd = "service irqbalance start"
status_irqbalance = "Active: active|running"
# We can test multi nics in multi vms by setting nics.
# We can test multi nics in multi vms by setting nics.
#nics += " nic2"
#nics += " nic2"
kill_vm_before_test = yes
start_vm = no
vms = "vm1 vm2 vm3 vm4"
vms = "vm1 vm2 vm3 vm4"
image_snapshot = yes
image_snapshot = yes
# Set packet size used in ping test, we can test different packet size
# Set packet size used in ping test, we can test different packet size
...
...
qemu/tests/multi_vms_nics.py
浏览文件 @
610c0a4a
import
logging
import
logging
import
re
from
autotest.client.shared
import
error
from
autotest.client.shared
import
error
from
virttest
import
utils_test
from
virttest
import
utils_test
from
virttest
import
remote
from
virttest
import
remote
from
virttest
import
utils_net
from
virttest
import
utils_net
from
virttest
import
utils_misc
from
virttest
import
env_process
from
avocado.utils
import
process
from
virttest.staging
import
utils_memory
@
error
.
context_aware
@
error
.
context_aware
...
@@ -43,8 +48,8 @@ def run(test, params, env):
...
@@ -43,8 +48,8 @@ def run(test, params, env):
for
size
in
packet_size
:
for
size
in
packet_size
:
error
.
context
(
"Ping with packet size %s"
%
size
,
logging
.
info
)
error
.
context
(
"Ping with packet size %s"
%
size
,
logging
.
info
)
status
,
output
=
utils_test
.
ping
(
dst_ip
,
10
,
interface
=
nic
,
status
,
output
=
utils_test
.
ping
(
dst_ip
,
10
,
interface
=
nic
,
packetsize
=
size
,
packetsize
=
size
,
timeout
=
30
,
timeout
=
30
,
session
=
session
)
session
=
session
)
if
strict_check
:
if
strict_check
:
ratio
=
utils_test
.
get_loss_ratio
(
output
)
ratio
=
utils_test
.
get_loss_ratio
(
output
)
if
ratio
!=
0
:
if
ratio
!=
0
:
...
@@ -113,18 +118,51 @@ def run(test, params, env):
...
@@ -113,18 +118,51 @@ def run(test, params, env):
raise
error
.
TestError
(
"File changed after transfer"
)
raise
error
.
TestError
(
"File changed after transfer"
)
nic_interface_list
=
[]
nic_interface_list
=
[]
check_irqbalance_cmd
=
params
.
get
(
"check_irqbalance_cmd"
)
stop_irqbalance_cmd
=
params
.
get
(
"stop_irqbalance_cmd"
)
start_irqbalance_cmd
=
params
.
get
(
"start_irqbalance_cmd"
)
status_irqbalance
=
params
.
get
(
"status_irqbalance"
)
vms
=
params
[
"vms"
].
split
()
vms
=
params
[
"vms"
].
split
()
host_mem
=
utils_memory
.
memtotal
()
/
(
1024
*
1024
)
host_cpu_count
=
len
(
utils_misc
.
get_cpu_processors
())
vhost_count
=
0
if
params
.
get
(
"vhost"
):
vhost_count
=
1
if
host_cpu_count
<
(
1
+
vhost_count
)
*
len
(
vms
):
raise
error
.
TestError
(
"The host don't have enough cpus to start guest"
"pcus: %d, minimum of vcpus and vhost: %d"
%
(
host_cpu_count
,
(
1
+
vhost_count
)
*
len
(
vms
)))
params
[
'mem'
]
=
host_mem
/
len
(
vms
)
*
1024
params
[
'smp'
]
=
host_cpu_count
/
len
(
vms
)
-
vhost_count
if
params
[
'smp'
]
%
2
!=
0
:
params
[
'vcpu_sockets'
]
=
1
params
[
"start_vm"
]
=
"yes"
for
vm_name
in
vms
:
env_process
.
preprocess_vm
(
test
,
params
,
env
,
vm_name
)
timeout
=
float
(
params
.
get
(
"login_timeout"
,
360
))
timeout
=
float
(
params
.
get
(
"login_timeout"
,
360
))
strict_check
=
params
.
get
(
"strick_check"
,
"no"
)
strict_check
=
params
.
get
(
"strick_check"
,
"no"
)
host_ip
=
utils_net
.
get_ip_address_by_interface
(
params
.
get
(
"netdst"
))
host_ip
=
utils_net
.
get_ip_address_by_interface
(
params
.
get
(
"netdst"
))
host_ip
=
params
.
get
(
"srchost"
,
host_ip
)
host_ip
=
params
.
get
(
"srchost"
,
host_ip
)
flood_minutes
=
float
(
params
[
"flood_minutes"
])
flood_minutes
=
float
(
params
[
"flood_minutes"
])
error
.
context
(
"Check irqbalance service status"
,
logging
.
info
)
o
=
process
.
system_output
(
check_irqbalance_cmd
,
ignore_status
=
True
)
check_stop_irqbalance
=
False
if
re
.
findall
(
status_irqbalance
,
o
):
logging
.
debug
(
"stop irqbalance"
)
process
.
run
(
stop_irqbalance_cmd
)
check_stop_irqbalance
=
True
o
=
process
.
system_output
(
check_irqbalance_cmd
,
ignore_status
=
True
)
if
re
.
findall
(
status_irqbalance
,
o
):
raise
error
.
TestError
(
"Can not stop irqbalance"
)
thread_list
=
[]
nic_interface
=
[]
nic_interface
=
[]
for
vm_name
in
vms
:
for
vm_name
in
vms
:
guest_ifname
=
""
guest_ifname
=
""
guest_ip
=
""
guest_ip
=
""
vm
=
env
.
get_vm
(
vm_name
)
vm
=
env
.
get_vm
(
vm_name
)
session
=
vm
.
wait_for_serial_login
(
timeout
=
timeout
)
session
=
vm
.
wait_for_login
(
timeout
=
timeout
)
thread_list
.
extend
(
vm
.
vcpu_threads
)
thread_list
.
extend
(
vm
.
vhost_threads
)
error
.
context
(
"Check all the nics available or not"
,
logging
.
info
)
error
.
context
(
"Check all the nics available or not"
,
logging
.
info
)
for
index
,
nic
in
enumerate
(
vm
.
virtnet
):
for
index
,
nic
in
enumerate
(
vm
.
virtnet
):
guest_ifname
=
utils_net
.
get_linux_ifname
(
session
,
nic
.
mac
)
guest_ifname
=
utils_net
.
get_linux_ifname
(
session
,
nic
.
mac
)
...
@@ -135,6 +173,18 @@ def run(test, params, env):
...
@@ -135,6 +173,18 @@ def run(test, params, env):
raise
error
.
TestFail
(
err_log
)
raise
error
.
TestFail
(
err_log
)
nic_interface
=
[
guest_ifname
,
guest_ip
,
session
]
nic_interface
=
[
guest_ifname
,
guest_ip
,
session
]
nic_interface_list
.
append
(
nic_interface
)
nic_interface_list
.
append
(
nic_interface
)
error
.
context
(
"Pin vcpus and vhosts to host cpus"
,
logging
.
info
)
host_numa_nodes
=
utils_misc
.
NumaInfo
()
vthread_num
=
0
for
numa_node_id
in
host_numa_nodes
.
nodes
:
numa_node
=
host_numa_nodes
.
nodes
[
numa_node_id
]
for
_
in
range
(
len
(
numa_node
.
cpus
)):
if
vthread_num
>=
len
(
thread_list
):
break
vcpu_tid
=
thread_list
[
vthread_num
]
logging
.
debug
(
"pin vcpu/vhost thread(%s) to cpu(%s)"
%
(
vcpu_tid
,
numa_node
.
pin_cpu
(
vcpu_tid
)))
vthread_num
+=
1
nic_interface_list_len
=
len
(
nic_interface_list
)
nic_interface_list_len
=
len
(
nic_interface_list
)
# ping and file transfer test
# ping and file transfer test
...
@@ -155,3 +205,5 @@ def run(test, params, env):
...
@@ -155,3 +205,5 @@ def run(test, params, env):
txt
+=
"and %s"
%
dst_ip
[
1
]
txt
+=
"and %s"
%
dst_ip
[
1
]
error
.
context
(
txt
,
logging
.
info
)
error
.
context
(
txt
,
logging
.
info
)
file_transfer
(
src_ip_info
[
2
],
src_ip_info
[
1
],
dst_ip
[
1
])
file_transfer
(
src_ip_info
[
2
],
src_ip_info
[
1
],
dst_ip
[
1
])
if
check_stop_irqbalance
:
process
.
run
(
start_irqbalance_cmd
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录