Try to fix iperf race condition
This is more complicated than it should be. We are also relying on the fact that waitOutput should eat extra prompts most of the time. Still not perfect - it's hard to get this exactly right, and we should try to make it easier! Fixes #589
This commit is contained in:
+5
-1
@@ -767,8 +767,12 @@ class Mininet( object ):
|
||||
cliout = client.cmd( iperfArgs + '-t %d -c ' % seconds +
|
||||
server.IP() + ' ' + bwArgs )
|
||||
debug( 'Client output: %s\n' % cliout )
|
||||
servout = ''
|
||||
# We need the second *b/sec from the iperf server output
|
||||
while len( re.findall( '/sec', servout ) ) < 2:
|
||||
servout += server.monitor( timeoutms=5000 )
|
||||
server.sendInt()
|
||||
servout = server.waitOutput()
|
||||
server.waitOutput()
|
||||
debug( 'Server output: %s\n' % servout )
|
||||
result = [ self._parseIperf( servout ), self._parseIperf( cliout ) ]
|
||||
if l4Type == 'UDP':
|
||||
|
||||
Reference in New Issue
Block a user