diff options
author | Ace Lee <liyin11@huawei.com> | 2017-09-15 06:14:19 +0000 |
---|---|---|
committer | Ace Lee <liyin11@huawei.com> | 2017-10-11 09:57:24 +0000 |
commit | 10f85b332c4b1f55e651aeb9c45b328e1ebdc2af (patch) | |
tree | 4cd1b1aa0dfbb9babb3cbb00b5816c4d970e17c0 /yardstick/benchmark/scenarios/networking | |
parent | de726ccdc524f7cd61d3dda998bb3826c6af721c (diff) |
Use "protocol" parameters in iperf3 yaml and task file
JIRA: YARDSTICK-755
There is a history problem that iperf use udp to set a net protocol.
This code will change it to protocol.
so you could use 'tcp','udp' and other protocol.
Change-Id: I1a101013dfe58165a3ed08aa77f0aa2f73d57a12
Signed-off-by: Ace Lee <liyin11@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking')
-rw-r--r-- | yardstick/benchmark/scenarios/networking/iperf3.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/yardstick/benchmark/scenarios/networking/iperf3.py b/yardstick/benchmark/scenarios/networking/iperf3.py index a3d273750..98c45990e 100644 --- a/yardstick/benchmark/scenarios/networking/iperf3.py +++ b/yardstick/benchmark/scenarios/networking/iperf3.py @@ -111,18 +111,22 @@ For more info see http://software.es.net/iperf # If there are no options specified if not options: - options = "" + options = {} use_UDP = False - if "udp" in options: - cmd += " --udp" - use_UDP = True - if "bandwidth" in options: - cmd += " --bandwidth %s" % options["bandwidth"] - else: - # tcp obviously + try: + protocol = options.get("protocol") + bandwidth = options.get('bandwidth') + use_UDP = protocol == 'udp' + if protocol: + cmd += " --" + protocol + if use_UDP and bandwidth: + cmd += " --bandwidth " + bandwidth + # if nodelay in the option, protocal maybe null or 'tcp' if "nodelay" in options: cmd += " --nodelay" + except AttributeError: + LOG.warning("Can't parser the options in your config file!!!") # these options are mutually exclusive in iperf3 if time: |