blob: 9d84bb475585f28576c5a1439906175ce2d1e479 [file] [log] [blame]
Flavio Castroab163ca2016-07-07 14:05:00 -07001# CASE1: 2x2 Leaf-Spine topo and test IP connectivity
2# CASE2: 4x4 topo + IP connectivity test
3# CASE3: Single switch topo + IP connectivity test
4# CASE4: 2x2 topo + 3-node ONOS CLUSTER + IP connectivity test
5# CASE5: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test
6# CASE6: Single switch + 3-node ONOS CLUSTER + IP connectivity test
7
8class SRDynamic:
9 def __init__( self ):
10 self.default = ''
11
12 def CASE1( self, main ):
13 """
14 Sets up 1-node Onos-cluster
15 Start 2x2 Leaf-Spine topology
16 Pingall
17 """
18 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
19 Testcaselib as run
20 if not hasattr( main, 'apps' ):
21 run.initTest( main )
22
23 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
24 main.case( description )
25
26 main.cfgName = '2x2'
27 main.numCtrls = 1
28 run.installOnos( main, vlanCfg=False )
29 run.startMininet( main, 'cord_fabric.py' )
30 # pre-configured routing and bridging test
31 run.checkFlows( main, minFlowCount=116 )
32 run.pingAll( main, dumpflows=False, )
33 run.addHostCfg( main )
34 run.checkFlows( main, minFlowCount=140, dumpflows=False )
35 run.pingAll( main, "CASE1" )
36 run.cleanup( main )
37
38 def CASE2( self, main ):
39 """
40 Sets up 1-node Onos-cluster
41 Start 4x4 Leaf-Spine topology
42 Pingall
43 """
44 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
45 Testcaselib as run
46 if not hasattr( main, 'apps' ):
47 run.initTest( main )
48 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
49 main.case( description )
50 main.cfgName = '4x4'
51 main.numCtrls = 1
52 run.installOnos( main, vlanCfg=False )
53 run.startMininet( main, 'cord_fabric.py',
54 args="--leaf=4 --spine=4" )
55 # pre-configured routing and bridging test
56 run.checkFlows( main, minFlowCount=350 )
57 run.pingAll( main, dumpflows=False )
58 run.addHostCfg( main )
59 run.checkFlows( main, minFlowCount=380, dumpflows=False )
60 run.pingAll( main, 'CASE2' )
61 run.cleanup( main )
62
63 def CASE3( self, main ):
64 """
65 Sets up 1-node Onos-cluster
66 Start single switch topology
67 Pingall
68 """
69 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
70 Testcaselib as run
71 if not hasattr( main, 'apps' ):
72 run.initTest( main )
73 description = "Bridging and Routing sanity test with single switch "
74 main.case( description )
75 main.cfgName = '0x1'
76 main.numCtrls = 1
77 run.installOnos( main, vlanCfg=False )
78 run.startMininet( main, 'cord_fabric.py',
79 args="--leaf=1 --spine=0" )
80 # pre-configured routing and bridging test
81 run.checkFlows( main, minFlowCount=15 )
82 run.pingAll( main, dumpflows=False )
83 run.addHostCfg( main )
84 run.checkFlows( main, minFlowCount=18, dumpflows=False )
85 run.pingAll( main, 'CASE3' )
86 run.cleanup( main )
87
88 def CASE4( self, main ):
89 """
90 Sets up 3-node Onos-cluster
91 Start 2x2 Leaf-Spine topology
92 Pingall
93 """
94 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
95 Testcaselib as run
96 if not hasattr( main, 'apps' ):
97 run.initTest( main )
98 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
99 main.case( description )
100
101 main.cfgName = '2x2'
102 main.numCtrls = 3
103 run.installOnos( main, vlanCfg=False )
104 run.startMininet( main, 'cord_fabric.py' )
105 # pre-configured routing and bridging test
106 run.checkFlows( main, minFlowCount=116 )
107 run.pingAll( main, dumpflows=False )
108 run.addHostCfg( main )
109 run.checkFlows( main, minFlowCount=140, dumpflows=False )
110 run.pingAll( main, "CASE4" )
111 run.killOnos( main, [ 0 ], '4', '8', '2' )
112 run.delHostCfg( main )
113 run.checkFlows( main, minFlowCount=116, dumpflows=False )
114 run.pingAll( main, "CASE4_after" )
115 run.cleanup( main )
116
117 def CASE5( self, main ):
118 """
119 Sets up 3-node Onos-cluster
120 Start 4x4 Leaf-Spine topology
121 Pingall
122 """
123 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
124 Testcaselib as run
125 if not hasattr( main, 'apps' ):
126 run.initTest( main )
127 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
128 main.case( description )
129 main.cfgName = '4x4'
130 main.numCtrls = 3
131 run.installOnos( main, vlanCfg=False )
132 run.startMininet( main, 'cord_fabric.py',
133 args="--leaf=4 --spine=4" )
134 # pre-configured routing and bridging test
135 run.checkFlows( main, minFlowCount=350 )
136 run.pingAll( main, dumpflows=False )
137 run.addHostCfg( main )
138 run.checkFlows( main, minFlowCount=380, dumpflows=False )
139 run.pingAll( main, 'CASE5' )
140 run.killOnos( main, [ 0 ], '8', '32', '2' )
141 run.delHostCfg( main )
142 run.checkFlows( main, minFlowCount=350, dumpflows=False )
143 run.pingAll( main, "CASE5_After" )
144 run.cleanup( main )
145
146 def CASE6( self, main ):
147 """
148 Sets up 3-node Onos-cluster
149 Start single switch topology
150 Pingall
151 """
152 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
153 Testcaselib as run
154 if not hasattr( main, 'apps' ):
155 run.initTest( main )
156 description = "Bridging and Routing sanity test with single switch "
157 main.case( description )
158 main.cfgName = '0x1'
159 main.numCtrls = 3
160 run.installOnos( main, vlanCfg=False )
161 run.startMininet( main, 'cord_fabric.py',
162 args="--leaf=1 --spine=0" )
163 # pre-configured routing and bridging test
164 run.checkFlows( main, minFlowCount=15 )
165 run.pingAll( main, dumpflows=False )
166 run.addHostCfg( main )
167 run.checkFlows( main, minFlowCount=20, dumpflows=False )
168 run.pingAll( main, 'CASE6' )
169 run.killOnos( main, [ 0 ], '1', '0', '2' )
170 run.delHostCfg( main )
171 run.checkFlows( main, minFlowCount=15, dumpflows=False )
172 run.pingAll( main, "CASE6_After" )
173 run.cleanup( main )