blob: 67614f4f18b655f4970e1785df6efa259bb4413b [file] [log] [blame]
Pier6a0c4de2018-03-18 16:01:30 -07001class SRMulticast:
2 def __init__( self ):
3 self.default = ''
4
5 def CASE1( self, main ):
6 """
You Wange24d6272018-03-27 21:18:50 -07007 Sets up 3 ONOS instances, start H-AGG topology
8 Create a Multicast flow between a source and sink on the same dual-tor leaf
9 Verify flows and groups
10 Verify traffic
11 Remove sink
12 Verify flows and groups
Pier6a0c4de2018-03-18 16:01:30 -070013 """
You Wangc02d8352018-04-17 16:42:10 -070014 import time
15 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
16 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
17 main.case( "Create a Multicast flow between a source and sink on the same dual-tor leaf" )
18 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0 ] } }
19 setupTest( main, test_idx=1, onosNodes=3 )
20 verifyMcastRoutes( main )
21 verifyMcastSinkRemoval( main, "ipv4", 0, False )
22 verifyMcastSourceRemoval( main, "ipv4", 0, False )
23 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -070024
You Wange24d6272018-03-27 21:18:50 -070025 def CASE2( self, main ):
Pier4b701302018-03-20 17:26:10 -070026 """
You Wange24d6272018-03-27 21:18:50 -070027 Sets up 3 ONOS instances, start H-AGG topology
Pier4b701302018-03-20 17:26:10 -070028 Create a Multicast flow between a source and sink on different dual-tor leaves
29 Verify flows and groups
30 Verify traffic
31 Remove sink
32 Verify flows and groups
33 """
You Wangc02d8352018-04-17 16:42:10 -070034 import time
35 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
36 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
37 main.case( "Create a Multicast flow between a source and sink on different dual-tor leaves" )
38 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 1 ] } }
39 setupTest( main, test_idx=2, onosNodes=3 )
40 verifyMcastRoutes( main )
41 verifyMcastSinkRemoval( main, "ipv4", 1, False )
42 verifyMcastSourceRemoval( main, "ipv4", 0, False )
43 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -070044
You Wange24d6272018-03-27 21:18:50 -070045 def CASE3( self, main ):
Pier4b701302018-03-20 17:26:10 -070046 """
You Wange24d6272018-03-27 21:18:50 -070047 Sets up 3 ONOS instances, start H-AGG topology
Pier4b701302018-03-20 17:26:10 -070048 Create a Multicast flow between a source and sink on different leaves (sink on single-tor)
49 Verify flows and groups
50 Verify traffic
51 Remove sink
52 Verify flows and groups
53 """
You Wangc02d8352018-04-17 16:42:10 -070054 import time
55 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
56 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
57 main.case( "Create a Multicast flow between a source and sink on different leaves (sink on single-tor)" )
58 main.mcastRoutes = { "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
59 setupTest( main, test_idx=3, onosNodes=3 )
60 verifyMcastRoutes( main )
61 verifyMcastRouteRemoval( main, "ipv6" )
62 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -070063
You Wange24d6272018-03-27 21:18:50 -070064 def CASE4( self, main ):
Pier4b701302018-03-20 17:26:10 -070065 """
You Wange24d6272018-03-27 21:18:50 -070066 Sets up 3 ONOS instances, start H-AGG topology
67 Combines CASE1 and CASE2
Pier4b701302018-03-20 17:26:10 -070068 Verify flows and groups
69 Verify traffic
70 Remove sinks
71 Verify flows and groups
72 """
You Wangc02d8352018-04-17 16:42:10 -070073 import time
74 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
75 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
76 main.case( "Combines CASE1 and CASE2" )
77 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1 ] } }
78 setupTest( main, test_idx=4, onosNodes=3 )
79 verifyMcastRoutes( main )
80 verifyMcastSinkRemoval( main, "ipv4", 0, False )
81 verifyMcastSinkRemoval( main, "ipv4", 1, False )
82 verifyMcastSourceRemoval( main, "ipv4", 0, False )
83 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -070084
You Wange24d6272018-03-27 21:18:50 -070085 def CASE5( self, main ):
Pier4b701302018-03-20 17:26:10 -070086 """
You Wange24d6272018-03-27 21:18:50 -070087 Sets up 3 ONOS instances, start H-AGG topology
88 Combines CASE2 and CASE3
Pier4b701302018-03-20 17:26:10 -070089 Verify flows and groups
90 Verify traffic
91 Remove sinks
92 Verify flows and groups
93 """
You Wangc02d8352018-04-17 16:42:10 -070094 import time
95 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
96 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
97 main.case( "Combines CASE2 and CASE3" )
98 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 1 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
99 setupTest( main, test_idx=5, onosNodes=3 )
100 verifyMcastRoutes( main )
101 verifyMcastRouteRemoval( main, "ipv6" )
102 verifyMcastSinkRemoval( main, "ipv4", 1, False )
103 verifyMcastSourceRemoval( main, "ipv4", 0, False )
104 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700105
You Wange24d6272018-03-27 21:18:50 -0700106 def CASE6( self, main ):
Pier4b701302018-03-20 17:26:10 -0700107 """
You Wange24d6272018-03-27 21:18:50 -0700108 Sets up 3 ONOS instances, start H-AGG topology
109 Combines CASE1 and CASE3
Pier4b701302018-03-20 17:26:10 -0700110 Verify flows and groups
111 Verify traffic
112 Remove sinks
113 Verify flows and groups
114 """
You Wangc02d8352018-04-17 16:42:10 -0700115 import time
116 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
117 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
118 main.case( "Combines CASE1 and CASE3" )
119 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
120 setupTest( main, test_idx=6, onosNodes=3 )
121 verifyMcastRoutes( main )
122 verifyMcastRouteRemoval( main, "ipv6" )
123 verifyMcastSinkRemoval( main, "ipv4", 0, False )
124 verifyMcastSourceRemoval( main, "ipv4", 0, False )
125 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700126
You Wange24d6272018-03-27 21:18:50 -0700127 def CASE7( self, main ):
Pier4b701302018-03-20 17:26:10 -0700128 """
You Wange24d6272018-03-27 21:18:50 -0700129 Sets up 3 ONOS instances, start H-AGG topology
130 Combines CASE1, CASE2 and CASE3
Pier4b701302018-03-20 17:26:10 -0700131 Verify flows and groups
132 Verify traffic
133 Remove sinks
134 Verify flows and groups
135 """
You Wangc02d8352018-04-17 16:42:10 -0700136 import time
137 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
138 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
139 main.case( "Combines CASE1, CASE2 and CASE3" )
140 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
141 setupTest( main, test_idx=7, onosNodes=3 )
142 verifyMcastRoutes( main )
143 verifyMcastRouteRemoval( main, "ipv6" )
144 verifyMcastSinkRemoval( main, "ipv4", 0, False )
145 verifyMcastSinkRemoval( main, "ipv4", 1, False )
146 verifyMcastSourceRemoval( main, "ipv4", 0, False )
147 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700148
You Wange24d6272018-03-27 21:18:50 -0700149 def CASE8( self, main ):
Pier4b701302018-03-20 17:26:10 -0700150 """
You Wange24d6272018-03-27 21:18:50 -0700151 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700152 Use all of the four sinks
153 Verify flows and groups
154 Verify traffic
155 Remove sinks
Pier4b701302018-03-20 17:26:10 -0700156 Verify flows and groups
157 """
You Wangc02d8352018-04-17 16:42:10 -0700158 import time
159 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
160 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
161 main.case( "Use all of the four sinks" )
162 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
163 setupTest( main, test_idx=8, onosNodes=3 )
164 verifyMcastRoutes( main )
165 verifyMcastRemoval( main )
166 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700167
168 def CASE101( self, main ):
169 """
You Wange24d6272018-03-27 21:18:50 -0700170 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700171 Combines CASE8 with a link failure (link ingress-spine)
Pier4b701302018-03-20 17:26:10 -0700172 Verify flows and groups
173 Verify traffic
174 """
You Wangc02d8352018-04-17 16:42:10 -0700175 import time
176 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
177 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
178 main.case( "Combines CASE8 with a link failure (link ingress-spine)" )
179 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
180 setupTest( main, test_idx=101, onosNodes=3 )
181 verifyMcastRoutes( main )
182 verifyLinkDown( main, [ "leaf2", "spine101" ], 4 )
183 verifyMcastRemoval( main )
184 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700185
186 def CASE102( self, main ):
187 """
You Wange24d6272018-03-27 21:18:50 -0700188 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700189 Combines CASE8 with a link failure (link spine-egress-dt-leaf)
Pier4b701302018-03-20 17:26:10 -0700190 Verify flows and groups
191 Verify traffic
192 """
You Wangc02d8352018-04-17 16:42:10 -0700193 import time
194 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
195 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
196 main.case( "Combines CASE8 with a link failure (link spine-engress-dt-leaf)" )
197 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
198 setupTest( main, test_idx=102, onosNodes=3 )
199 verifyMcastRoutes( main )
200 verifyLinkDown( main, [ "leaf5", "spine101" ], 4 )
201 verifyMcastRemoval( main )
202 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700203
204 def CASE103( self, main ):
205 """
You Wange24d6272018-03-27 21:18:50 -0700206 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700207 Combines CASE8 with a link failure (link spine-egress-st-leaf)
Pier4b701302018-03-20 17:26:10 -0700208 Verify flows and groups
209 Verify traffic
210 """
You Wangc02d8352018-04-17 16:42:10 -0700211 import time
212 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
213 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
214 main.case( "Combines CASE8 with a link failure (link spine-engress-st-leaf)" )
215 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
216 setupTest( main, test_idx=103, onosNodes=3 )
217 verifyMcastRoutes( main )
218 verifyLinkDown( main, [ "spine103", "spine101" ], 4 )
219 verifyMcastRemoval( main )
220 lib.cleanup( main, copyKarafLog=False )
221
222 def CASE104( self, main ):
223 """
224 Sets up 3 ONOS instances, start H-AGG topology
225 Combines CASE8 with a link failure (link spine-egress-st-leaf-2)
226 Verify flows and groups
227 Verify traffic
228 """
229 import time
230 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
231 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
232 main.case( "Combines CASE8 with a link failure (link spine-engress-st-leaf-2)" )
233 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
234 setupTest( main, test_idx=104, onosNodes=3 )
235 verifyMcastRoutes( main )
236 verifyLinkDown( main, [ "leaf4", "spine101" ], 4 )
237 verifyMcastRemoval( main )
238 lib.cleanup( main, copyKarafLog=False )
239
240 def CASE105( self, main ):
241 """
242 Sets up 3 ONOS instances, start H-AGG topology
243 Combines CASE8 with a link failure (link dt-leaf-sink)
244 Verify flows and groups
245 Verify traffic
246 """
247 import time
248 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
249 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
250 main.case( "Combines CASE8 with a link failure (link dt-leaf-sink)" )
251 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
252 setupTest( main, test_idx=105, onosNodes=3 )
253 verifyMcastRoutes( main )
254 verifyLinkDown( main, [ "leaf2", "h4v4" ], 0 )
255 verifyMcastRemoval( main )
256 lib.cleanup( main, copyKarafLog=False )
257
258 def CASE106( self, main ):
259 """
260 Sets up 3 ONOS instances, start H-AGG topology
261 Combines CASE8 with a link failure (link dt-leaf-sink-2)
262 Verify flows and groups
263 Verify traffic
264 """
265 import time
266 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
267 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
268 main.case( "Combines CASE8 with a link failure (link dt-leaf-sink-2)" )
269 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
270 setupTest( main, test_idx=106, onosNodes=3 )
271 verifyMcastRoutes( main )
272 verifyLinkDown( main, [ "leaf5", "h10v4" ], 0 )
273 verifyMcastRemoval( main )
274 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700275
276 def CASE201( self, main ):
277 """
You Wange24d6272018-03-27 21:18:50 -0700278 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700279 Combines CASE8 with spine failure
Pier4b701302018-03-20 17:26:10 -0700280 Verify flows and groups
281 Verify traffic
282 """
You Wangc02d8352018-04-17 16:42:10 -0700283 import time
284 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
285 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
286 main.case( "Combines CASE8 with spine failure" )
287 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
288 setupTest( main, test_idx=201, onosNodes=3 )
289 verifyMcastRoutes( main )
290 verifySwitchDown( main, "spine101", 18 )
291 verifySwitchDown( main, "spine102", 18 )
292 verifyMcastRemoval( main, removeDHT1=False )
293 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700294
295 def CASE202( self, main ):
296 """
You Wange24d6272018-03-27 21:18:50 -0700297 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700298 Combines CASE8 with ingress failure and recovery
Pier4b701302018-03-20 17:26:10 -0700299 Verify flows and groups are removed (failure)
300 Verify flows and groups (recovery)
301 Verify traffic (recovery)
302 """
You Wangc02d8352018-04-17 16:42:10 -0700303 import time
304 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
305 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
306 main.case( "Combines CASE8 with ingress failure and recovery" )
307 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
308 setupTest( main, test_idx=202, onosNodes=3 )
309 verifyMcastRoutes( main )
310 verifySwitchDown( main, "leaf2", 10, { "ipv4": False, "ipv6": False } )
311 verifyMcastRemoval( main, removeDHT1=False )
312 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700313
314 def CASE203( self, main ):
315 """
You Wange24d6272018-03-27 21:18:50 -0700316 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700317 Combines CASE8 with egress-dt-leaf failure and recovery
Pier4b701302018-03-20 17:26:10 -0700318 Verify flows and groups are removed for the failing sink (failure)
319 Verify traffic on remaining sinks (failure)
320 Verify flows and groups (recovery)
321 Verify traffic (recovery)
322 """
You Wangc02d8352018-04-17 16:42:10 -0700323 import time
324 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
325 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
326 main.case( "Combines CASE8 with egress-dt-leaf failure and recovery" )
327 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
328 setupTest( main, test_idx=203, onosNodes=3 )
329 verifyMcastRoutes( main )
330 verifySwitchDown( main, "leaf5", 10 )
331 verifyMcastRemoval( main, removeDHT1=False )
332 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700333
334 def CASE204( self, main ):
335 """
You Wange24d6272018-03-27 21:18:50 -0700336 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700337 Combines CASE8 with egress-st-leaf failure and recovery
Pier4b701302018-03-20 17:26:10 -0700338 Verify flows and groups are removed for the failing sink (failure)
339 Verify traffic on remaining sinks (failure)
340 Verify flows and groups (recovery)
341 Verify traffic (recovery)
342 """
You Wangc02d8352018-04-17 16:42:10 -0700343 import time
344 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
345 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
346 main.case( "Combines CASE8 with egress-st-leaf failure and recovery" )
347 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
348 setupTest( main, test_idx=204, onosNodes=3 )
349 verifyMcastRoutes( main )
350 verifySwitchDown( main, "leaf4", 10, { "ipv4": [ True, False, True ], "ipv6": True } )
351 verifyMcastRemoval( main, removeDHT1=False )
352 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700353
354 def CASE205( self, main ):
355 """
You Wange24d6272018-03-27 21:18:50 -0700356 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700357 Combines CASE8 with egress leaves failure and recovery
Pier4b701302018-03-20 17:26:10 -0700358 Verify flows and groups are removed for the failing sinks (failure)
359 Verify traffic on remaining sink (failure)
360 Verify flows and groups (recovery)
361 Verify traffic (recovery)
362 """
You Wangc02d8352018-04-17 16:42:10 -0700363 import time
364 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
365 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
366 main.case( "Combines CASE8 with leaves failure and recovery" )
367 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
368 setupTest( main, test_idx=205, onosNodes=3 )
369 verifyMcastRoutes( main )
370 verifySwitchDown( main, [ "leaf1", "leaf3", "leaf4", "leaf5" ], 32, { "ipv4": [ True, False, False ], "ipv6": False } )
371 verifyMcastRemoval( main, removeDHT1=False )
372 lib.cleanup( main, copyKarafLog=False )
Pier4b701302018-03-20 17:26:10 -0700373
374 def CASE301( self, main ):
375 """
You Wange24d6272018-03-27 21:18:50 -0700376 Sets up 3 ONOS instances, start H-AGG topology
You Wangc02d8352018-04-17 16:42:10 -0700377 Combines CASE8 with ONOS failure and recovery
Pier4b701302018-03-20 17:26:10 -0700378 Verify flows and groups (failure)
379 Verify traffic (failure)
380 Verify flows and groups (recovery)
381 Verify traffic (recovery)
382 """
You Wangc02d8352018-04-17 16:42:10 -0700383 import time
384 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
385 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
386 main.case( "Combines CASE8 with leaves failure and recovery" )
387 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
388 setupTest( main, test_idx=205, onosNodes=3 )
389 verifyMcastRoutes( main )
390 verifyOnosDown( main )
391 verifyMcastRemoval( main, removeDHT1=False )
392 lib.cleanup( main, copyKarafLog=False )
393
394 def CASE401( self, main ):
395 """
396 Extends MCAST105
397 Create sinks and verify traffic is working
398 Bring down host port and verify traffic is still working for all sinks
399 Bring up host port again and start ping from DTH1 to STS
400 Verify host has both location and stop the ping
401 Kill LEAFA and verify traffic is still working for all sinks
402 Remove IPv6 route
403 Remove DTH2 sink
404 Remove STH2 sink
405 Remove STS
406 """
407 import time
408 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
409 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
410 main.case( "Extends MCAST105" )
411 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
412 setupTest( main, test_idx=401, onosNodes=3 )
413 verifyMcastRoutes( main )
414 #TODO: Verify host has both locations
415 # Verify killing one link of dual-homed host h4
416 verifyLinkDown( main, [ "leaf2", "h4v4" ], 0 )
417 verifyLinkDown( main, [ "leaf3", "h4v4" ], 0 )
418 # Verify killing one link of dual-homed host h10
419 verifyLinkDown( main, [ "leaf4", "h10v4" ], 0 )
420 verifyLinkDown( main, [ "leaf5", "h10v4" ], 0 )
421 verifySwitchDown( main, "leaf3", 10 )
422 verifyMcastRemoval( main, removeDHT1=False )
423 lib.cleanup( main, copyKarafLog=False )
424
425 def CASE402( self, main ):
426 """
427 No downstream path for DTH2
428 Create sinks and verify traffic is working
429 Kill all up-links of the LEAFB and verify traffic is still working
430 Remove IPv6 route
431 Remove DTH2 sink
432 Remove STH2 sink
433 Remove STS
434 """
435 import time
436 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
437 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
438 main.case( "No downstream path for DTH2" )
439 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
440 setupTest( main, test_idx=402, onosNodes=3 )
441 verifyMcastRoutes( main )
442 verifyLinkDown( main, [ [ "leaf5", "spine101" ], [ "leaf5", "spine102" ] ], 8 )
443 verifyMcastRemoval( main, removeDHT1=False )
444 lib.cleanup( main, copyKarafLog=False )
445
446 def CASE403( self, main ):
447 """
448 No downstream path for DTH1
449 Create sinks and verify traffic is working
450 Bring down host port and verify traffic is still working for all sinks
451 Bring up host port again and start ping from DTH1 to STS
452 Verify host has both location and stop the ping
453 Kill all up-links of the LEAFA and verify traffic is still working
454 Remove IPv6 route
455 Remove DTH2 sink
456 Remove STH2 sink
457 Remove STS
458 """
459 import time
460 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
461 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
462 main.case( "No downstream path for DTH1" )
463 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
464 setupTest( main, test_idx=403, onosNodes=3 )
465 verifyMcastRoutes( main )
466 # Verify killing one link of dual-homed host h4
467 verifyLinkDown( main, [ "leaf2", "h4v4" ], 0 )
468 verifyLinkDown( main, [ "leaf3", "h4v4" ], 0 )
469 # Verify killing one link of dual-homed host h10
470 verifyLinkDown( main, [ "leaf4", "h10v4" ], 0 )
471 verifyLinkDown( main, [ "leaf5", "h10v4" ], 0 )
472 verifyLinkDown( main, [ [ "leaf3", "spine101" ], [ "leaf3", "spine102" ] ], 8 )
473 verifyMcastRemoval( main, removeDHT1=False )
474 lib.cleanup( main, copyKarafLog=False )
475
476 def CASE404( self, main ):
477 """
478 Extends MCAST 403
479 Create sinks and verify traffic is working
480 Bring down host port and verify traffic is still working for all sinks
481 Bring up host port again and start ping from DTH1 to STS
482 Verify host has both location and stop the ping
483 Kill up-links of the LEAFA towards SPINEA, kill up-links of the SOURCE LEAF towards SPINEC and verify traffic is still working for all sinks
484 Remove IPv6 route
485 Remove DTH2 sink
486 Remove STH2 sink
487 Remove STS
488 """
489 import time
490 from tests.USECASE.SegmentRouting.SRMulticast.dependencies.SRMulticastTest import *
491 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
492 main.case( "Extends MCASR 403" )
493 main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
494 setupTest( main, test_idx=404, onosNodes=3 )
495 verifyMcastRoutes( main )
496 # Verify killing one link of dual-homed host h4
497 verifyLinkDown( main, [ "leaf2", "h4v4" ], 0 )
498 verifyLinkDown( main, [ "leaf3", "h4v4" ], 0 )
499 # Verify killing one link of dual-homed host h10
500 verifyLinkDown( main, [ "leaf4", "h10v4" ], 0 )
501 verifyLinkDown( main, [ "leaf5", "h10v4" ], 0 )
502 verifyLinkDown( main, [ [ "leaf3", "spine101" ], [ "leaf2", "spine102" ] ], 8 )
503 verifyMcastRemoval( main, removeDHT1=False )
504 lib.cleanup( main, copyKarafLog=False )