remove User Switch from linearBandwidth due to poor performance
This commit is contained in:
@@ -24,7 +24,7 @@ of switches, this example demonstrates:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from mininet.net import Mininet
|
from mininet.net import Mininet
|
||||||
from mininet.node import UserSwitch, OVSKernelSwitch, Controller
|
from mininet.node import OVSKernelSwitch, Controller
|
||||||
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
|
||||||
@@ -67,8 +67,7 @@ def linearBandwidthTest( lengths ):
|
|||||||
switchCount = max( lengths )
|
switchCount = max( lengths )
|
||||||
hostCount = switchCount + 1
|
hostCount = switchCount + 1
|
||||||
|
|
||||||
switches = { 'reference user': UserSwitch,
|
switches = { 'Open vSwitch kernel': OVSKernelSwitch }
|
||||||
'Open vSwitch kernel': OVSKernelSwitch }
|
|
||||||
|
|
||||||
topo = LinearTestTopo( hostCount )
|
topo = LinearTestTopo( hostCount )
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class testLinearBandwidth( unittest.TestCase ):
|
|||||||
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 @@ class testLinearBandwidth( unittest.TestCase ):
|
|||||||
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__':
|
||||||
|
|||||||
Reference in New Issue
Block a user