8
8
from functools import partial
9
9
10
10
from mininet .net import Mininet
11
- from mininet .node import OVSSwitch , UserSwitch , IVSSwitch
11
+ from mininet .node import IVSSwitch
12
+ from mininet .wifi .node import OVSAP , UserAP
12
13
from mininet .node import CPULimitedHost
13
14
from mininet .link import TCLink
14
15
from mininet .topo import Topo
19
20
# Number of stations for each test
20
21
N = 2
21
22
22
- class SingleSwitchOptionsTopo (Topo ):
23
+ class SingleAPOptionsTopo (Topo ):
23
24
"Single switch connected to n hosts."
24
25
def __init__ (self , n = 2 , hopts = None , lopts = None ):
25
26
if not hopts :
@@ -39,7 +40,7 @@ class testOptionsTopoCommon( object ):
39
40
"""Verify ability to create networks with host and link options
40
41
(common code)."""
41
42
42
- switchClass = None # overridden in subclasses
43
+ apClass = None # overridden in subclasses
43
44
44
45
@staticmethod
45
46
def tearDown ():
@@ -49,10 +50,10 @@ def tearDown():
49
50
50
51
def runOptionsTopoTest ( self , n , msg , hopts = None , lopts = None ):
51
52
"Generic topology-with-options test runner."
52
- mn = Mininet ( topo = SingleSwitchOptionsTopo ( n = n , hopts = hopts ,
53
- lopts = lopts ),
53
+ mn = Mininet ( topo = SingleAPOptionsTopo ( n = n , hopts = hopts ,
54
+ lopts = lopts ),
54
55
host = CPULimitedHost , link = TCLink ,
55
- switch = self .switchClass , waitConnected = True )
56
+ switch = self .apClass , waitConnected = True )
56
57
dropped = mn .run ( mn .ping )
57
58
hoptsStr = ', ' .join ( '%s: %s' % ( opt , value )
58
59
for opt , value in hopts .items () )
@@ -95,14 +96,14 @@ class testOptionsTopoOVSKernel( testOptionsTopoCommon, unittest.TestCase ):
95
96
"""Verify ability to create networks with host and link options
96
97
(OVS kernel switch)."""
97
98
longMessage = True
98
- switchClass = OVSSwitch
99
+ switchClass = OVSAP
99
100
100
101
@unittest .skip ( 'Skipping OVS user switch test for now' )
101
102
class testOptionsTopoOVSUser ( testOptionsTopoCommon , unittest .TestCase ):
102
103
"""Verify ability to create networks with host and link options
103
104
(OVS user switch)."""
104
105
longMessage = True
105
- switchClass = partial ( OVSSwitch , datapath = 'user' )
106
+ switchClass = partial ( OVSAP , datapath = 'user' )
106
107
107
108
@unittest .skipUnless ( quietRun ( 'which ivs-ctl' ), 'IVS is not installed' )
108
109
class testOptionsTopoIVS ( testOptionsTopoCommon , unittest .TestCase ):
@@ -116,7 +117,7 @@ class testOptionsTopoUserspace( testOptionsTopoCommon, unittest.TestCase ):
116
117
"""Verify ability to create networks with host and link options
117
118
(UserSwitch)."""
118
119
longMessage = True
119
- switchClass = UserSwitch
120
+ apClass = UserAP
120
121
121
122
if __name__ == '__main__' :
122
123
setLogLevel ( 'warning' )
0 commit comments