Revision e1711f35

View differences:

mininet/net.py
689 689
        """Run iperf between two hosts.
690 690
           hosts: list of hosts; if None, uses opposite hosts
691 691
           l4Type: string, one of [ TCP, UDP ]
692
           returns: results two-element array of server and client speeds"""
692
           returns: results two-element array of [ server, client ] speeds
693
           note: send() is buffered, so client rate can be much higher than
694
           the actual transmission rate; on an unloaded system, server
695
           rate should be much closer to the actual receive rate"""
693 696
        if not quietRun( 'which telnet' ):
694 697
            error( 'Cannot find telnet in $PATH - required for iperf test' )
695 698
            return
mininet/test/test_hifi.py
136 136
                'switch = %s\n'
137 137
                % ( BW, bw_strs, N, loptsStr, self.switchClass ) )
138 138

  
139
        for bw_str in bw_strs:
140
            bw = float( bw_str.split(' ')[0] )
141
            self.assertWithinTolerance( bw, BW, BW_TOLERANCE, msg )
139
        # On the client side, iperf doesn't wait for ACKs - it simply
140
        # reports how long it took to fill up the TCP send buffer.
141
        # As long as the kernel doesn't wait a long time before
142
        # delivering bytes to the iperf server, its reported data rate
143
        # should be close to the actual receive rate.
144
        serverRate, clientRate = bw_strs
145
        bw = float( serverRate.split(' ')[0] )
146
        self.assertWithinTolerance( bw, BW, BW_TOLERANCE, msg )
142 147

  
143 148
    def testLinkDelay( self ):
144 149
        "Verify that link delays are accurate within a bound."

Also available in: Unified diff