fixed multiping example

This commit is contained in:
Brian O'Connor
2013-09-11 12:00:14 -07:00
parent ecddbcf240
commit 891d807137
+2 -5
View File
@@ -23,13 +23,8 @@ def chunks( l, n ):
def startpings( host, targetips ):
"Tell host to repeatedly ping targets"
targetips.append( '10.0.0.200' )
targetips = ' '.join( targetips )
# BL: Not sure why loopback intf isn't up!
host.cmd( 'ifconfig lo up' )
# Simple ping loop
cmd = ( 'while true; do '
' for ip in %s; do ' % targetips +
@@ -63,6 +58,8 @@ def multiping( netsize, chunksize, seconds):
# Start pings
for subnet in subnets:
ips = [ host.IP() for host in subnet ]
#adding bogus to generate packet loss
ips.append( '10.0.0.200' )
for host in subnet:
startpings( host, ips )