Skip to content

Commit

Permalink
Merge pull request mininet#734 from akoshibe/upstream
Browse files Browse the repository at this point in the history
Allow match on 'packets received' in ping results
  • Loading branch information
lantz authored Apr 24, 2017
2 parents e823c4f + ba2d91b commit 23f4f4a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mininet/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def _parsePingFull( pingOutput ):
m = re.search( r, pingOutput )
if m is not None:
return errorTuple
r = r'(\d+) packets transmitted, (\d+) received'
r = r'(\d+) packets transmitted, (\d+)( packets)? received'
m = re.search( r, pingOutput )
if m is None:
error( '*** Error: could not parse ping output: %s\n' %
Expand Down Expand Up @@ -827,7 +827,7 @@ def iperf( self, hosts=None, l4Type='TCP', udpBw='10M', fmt=None,
debug( 'Client output: %s\n' % cliout )
servout = ''
# We want the last *b/sec from the iperf server output
# for TCP, there are two fo them because of waitListening
# for TCP, there are two of them because of waitListening
count = 2 if l4Type == 'TCP' else 1
while len( re.findall( '/sec', servout ) ) < count:
servout += server.monitor( timeoutms=5000 )
Expand All @@ -846,7 +846,6 @@ def runCpuLimitTest( self, cpu, duration=5 ):
duration: test duration in seconds (integer)
returns a single list of measured CPU fractions as floats.
"""
cores = int( quietRun( 'nproc' ) )
pct = cpu * 100
info( '*** Testing CPU %.0f%% bandwidth limit\n' % pct )
hosts = self.hosts
Expand Down

0 comments on commit 23f4f4a

Please sign in to comment.