Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
16b5e437
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,发现更多精彩内容 >>
提交
16b5e437
编写于
5月 09, 2014
作者:
F
Feng Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu.tests: Add boot_with_different_vectors test case and script.
Signed-off-by:
N
Feng Yang
<
fyang@redhat.com
>
上级
7cb4877b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
141 addition
and
0 deletion
+141
-0
qemu/tests/boot_with_different_vectors.py
qemu/tests/boot_with_different_vectors.py
+122
-0
qemu/tests/cfg/boot_with_different_vectors.cfg
qemu/tests/cfg/boot_with_different_vectors.cfg
+19
-0
未找到文件。
qemu/tests/boot_with_different_vectors.py
0 → 100644
浏览文件 @
16b5e437
import
logging
import
re
from
autotest.client
import
utils
from
autotest.client.shared
import
error
from
virttest
import
utils_net
,
utils_test
,
utils_misc
,
env_process
,
virt_vm
@
error
.
context_aware
def
run
(
test
,
params
,
env
):
"""
Boot guest with different vectors, then do netperf testing.
1) Boot up VM with vectors.
2) Enable multi queues in guest.
3) Check guest pci msi support.
4) Check the cpu interrupt of virito driver.
5) Run netperf test in guest.
6) Repeat step 1 ~ step 5 with different vectors.
:param test: QEMU test object.
:param params: Dictionary with the test parameters.
:param env: Dictionary with test environment.
"""
def
boot_guest_with_vectors
(
vectors
):
error
.
context
(
"Boot guest with vectors = %s"
%
vectors
,
logging
.
info
)
params
[
"vectors"
]
=
vectors
params
[
"start_vm"
]
=
"yes"
try
:
env_process
.
preprocess_vm
(
test
,
params
,
env
,
params
.
get
(
"main_vm"
))
except
virt_vm
.
VMStartError
,
err
:
if
int
(
vectors
)
<
0
:
txt
=
"Parameter 'vectors' expects uint32_t"
if
re
.
findall
(
txt
,
str
(
err
)):
return
if
int
(
vectors
)
<
0
:
msg
=
"Qemu did not raise correct error"
msg
+=
" when vectors = %s"
%
vectors
raise
error
.
TestFail
(
msg
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
return
vm
def
enable_multi_queues
(
vm
):
session
=
vm
.
wait_for_login
(
timeout
=
login_timeout
)
error
.
context
(
"Enable multi queues in guest."
,
logging
.
info
)
for
nic_index
,
nic
in
enumerate
(
vm
.
virtnet
):
ifname
=
utils_net
.
get_linux_ifname
(
session
,
nic
.
mac
)
queues
=
int
(
nic
.
queues
)
mq_set_cmd
=
"ethtool -L %s combined %d"
%
(
ifname
,
queues
)
status
,
output
=
session
.
cmd_status_output
(
mq_set_cmd
)
if
status
:
msg
=
"Fail to enable multi queue in guest."
msg
+=
"Command %s, fail with output %s"
%
(
mq_set_cmd
,
output
)
error
.
TestError
(
msg
)
def
check_msi_support
(
session
):
devices
=
session
.
cmd_output
(
"lspci |grep Eth"
).
strip
()
vectors
=
params
[
"vectors"
]
error
.
context
(
"Check if vnic inside guest support msi."
,
logging
.
info
)
for
device
in
devices
.
split
(
"
\n
"
):
if
not
device
:
continue
d_id
=
device
.
split
()[
0
]
msi_check_cmd
=
"lspci -vvv -s %s |grep MSI"
%
d_id
output
=
session
.
cmd_output
(
msi_check_cmd
)
if
vectors
==
0
and
output
:
error
.
TestFail
(
"Guest do not support msi when vectors = 0."
)
if
output
:
if
vectors
==
1
:
if
"MSI-X: Enable-"
in
output
:
logging
.
info
(
"MSI-X is disabled"
)
else
:
msg
=
"Command %s get wrong output."
%
msi_check_cmd
msg
+=
" when vectors = 1"
error
.
TestFail
(
msg
)
else
:
if
"MSI-X: Enable+"
in
output
:
logging
.
info
(
"MSI-X is enabled"
)
else
:
msg
=
"Command %s get wrong output."
%
msi_check_cmd
msg
+=
" when vectors = %s"
%
vectors
error
.
TestFail
(
msg
)
def
check_interrupt
(
session
,
vectors
):
error
.
context
(
"Check the cpu interrupt of virito"
,
logging
.
info
)
cmd
=
"cat /proc/interrupts |grep virtio"
output
=
session
.
cmd_output
(
cmd
)
vectors
=
int
(
vectors
)
if
vectors
==
0
or
vectors
==
1
:
if
"IO-APIC-fasteoi"
not
in
output
:
msg
=
"Could not find IO-APIC-fasteoi interrupt"
msg
+=
" when vectors = %s"
%
vectors
error
.
TestFail
(
msg
)
elif
2
<=
vectors
and
vectors
<=
8
:
if
not
re
.
findall
(
"vritio[0-9]-virtqueues"
,
output
):
msg
=
"Could not find the device for msi interrupt "
msg
+=
"when vectors = %s "
%
vectors
msg
+=
"Command %s got output %s"
%
(
cmd
,
output
)
error
.
TestFail
(
msg
)
elif
vectors
==
9
or
vectors
==
10
:
if
not
(
re
.
findall
(
"virtio[0-9]-input"
,
output
)
and
re
.
findall
(
"virtio[0-9]-output"
,
output
)):
msg
=
"Could not find the device for msi interrupt "
msg
+=
"when vectors = %s "
%
vectors
msg
+=
"Command %s got output %s"
%
(
cmd
,
output
)
error
.
TestFail
(
msg
)
vectors_list
=
params
[
"vectors_list"
]
login_timeout
=
int
(
params
.
get
(
"login_timeout"
,
360
))
sub_test
=
params
.
get
(
"sub_test_name"
,
"netperf_stress"
)
for
vectors
in
vectors_list
.
split
():
vm
=
boot_guest_with_vectors
(
vectors
)
if
int
(
vectors
)
<
0
:
continue
session
=
vm
.
wait_for_login
(
timeout
=
login_timeout
)
enable_multi_queues
(
vm
)
check_msi_support
(
session
)
check_interrupt
(
session
,
vectors
)
error
.
context
(
"Run netperf test in guest."
,
logging
.
info
)
utils_test
.
run_virt_sub_test
(
test
,
params
,
env
,
sub_type
=
sub_test
)
qemu/tests/cfg/boot_with_different_vectors.cfg
0 → 100644
浏览文件 @
16b5e437
- boot_with_different_vectors:
only Linux
only virtio_net
no RHEL.3 RHEL.4 RHEL.5 RHEL.6
queues = 4
vectors_list = 0 1 2 3 4 5 6 7 8 9 10 11 -1
type = boot_with_different_vectors
start_vm = no
image_snapshot = yes
hostpassword = redhat
netperf_client = ${vms}
netperf_server = localhost
netperf_link = netperf-2.6.0.tar.bz2
server_path = /var/tmp/
client_path = /var/tmp/
netperf_test_duration = 300
netperf_para_sessions = 6
test_protocol = TCP_STREAM
enable_msix_vectors = yes
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录