Add ability to specify hosts for iperf test

This commit is contained in:
Brandon Heller
2010-07-26 11:07:04 -07:00
committed by Bob Lantz
parent 6e9074f89e
commit fc75a1b185
+17 -2
View File
@@ -149,8 +149,23 @@ class CLI( Cmd ):
self.mn.pingPair()
def do_iperf( self, line ):
"Simple iperf TCP test between two hosts."
self.mn.iperf()
"Simple iperf TCP test between two (optionally specified) hosts."
args = line.split()
if not args:
self.mn.iperf()
elif len(args) == 2:
hosts = []
err = False
for arg in args:
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 )
else:
error( 'invalid number of args: iperf src dst\n' )
def do_iperfudp( self, line ):
"Simple iperf UDP test between two hosts."