Ran unpep8 on test_nets.py.

This commit is contained in:
Bob Lantz
2010-02-26 17:25:38 -08:00
parent 019bff8282
commit 235415cf49
+14 -14
View File
@@ -1,8 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
'''@package mininet
Test creation and all-pairs ping for each included mininet topo type. """Package: mininet
''' Test creation and all-pairs ping for each included mininet topo type."""
import unittest import unittest
@@ -15,42 +14,43 @@ SWITCHES = {'kernel': KernelSwitch}
class testSingleSwitch( unittest.TestCase ): class testSingleSwitch( unittest.TestCase ):
'''For each datapath type, test ping with single switch topologies.''' "For each datapath type, test ping with single switch topologies."
def testMinimal( self ): def testMinimal( self ):
'''Ping test with both datapaths on minimal topology''' "Ping test with both datapaths on minimal topology"
init() init()
for switch in SWITCHES.values(): for switch in SWITCHES.values():
controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8 controllerParams = ControllerParams( 0x0a000000, 8 ) # 10.0.0.0/8
mn = Mininet( SingleSwitchTopo(), switch, Host, Controller, mn = Mininet( SingleSwitchTopo(), switch, Host, Controller,
controller_params) controllerParams )
dropped = mn.run( 'ping' ) dropped = mn.run( 'ping' )
self.assertEqual( dropped, 0 ) self.assertEqual( dropped, 0 )
def testSingle5( self ): def testSingle5( self ):
'''Ping test with both datapaths on 5-host single-switch topology''' "Ping test with both datapaths on 5-host single-switch topology"
init() init()
for switch in SWITCHES.values(): for switch in SWITCHES.values():
controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8 controllerParams = ControllerParams( 0x0a000000, 8 ) # 10.0.0.0/8
mn = Mininet( SingleSwitchTopo( k=5 ), switch, Host, Controller, mn = Mininet( SingleSwitchTopo( k=5 ), switch, Host, Controller,
controller_params) controllerParams )
dropped = mn.run( 'ping' ) dropped = mn.run( 'ping' )
self.assertEqual( dropped, 0 ) self.assertEqual( dropped, 0 )
class testLinear( unittest.TestCase ): class testLinear( unittest.TestCase ):
'''For each datapath type, test all-pairs ping with LinearNet.''' "For each datapath type, test all-pairs ping with LinearNet."
def testLinear5( self ): def testLinear5( self ):
'''Ping test with both datapaths on a 5-switch topology''' "Ping test with both datapaths on a 5-switch topology"
init() init()
for switch in SWITCHES.values(): for switch in SWITCHES.values():
controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8 controllerParams = ControllerParams( 0x0a000000, 8 ) # 10.0.0.0/8
mn = Mininet( LinearTopo( k=5 ), switch, Host, Controller, mn = Mininet( LinearTopo( k=5 ), switch, Host, Controller,
controller_params) controllerParams )
dropped = mn.run( 'ping' ) dropped = mn.run( 'ping' )
self.assertEqual( dropped, 0 ) self.assertEqual( dropped, 0 )
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()