diff --git a/generic/tests/cfg/kdump.cfg b/generic/tests/cfg/kdump.cfg index 4e1e52af15016c53256b8ba432a3e2984d497753..a4627b3e33de8fec34a2ba0c9f20bddfd0e50405 100644 --- a/generic/tests/cfg/kdump.cfg +++ b/generic/tests/cfg/kdump.cfg @@ -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 diff --git a/generic/tests/cfg/multi_queues_test.cfg b/generic/tests/cfg/multi_queues_test.cfg index f14cebc17d2b705e06c0833813c0a2ab4b59a3b3..f8a263e8264d622017708ca6fe9ff799472ce550 100644 --- a/generic/tests/cfg/multi_queues_test.cfg +++ b/generic/tests/cfg/multi_queues_test.cfg @@ -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" diff --git a/qemu/tests/cfg/device_assignment_netperf_test.cfg b/qemu/tests/cfg/device_assignment_netperf_test.cfg index a0e5ae8e76460a699521e9b53ef5d3f99a685f21..417fc6619df0715fa184b59696f25d15e594b4b9 100644 --- a/qemu/tests/cfg/device_assignment_netperf_test.cfg +++ b/qemu/tests/cfg/device_assignment_netperf_test.cfg @@ -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" diff --git a/qemu/tests/cfg/ext_host_netperf_stress.cfg b/qemu/tests/cfg/ext_host_netperf_stress.cfg new file mode 100644 index 0000000000000000000000000000000000000000..09a53ca909a5d18c0338ba50d4762bb1d3f25519 --- /dev/null +++ b/qemu/tests/cfg/ext_host_netperf_stress.cfg @@ -0,0 +1,22 @@ +- 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 diff --git a/qemu/tests/cfg/flow_caches_stress_test.cfg b/qemu/tests/cfg/flow_caches_stress_test.cfg index c517177c90a9c065f91141f248b4bb09933855e1..65837446da97b6edc92bc41a33b3b69127c29791 100644 --- a/qemu/tests/cfg/flow_caches_stress_test.cfg +++ b/qemu/tests/cfg/flow_caches_stress_test.cfg @@ -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 diff --git a/qemu/tests/cfg/mq_change_qnum.cfg b/qemu/tests/cfg/mq_change_qnum.cfg index ea7cb9f094b46937f3bc07bd37a20ca4f77bc027..cbe8d5e56abe00fd496f5ec5c93b703ab030e2ab 100644 --- a/qemu/tests/cfg/mq_change_qnum.cfg +++ b/qemu/tests/cfg/mq_change_qnum.cfg @@ -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 diff --git a/qemu/tests/cfg/multi_vms_netperf_stress.cfg b/qemu/tests/cfg/multi_vms_netperf_stress.cfg index 15f36039913e75e468856555afc21fe1c1a56cce..eb0d9e0c5c6c6359621d7f9831e6dd51ce09f52c 100644 --- a/qemu/tests/cfg/multi_vms_netperf_stress.cfg +++ b/qemu/tests/cfg/multi_vms_netperf_stress.cfg @@ -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" diff --git a/qemu/tests/cfg/netperf_stress_test.cfg b/qemu/tests/cfg/netperf_stress_test.cfg index 6cfcb458803e2a868afc921a9881219291b76fbd..0f02a48bc33d307e9a32f8128c791bb39cb9ca89 100644 --- a/qemu/tests/cfg/netperf_stress_test.cfg +++ b/qemu/tests/cfg/netperf_stress_test.cfg @@ -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 diff --git a/qemu/tests/cfg/sr_iov_netperf_test.cfg b/qemu/tests/cfg/sr_iov_netperf_test.cfg index 8b0ad2b4934aa0f7db901a462b142477305240a3..b5c143fedd935d06063c57e134ff616f5a5d1204 100644 --- a/qemu/tests/cfg/sr_iov_netperf_test.cfg +++ b/qemu/tests/cfg/sr_iov_netperf_test.cfg @@ -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" diff --git a/qemu/tests/cfg/suspend_under_netperf.cfg b/qemu/tests/cfg/suspend_under_netperf.cfg index b77600ff5af7575698d6004510633c09ee8ff1e7..7084bfda6824862cd01af9d840165971db94cfcb 100644 --- a/qemu/tests/cfg/suspend_under_netperf.cfg +++ b/qemu/tests/cfg/suspend_under_netperf.cfg @@ -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" diff --git a/qemu/tests/netperf_stress.py b/qemu/tests/netperf_stress.py index d5a5067ee0f77d5c7f1b7811cde78b7445feb6bd..3cbd5f38350a82d8311d7808c874d1fa30330738 100644 --- a/qemu/tests/netperf_stress.py +++ b/qemu/tests/netperf_stress.py @@ -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: