From 6a69c3c74378259b125ca29bfdb009fa103b58b5 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Thu, 21 Jan 2016 16:59:18 -0800 Subject: [PATCH] Fix UDP iperf. --- mininet/net.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mininet/net.py b/mininet/net.py index 2494d1c..30d06ce 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -768,8 +768,10 @@ class Mininet( object ): 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: + # We want the last *b/sec from the iperf server output + # for TCP, there are two fo them because of waitListening + count = 2 if l4Type == 'TCP' else 1 + while len( re.findall( '/sec', servout ) ) < count: servout += server.monitor( timeoutms=5000 ) server.sendInt() server.waitOutput()