Revision 57aae3e1 mininet/cli.py

View differences:

mininet/cli.py
167 167
            error( 'invalid number of args: iperf src dst\n' )
168 168

  
169 169
    def do_iperfudp( self, line ):
170
        "Simple iperf UDP test between two hosts."
170
        "Simple iperf TCP test between two (optionally specified) hosts."
171 171
        args = line.split()
172
        udpBw = args[ 0 ] if len( args ) else '10M'
173
        self.mn.iperfUdp( udpBw )
172
        if not args:
173
            self.mn.iperf( l4Type='UDP' )
174
        elif len(args) == 3:
175
            udpBw = args[ 0 ]
176
            hosts = []
177
            err = False
178
            for arg in args[ 1:3 ]:
179
                if arg not in self.nodemap:
180
                    err = True
181
                    error( "node '%s' not in network\n" % arg )
182
                else:
183
                    hosts.append( self.nodemap[ arg ] )
184
            if not err:
185
                self.mn.iperf( hosts, l4Type='UDP', udpBw=udpBw )
186
        else:
187
            error( 'invalid number of args: iperfudp bw src dst\n' +
188
                   'bw examples: 10M\n' )
174 189

  
175 190
    def do_intfs( self, line ):
176 191
        "List interfaces."

Also available in: Unified diff