Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
83af6df0
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,发现更多精彩内容 >>
未验证
提交
83af6df0
编写于
10月 17, 2018
作者:
Q
Qianqian Zhu
提交者:
GitHub
10月 17, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1230 from xiywang/flow_caches_stress_test
flow_caches_stress_test: fix subcase no_multi_queues on RHEL guest
上级
aec6656f
d889903d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
62 addition
and
52 deletion
+62
-52
qemu/tests/cfg/flow_caches_stress_test.cfg
qemu/tests/cfg/flow_caches_stress_test.cfg
+4
-4
qemu/tests/flow_caches_stress_test.py
qemu/tests/flow_caches_stress_test.py
+58
-48
未找到文件。
qemu/tests/cfg/flow_caches_stress_test.cfg
浏览文件 @
83af6df0
- flow_caches_stress_test:
no Windows
type = flow_caches_stress_test
image_snapshot = yes
hostpasswd = redhat
...
...
@@ -15,14 +16,13 @@
netperf_timeout = 600
compile_option_server = --enable-burst
compile_option_client = --enable-burst
server_shell_client = ssh
server_shell_port = 22
nf_conntrack_max_set = "echo 0 > /proc/sys/net/nf_conntrack_max"
#test_protocols = TCP_STREAM
variants:
- multi_queues:
no Host_RHEL.m5, Host_RHEL.m6
no Windows
queues = 4
- no_multi_queues:
queues = 1
Windows:
win_netperf_link = "c:\"
server_path = "c:\"
qemu/tests/flow_caches_stress_test.py
浏览文件 @
83af6df0
...
...
@@ -15,7 +15,7 @@ from virttest import utils_test
@
error_context
.
context_aware
def
run
(
test
,
params
,
env
):
"""
QEMU flow caches stress test
test
QEMU flow caches stress test
case, only for linux
1) Make sure nf_conntrack is disabled in host and guest.
If nf_conntrack is enabled in host, skip this case.
...
...
@@ -32,11 +32,23 @@ def run(test, params, env):
:param params: Dictionary with the test parameters.
:param env: Dictionary with test environment.
"""
def
get_if_queues
(
ifname
):
"""
Query interface queues with 'ethtool -l'
:param ifname: interface name
"""
cmd
=
"ethtool -l %s"
%
ifname
out
=
session
.
cmd_output
(
cmd
)
logging
.
info
(
"%s"
%
out
)
nf_conntrack_max_set_cmd
=
params
.
get
(
"nf_conntrack_max_set"
)
logging
.
info
(
"nf_conntrack_max_set_cmd is %s"
%
nf_conntrack_max_set_cmd
)
msg
=
"Make sure nf_conntrack is disabled in host and guest."
error_context
.
context
(
msg
,
logging
.
info
)
if
"nf_conntrack"
in
process
.
system_output
(
"lsmod"
):
err
=
"nf_conntrack load in host, skip this case"
test
.
cancel
(
err
)
if
str
.
encode
(
"nf_conntrack"
)
in
process
.
system_output
(
"lsmod"
):
process
.
system_output
(
nf_conntrack_max_set_cmd
)
params
[
"start_vm"
]
=
"yes"
error_context
.
context
(
"Boot up guest"
,
logging
.
info
)
...
...
@@ -58,64 +70,53 @@ def run(test, params, env):
session
.
cmd
(
cmd
)
session
=
vm
.
reboot
(
session
,
timeout
=
timeout
)
if
"nf_conntrack"
in
session
.
cmd_output
(
"lsmod"
):
err
=
"Fail to unload nf_conntrack module in guest."
test
.
error
(
err
)
err
=
"nf_conntrack module still running in guest, "
err
+=
"set nf_conntrack_max instead."
error_context
.
context
(
err
,
logging
.
info
)
session
.
cmd
(
nf_conntrack_max_set_cmd
)
netperf_link
=
utils_misc
.
get_path
(
data_dir
.
get_deps_dir
(
"netperf"
),
params
[
"netperf_link"
])
md5sum
=
params
.
get
(
"pkg_md5sum"
)
win_netperf_link
=
params
.
get
(
"win_netperf_link"
)
if
win_netperf_link
:
win_netperf_link
=
utils_misc
.
get_path
(
data_dir
.
get_deps_dir
(
"netperf"
),
win_netperf_link
)
win_netperf_md5sum
=
params
.
get
(
"win_netperf_md5sum"
)
server_path
=
params
.
get
(
"server_path"
,
"/var/tmp/"
)
client_path
=
params
.
get
(
"client_path"
,
"/var/tmp/"
)
win_netperf_path
=
params
.
get
(
"win_netperf_path"
,
"c:
\\
"
)
client_num
=
params
.
get
(
"netperf_client_num"
,
520
)
netperf_timeout
=
int
(
params
.
get
(
"netperf_timeout"
,
600
))
netperf_client_ip
=
vm
.
get_address
()
host_ip
=
utils_net
.
get_host_ip_address
(
params
)
netperf_server_ip
=
params
.
get
(
"netperf_server_ip"
,
host_ip
)
if
int
(
params
.
get
(
"queues"
,
1
))
>
1
and
params
.
get
(
"os_type"
)
==
"linux"
:
error_context
.
context
(
"Enable multi queues support in guest."
,
logging
.
info
)
guest_mac
=
vm
.
get_mac_address
()
ifname
=
utils_net
.
get_linux_ifname
(
session
,
guest_mac
)
get_if_queues
(
ifname
)
try
:
cmd
=
"ethtool -L %s combined %s"
%
(
ifname
,
params
.
get
(
"queues"
))
status
,
out
=
session
.
cmd_status_output
(
cmd
)
except
Exception
:
get_if_queues
(
ifname
)
msg
=
"Fail to enable multi queues support in guest."
msg
+=
"Command %s fail output: %s"
%
(
cmd
,
out
)
test
.
error
(
msg
)
logging
.
info
(
"Command %s set queues succeed"
%
cmd
)
error_context
.
context
(
"Setup netperf in guest"
,
logging
.
info
)
if
params
.
get
(
"os_type"
)
==
"linux"
:
session
.
cmd
(
"iptables -F"
,
ignore_all_errors
=
True
)
g_client_link
=
netperf_link
g_client_path
=
params
.
get
(
"client_path"
,
"/var/tmp/"
)
netperf_client_ip
=
vm
.
get_address
()
username
=
params
.
get
(
"username"
,
"root"
)
password
=
params
.
get
(
"password"
,
"123456"
)
passwd
=
params
.
get
(
"hostpasswd"
,
"123456"
)
client
=
params
.
get
(
"shell_client"
,
"ssh"
)
port
=
params
.
get
(
"shell_port"
,
"22"
)
prompt
=
params
.
get
(
"shell_prompt"
,
r
"^root@.*[\#\$]\s*$|#"
)
linesep
=
params
.
get
(
"shell_linesep"
,
"
\n
"
).
encode
().
decode
(
'unicode_escape'
)
status_test_command
=
params
.
get
(
"status_test_command"
,
"echo $?"
)
compile_option_client
=
params
.
get
(
"compile_option_client"
,
""
)
compile_option_server
=
params
.
get
(
"compile_option_server"
,
""
)
if
int
(
params
.
get
(
"queues"
,
1
))
>
1
and
params
.
get
(
"os_type"
)
==
"linux"
:
error_context
.
context
(
"Enable multi queues support in guest."
,
logging
.
info
)
guest_mac
=
vm
.
get_mac_address
()
ifname
=
utils_net
.
get_linux_ifname
(
session
,
guest_mac
)
cmd
=
"ethtool -L %s combined %s"
%
(
ifname
,
params
.
get
(
"queues"
))
status
,
out
=
session
.
cmd_status_output
(
cmd
)
msg
=
"Fail to enable multi queues support in guest."
msg
+=
"Command %s fail output: %s"
%
(
cmd
,
out
)
test
.
error
(
msg
)
if
params
.
get
(
"os_type"
)
==
"linux"
:
session
.
cmd
(
"iptables -F"
,
ignore_all_errors
=
True
)
g_client_link
=
netperf_link
g_client_path
=
client_path
g_md5sum
=
md5sum
elif
params
.
get
(
"os_type"
)
==
"windows"
:
g_client_link
=
win_netperf_link
g_client_path
=
win_netperf_path
g_md5sum
=
win_netperf_md5sum
error_context
.
context
(
"Setup netperf in guest and host"
,
logging
.
info
)
netperf_client
=
utils_netperf
.
NetperfClient
(
netperf_client_ip
,
g_client_path
,
g_md5sum
,
g_client_link
,
md5sum
,
g_client_link
,
client
,
port
,
username
=
username
,
password
=
password
,
prompt
=
prompt
,
...
...
@@ -123,12 +124,21 @@ def run(test, params, env):
status_test_command
=
status_test_command
,
compile_option
=
compile_option_client
)
netperf_server
=
utils_netperf
.
NetperfServer
(
netperf_server_ip
,
error_context
.
context
(
"Setup netperf in host"
,
logging
.
info
)
host_ip
=
utils_net
.
get_host_ip_address
(
params
)
server_path
=
params
.
get
(
"server_path"
,
"/var/tmp/"
)
server_shell_client
=
params
.
get
(
"server_shell_client"
,
"ssh"
)
server_shell_port
=
params
.
get
(
"server_shell_port"
,
"22"
)
server_passwd
=
params
[
"hostpasswd"
]
server_username
=
params
.
get
(
"host_username"
,
"root"
)
compile_option_server
=
params
.
get
(
"compile_option_server"
,
""
)
netperf_server
=
utils_netperf
.
NetperfServer
(
host_ip
,
server_path
,
md5sum
,
netperf_link
,
client
,
port
,
password
=
passwd
,
server_shell_client
,
server_shell_port
,
username
=
server_username
,
password
=
server_passwd
,
prompt
=
prompt
,
linesep
=
linesep
,
status_test_command
=
status_test_command
,
...
...
@@ -141,7 +151,7 @@ def run(test, params, env):
error_context
.
context
(
"Start Netperf in guest for %ss."
%
netperf_timeout
,
logging
.
info
)
test_option
=
"-t TCP_CRR -l %s -- -b 10 -D"
%
netperf_timeout
netperf_client
.
bg_start
(
netperf_server
_ip
,
test_option
,
client_num
)
netperf_client
.
bg_start
(
host
_ip
,
test_option
,
client_num
)
utils_misc
.
wait_for
(
lambda
:
not
netperf_client
.
is_netperf_running
(),
timeout
=
netperf_timeout
,
first
=
590
,
step
=
2
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录