Renamed LinearTestTopo() and added full ping test.
This commit is contained in:
@@ -23,13 +23,13 @@ from mininet.node import Host, KernelSwitch, UserSwitch
|
|||||||
from mininet.topo import Topo, Node
|
from mininet.topo import Topo, Node
|
||||||
from mininet.log import lg
|
from mininet.log import lg
|
||||||
|
|
||||||
class LinearTopo( Topo ):
|
class LinearTestTopo( Topo ):
|
||||||
"Topology for a string of N hosts and N-1 switches."
|
"Topology for a string of N hosts and N-1 switches."
|
||||||
|
|
||||||
def __init__( self, N ):
|
def __init__( self, N ):
|
||||||
|
|
||||||
# Add default members to class.
|
# Add default members to class.
|
||||||
super( LinearTopo, self ).__init__()
|
super( LinearTestTopo, self ).__init__()
|
||||||
|
|
||||||
# Create switch and host nodes
|
# Create switch and host nodes
|
||||||
hosts = range( 1, N+1 )
|
hosts = range( 1, N+1 )
|
||||||
@@ -63,10 +63,11 @@ def linearBandwidthTest( lengths ):
|
|||||||
for datapath in datapaths:
|
for datapath in datapaths:
|
||||||
Switch = KernelSwitch if datapath == 'kernel' else UserSwitch
|
Switch = KernelSwitch if datapath == 'kernel' else UserSwitch
|
||||||
results[ datapath ] = []
|
results[ datapath ] = []
|
||||||
net = Mininet( topo=LinearTopo( hostCount ), switch=Switch )
|
net = Mininet( topo=LinearTestTopo( hostCount ), switch=Switch )
|
||||||
net.start()
|
net.start()
|
||||||
print "*** testing basic connectivity"
|
print "*** testing basic connectivity"
|
||||||
net.ping( [ net.hosts[ 0 ], net.hosts[ -1 ] ] )
|
for n in lengths:
|
||||||
|
net.ping( [ net.hosts[ 0 ], net.hosts[ n ] ] )
|
||||||
print "*** testing bandwidth"
|
print "*** testing bandwidth"
|
||||||
for n in lengths:
|
for n in lengths:
|
||||||
src, dst = net.hosts[ 0 ], net.hosts[ n ]
|
src, dst = net.hosts[ 0 ], net.hosts[ n ]
|
||||||
|
|||||||
Reference in New Issue
Block a user