Update nuttcp and iperf to latest

Change-Id: I9e06e759f7ccd82b682b69aa0b631fdb607f324d
This commit is contained in:
Yichen Wang 2017-08-19 00:57:37 -07:00
parent dd33f6a1df
commit f2449844b3
8 changed files with 959 additions and 157 deletions

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@ def get_bdw_kbps(bdw, bdw_unit):
class IperfTool(PerfTool):
def __init__(self, instance):
PerfTool.__init__(self, 'iperf', instance)
PerfTool.__init__(self, 'iperf-2.0.9', instance)
def get_server_launch_cmd(self):
'''Return the command to launch the server side.'''
@ -66,6 +66,8 @@ class IperfTool(PerfTool):
bidir = bidirectional
loop_count = self.instance.config.tcp_tp_loop_count
for pkt_size in pkt_size_list:
self.instance.display('Measuring %s Throughput (packet size=%d)...',
proto, pkt_size)
for _ in xrange(loop_count):
res = self.run_client_dir(target_ip, mss,
bandwidth_kbps=bandwidth,

View File

@ -21,7 +21,7 @@ import sshutils
class NuttcpTool(PerfTool):
def __init__(self, instance):
PerfTool.__init__(self, 'nuttcp-7.3.2', instance)
PerfTool.__init__(self, 'nuttcp-8.1.4', instance)
def get_server_launch_cmd(self):
'''Return the commands to launch the server side.'''
@ -201,8 +201,9 @@ class NuttcpTool(PerfTool):
else:
# TCP output:
# megabytes=1083.4252 real_seconds=10.04 rate_Mbps=905.5953 tx_cpu=3 rx_cpu=19
# retrans=0 rtt_ms=0.55
re_tcp = r'rate_Mbps=([\d\.]*) tx_cpu=\d* rx_cpu=\d* retrans=(\d*) rtt_ms=([\d\.]*)'
# retrans=0 cwnd=3202 rtt_ms=0.55
re_tcp = \
r'rate_Mbps=([\d\.]*) tx_cpu=\d* rx_cpu=\d* retrans=(\d*) cwnd=\d* rtt_ms=([\d\.]*)'
match = re.search(re_tcp, cmd_out)
if match:
rate_mbps = float(match.group(1))

Binary file not shown.

BIN
vmtp/tools/iperf-2.0.9 Executable file

Binary file not shown.

Binary file not shown.

BIN
vmtp/tools/nuttcp-8.1.4 Executable file

Binary file not shown.

View File

@ -580,7 +580,8 @@ def gen_report_data(proto, result):
if proto in ['TCP', 'Upload', 'Download']:
tcp_test_count = tcp_test_count + 1
retval['tp_kbps'] += item['throughput_kbps']
retval['rtt_ms'] += item['rtt_ms']
# iperf doesn't support to have rtt_ms
retval['rtt_ms'] += item.get('rtt_ms', 0)
elif proto == 'UDP' or proto == 'Multicast':
retval[item['pkt_size']]['tp_kbps'] = item['throughput_kbps']
retval[item['pkt_size']]['loss_rate'] = item['loss_rate']
@ -601,8 +602,12 @@ def gen_report_data(proto, result):
retval['rtt avg/min/max/stddev msec'] = pkt_size_results
if proto in ['TCP', 'Upload', 'Download']:
for key in retval:
retval[key] = '{0:n}'.format(retval[key] / tcp_test_count)
for key in retval.keys():
if retval[key]:
retval[key] = '{0:n}'.format(retval[key] / tcp_test_count)
else:
retval.pop(key)
except Exception:
retval = "ERROR! Check JSON outputs for more details."
traceback.print_exc()