Skip to content
Snippets Groups Projects
Commit 762479c1 authored by Bob Lantz's avatar Bob Lantz
Browse files

Merge branch 'patches/linear_bw' of https://github.com/cdburkard/mininet into...

Merge branch 'patches/linear_bw' of https://github.com/cdburkard/mininet into cdburkard-patches/linear_bw
parents c8607467 9cbf4688
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
from mininet.topo import Topo from mininet.topo import Topo
from mininet.log import lg from mininet.log import lg
from mininet.util import irange from mininet.util import irange
from mininet.link import TCLink
from functools import partial
import sys import sys
flush = sys.stdout.flush flush = sys.stdout.flush
...@@ -70,13 +72,20 @@ def linearBandwidthTest( lengths ): ...@@ -70,13 +72,20 @@ def linearBandwidthTest( lengths ):
switches = { 'reference user': UserSwitch, switches = { 'reference user': UserSwitch,
'Open vSwitch kernel': OVSKernelSwitch } 'Open vSwitch kernel': OVSKernelSwitch }
# UserSwitch is horribly slow with recent kernels.
# We can reinstate it once its performance is fixed
del switches[ 'reference user' ]
topo = LinearTestTopo( hostCount ) topo = LinearTestTopo( hostCount )
for datapath in switches.keys(): for datapath in switches.keys():
print "*** testing", datapath, "datapath" print "*** testing", datapath, "datapath"
Switch = switches[ datapath ] Switch = switches[ datapath ]
results[ datapath ] = [] results[ datapath ] = []
net = Mininet( topo=topo, switch=Switch, controller=Controller, waitConnected=True ) link = partial( TCLink, delay='1ms' )
net = Mininet( topo=topo, switch=Switch,
controller=Controller, waitConnected=True,
link=link )
net.start() net.start()
print "*** testing basic connectivity" print "*** testing basic connectivity"
for n in lengths: for n in lengths:
......
...@@ -21,7 +21,6 @@ def testLinearBandwidth( self ): ...@@ -21,7 +21,6 @@ def testLinearBandwidth( self ):
while True: while True:
index = p.expect( opts, timeout=600 ) index = p.expect( opts, timeout=600 )
if index == 0: if index == 0:
previous_bw = 10 ** 10 # 10 Gbits
count += 1 count += 1
elif index == 1: elif index == 1:
n = int( p.match.group( 1 ) ) n = int( p.match.group( 1 ) )
...@@ -32,12 +31,15 @@ def testLinearBandwidth( self ): ...@@ -32,12 +31,15 @@ def testLinearBandwidth( self ):
elif unit[ 0 ] == 'M': elif unit[ 0 ] == 'M':
bw *= 10 ** 6 bw *= 10 ** 6
elif unit[ 0 ] == 'G': elif unit[ 0 ] == 'G':
bw *= 10 ** 9 bw *= 10 ** 9a
self.assertTrue( bw < previous_bw ) # check that we have a previous result to compare to
if n != 1:
self.assertTrue( bw < previous_bw )
previous_bw = bw previous_bw = bw
else: else:
break break
# verify that we received results from at least one switch
self.assertTrue( count > 0 ) self.assertTrue( count > 0 )
if __name__ == '__main__': if __name__ == '__main__':
......
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