提交 e0fcaab8 编写于 作者: F Feng Yang

Merge pull request #239 from FengYang/test_protocols

Test protocols
......@@ -56,7 +56,7 @@
client_path = /var/tmp/
netperf_test_duration = 360
netperf_para_sessions = 2
test_protocol = TCP_STREAM
test_protocols = TCP_STREAM
check_cmd = "pidof netserver"
RHEL.4:
netperf_link = netperf-2.4.5.tar.bz2
......
......@@ -25,7 +25,7 @@
bg_sub_test = netperf_stress
bg_stress_run_flag = netperf_run
netperf_para_sessions = 2
test_protocol = TCP_STREAM
test_protocols = TCP_STREAM
Windows:
netperf_server_link_win = "netserver-2.6.0.exe"
netperf_client_link_win = "netperf.exe"
......
......@@ -11,7 +11,7 @@
client_path = /var/tmp/
netperf_test_duration = 600
netperf_para_sessions = 1
test_protocol = TCP_STREAM
test_protocols = TCP_STREAM
netperf_package_sizes = 32 64 128 256 512 1024 2048 4096 8192 16834
Windows:
netperf_server_link_win = "netserver-2.6.0.exe"
......
- ext_host_netperf_stress:
virt_test_type = qemu
type = netperf_stress
image_snapshot = yes
hostpassword = redhat
#netperf client is the vm, the netperf client is the ext_host
netperf_link = netperf-2.6.0.tar.bz2
server_path = /var/tmp/
client_path = /var/tmp/
netperf_test_duration = 120
netperf_para_sessions = 1
netperf_client = ${vms}
# please update netperf_server according to your env.
netperf_server = 192.168.11.21
test_protocols = TCP_RR TCP_CRR UDP_RR TCP_STREAM TCP_MAERTS TCP_SENDFILE UDP_STREAM
Windows:
netperf_server_link_win = "netserver-2.6.0.exe"
netperf_client_link_win = "netperf.exe"
server_path_win = "c:\\"
client_path_win = "c:\\"
RHEL.4:
netperf_link = netperf-2.4.5.tar.bz2
......@@ -15,7 +15,7 @@
netperf_timeout = 600
compile_option_server = --enable-burst
compile_option_client = --enable-burst
#test_protocol = TCP_STREAM
#test_protocols = TCP_STREAM
variants:
- vhost_on:
vhost=on
......
......@@ -53,7 +53,7 @@
pkg_md5sum = 9654ffdfd4c4f2c93ce3733cd9ed9236
netperf_test_timeout = 360
netperf_para_sessions = 6
test_protocol = TCP_STREAM
test_protocols = TCP_STREAM
Windows:
server_download_link = "c:\\netserver-2.6.0.exe"
server_md5sum = 8f107e9df4f501d20cf46cccc426f4a9
......
......@@ -13,7 +13,7 @@
client_path = /var/tmp/
netperf_test_duration = 600
netperf_para_sessions = 1
test_protocol = TCP_STREAM
test_protocols = TCP_STREAM
Windows:
netperf_server_link_win = "netserver-2.6.0.exe"
netperf_client_link_win = "netperf.exe"
......
......@@ -10,7 +10,7 @@
client_path = /var/tmp/
netperf_test_duration = 120
netperf_para_sessions = 1
test_protocol = TCP_STREAM
test_protocols = TCP_STREAM
Windows:
netperf_server_link_win = "netserver-2.6.0.exe"
netperf_client_link_win = "netperf.exe"
......@@ -28,16 +28,16 @@
netperf_server = localhost
variants:
- TCP_STREAM:
test_protocol= TCP_STREAM
test_protocols = TCP_STREAM
- TCP_RR:
test_protocol= TCP_RR
test_protocols = TCP_RR
- TCP_CRR:
test_protocol= TCP_CRR
test_protocols = TCP_CRR
- TCP_MAERTS:
test_protocol= TCP_MAERTS
test_protocols = TCP_MAERTS
- TCP_SENDFILE:
test_protocol= TCP_SENDFILE
test_protocols = TCP_SENDFILE
- UDP_STREAM:
test_protocol= UDP_STREAM
test_protocols = UDP_STREAM
- UDP_RR:
test_protocol= UDP_RR
test_protocols = UDP_RR
......@@ -14,7 +14,7 @@
client_path = /var/tmp/
netperf_test_duration = 600
netperf_para_sessions = 1
test_protocol = TCP_STREAM
test_protocols = TCP_STREAM
netperf_package_sizes = 64 256 1024 4096 16384 65535
Windows:
netperf_server_link_win = "netserver-2.6.0.exe"
......
......@@ -15,7 +15,7 @@
client_path = /var/tmp/
netperf_test_timeout = 360
netperf_para_sessions = 6
test_protocol = TCP_STREAM
test_protocols = TCP_STREAM
Windows:
netperf_server_link_win = "netserver-2.6.0.exe"
netperf_client_link_win = "netperf.exe"
......
......@@ -171,11 +171,12 @@ def run(test, params, env):
# Run netperf with message size defined in range.
netperf_test_duration = int(params.get("netperf_test_duration", 60))
netperf_para_sess = params.get("netperf_para_sessions", "1")
test_protocol = params.get("test_protocol", "TCP_STREAM")
test_protocols = params.get("test_protocols", "TCP_STREAM")
netperf_cmd_prefix = params.get("netperf_cmd_prefix", "")
netperf_output_unit = params.get("netperf_output_unit", " ")
netperf_package_sizes = params.get("netperf_package_sizes")
test_option = "-t %s -l %s" % (test_protocol, netperf_test_duration)
test_option = params.get("test_option", "")
test_option += " -l %s" % netperf_test_duration
if params.get("netperf_remote_cpu") == "yes":
test_option += " -C"
if params.get("netperf_local_cpu") == "yes":
......@@ -186,30 +187,32 @@ def run(test, params, env):
stop_time = start_time + netperf_test_duration
num = 0
s_len = len(server_infos)
for n_client in netperf_clients:
index = num % s_len
server_ip = server_infos[index]["ip"]
n_client.bg_start(server_ip, test_option,
netperf_para_sess, netperf_cmd_prefix,
package_sizes=netperf_package_sizes)
if utils_misc.wait_for(n_client.is_netperf_running, 10, 0, 1,
"Wait netperf test start"):
logging.info("Netperf test start successfully.")
else:
raise error.TestError("Can not start netperf client.")
num += 1
# here when set a run flag, when other case call this case as a
# subprocess backgroundly, can set this run flag to False to stop
# the stress test.
env["netperf_run"] = True
for n_client in netperf_clients:
if n_client.is_netperf_running():
left_time = stop_time - time.time()
utils_misc.wait_for(lambda: not
n_client.is_netperf_running(),
left_time, 0, 5,
"Wait netperf test finish %ss" % left_time)
for protocol in test_protocols.split():
error.context("Testing %s protocol" % protocol, logging.info)
t_option = "%s -t %s" % (test_option, protocol)
for n_client in netperf_clients:
index = num % s_len
server_ip = server_infos[index]["ip"]
n_client.bg_start(server_ip, t_option,
netperf_para_sess, netperf_cmd_prefix,
package_sizes=netperf_package_sizes)
if utils_misc.wait_for(n_client.is_netperf_running, 10, 0, 1,
"Wait netperf test start"):
logging.info("Netperf test start successfully.")
else:
raise error.TestError("Can not start netperf client.")
num += 1
# here when set a run flag, when other case call this case as a
# subprocess backgroundly, can set this run flag to False to stop
# the stress test.
env["netperf_run"] = True
for n_client in netperf_clients:
if n_client.is_netperf_running():
left_time = stop_time - time.time()
utils_misc.wait_for(lambda: not
n_client.is_netperf_running(),
left_time, 0, 5,
"Wait netperf test finish %ss" % left_time)
finally:
for n_server in netperf_servers:
if n_server:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册