Skip to content
Snippets Groups Projects
Commit 299925c2 authored by Brandon Heller's avatar Brandon Heller Committed by Bob Lantz
Browse files

Add more param choices for iperf udp on CLI

parent 7d83d462
No related branches found
No related tags found
No related merge requests found
...@@ -168,10 +168,25 @@ def do_iperf( self, line ): ...@@ -168,10 +168,25 @@ def do_iperf( self, line ):
error( 'invalid number of args: iperf src dst\n' ) error( 'invalid number of args: iperf src dst\n' )
def do_iperfudp( self, line ): def do_iperfudp( self, line ):
"Simple iperf UDP test between two hosts." "Simple iperf TCP test between two (optionally specified) hosts."
args = line.split() args = line.split()
udpBw = args[ 0 ] if len( args ) else '10M' if not args:
self.mn.iperfUdp( udpBw ) self.mn.iperf( l4Type='UDP' )
elif len(args) == 3:
udpBw = args[ 0 ]
hosts = []
err = False
for arg in args[ 1:3 ]:
if arg not in self.nodemap:
err = True
error( "node '%s' not in network\n" % arg )
else:
hosts.append( self.nodemap[ arg ] )
if not err:
self.mn.iperf( hosts, l4Type='UDP', udpBw=udpBw )
else:
error( 'invalid number of args: iperfudp bw src dst\n' +
'bw examples: 10M\n' )
def do_intfs( self, line ): def do_intfs( self, line ):
"List interfaces." "List interfaces."
......
...@@ -505,10 +505,6 @@ def iperf( self, hosts=None, l4Type='TCP', udpBw='10M' ): ...@@ -505,10 +505,6 @@ def iperf( self, hosts=None, l4Type='TCP', udpBw='10M' ):
output( '*** Results: %s\n' % result ) output( '*** Results: %s\n' % result )
return result return result
def iperfUdp( self, udpBw='10M' ):
"Run iperf UDP test."
return self.iperf( l4Type='UDP', udpBw=udpBw )
def configLinkStatus( self, src, dst, status ): def configLinkStatus( self, src, dst, status ):
"""Change status of src <-> dst links. """Change status of src <-> dst links.
src: node name src: node name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment