Make Ripcord-specific topologies optional

If ripcord.dctopo imports properly, then include its topologies in the
list of available ones.  Also replace topo.py with new generic
topologies and update paths.
This commit is contained in:
Brandon Heller
2010-01-03 03:53:23 -08:00
parent c98514ae44
commit 433a7cc88c
3 changed files with 337 additions and 119 deletions
+3 -20
View File
@@ -7,16 +7,14 @@ Test creation and all-pairs ping for each included mininet topo type.
from time import sleep
import unittest
from ripcord.topo import SingleSwitchTopo, LinearTopo
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, Host, ControllerParams
from mininet.node import Controller
from mininet.topo import TreeTopo
from mininet.node import KernelSwitch, Host, Controller, ControllerParams
from mininet.topo import SingleSwitchTopo, LinearTopo
# temporary, until user-space side is tested
SWITCHES = {'kernel' : KernelSwitch}
class testSingleSwitch(unittest.TestCase):
'''For each datapath type, test ping with single switch topologies.'''
@@ -55,20 +53,5 @@ class testLinear(unittest.TestCase):
self.assertEqual(dropped, 0)
class testTree(unittest.TestCase):
'''For each datapath type, test all-pairs ping with TreeNet.'''
def testTree9(self):
'''Ping test with both datapaths on 9-host topology'''
init()
for switch in SWITCHES.values():
controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8
tree_topo = TreeTopo(depth = 3, fanout = 3)
mn = Mininet(tree_topo, switch, Host, Controller,
controller_params)
dropped = mn.run('ping')
self.assertEqual(dropped, 0)
if __name__ == '__main__':
unittest.main()