X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yardstick%2Fbenchmark%2Fscenarios%2Fnetworking%2Fiperf3.py;h=98c45990e4ab6708d4ec9a4936e41643cbcb55cc;hb=32e60fb2c37573265111994d33c1a43ea64bf6f8;hp=3135af9bd75eccc2cab7a66a72e711e788b9c148;hpb=dae41a002f756d1da65a749bc82eef3ccf4252db;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/networking/iperf3.py b/yardstick/benchmark/scenarios/networking/iperf3.py index 3135af9bd..98c45990e 100644 --- a/yardstick/benchmark/scenarios/networking/iperf3.py +++ b/yardstick/benchmark/scenarios/networking/iperf3.py @@ -50,6 +50,17 @@ For more info see http://software.es.net/iperf type: int unit: bytes default: - + length - length of buffer to read or write, + (default 128 KB for TCP, 8 KB for UDP) + type: int + unit: k + default: - + window - set window size / socket buffer size + set TCP windows size. for UDP way to test, this will set to accept UDP + packet buffer size, limit the max size of acceptable data packet. + type: int + unit: k + default: - """ __scenario_type__ = "Iperf3" @@ -100,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: @@ -122,6 +137,12 @@ For more info see http://software.es.net/iperf elif "blockcount" in options: cmd += " --blockcount %d" % options["blockcount"] + if "length" in options: + cmd += " --length %s" % options["length"] + + if "window" in options: + cmd += " --window %s" % options["window"] + LOG.debug("Executing command: %s", cmd) status, stdout, stderr = self.host.execute(cmd)