blob: 8bfade801dff25edd64f40d7cdc9d148d21568f2 [file] [log] [blame]
Andreas Pantelopoulos90f0b102018-02-01 13:21:45 -08001
2class SRRouting:
Jon Halla604fd42018-05-04 14:27:27 -07003
Andreas Pantelopoulos90f0b102018-02-01 13:21:45 -08004 def __init__( self ):
5 self.default = ''
6
7 def CASE1( self, main ):
8 """
Andreas Pantelopoulosb7904ce2018-02-07 16:24:49 -08009 Ping between all ipv4 hosts in the topology.
Andreas Pantelopoulos90f0b102018-02-01 13:21:45 -080010 """
You Wangd66de192018-04-30 17:30:12 -070011 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
12 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
13 main.case( "Ping between all ipv4 hosts in the topology" )
14 setupTest( main, test_idx=1, onosNodes=3, ipv6=False, external=False )
15 verify( main, ipv6=False, disconnected=False, external=False )
16 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosf6ed5012018-02-08 21:26:01 -080017
18 def CASE2( self, main ):
19 """
20 Ping between all ipv6 hosts in the topology.
21 """
You Wangd66de192018-04-30 17:30:12 -070022 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
23 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
24 main.case( "Ping between all ipv6 hosts in the topology" )
25 setupTest( main, test_idx=2, onosNodes=3, ipv4=False, external=False )
26 verify( main, ipv4=False, disconnected=False, external=False )
27 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosf6ed5012018-02-08 21:26:01 -080028
You Wang79577812018-02-27 16:39:50 -080029 def CASE3( self, main ):
30 """
31 Ping between all ipv4 and ipv6 hosts in the topology.
32 """
You Wangd66de192018-04-30 17:30:12 -070033 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
34 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
35 main.case( "Ping between all ipv4 and ipv6 hosts in the topology" )
36 setupTest( main, test_idx=3, onosNodes=3, external=False )
37 verify( main, disconnected=False, external=False )
38 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wangba231e72018-03-01 13:18:21 -080039
40 def CASE4( self, main ):
41 """
42 Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts
43 """
You Wangd66de192018-04-30 17:30:12 -070044 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
45 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
46 main.case( "Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts" )
47 setupTest( main, test_idx=4, onosNodes=3, ipv6=False )
48 verify( main, ipv6=False, disconnected=False )
49 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wangba231e72018-03-01 13:18:21 -080050
51 def CASE5( self, main ):
52 """
53 Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts
54 """
You Wangd66de192018-04-30 17:30:12 -070055 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
56 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
57 main.case( "Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts" )
58 setupTest( main, test_idx=5, onosNodes=3, ipv4=False )
59 verify( main, ipv4=False, disconnected=False )
60 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wangba231e72018-03-01 13:18:21 -080061
62 def CASE6( self, main ):
63 """
64 Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts
65 """
You Wangd66de192018-04-30 17:30:12 -070066 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
67 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
68 main.case( "Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external hosts" )
69 setupTest( main, test_idx=6, onosNodes=3 )
70 verify( main, disconnected=False )
71 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulos2eae3242018-03-06 13:47:20 -080072
73 def CASE7( self, main ):
74 """
75 Ping between ipv4 hosts and an external host that is not configured in
76 external router config, but reachable through the use of route-add
77 command.
78 """
You Wangd66de192018-04-30 17:30:12 -070079 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
80 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
81 main.case( "Ping between from ipv4 hosts to external host configured with route-add command" )
82 setupTest( main, test_idx=7, onosNodes=3, ipv6=False, external=False )
83 verify( main, ipv6=False, internal=False, disconnected=False )
84 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulos2eae3242018-03-06 13:47:20 -080085
86 def CASE8( self, main ):
87 """
88 Ping between ipv6 hosts and an external host that is not configured in
89 external router config, but reachable through the use of route-add
90 command.
91 """
You Wangd66de192018-04-30 17:30:12 -070092 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
93 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
94 main.case( "Ping between from ipv6 hosts to external host configured with route-add command" )
95 setupTest( main, test_idx=8, onosNodes=3, ipv4=False, external=False )
96 verify( main, ipv6=False, internal=False, disconnected=False )
97 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulos2eae3242018-03-06 13:47:20 -080098
99 def CASE9( self, main ):
100 """
101 Ping between ipv4 and pv6 hosts and external hosts that is not configured in
102 external router config, but reachable through the use of route-add
103 command.
104 """
You Wangd66de192018-04-30 17:30:12 -0700105 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
106 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
107 main.case( "Ping between from ipv4 and ipv6 hosts to external host configured with route-add command" )
108 setupTest( main, test_idx=9, onosNodes=3, external=False )
109 verify( main, internal=False, disconnected=False )
110 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800111
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800112 def CASE101( self, main ):
113 """
114 Kill and recover links
115 Ping between all ipv4 hosts in the topology.
116 """
You Wangd66de192018-04-30 17:30:12 -0700117 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
118 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
119 main.case( "Test link failures with IPv4 hosts" )
120 setupTest( main, test_idx=101, onosNodes=3, ipv6=False, external=False )
121 verify( main, ipv6=False, external=False, disconnected=False )
122 verifyLinkFailure( main, ipv6=False, external=False )
123 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800124
125 def CASE102( self, main ):
126 """
127 Kill and recover links
128 Ping between all ipv6 hosts in the topology.
129 """
You Wangd66de192018-04-30 17:30:12 -0700130 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
131 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
132 main.case( "Test link failures with IPv6 hosts" )
133 setupTest( main, test_idx=102, onosNodes=3, ipv4=False, external=False )
134 verify( main, ipv4=False, external=False, disconnected=False )
135 verifyLinkFailure( main, ipv4=False, external=False )
136 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800137
138 def CASE103( self, main ):
139 """
140 Kill and recover links
141 Ping between all ipv4 and ipv6 hosts in the topology.
142 """
You Wangd66de192018-04-30 17:30:12 -0700143 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
144 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
145 main.case( "Test link failures with IPv4 and IPv6 hosts" )
146 setupTest( main, test_idx=103, onosNodes=3, external=False )
147 verify( main, external=False, disconnected=False )
148 verifyLinkFailure( main, external=False )
149 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800150
151 def CASE104( self, main ):
152 """
153 Kill and recover links
154 Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts
155 """
You Wangd66de192018-04-30 17:30:12 -0700156 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
157 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
158 main.case( "Test link failures with IPv4 hosts including external hosts" )
159 setupTest( main, test_idx=104, onosNodes=3, ipv6=False )
160 verify( main, ipv6=False, disconnected=False )
161 verifyLinkFailure( main, ipv6=False )
162 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800163
164 def CASE105( self, main ):
165 """
166 Kill and recover links
167 Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts
168 """
You Wangd66de192018-04-30 17:30:12 -0700169 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
170 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
171 main.case( "Test link failures with IPv6 hosts including external hosts" )
172 setupTest( main, test_idx=105, onosNodes=3, ipv4=False )
173 verify( main, ipv4=False, disconnected=False )
174 verifyLinkFailure( main, ipv4=False )
175 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800176
177 def CASE106( self, main ):
178 """
179 Kill and recover links
180 Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts
181 """
You Wangd66de192018-04-30 17:30:12 -0700182 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
183 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
184 main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts" )
185 setupTest( main, test_idx=106, onosNodes=3 )
186 verify( main, disconnected=False )
187 verifyLinkFailure( main )
188 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800189
190 def CASE107( self, main ):
191 """
192 Kill and recover links
193 Ping between ipv4 hosts and an external host that is not configured in
194 external router config, but reachable through the use of route-add command.
195 """
You Wangd66de192018-04-30 17:30:12 -0700196 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
197 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
198 main.case( "Test link failures with IPv4 hosts including external hosts configured with route-add command" )
199 setupTest( main, test_idx=107, onosNodes=3, ipv6=False, external=False )
200 verify( main, ipv6=False, disconnected=False )
201 verifyLinkFailure( main, ipv6=False, internal=False )
202 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800203
204 def CASE108( self, main ):
205 """
206 Kill and recover links
207 Ping between ipv6 hosts and an external host that is not configured in
208 external router config, but reachable through the use of route-add command.
209 """
You Wangd66de192018-04-30 17:30:12 -0700210 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
211 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
212 main.case( "Test link failures with IPv6 hosts including external hosts configured with route-add command" )
213 setupTest( main, test_idx=108, onosNodes=3, ipv4=False, external=False )
214 verify( main, ipv4=False, disconnected=False )
215 verifyLinkFailure( main, ipv4=False, internal=False )
216 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800217
218 def CASE109( self, main ):
219 """
220 Kill and recover links
221 Ping between ipv4 and pv6 hosts and external hosts that is not configured in
222 external router config, but reachable through the use of route-add command.
223 """
You Wangd66de192018-04-30 17:30:12 -0700224 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
225 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
226 main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
227 setupTest( main, test_idx=109, onosNodes=3, external=False )
228 verify( main, disconnected=False )
229 verifyLinkFailure( main, internal=False )
230 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800231
You Wang27317572018-03-06 12:13:11 -0800232 def CASE201( self, main ):
233 """
234 Kill and recover spine switches
235 Ping between all ipv4 hosts in the topology.
236 """
You Wangd66de192018-04-30 17:30:12 -0700237 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
238 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
239 main.case( "Test switch failures with IPv4 hosts" )
240 setupTest( main, test_idx=201, onosNodes=3, ipv6=False, external=False )
241 verify( main, ipv6=False, external=False, disconnected=False )
242 verifySwitchFailure( main, ipv6=False, external=False )
243 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800244
245 def CASE202( self, main ):
246 """
247 Kill and recover spine switches
248 Ping between all ipv6 hosts in the topology.
249 """
You Wangd66de192018-04-30 17:30:12 -0700250 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
251 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
252 main.case( "Test switch failures with IPv6 hosts" )
253 setupTest( main, test_idx=202, onosNodes=3, ipv4=False, external=False )
254 verify( main, ipv4=False, external=False, disconnected=False )
255 verifySwitchFailure( main, ipv4=False, external=False )
256 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800257
258 def CASE203( self, main ):
259 """
260 Kill and recover spine switches
261 Ping between all ipv4 and ipv6 hosts in the topology.
262 """
You Wangd66de192018-04-30 17:30:12 -0700263 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
264 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
265 main.case( "Test switch failures with IPv4 and IPv6 hosts" )
266 setupTest( main, test_idx=203, onosNodes=3, external=False )
267 verify( main, external=False, disconnected=False )
268 verifySwitchFailure( main, external=False )
269 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800270
271 def CASE204( self, main ):
272 """
273 Kill and recover spine switches
274 Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts
275 """
You Wangd66de192018-04-30 17:30:12 -0700276 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
277 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
278 main.case( "Test switch failures with IPv4 hosts including external hosts" )
279 setupTest( main, test_idx=204, onosNodes=3, ipv6=False )
280 verify( main, ipv6=False, disconnected=False )
281 verifySwitchFailure( main, ipv6=False )
282 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800283
284 def CASE205( self, main ):
285 """
286 Kill and recover spine switches
287 Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts
288 """
You Wangd66de192018-04-30 17:30:12 -0700289 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
290 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
291 main.case( "Test switch failures with IPv6 hosts including external hosts" )
292 setupTest( main, test_idx=205, onosNodes=3, ipv4=False )
293 verify( main, ipv4=False, disconnected=False )
294 verifySwitchFailure( main, ipv4=False )
295 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800296
297 def CASE206( self, main ):
298 """
299 Kill and recover spine switches
300 Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts
301 """
You Wangd66de192018-04-30 17:30:12 -0700302 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
303 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
304 main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts" )
305 setupTest( main, test_idx=206, onosNodes=3 )
306 verify( main, disconnected=False )
307 verifySwitchFailure( main )
308 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800309
310 def CASE207( self, main ):
311 """
312 Kill and recover spine switches
313 Ping between ipv4 hosts and an external host that is not configured in
314 external router config, but reachable through the use of route-add command.
315 """
You Wangd66de192018-04-30 17:30:12 -0700316 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
317 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
318 main.case( "Test switch failures with IPv4 hosts including external hosts configured with route-add command" )
319 setupTest( main, test_idx=207, onosNodes=3, ipv6=False, external=False )
320 verify( main, ipv6=False, disconnected=False )
321 verifySwitchFailure( main, ipv6=False, internal=False )
322 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800323
324 def CASE208( self, main ):
325 """
326 Kill and recover spine switches
327 Ping between ipv6 hosts and an external host that is not configured in
328 external router config, but reachable through the use of route-add command.
329 """
You Wangd66de192018-04-30 17:30:12 -0700330 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
331 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
332 main.case( "Test switch failures with IPv6 hosts including external hosts configured with route-add command" )
333 setupTest( main, test_idx=208, onosNodes=3, ipv4=False, external=False )
334 verify( main, ipv4=False, disconnected=False )
335 verifySwitchFailure( main, ipv4=False, internal=False )
336 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800337
338 def CASE209( self, main ):
339 """
340 Kill and recover spine switches
341 Ping between ipv4 and pv6 hosts and external hosts that is not configured in
342 external router config, but reachable through the use of route-add command.
343 """
You Wangd66de192018-04-30 17:30:12 -0700344 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
345 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
346 main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
347 setupTest( main, test_idx=209, onosNodes=3, external=False )
348 verify( main, disconnected=False )
349 verifySwitchFailure( main, internal=False )
350 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800351
Jon Hall3c910162018-03-07 14:42:16 -0800352 def CASE301( self, main ):
353 """
You Wangd66de192018-04-30 17:30:12 -0700354 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800355 Ping between all ipv4 hosts in the topology.
356 """
You Wangd66de192018-04-30 17:30:12 -0700357 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
358 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
359 main.case( "Test onos failures with IPv4 hosts" )
360 setupTest( main, test_idx=301, onosNodes=3, ipv6=False, external=False )
361 verify( main, ipv6=False, external=False, disconnected=False )
362 verifyOnosFailure( main, ipv6=False, external=False )
363 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800364
365 def CASE302( self, main ):
366 """
You Wangd66de192018-04-30 17:30:12 -0700367 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800368 Ping between all ipv6 hosts in the topology.
369 """
You Wangd66de192018-04-30 17:30:12 -0700370 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
371 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
372 main.case( "Test onos failures with IPv6 hosts" )
373 setupTest( main, test_idx=302, onosNodes=3, ipv4=False, external=False )
374 verify( main, ipv4=False, external=False, disconnected=False )
375 verifyOnosFailure( main, ipv4=False, external=False )
376 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800377
378 def CASE303( self, main ):
379 """
You Wangd66de192018-04-30 17:30:12 -0700380 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800381 Ping between all ipv4 and ipv6 hosts in the topology.
382 """
You Wangd66de192018-04-30 17:30:12 -0700383 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
384 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
385 main.case( "Test onos failures with IPv4 and IPv6 hosts" )
386 setupTest( main, test_idx=303, onosNodes=3, external=False )
387 verify( main, external=False, disconnected=False )
388 verifyOnosFailure( main, external=False )
389 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800390
391 def CASE304( self, main ):
392 """
You Wangd66de192018-04-30 17:30:12 -0700393 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800394 Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts
395 """
You Wangd66de192018-04-30 17:30:12 -0700396 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
397 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
398 main.case( "Test onos failures with IPv4 hosts including external hosts" )
399 setupTest( main, test_idx=304, onosNodes=3, ipv6=False )
400 verify( main, ipv6=False, disconnected=False )
401 verifyOnosFailure( main, ipv6=False )
402 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800403
404 def CASE305( self, main ):
405 """
You Wangd66de192018-04-30 17:30:12 -0700406 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800407 Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts
408 """
You Wangd66de192018-04-30 17:30:12 -0700409 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
410 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
411 main.case( "Test onos failures with IPv6 hosts including external hosts" )
412 setupTest( main, test_idx=305, onosNodes=3, ipv4=False )
413 verify( main, ipv4=False, disconnected=False )
414 verifyOnosFailure( main, ipv4=False )
415 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800416
417 def CASE306( self, main ):
418 """
You Wangd66de192018-04-30 17:30:12 -0700419 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800420 Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts
421 """
You Wangd66de192018-04-30 17:30:12 -0700422 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
423 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
424 main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts" )
425 setupTest( main, test_idx=306, onosNodes=3 )
426 verify( main, disconnected=False )
427 verifyOnosFailure( main )
428 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800429
430 def CASE307( self, main ):
431 """
You Wangd66de192018-04-30 17:30:12 -0700432 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800433 Ping between ipv4 hosts and an external host that is not configured in
434 external router config, but reachable through the use of route-add command.
435 """
You Wangd66de192018-04-30 17:30:12 -0700436 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
437 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
438 main.case( "Test onos failures with IPv4 hosts including external hosts configured with route-add command" )
439 setupTest( main, test_idx=307, onosNodes=3, ipv6=False, external=False )
440 verify( main, ipv6=False, disconnected=False )
441 verifyOnosFailure( main, ipv6=False, internal=False )
442 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800443
444 def CASE308( self, main ):
445 """
You Wangd66de192018-04-30 17:30:12 -0700446 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800447 Ping between ipv6 hosts and an external host that is not configured in
448 external router config, but reachable through the use of route-add command.
449 """
You Wangd66de192018-04-30 17:30:12 -0700450 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
451 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
452 main.case( "Test onos failures with IPv6 hosts including external hosts configured with route-add command" )
453 setupTest( main, test_idx=308, onosNodes=3, ipv4=False, external=False )
454 verify( main, ipv4=False, disconnected=False )
455 verifyOnosFailure( main, ipv4=False, internal=False )
456 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800457
458 def CASE309( self, main ):
459 """
You Wangd66de192018-04-30 17:30:12 -0700460 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800461 Ping between ipv4 and pv6 hosts and external hosts that is not configured in
462 external router config, but reachable through the use of route-add command.
463 """
You Wangd66de192018-04-30 17:30:12 -0700464 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
465 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
466 main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
467 setupTest( main, test_idx=309, onosNodes=3, external=False )
468 verify( main, disconnected=False )
469 verifyOnosFailure( main, internal=False )
470 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800471
Jon Halla604fd42018-05-04 14:27:27 -0700472 def CASE601( self, main ):
473 """
474 Bring down all switches
475 Verify Topology
476 Bring up all switches
477 Verify
478
479 repeat x3
480 """
481 import time
482 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
483 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
484 main.case( "Bring down all switches then recover" )
485 setupTest( main, test_idx=601, external=False )
486 main.Cluster.next().CLI.balanceMasters()
487 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
488 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
489 totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] )
490 totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] )
491 switchList = [ 'spine101', 'spine102', 'spine103', 'spine104',
492 'leaf1', 'leaf2', 'leaf3', 'leaf4', 'leaf5', 'leaf6' ]
493 verify( main, disconnected=False, external=False )
494 for i in range( 1, 4 ):
495 main.log.info( "Beginning iteration {} of stopping then starting all switches".format( i ) )
496 main.log.debug( main.Cluster.next().summary() )
497 # Bring down all switches
498 main.step( "Stopping switches - iteration " + str( i ) )
499 switchStop = main.TRUE
500 for switch in switchList:
501 switchStop = switchStop and main.Network.switch( SW=switch, OPTION="stop" )
502 utilities.assert_equals( expect=main.TRUE, actual=switchStop,
503 onpass="All switches stopped",
504 onfail="Failed to stop all switches" )
505
506 time.sleep( 60 )
507 lib.verifyTopology( main, 0, 0, main.Cluster.numCtrls )
508 # Bring up all switches
509 main.log.debug( main.Cluster.next().summary() )
510 main.step( "Starting switches - iteration " + str( i ) )
511 switchStart = main.TRUE
512 for switch in switchList:
513 switchStart = switchStart and main.Network.switch( SW=switch, OPTION="start" )
514 utilities.assert_equals( expect=main.TRUE, actual=switchStart,
515 onpass="All switches started",
516 onfail="Failed to start all switches" )
517
518 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
519 lib.verifyTopology( main, totalSwitches, totalLinks, main.Cluster.numCtrls )
520 main.log.debug( main.Cluster.next().summary() )
521 time.sleep( 60 )
522 main.log.debug( main.Cluster.next().summary() )
523 time.sleep( 60 )
524 main.log.debug( main.Cluster.next().summary() )
525 verifyPing( main )
526 verify( main, disconnected=False, external=False )
527 verify( main, disconnected=False, external=False )
528 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
529
You Wangc02f3be2018-05-18 12:14:23 -0700530 def CASE602( self, main ):
531 """"
532 Take down a leaf switch that is paired and has a dual homed host
533 Restore the leaf switch
534 Repeat for various dual homed hosts and paired switches
535 """
536 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
537 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
538 main.case( "Drop a leaf switch that is paired and has a dual homed host." )
539 setupTest( main, test_idx=602, onosNodes=3 )
540 verify( main, disconnected=False )
You Wangbe98fb12018-05-24 16:15:17 -0700541 # We need to disable ports toward dual-homed hosts before killing the leaf switch
542 portsToDisable = [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ],
543 [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ]
544 lib.disablePortBatch( main, portsToDisable, 10, 48, 5 )
You Wangc02f3be2018-05-18 12:14:23 -0700545 # Kill leaf-2
546 lib.killSwitch( main, "leaf2", 9, 38 )
You Wangbe98fb12018-05-24 16:15:17 -0700547 # FIXME: the downed interfaces on h4v6 and h5v6 won't disappear because they are
548 # configured by netcfg
You Wangc02f3be2018-05-18 12:14:23 -0700549 hostLocations = { "h4v6": "of:0000000000000003/6",
You Wangbe98fb12018-05-24 16:15:17 -0700550 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
You Wangc02f3be2018-05-18 12:14:23 -0700551 "h4v4": "of:0000000000000003/10",
552 "h5v4": "of:0000000000000003/11" }
553 lib.verifyHostLocations( main, hostLocations )
554 main.disconnectedIpv4Hosts = [ "h3v4" ]
555 main.disconnectedIpv6Hosts = [ "h3v6" ]
556 verify( main )
557 # Recover leaf-2
You Wangbe98fb12018-05-24 16:15:17 -0700558 lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True )
You Wangc02f3be2018-05-18 12:14:23 -0700559 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
560 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
561 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
562 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
563 lib.verifyHostLocations( main, hostLocations )
564 main.disconnectedIpv4Hosts = []
565 main.disconnectedIpv6Hosts = []
566 verify( main, disconnected=False )
You Wangbe98fb12018-05-24 16:15:17 -0700567 # We need to disable ports toward dual-homed hosts before killing the leaf switch
568 portsToDisable = [ [ "of:0000000000000004", 7 ], [ "of:0000000000000004", 8 ],
569 [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ] ]
570 lib.disablePortBatch( main, portsToDisable, 10, 48, 5 )
You Wangc02f3be2018-05-18 12:14:23 -0700571 # Kill leaf-4
572 lib.killSwitch( main, "leaf4", 9, 38 )
You Wangbe98fb12018-05-24 16:15:17 -0700573 hostLocations = { "h9v6": [ "of:0000000000000004/7", "of:0000000000000005/6" ],
574 "h10v6": [ "of:0000000000000004/8", "of:0000000000000005/7" ],
You Wangc02f3be2018-05-18 12:14:23 -0700575 "h9v4": "of:0000000000000005/9",
576 "h10v4": "of:0000000000000005/10" }
577 lib.verifyHostLocations( main, hostLocations )
578 main.disconnectedIpv4Hosts = [ "h8v4" ]
579 main.disconnectedIpv6Hosts = [ "h8v6" ]
580 verify( main )
581 # Recover leaf-4
You Wangbe98fb12018-05-24 16:15:17 -0700582 lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True )
You Wangc02f3be2018-05-18 12:14:23 -0700583 hostLocations = { "h9v6": [ "of:0000000000000004/7", "of:0000000000000005/6" ],
584 "h10v6": [ "of:0000000000000004/8", "of:0000000000000005/7" ],
585 "h9v4": [ "of:0000000000000004/10", "of:0000000000000005/9" ],
586 "h10v4": [ "of:0000000000000004/11", "of:0000000000000005/10" ] }
587 lib.verifyHostLocations( main, hostLocations )
588 main.disconnectedIpv4Hosts = []
589 main.disconnectedIpv6Hosts = []
590 verify( main, disconnected=False )
591 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
592
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700593 def CASE603( self, main ):
594 """"
595 Drop HAGG-1 device and test connectivity.
596 Drop DAAS-1 device and test connectivity (some hosts lost it)
597 Bring up DAAS-1 and test connectivity (all hosts gained it again)
598
599 Repeat the same with HAGG-2 and DAAS-2.
600 """
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700601 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
602 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
603 main.case( "Drop hagg spine switch along with dass leaf switch." )
604 setupTest( main, test_idx=603, onosNodes=3 )
605 main.disconnectedIpv4Hosts = []
606 main.disconnectedIpv6Hosts = []
607
608 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700609 lib.killSwitch( main, "spine103",
610 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
611 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700612 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700613 lib.killSwitch( main, "leaf6",
614 int( main.params[ "TOPO" ]["switchNum" ] ) - 2,
615 int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700616 main.disconnectedIpv4Hosts = [ 'h12v4', 'h13v4']
617 main.disconnectedIpv6Hosts = [ 'h12v6', 'h13v6']
618 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700619 lib.recoverSwitch( main, "leaf6",
620 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
621 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6,
622 rediscoverHosts=True)
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700623 main.disconnectedIpv4Hosts = []
624 main.disconnectedIpv6Hosts = []
625 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700626 lib.recoverSwitch( main, "spine103",
627 int( main.params[ "TOPO" ][ "switchNum" ] ),
628 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700629 verify( main )
630
Jon Halla604fd42018-05-04 14:27:27 -0700631 lib.killSwitch( main, "spine104",
632 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
633 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700634 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700635 lib.killSwitch( main, "leaf1",
636 int( main.params[ "TOPO" ]["switchNum" ] ) - 2,
637 int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700638 main.disconnectedIpv4Hosts = [ 'h1v4', 'h2v4']
639 main.disconnectedIpv6Hosts = [ 'h1v6', 'h2v6']
640 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700641 lib.recoverSwitch( main, "leaf1",
642 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
643 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6,
644 rediscoverHosts=True )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700645 main.disconnectedIpv4Hosts = []
646 main.disconnectedIpv6Hosts = []
647 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700648 lib.recoverSwitch( main, "spine104",
649 int( main.params[ "TOPO" ][ "switchNum" ] ),
650 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700651 verify( main )
652
653 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
654
655 def CASE604( self, main ):
656 """"
657 Drop HAGG-1 device and test connectivity.
658 Bring up HAGG-1 and test connectivity.
659 Drop HAGG-2 device and test connectivity.
660 Bring up HAGG-2 device and test connectivity
661 """
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700662 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
663 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
664 main.case( "Drop hagg spine switches." )
665 setupTest( main, test_idx=604, onosNodes=3 )
666 main.disconnectedIpv4Hosts = []
667 main.disconnectedIpv6Hosts = []
668 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700669 lib.killSwitch( main, "spine103",
670 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
671 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700672 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700673 lib.recoverSwitch( main, "spine103",
674 int( main.params[ "TOPO" ][ "switchNum" ] ),
675 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700676 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700677 lib.killSwitch( main, "spine104",
678 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
679 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700680 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700681 lib.recoverSwitch( main, "spine104",
682 int( main.params[ "TOPO" ][ "switchNum" ] ),
683 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700684 verify( main )
685 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
686
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700687 def CASE605( self, main ):
688 """
689 Drop HAGG-1 and test connectivity (expect no failure)
690 Drop all leafs in big fabric and test connectivity (expect some failures)
691 Bring up HAGG-1 and test connectivity (still expect some failures)
692 Bring up all leafs in big fabric and test connectivity (expect no failure)
693 Repeat above with HAGG-2
694 """
695 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
696 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
697 main.case( "Drop one hagg and all leafs in big fabric" )
698 setupTest( main, test_idx=605, onosNodes=3 )
699 main.disconnectedIpv4Hosts = []
700 main.disconnectedIpv6Hosts = []
701 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700702 lib.killSwitch( main, "spine103",
703 int( main.params[ "TOPO" ][ "switchNum" ] ) - 1,
704 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700705 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700706 lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
707 int( main.params[ "TOPO" ][ "switchNum" ] ) - 5,
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700708 int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 )
709 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ]
710 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ]
711 main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ]
712 main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ]
713 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700714 lib.recoverSwitch( main, "spine103",
715 int( main.params[ "TOPO" ][ "switchNum" ] ) - 4,
716 int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700717 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700718 lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
719 int( main.params[ "TOPO" ][ "switchNum" ] ),
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700720 int( main.params[ "TOPO" ][ "linkNum" ] ) )
721 main.disconnectedIpv4Hosts = []
722 main.disconnectedIpv6Hosts = []
723 main.disconnectedExternalIpv4Hosts = [ ]
724 main.disconnectedExternalIpv6Hosts = [ ]
725 verify( main )
726
Jon Halla604fd42018-05-04 14:27:27 -0700727 lib.killSwitch( main, "spine104",
728 int( main.params[ "TOPO" ][ "switchNum" ] ) - 1,
729 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700730 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700731 lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
732 int( main.params[ "TOPO" ][ "switchNum" ] ) - 5,
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700733 int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 )
734 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ]
735 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ]
736 main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ]
737 main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ]
738 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700739 lib.recoverSwitch( main, "spine104",
740 int( main.params[ "TOPO" ][ "switchNum" ] ) - 4,
741 int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700742 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700743 lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
744 int( main.params[ "TOPO" ][ "switchNum" ] ),
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700745 int( main.params[ "TOPO" ][ "linkNum" ] ) )
746 main.disconnectedIpv4Hosts = []
747 main.disconnectedIpv6Hosts = []
748 main.disconnectedExternalIpv4Hosts = [ ]
749 main.disconnectedExternalIpv6Hosts = [ ]
750 verify( main )
751 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
752
You Wang5da39c82018-04-26 22:55:08 -0700753 def CASE606( self, main ):
754 """
755 Drop SPINE-1 and test connectivity
756 Drop paired leaf and test connectivity (expect some failures)
757 Bring up SPINE-1 and test connectivity (still expect some failures)
758 Bring up the paired leaf and test connectivity
759 Repeat above with SPINE-2 and a different paired leaf
760 """
You Wang5da39c82018-04-26 22:55:08 -0700761 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
762 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
763 main.case( "Drop spine and paired leaf" )
764 setupTest( main, test_idx=606, onosNodes=3 )
You Wangd66de192018-04-30 17:30:12 -0700765 verify( main, disconnected=False )
You Wang6d2d6312018-05-08 12:02:02 -0700766 # Drop spine101 and leaf-2/3
You Wangd66de192018-04-30 17:30:12 -0700767 lib.killSwitch( main, "spine101", 9, 30 )
768 verify( main, disconnected=False )
769 lib.killSwitch( main, "leaf2", 8, 24 )
770 lib.killSwitch( main, "leaf3", 7, 20 )
You Wang5da39c82018-04-26 22:55:08 -0700771 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4" ]
772 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6" ]
You Wangd66de192018-04-30 17:30:12 -0700773 verify( main )
774 lib.recoverSwitch( main, "spine101", 8, 30 )
775 verify( main )
776 lib.recoverSwitch( main, "leaf3", 9, 38 )
You Wang6d2d6312018-05-08 12:02:02 -0700777 lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True,
778 hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
You Wang5da39c82018-04-26 22:55:08 -0700779 main.disconnectedIpv4Hosts = []
780 main.disconnectedIpv6Hosts = []
You Wang6d2d6312018-05-08 12:02:02 -0700781 verify( main, disconnected=False )
782 # Drop spine102 and leaf-4/5
783 lib.killSwitch( main, "spine102", 9, 30 )
784 verify( main, disconnected=False )
785 lib.killSwitch( main, "leaf4", 8, 24 )
786 lib.killSwitch( main, "leaf5", 7, 20 )
787 main.disconnectedIpv4Hosts = [ "h8v4", "h9v4", "h10v4", "h11v4" ]
788 main.disconnectedIpv6Hosts = [ "h8v6", "h9v6", "h10v6", "h11v6" ]
789 verify( main, external=False )
790 lib.recoverSwitch( main, "spine102", 8, 30 )
791 verify( main, external=False )
792 lib.recoverSwitch( main, "leaf5", 9, 38 )
793 lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True,
794 hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
795 main.disconnectedIpv4Hosts = []
796 main.disconnectedIpv6Hosts = []
797 verify( main, disconnected=False )
798 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
799
800 def CASE620( self, main ):
801 """
802 Take down one of double links towards the spine from all leaf switches and
803 check that buckets in select groups change accordingly
804 Bring up links again and check that buckets in select groups change accordingly
805 """
You Wang6d2d6312018-05-08 12:02:02 -0700806 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
807 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
808 main.case( "Take down one of double links towards the spine" )
809 setupTest( main, test_idx=620, onosNodes=3 )
810 verify( main, disconnected=False )
You Wangc02f3be2018-05-18 12:14:23 -0700811 groupBuckets = { "of:0000000000000002": { "10.1.0.0/24": 4, "10.1.10.0/24": 4,
812 "10.2.0.0/24": 1, "10.2.30.0/24": 1, "10.2.20.0/24": 1,
813 "10.2.10.0/24": 4, "10.2.40.0/24": 4,
814 "10.3.0.0/24": 4, "10.3.10.0/24": 8, "10.3.30.0/24": 8,
815 "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 },
816 "of:0000000000000003": { "10.1.0.0/24": 4, "10.1.10.0/24": 4,
817 "10.2.0.0/24": 4, "10.2.30.0/24": 1, "10.2.20.0/24": 1,
818 "10.2.10.0/24": 1, "10.2.40.0/24": 1,
819 "10.3.0.0/24": 4, "10.3.10.0/24": 8, "10.3.30.0/24": 8,
820 "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 },
821 "of:0000000000000004": { "10.1.0.0/24": 4, "10.1.10.0/24": 4,
822 "10.2.0.0/24": 4, "10.2.30.0/24": 8, "10.2.20.0/24": 8,
823 "10.2.10.0/24": 4, "10.2.40.0/24": 4,
824 "10.3.0.0/24": 1, "10.3.10.0/24": 1, "10.3.30.0/24": 1,
825 "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 },
826 "of:0000000000000005": { "10.1.0.0/24": 4, "10.1.10.0/24": 4,
827 "10.2.0.0/24": 4, "10.2.30.0/24": 8, "10.2.20.0/24": 8,
828 "10.2.10.0/24": 4, "10.2.40.0/24": 4,
829 "10.3.0.0/24": 4, "10.3.10.0/24": 1, "10.3.30.0/24": 1,
830 "10.3.20.0/24": 1, "10.5.10.0/24": 4, "10.5.20.0/24": 4 } }
831 for switch, subnets in groupBuckets.items():
832 lib.checkGroupsForBuckets( main, switch, subnets )
833 # Take down one of double links
You Wang6d2d6312018-05-08 12:02:02 -0700834 portsToDisable = [ [ "of:0000000000000002", 1 ], [ "of:0000000000000002", 3 ],
835 [ "of:0000000000000003", 1 ], [ "of:0000000000000003", 3 ],
836 [ "of:0000000000000004", 1 ], [ "of:0000000000000004", 3 ],
837 [ "of:0000000000000005", 1 ], [ "of:0000000000000005", 3 ] ]
You Wang85747762018-05-11 15:51:50 -0700838 lib.disablePortBatch( main, portsToDisable, 10, 32 )
You Wangc02f3be2018-05-18 12:14:23 -0700839 groupBucketsNew = { "of:0000000000000002": { "10.1.0.0/24": 2, "10.1.10.0/24": 2,
840 "10.2.0.0/24": 1, "10.2.30.0/24": 1, "10.2.20.0/24": 1,
841 "10.2.10.0/24": 2, "10.2.40.0/24": 2,
842 "10.3.0.0/24": 2, "10.3.10.0/24": 4, "10.3.30.0/24": 4,
843 "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 },
844 "of:0000000000000003": { "10.1.0.0/24": 2, "10.1.10.0/24": 2,
845 "10.2.0.0/24": 2, "10.2.30.0/24": 1, "10.2.20.0/24": 1,
846 "10.2.10.0/24": 1, "10.2.40.0/24": 1,
847 "10.3.0.0/24": 2, "10.3.10.0/24": 4, "10.3.30.0/24": 4,
848 "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 },
849 "of:0000000000000004": { "10.1.0.0/24": 2, "10.1.10.0/24": 2,
850 "10.2.0.0/24": 2, "10.2.30.0/24": 4, "10.2.20.0/24": 4,
851 "10.2.10.0/24": 2, "10.2.40.0/24": 2,
852 "10.3.0.0/24": 1, "10.3.10.0/24": 1, "10.3.30.0/24": 1,
853 "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 },
854 "of:0000000000000005": { "10.1.0.0/24": 2, "10.1.10.0/24": 2,
855 "10.2.0.0/24": 2, "10.2.30.0/24": 4, "10.2.20.0/24": 4,
856 "10.2.10.0/24": 2, "10.2.40.0/24": 2,
857 "10.3.0.0/24": 2, "10.3.10.0/24": 1, "10.3.30.0/24": 1,
858 "10.3.20.0/24": 1, "10.5.10.0/24": 2, "10.5.20.0/24": 2 } }
859 for switch, subnets in groupBucketsNew.items():
860 lib.checkGroupsForBuckets( main, switch, subnets )
You Wang6d2d6312018-05-08 12:02:02 -0700861 verify( main, disconnected=False )
You Wangc02f3be2018-05-18 12:14:23 -0700862 # Bring up the links
You Wang85747762018-05-11 15:51:50 -0700863 lib.enablePortBatch( main, portsToDisable, 10, 48 )
You Wangc02f3be2018-05-18 12:14:23 -0700864 for switch, subnets in groupBuckets.items():
865 lib.checkGroupsForBuckets( main, switch, subnets )
You Wang6d2d6312018-05-08 12:02:02 -0700866 verify( main, disconnected=False )
867 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
868
869 def CASE621( self, main ):
870 """
871 Remove all the links in the network and restore all Links (repeat x3)
872 """
873 import time
874 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
875 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
876 main.case( "Remove all the links in the network and restore all Links" )
877 setupTest( main, test_idx=621, onosNodes=3 )
878 verify( main, disconnected=False )
879 linksToRemove = [ ["spine101", "spine103"], ["spine102", "spine104"],
880 ["spine103", "leaf6"], ["spine103", "leaf1"],
881 ["spine104", "leaf6"], ["spine104", "leaf1"],
882 ["spine101", "leaf2"], ["spine101", "leaf3"], ["spine101", "leaf4"], ["spine101", "leaf5"],
883 ["spine102", "leaf2"], ["spine102", "leaf3"], ["spine102", "leaf4"], ["spine102", "leaf5"],
884 ["leaf2", "leaf3"], ["leaf4", "leaf5"] ]
885 portsToDisable = [ [ "of:0000000000000001", 3 ], [ "of:0000000000000001", 4 ],
886 [ "of:0000000000000001", 5 ], [ "of:0000000000000001", 6 ],
887 [ "of:0000000000000002", 6 ], [ "of:0000000000000002", 7 ],
888 [ "of:0000000000000002", 8 ], [ "of:0000000000000002", 9 ],
889 [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ],
890 [ "of:0000000000000003", 6 ], [ "of:0000000000000003", 7 ],
891 [ "of:0000000000000003", 8 ], [ "of:0000000000000003", 9 ],
892 [ "of:0000000000000003", 10 ], [ "of:0000000000000003", 11 ],
893 [ "of:0000000000000003", 12 ], [ "of:0000000000000003", 13 ],
894 [ "of:0000000000000004", 6 ], [ "of:0000000000000004", 7 ],
895 [ "of:0000000000000004", 8 ], [ "of:0000000000000004", 9 ],
896 [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ],
897 [ "of:0000000000000004", 12 ], [ "of:0000000000000004", 13 ], [ "of:0000000000000004", 14 ],
898 [ "of:0000000000000005", 6 ], [ "of:0000000000000005", 7 ],
899 [ "of:0000000000000005", 8 ], [ "of:0000000000000005", 9 ],
900 [ "of:0000000000000005", 10 ], [ "of:0000000000000005", 11 ],
901 [ "of:0000000000000005", 12 ], [ "of:0000000000000005", 13 ],
902 [ "of:0000000000000005", 14 ], [ "of:0000000000000005", 15 ],
903 [ "of:0000000000000006", 3 ], [ "of:0000000000000006", 4 ],
904 [ "of:0000000000000006", 5 ], [ "of:0000000000000006", 6 ] ]
905 for i in range( 0, 3 ):
906 lib.killLinkBatch( main, linksToRemove, 0, 10 )
You Wang85747762018-05-11 15:51:50 -0700907 lib.disablePortBatch( main, portsToDisable, 10, 0 )
You Wang6d2d6312018-05-08 12:02:02 -0700908 main.disconnectedIpv4Hosts = main.internalIpv4Hosts
909 main.disconnectedIpv6Hosts = main.internalIpv6Hosts
910 verify( main )
911 lib.restoreLinkBatch( main, linksToRemove, 48, 10 )
You Wang85747762018-05-11 15:51:50 -0700912 lib.enablePortBatch( main, portsToDisable, 10, 48 )
You Wang6d2d6312018-05-08 12:02:02 -0700913 main.Network.discoverHosts( hostList=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
914 time.sleep( 10 )
915 main.disconnectedIpv4Hosts = []
916 main.disconnectedIpv6Hosts = []
917 verify( main )
918 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
919
920 def CASE622( self, main ):
921 """
922 Take down all uplinks from a paired leaf switch
923 """
You Wang6d2d6312018-05-08 12:02:02 -0700924 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
925 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
926 from core import utilities
927 main.case( "Take down all uplinks from a paired leaf switch" )
928 setupTest( main, test_idx=622, onosNodes=3 )
929 verify( main, disconnected=False )
You Wang85747762018-05-11 15:51:50 -0700930 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
931 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
932 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
933 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
934 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700935 linksToRemove = [ ["spine101", "leaf2"], ["spine102", "leaf2"] ]
936 lib.killLinkBatch( main, linksToRemove, 40, 10 )
937 # TODO: more verifications are required
You Wangc02f3be2018-05-18 12:14:23 -0700938 main.disconnectedIpv4Hosts = [ "h3v4" ]
939 main.disconnectedIpv6Hosts = [ "h3v6" ]
You Wangd66de192018-04-30 17:30:12 -0700940 verify( main )
You Wang85747762018-05-11 15:51:50 -0700941 hostLocations = { "h4v6": "of:0000000000000003/6",
You Wangbe98fb12018-05-24 16:15:17 -0700942 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
You Wang85747762018-05-11 15:51:50 -0700943 "h4v4": "of:0000000000000003/10",
944 "h5v4": "of:0000000000000003/11" }
945 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700946 lib.restoreLinkBatch( main, linksToRemove, 48, 10 )
You Wangc02f3be2018-05-18 12:14:23 -0700947 main.disconnectedIpv4Hosts = []
948 main.disconnectedIpv6Hosts = []
949 verify( main, disconnected=False )
You Wang85747762018-05-11 15:51:50 -0700950 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
951 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
952 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
953 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
954 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700955 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
956
957 def CASE630( self, main ):
958 """
959 Bring an instance down
960 Drop a device
961 Bring that same instance up again and observe that this specific instance sees that the device is down.
962 """
You Wang6d2d6312018-05-08 12:02:02 -0700963 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
964 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
965 from core import utilities
966 main.case( "Bring an instance down and drop a device" )
967 setupTest( main, test_idx=630, onosNodes=3 )
968 onosToKill = 0
969 deviceToDrop = "spine101"
970 lib.killOnos( main, [ onosToKill ], 10, 48, 2 )
971 lib.killSwitch( main, deviceToDrop, 9, 30 )
972 lib.recoverOnos( main, [ onosToKill ], 9, 30, 3 )
973 result = main.Cluster.runningNodes[ onosToKill ].CLI.checkStatus( 9, 30, 3 )
974 utilities.assert_equals( expect=main.TRUE, actual=result,
975 onpass="ONOS instance {} sees correct device numbers".format( onosToKill ),
976 onfail="ONOS instance {} doesn't see correct device numbers".format( onosToKill ) )
You Wang5da39c82018-04-26 22:55:08 -0700977 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700978
Jon Halla604fd42018-05-04 14:27:27 -0700979 def CASE640( self, main ):
980 """
981 Controller instance going down and switch coming down at the same time and then we bring them up together
982
983 A. Instance goes down and SPINE-1 goes down
984 - All connectivity should be there
985 - Bring them up together
986 - All connectivity should be there
987 B. Instance goes down and HAGG-1 goes down
988 - All connectivity should be there
989 - Bring them up together
990 - All connectivity should be there
991 C. Instance goes down and a paired leaf switch goes down
992 - Single homed hosts in this leaf should lose connectivity all others should be ok
993 - Bring them up together
994 - Test connectivity
995 """
996 import time
997 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
998 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
999 main.case( "Drop an ONOS instance and switch(es) at the same time" )
1000 caseDict = { 'A': { 'switches': "spine101",
You Wangbe98fb12018-05-24 16:15:17 -07001001 'ports': [],
Jon Halla604fd42018-05-04 14:27:27 -07001002 'disconnectedV4': [],
1003 'disconnectedV6': [],
1004 'expectedSwitches': 9,
1005 'expectedLinks': 30 },
1006 'B': { 'switches': "spine103",
You Wangbe98fb12018-05-24 16:15:17 -07001007 'ports': [],
Jon Halla604fd42018-05-04 14:27:27 -07001008 'disconnectedV4': [],
1009 'disconnectedV6': [],
1010 'expectedSwitches': 9,
1011 'expectedLinks': 42 },
1012 'C': { 'switches': "leaf2",
You Wangbe98fb12018-05-24 16:15:17 -07001013 'ports': [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ],
1014 [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ],
Jon Halla604fd42018-05-04 14:27:27 -07001015 'disconnectedV4': [ "h3v4" ],
1016 'disconnectedV6': [ "h3v6" ],
1017 'expectedSwitches': 9,
1018 'expectedLinks': 38 } }
1019 totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] )
1020 totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] )
1021 nodeIndex = 0
1022 cases = sorted( caseDict.keys() )
1023 for case in cases:
1024 switches = caseDict[ case ][ 'switches' ]
You Wangbe98fb12018-05-24 16:15:17 -07001025 ports = caseDict[ case ][ 'ports' ]
Jon Halla604fd42018-05-04 14:27:27 -07001026 expectedSwitches = caseDict[ case ][ 'expectedSwitches' ]
1027 expectedLinks = caseDict[ case ][ 'expectedLinks' ]
1028 main.step( "\n640{}: Drop ONOS{} and switch(es) {} at the same time".format( case,
1029 nodeIndex + 1,
1030 switches ) )
1031 setupTest( main, test_idx=640 )
1032 main.Cluster.next().CLI.balanceMasters()
1033 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1034 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
1035 instance = main.Cluster.controllers[ nodeIndex ]
1036 verify( main, disconnected=False, external=False )
1037
1038 # Simultaneous failures
1039 main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) )
1040 killResult = main.ONOSbench.onosDie( instance.ipAddress )
1041 utilities.assert_equals( expect=main.TRUE, actual=killResult,
1042 onpass="ONOS node killed",
1043 onfail="Failed to kill ONOS node" )
1044 instance.active = False
1045 main.Cluster.reset()
You Wangbe98fb12018-05-24 16:15:17 -07001046 if ports:
1047 lib.disablePortBatch( main, ports, 10, 48, 0 )
Jon Halla604fd42018-05-04 14:27:27 -07001048 # TODO: Remove sleeps from the concurrent events
1049 lib.killSwitch( main, switches, expectedSwitches, expectedLinks )
1050 main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ]
1051 main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ]
1052
1053 # verify functionality
1054 main.log.debug( main.Cluster.next().summary() )
1055 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
1056 main.log.debug( main.Cluster.next().summary() )
1057 lib.verifyTopology( main, expectedSwitches, expectedLinks, main.Cluster.numCtrls - 1 )
1058 lib.verifyNodes( main )
1059 verify( main, external=False )
1060
1061 # Bring everything back up
1062 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
1063 main.disconnectedIpv4Hosts = []
1064 main.disconnectedIpv6Hosts = []
1065 lib.recoverOnos( main, [ nodeIndex ], expectedSwitches, expectedLinks, main.Cluster.numCtrls )
1066
1067 # Verify functionality
1068 lib.verifyNodes( main )
1069 verify( main, disconnected=False, external=False )
1070 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
1071 nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls
1072
1073 def CASE641( self, main ):
1074 """
1075 Controller instance going down while switch comes up at the same time
1076
1077 A. Take down SPINE-1
1078 - Test connectivity
1079 - Bring up SPINE-1 and drop an instance at the same time
1080 - Test connectivity
1081 - Bring up instance one
1082 - Test connectivity
1083 B. Take down HAGG-1
1084 - Test connectivity
1085 - Bring up HAGG-1 and drop an instance at the same time
1086 - Test connectivity
1087 - Bring up instance one
1088 - Test connectivity
1089 C. Take down a paired leaf switch
1090 - Test connectivity ( single homed hosts on this leaf will lose it )
1091 - Bring up paired leaf switch and drop a controller instance at the same time
1092 - Test connectivity
1093 - Bring up the instance
1094 - Test connectivity
1095 """
1096 import time
1097 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1098 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1099 main.case( "Drop an ONOS instance and recover switch(es) at the same time" )
1100 caseDict = { 'A': { 'switches': "spine101",
You Wangbe98fb12018-05-24 16:15:17 -07001101 'ports': [],
Jon Halla604fd42018-05-04 14:27:27 -07001102 'disconnectedV4': [],
1103 'disconnectedV6': [],
1104 'expectedSwitches': 9,
1105 'expectedLinks': 30 },
1106 'B': { 'switches': "spine103",
You Wangbe98fb12018-05-24 16:15:17 -07001107 'ports': [],
Jon Halla604fd42018-05-04 14:27:27 -07001108 'disconnectedV4': [],
1109 'disconnectedV6': [],
1110 'expectedSwitches': 9,
1111 'expectedLinks': 42 },
1112 'C': { 'switches': "leaf2",
You Wangbe98fb12018-05-24 16:15:17 -07001113 'ports': [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ],
1114 [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ],
Jon Halla604fd42018-05-04 14:27:27 -07001115 'disconnectedV4': [ "h3v4" ],
1116 'disconnectedV6': [ "h3v6" ],
1117 'expectedSwitches': 9,
1118 'expectedLinks': 38 } }
1119 totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] )
1120 totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] )
1121 nodeIndex = 0
1122 cases = sorted( caseDict.keys() )
1123 for case in cases:
1124 switches = caseDict[ case ][ 'switches' ]
You Wangbe98fb12018-05-24 16:15:17 -07001125 ports = caseDict[ case ][ 'ports' ]
Jon Halla604fd42018-05-04 14:27:27 -07001126 expectedSwitches = caseDict[ case ][ 'expectedSwitches' ]
1127 expectedLinks = caseDict[ case ][ 'expectedLinks' ]
1128 main.step( "\n641{}: Drop ONOS{} and recover switch(es) {} at the same time".format( case,
1129 nodeIndex + 1,
1130 switches ) )
1131 setupTest( main, test_idx=641 )
1132 main.Cluster.next().CLI.balanceMasters()
1133 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1134 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
1135 instance = main.Cluster.controllers[ nodeIndex ]
1136 verify( main, disconnected=False, external=False )
1137 # Drop the switch to setup scenario
You Wangbe98fb12018-05-24 16:15:17 -07001138 if ports:
1139 lib.disablePortBatch( main, ports, 10, 48, 5 )
Jon Halla604fd42018-05-04 14:27:27 -07001140 lib.killSwitch( main, switches, expectedSwitches, expectedLinks )
1141 main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ]
1142 main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ]
1143 verify( main, external=False )
1144
1145 # Simultaneous node failure and switch recovery
1146 main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) )
1147 killResult = main.ONOSbench.onosDie( instance.ipAddress )
1148 utilities.assert_equals( expect=main.TRUE, actual=killResult,
1149 onpass="ONOS node killed",
1150 onfail="Failed to kill ONOS node" )
1151 instance.active = False
1152 main.Cluster.reset()
1153 # TODO: Remove sleeps from the concurrent events
1154 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
1155 main.disconnectedIpv4Hosts = []
1156 main.disconnectedIpv6Hosts = []
1157
1158 # verify functionality
1159 main.log.debug( main.Cluster.next().summary() )
1160 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
1161 main.log.debug( main.Cluster.next().summary() )
1162 lib.verifyTopology( main, totalSwitches, totalLinks, main.Cluster.numCtrls - 1 )
1163 lib.verifyNodes( main )
1164 verify( main, disconnected=False, external=False )
1165
1166 # Bring everything back up and verify functionality
1167 lib.recoverOnos( main, [ nodeIndex ], totalSwitches, totalLinks, main.Cluster.numCtrls )
1168 lib.verifyNodes( main )
1169 verify( main, external=False )
1170 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
1171 nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls
1172
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001173 def CASE642( self, main ):
1174 """
1175 Drop one link from each double link
1176 Drop a link between DAAS-1 and HAAG-1
1177 Drop a link between HAGG-2 and SPINE-2
1178 Drop one ONOS instance
1179 Test connectivity (expect no failure)
1180 Bring up all links and ONOS instance
1181 Test connectivity (expect no failure)
1182 """
1183 import time
1184 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1185 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1186 main.case( "Drop ONOS instance and links at the same time" )
1187 setupTest( main, test_idx=642, onosNodes=3 )
1188 main.Cluster.active( 0 ).CLI.balanceMasters()
1189 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1190 verify( main )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001191 portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ],
1192 [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ],
1193 [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ],
1194 [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ],
1195 [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ],
1196 [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ],
1197 [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ],
1198 [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ],
1199 [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ],
1200 [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ],
1201 [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ]
You Wang85747762018-05-11 15:51:50 -07001202 lib.disablePortBatch( main, portsToDisable,
1203 int( main.params[ "TOPO" ][ "switchNum" ] ),
1204 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ),
1205 sleep=0 )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001206 lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1207 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ), 2 )
1208 verify( main )
You Wang85747762018-05-11 15:51:50 -07001209 lib.enablePortBatch( main, portsToDisable,
1210 int( main.params[ "TOPO" ][ "switchNum" ] ),
1211 int( main.params[ "TOPO" ][ "linkNum" ] ),
1212 sleep=0 )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001213 lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1214 int( main.params[ "TOPO" ][ "linkNum" ] ), 3 )
1215 verify( main )
1216 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
1217
1218 def CASE643( self, main ):
1219 """
1220 Drop one link from each double link
1221 Drop a link between DAAS-1 and HAAG-1
1222 Drop a link between HAGG-2 and SPINE-2
1223 Test connectivity (expect no failure)
1224 Bring up all links
1225 Drop one ONOS instance
1226 Test connectivity (expect no failure)
1227 Bring up ONOS instance
1228 Test connectivity (expect no failure)
1229 """
1230 import time
1231 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1232 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1233 main.case( "Drop ONOS instances and bring up links at the same time" )
1234 setupTest( main, test_idx=643, onosNodes=3 )
1235 main.Cluster.active( 0 ).CLI.balanceMasters()
1236 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1237 verify( main )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001238 portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ],
1239 [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ],
1240 [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ],
1241 [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ],
1242 [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ],
1243 [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ],
1244 [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ],
1245 [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ],
1246 [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ],
1247 [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ],
1248 [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ]
You Wang85747762018-05-11 15:51:50 -07001249 lib.disablePortBatch( main, portsToDisable,
1250 int( main.params[ "TOPO" ][ "switchNum" ] ),
1251 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ) )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001252 verify( main )
You Wang85747762018-05-11 15:51:50 -07001253 lib.enablePortBatch( main, portsToDisable,
1254 int( main.params[ "TOPO" ][ "switchNum" ] ),
1255 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001256 lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1257 int( main.params[ "TOPO" ][ "linkNum" ] ), 2 )
1258 verify( main )
1259 lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1260 int( main.params[ "TOPO" ][ "linkNum" ] ), 3 )
1261 verify( main )
1262 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jonghwan Hyun785471d2018-05-14 14:48:19 -07001263
1264 def CASE651( self, main ):
1265 """
1266 Move a single-homed host from port A to port B in DAAS-1
1267 Test connectivity (expect no failure)
1268
1269 Repeat with DAAS-2
1270 """
1271 import time
1272 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1273 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1274 main.case( "Move a single-homed host to another port in the same DAAS" )
1275 setupTest( main, test_idx=651, onosNodes=3 )
1276 main.Cluster.active( 0 ).CLI.balanceMasters()
1277 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1278 verify( main )
1279
1280 h1v4cfg = '{"of:0000000000000001/7" : { "interfaces" : [ { "ips" : [ "10.1.0.254/24" ], "vlan-untagged": 10 } ] } }'
1281 lib.moveHost( main, "h1v4", "leaf1", "leaf1", "10.1.0.254", prefixLen=24, cfg=h1v4cfg )
1282 verify( main )
1283
1284 h13v4cfg = '''{"of:0000000000000006/7" : { "interfaces" : [ { "ips" : [ "10.5.20.254/24" ], "vlan-untagged": 20 } ] } }'''
1285 lib.moveHost( main, "h13v4", "leaf6", "leaf6", "10.5.20.254", prefixLen=24, cfg=h13v4cfg )
1286 verify( main )