Separate kernel and user switches into separate objects
This commit is contained in:
@@ -8,12 +8,12 @@ from time import sleep
|
||||
import unittest
|
||||
|
||||
from mininet.net import init, Mininet #, DATAPATHS
|
||||
from mininet.node import Switch, Host, NOXController, ControllerParams
|
||||
from mininet.node import KernelSwitch, Host, ControllerParams
|
||||
from mininet.node import Controller
|
||||
from mininet.topo import TreeTopo
|
||||
|
||||
# temporary, until user-space side is tested
|
||||
DATAPATHS = ['kernel']
|
||||
SWITCHES = {'kernel' : KernelSwitch}
|
||||
|
||||
class testMinimal(unittest.TestCase):
|
||||
'''For each datapath type, test ping with a minimal topology.
|
||||
@@ -24,15 +24,12 @@ class testMinimal(unittest.TestCase):
|
||||
def testMinimal(self):
|
||||
'''Ping test with both datapaths on minimal topology'''
|
||||
init()
|
||||
for datapath in DATAPATHS:
|
||||
k = datapath == 'kernel'
|
||||
for switch in SWITCHES.values():
|
||||
controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8
|
||||
mn = Mininet(TreeTopo(), Switch, Host, Controller,
|
||||
mn = Mininet(TreeTopo(), switch, Host, Controller,
|
||||
controller_params)
|
||||
mn.start()
|
||||
dropped = mn.ping_test()
|
||||
dropped = mn.run('ping')
|
||||
self.assertEqual(dropped, 0)
|
||||
mn.stop()
|
||||
|
||||
|
||||
class testTree(unittest.TestCase):
|
||||
@@ -41,16 +38,13 @@ class testTree(unittest.TestCase):
|
||||
def testTree16(self):
|
||||
'''Ping test with both datapaths on 16-host topology'''
|
||||
init()
|
||||
for datapath in DATAPATHS:
|
||||
k = datapath == 'kernel'
|
||||
for switch in SWITCHES.values():
|
||||
controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8
|
||||
tree_topo = TreeTopo(depth = 3, fanout = 4)
|
||||
mn = Mininet(tree_topo, Switch, Host, Controller,
|
||||
mn = Mininet(tree_topo, switch, Host, Controller,
|
||||
controller_params)
|
||||
mn.start()
|
||||
dropped = mn.ping_test()
|
||||
dropped = mn.run('ping')
|
||||
self.assertEqual(dropped, 0)
|
||||
mn.stop()
|
||||
|
||||
#class testLinear(unittest.TestCase):
|
||||
# '''For each datapath type, test all-pairs ping with LinearNet.'''
|
||||
|
||||
Reference in New Issue
Block a user