Revision 60a39a72 mininet/cli.py

View differences:

mininet/cli.py
148 148
        self.mn.pingPair()
149 149

  
150 150
    def do_iperf( self, line ):
151
        "Simple iperf TCP test between two hosts."
152
        self.mn.iperf()
151
        "Simple iperf TCP test between two (optionally specified) hosts."
152
        args = line.split()
153
        if not args:
154
            self.mn.iperf()
155
        elif len(args) == 2:
156
            hosts = []
157
            err = False
158
            for arg in args:
159
                if arg not in self.nodemap:
160
                    err = True
161
                    error( "node '%s' not in network\n" % arg )
162
                else:
163
                    hosts.append( self.nodemap[ arg ] )
164
            if not err:
165
                self.mn.iperf( hosts )
166
        else:
167
            error( 'invalid number of args: iperf src dst\n' )
153 168

  
154 169
    def do_iperfudp( self, line ):
155 170
        "Simple iperf UDP test between two hosts."

Also available in: Unified diff