Skip to content
Snippets Groups Projects
Commit 812c91cc authored by Rich Lane's avatar Rich Lane
Browse files

test_hifi: use SWITCH to pick the switch class

parent 27da832d
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ def runOptionsTopoTest( self, n, hopts=None, lopts=None ): ...@@ -39,7 +39,7 @@ def runOptionsTopoTest( self, n, hopts=None, lopts=None ):
"Generic topology-with-options test runner." "Generic topology-with-options test runner."
mn = Mininet( topo=SingleSwitchOptionsTopo( n=n, hopts=hopts, mn = Mininet( topo=SingleSwitchOptionsTopo( n=n, hopts=hopts,
lopts=lopts ), lopts=lopts ),
host=CPULimitedHost, link=TCLink ) host=CPULimitedHost, link=TCLink, switch=SWITCH )
dropped = mn.run( mn.ping ) dropped = mn.run( mn.ping )
self.assertEqual( dropped, 0 ) self.assertEqual( dropped, 0 )
...@@ -58,7 +58,7 @@ def testCPULimits( self ): ...@@ -58,7 +58,7 @@ def testCPULimits( self ):
#self.runOptionsTopoTest( N, hopts=hopts ) #self.runOptionsTopoTest( N, hopts=hopts )
mn = Mininet( SingleSwitchOptionsTopo( n=N, hopts=hopts ), mn = Mininet( SingleSwitchOptionsTopo( n=N, hopts=hopts ),
host=CPULimitedHost ) host=CPULimitedHost, switch=SWITCH )
mn.start() mn.start()
results = mn.runCpuLimitTest( cpu=CPU_FRACTION ) results = mn.runCpuLimitTest( cpu=CPU_FRACTION )
mn.stop() mn.stop()
...@@ -73,7 +73,7 @@ def testLinkBandwidth( self ): ...@@ -73,7 +73,7 @@ def testLinkBandwidth( self ):
lopts = { 'bw': BW, 'use_htb': True } lopts = { 'bw': BW, 'use_htb': True }
# Also verify correctness of limit limitng within a bound. # Also verify correctness of limit limitng within a bound.
mn = Mininet( SingleSwitchOptionsTopo( n=N, lopts=lopts ), mn = Mininet( SingleSwitchOptionsTopo( n=N, lopts=lopts ),
link=TCLink ) link=TCLink, switch=SWITCH )
bw_strs = mn.run( mn.iperf ) bw_strs = mn.run( mn.iperf )
for bw_str in bw_strs: for bw_str in bw_strs:
bw = float( bw_str.split(' ')[0] ) bw = float( bw_str.split(' ')[0] )
...@@ -85,7 +85,7 @@ def testLinkDelay( self ): ...@@ -85,7 +85,7 @@ def testLinkDelay( self ):
DELAY_TOLERANCE = 0.8 # Delay fraction below which test should fail DELAY_TOLERANCE = 0.8 # Delay fraction below which test should fail
lopts = { 'delay': '%sms' % DELAY_MS, 'use_htb': True } lopts = { 'delay': '%sms' % DELAY_MS, 'use_htb': True }
mn = Mininet( SingleSwitchOptionsTopo( n=N, lopts=lopts ), mn = Mininet( SingleSwitchOptionsTopo( n=N, lopts=lopts ),
link=TCLink ) link=TCLink, switch=SWITCH )
ping_delays = mn.run( mn.pingFull ) ping_delays = mn.run( mn.pingFull )
test_outputs = ping_delays[0] test_outputs = ping_delays[0]
# Ignore unused variables below # Ignore unused variables below
...@@ -105,7 +105,7 @@ def testLinkLoss( self ): ...@@ -105,7 +105,7 @@ def testLinkLoss( self ):
REPS = 1 REPS = 1
lopts = { 'loss': LOSS_PERCENT, 'use_htb': True } lopts = { 'loss': LOSS_PERCENT, 'use_htb': True }
mn = Mininet( topo=SingleSwitchOptionsTopo( n=N, lopts=lopts ), mn = Mininet( topo=SingleSwitchOptionsTopo( n=N, lopts=lopts ),
host=CPULimitedHost, link=TCLink ) host=CPULimitedHost, link=TCLink, switch=SWITCH )
# Drops are probabilistic, but the chance of no dropped packets is # Drops are probabilistic, but the chance of no dropped packets is
# 1 in 100 million with 4 hops for a link w/99% loss. # 1 in 100 million with 4 hops for a link w/99% loss.
dropped_total = 0 dropped_total = 0
......
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