Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
266de2bc
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,发现更多精彩内容 >>
提交
266de2bc
编写于
8月 28, 2014
作者:
Y
Yiqiao Pu
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #81 from FengYang/flow_caches_stress_test
qemu.tests: Add flow_caches_stress_test new test case
上级
d7abde4f
3d8e8d09
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
163 addition
and
0 deletion
+163
-0
qemu/tests/cfg/flow_caches_stress_test.cfg
qemu/tests/cfg/flow_caches_stress_test.cfg
+28
-0
qemu/tests/flow_caches_stress_test.py
qemu/tests/flow_caches_stress_test.py
+135
-0
未找到文件。
qemu/tests/cfg/flow_caches_stress_test.cfg
0 → 100644
浏览文件 @
266de2bc
- flow_caches_stress_test:
type = flow_caches_stress_test
image_snapshot = yes
hostpasswd = redhat
start_vm = no
#netperf server is main vm, the netperf client is the host or another vm
#Set the netperf client via dsthost
netperf_link = netperf-2.6.0.tar.bz2
server_path = /var/tmp/
client_path = /var/tmp/
filesize = 4000
transfer_timeout = 1000
netperf_timeout = 600
#test_protocol = TCP_STREAM
variants:
- vhost_on:
vhost=on
- vhost_off:
vhost=off
variants:
- multi_queues:
no Windows
queues = 4
- no_multi_queues:
queues = 1
Windows:
win_netperf_link = "c:\"
server_path = "c:\"
qemu/tests/flow_caches_stress_test.py
0 → 100644
浏览文件 @
266de2bc
import
logging
import
time
from
autotest.client
import
utils
from
autotest.client.shared
import
error
from
virttest
import
utils_netperf
,
utils_net
,
env_process
,
utils_misc
from
virttest
import
data_dir
,
utils_test
# This decorator makes the test function aware of context strings
@
error
.
context_aware
def
run
(
test
,
params
,
env
):
"""
QEMU flow caches stress test test
1) Make sure nf_conntrack is disabled in host and guest.
If nf_conntrack is enabled in host, skip this case.
2) Boot guest with vhost=on/off.
3) Enable multi queues support in guest (optional).
4) After installation of netperf, run netserver in host.
5) Run netperf TCP_CRR protocal test in guest.
6) Transfer file between guest and host.
7) Check the md5 of copied file.
This is a sample QEMU test, so people can get used to some of the test APIs.
:param test: QEMU test object.
:param params: Dictionary with the test parameters.
:param env: Dictionary with test environment.
"""
msg
=
"Make sure nf_conntrack is disabled in host and guest."
error
.
context
(
msg
,
logging
.
info
)
if
"nf_conntrack"
in
utils
.
system_output
(
"lsmod"
):
err
=
"nf_conntrack load in host, skip this case"
raise
error
.
TestNAError
(
err
)
params
[
"start_vm"
]
=
"yes"
error
.
context
(
"Boot up guest"
,
logging
.
info
)
env_process
.
preprocess_vm
(
test
,
params
,
env
,
params
[
"main_vm"
])
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
timeout
=
int
(
params
.
get
(
"login_timeout"
,
360
))
session
=
vm
.
wait_for_login
(
timeout
=
timeout
)
if
"nf_conntrack"
in
session
.
cmd_output
(
"lsmod"
):
msg
=
"Unload nf_conntrack module in guest."
error
.
context
(
msg
,
logging
.
info
)
black_str
=
"#disable nf_conntrack
\n
blacklist nf_conntrack
\n
"
\
"blacklist nf_conntrack_ipv6
\n
blacklist xt_conntrack
\n
"
\
"blacklist nf_conntrack_ftp
\n
blacklist xt_state
\n
"
\
"blacklist iptable_nat
\n
blacklist ipt_REDIRECT
\n
"
\
"blacklist nf_nat
\n
blacklist nf_conntrack_ipv4"
cmd
=
"echo -e '%s' >> /etc/modprobe.d/blacklist.conf"
%
black_str
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."
error
.
TestError
(
err
)
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
=
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
)
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"
)
if
int
(
params
.
get
(
"queues"
,
1
))
>
1
and
params
.
get
(
"os_type"
)
==
"linux"
:
error
.
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
)
error
.
TestError
(
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
(
"Setup netperf in guest and host"
,
logging
.
info
)
netperf_client
=
utils_netperf
.
NetperfClient
(
netperf_client_ip
,
g_client_path
,
g_md5sum
,
g_client_link
,
username
=
username
,
password
=
password
,
compile_option
=
"--enable-burst"
)
netperf_server
=
utils_netperf
.
NetperfServer
(
netperf_server_ip
,
server_path
,
md5sum
,
netperf_link
,
client
,
port
,
password
=
passwd
,
compile_option
=
"--enable-burst"
)
try
:
error
.
base_context
(
"Run netperf test between host and guest."
)
error
.
context
(
"Start netserver in host."
,
logging
.
info
)
netperf_server
.
start
()
error
.
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
)
utils_misc
.
wait_for
(
lambda
:
not
netperf_client
.
is_netperf_running
(),
timeout
=
netperf_timeout
,
first
=
590
,
step
=
2
)
utils_test
.
run_file_transfer
(
test
,
params
,
env
)
finally
:
netperf_server
.
stop
()
netperf_client
.
package
.
env_cleanup
(
True
)
if
session
:
session
.
close
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录