blob: 421b74c82bc91acc59d3875657e3e4564d03ef85 [file] [log] [blame]
"""isostream: runs an isostream test."""
def RunIsostreamTest(run, host, bandwidth=14, time=10):
"""RunIsostreamTest runs an isostream test and returns the results."""
# add 1 second to the timeout so we get results for the full requested time.
isostream_cmd = ['./timeout', '{:d}'.format(time + 1),
'isostream', '-b', '{:d}'.format(bandwidth), host]
return run(isostream_cmd)
def ParseIsostream(text):
# The last non-dropout line is a reasonable summary of an isostream test.
for line in reversed(text.splitlines()):
if line.find('offset=') > -1:
return line.strip()
return None