blob: 53f52bbdeba2caea138ab3437cecb36cdcbb68fc [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 )
541 # Kill leaf-2
542 lib.killSwitch( main, "leaf2", 9, 38 )
543 hostLocations = { "h4v6": "of:0000000000000003/6",
544 "h5v6": "of:0000000000000003/7",
545 "h4v4": "of:0000000000000003/10",
546 "h5v4": "of:0000000000000003/11" }
547 lib.verifyHostLocations( main, hostLocations )
548 main.disconnectedIpv4Hosts = [ "h3v4" ]
549 main.disconnectedIpv6Hosts = [ "h3v6" ]
550 verify( main )
551 # Recover leaf-2
552 lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True)
553 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
554 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
555 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
556 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
557 lib.verifyHostLocations( main, hostLocations )
558 main.disconnectedIpv4Hosts = []
559 main.disconnectedIpv6Hosts = []
560 verify( main, disconnected=False )
561 # Kill leaf-4
562 lib.killSwitch( main, "leaf4", 9, 38 )
563 hostLocations = { "h9v6": "of:0000000000000005/6",
564 "h10v6": "of:0000000000000005/7",
565 "h9v4": "of:0000000000000005/9",
566 "h10v4": "of:0000000000000005/10" }
567 lib.verifyHostLocations( main, hostLocations )
568 main.disconnectedIpv4Hosts = [ "h8v4" ]
569 main.disconnectedIpv6Hosts = [ "h8v6" ]
570 verify( main )
571 # Recover leaf-4
572 lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True)
573 hostLocations = { "h9v6": [ "of:0000000000000004/7", "of:0000000000000005/6" ],
574 "h10v6": [ "of:0000000000000004/8", "of:0000000000000005/7" ],
575 "h9v4": [ "of:0000000000000004/10", "of:0000000000000005/9" ],
576 "h10v4": [ "of:0000000000000004/11", "of:0000000000000005/10" ] }
577 lib.verifyHostLocations( main, hostLocations )
578 main.disconnectedIpv4Hosts = []
579 main.disconnectedIpv6Hosts = []
580 verify( main, disconnected=False )
581 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
582
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700583 def CASE603( self, main ):
584 """"
585 Drop HAGG-1 device and test connectivity.
586 Drop DAAS-1 device and test connectivity (some hosts lost it)
587 Bring up DAAS-1 and test connectivity (all hosts gained it again)
588
589 Repeat the same with HAGG-2 and DAAS-2.
590 """
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700591 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
592 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
593 main.case( "Drop hagg spine switch along with dass leaf switch." )
594 setupTest( main, test_idx=603, onosNodes=3 )
595 main.disconnectedIpv4Hosts = []
596 main.disconnectedIpv6Hosts = []
597
598 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700599 lib.killSwitch( main, "spine103",
600 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
601 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700602 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700603 lib.killSwitch( main, "leaf6",
604 int( main.params[ "TOPO" ]["switchNum" ] ) - 2,
605 int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700606 main.disconnectedIpv4Hosts = [ 'h12v4', 'h13v4']
607 main.disconnectedIpv6Hosts = [ 'h12v6', 'h13v6']
608 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700609 lib.recoverSwitch( main, "leaf6",
610 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
611 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6,
612 rediscoverHosts=True)
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700613 main.disconnectedIpv4Hosts = []
614 main.disconnectedIpv6Hosts = []
615 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700616 lib.recoverSwitch( main, "spine103",
617 int( main.params[ "TOPO" ][ "switchNum" ] ),
618 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700619 verify( main )
620
Jon Halla604fd42018-05-04 14:27:27 -0700621 lib.killSwitch( main, "spine104",
622 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
623 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700624 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700625 lib.killSwitch( main, "leaf1",
626 int( main.params[ "TOPO" ]["switchNum" ] ) - 2,
627 int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700628 main.disconnectedIpv4Hosts = [ 'h1v4', 'h2v4']
629 main.disconnectedIpv6Hosts = [ 'h1v6', 'h2v6']
630 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700631 lib.recoverSwitch( main, "leaf1",
632 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
633 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6,
634 rediscoverHosts=True )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700635 main.disconnectedIpv4Hosts = []
636 main.disconnectedIpv6Hosts = []
637 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700638 lib.recoverSwitch( main, "spine104",
639 int( main.params[ "TOPO" ][ "switchNum" ] ),
640 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700641 verify( main )
642
643 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
644
645 def CASE604( self, main ):
646 """"
647 Drop HAGG-1 device and test connectivity.
648 Bring up HAGG-1 and test connectivity.
649 Drop HAGG-2 device and test connectivity.
650 Bring up HAGG-2 device and test connectivity
651 """
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700652 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
653 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
654 main.case( "Drop hagg spine switches." )
655 setupTest( main, test_idx=604, onosNodes=3 )
656 main.disconnectedIpv4Hosts = []
657 main.disconnectedIpv6Hosts = []
658 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700659 lib.killSwitch( main, "spine103",
660 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
661 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700662 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700663 lib.recoverSwitch( main, "spine103",
664 int( main.params[ "TOPO" ][ "switchNum" ] ),
665 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700666 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700667 lib.killSwitch( main, "spine104",
668 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
669 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700670 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700671 lib.recoverSwitch( main, "spine104",
672 int( main.params[ "TOPO" ][ "switchNum" ] ),
673 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700674 verify( main )
675 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
676
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700677 def CASE605( self, main ):
678 """
679 Drop HAGG-1 and test connectivity (expect no failure)
680 Drop all leafs in big fabric and test connectivity (expect some failures)
681 Bring up HAGG-1 and test connectivity (still expect some failures)
682 Bring up all leafs in big fabric and test connectivity (expect no failure)
683 Repeat above with HAGG-2
684 """
685 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
686 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
687 main.case( "Drop one hagg and all leafs in big fabric" )
688 setupTest( main, test_idx=605, onosNodes=3 )
689 main.disconnectedIpv4Hosts = []
690 main.disconnectedIpv6Hosts = []
691 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700692 lib.killSwitch( main, "spine103",
693 int( main.params[ "TOPO" ][ "switchNum" ] ) - 1,
694 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700695 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700696 lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
697 int( main.params[ "TOPO" ][ "switchNum" ] ) - 5,
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700698 int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 )
699 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ]
700 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ]
701 main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ]
702 main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ]
703 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700704 lib.recoverSwitch( main, "spine103",
705 int( main.params[ "TOPO" ][ "switchNum" ] ) - 4,
706 int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700707 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700708 lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
709 int( main.params[ "TOPO" ][ "switchNum" ] ),
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700710 int( main.params[ "TOPO" ][ "linkNum" ] ) )
711 main.disconnectedIpv4Hosts = []
712 main.disconnectedIpv6Hosts = []
713 main.disconnectedExternalIpv4Hosts = [ ]
714 main.disconnectedExternalIpv6Hosts = [ ]
715 verify( main )
716
Jon Halla604fd42018-05-04 14:27:27 -0700717 lib.killSwitch( main, "spine104",
718 int( main.params[ "TOPO" ][ "switchNum" ] ) - 1,
719 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700720 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700721 lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
722 int( main.params[ "TOPO" ][ "switchNum" ] ) - 5,
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700723 int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 )
724 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ]
725 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ]
726 main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ]
727 main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ]
728 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700729 lib.recoverSwitch( main, "spine104",
730 int( main.params[ "TOPO" ][ "switchNum" ] ) - 4,
731 int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700732 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700733 lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
734 int( main.params[ "TOPO" ][ "switchNum" ] ),
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700735 int( main.params[ "TOPO" ][ "linkNum" ] ) )
736 main.disconnectedIpv4Hosts = []
737 main.disconnectedIpv6Hosts = []
738 main.disconnectedExternalIpv4Hosts = [ ]
739 main.disconnectedExternalIpv6Hosts = [ ]
740 verify( main )
741 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
742
You Wang5da39c82018-04-26 22:55:08 -0700743 def CASE606( self, main ):
744 """
745 Drop SPINE-1 and test connectivity
746 Drop paired leaf and test connectivity (expect some failures)
747 Bring up SPINE-1 and test connectivity (still expect some failures)
748 Bring up the paired leaf and test connectivity
749 Repeat above with SPINE-2 and a different paired leaf
750 """
You Wang5da39c82018-04-26 22:55:08 -0700751 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
752 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
753 main.case( "Drop spine and paired leaf" )
754 setupTest( main, test_idx=606, onosNodes=3 )
You Wangd66de192018-04-30 17:30:12 -0700755 verify( main, disconnected=False )
You Wang6d2d6312018-05-08 12:02:02 -0700756 # Drop spine101 and leaf-2/3
You Wangd66de192018-04-30 17:30:12 -0700757 lib.killSwitch( main, "spine101", 9, 30 )
758 verify( main, disconnected=False )
759 lib.killSwitch( main, "leaf2", 8, 24 )
760 lib.killSwitch( main, "leaf3", 7, 20 )
You Wang5da39c82018-04-26 22:55:08 -0700761 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4" ]
762 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6" ]
You Wangd66de192018-04-30 17:30:12 -0700763 verify( main )
764 lib.recoverSwitch( main, "spine101", 8, 30 )
765 verify( main )
766 lib.recoverSwitch( main, "leaf3", 9, 38 )
You Wang6d2d6312018-05-08 12:02:02 -0700767 lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True,
768 hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
You Wang5da39c82018-04-26 22:55:08 -0700769 main.disconnectedIpv4Hosts = []
770 main.disconnectedIpv6Hosts = []
You Wang6d2d6312018-05-08 12:02:02 -0700771 verify( main, disconnected=False )
772 # Drop spine102 and leaf-4/5
773 lib.killSwitch( main, "spine102", 9, 30 )
774 verify( main, disconnected=False )
775 lib.killSwitch( main, "leaf4", 8, 24 )
776 lib.killSwitch( main, "leaf5", 7, 20 )
777 main.disconnectedIpv4Hosts = [ "h8v4", "h9v4", "h10v4", "h11v4" ]
778 main.disconnectedIpv6Hosts = [ "h8v6", "h9v6", "h10v6", "h11v6" ]
779 verify( main, external=False )
780 lib.recoverSwitch( main, "spine102", 8, 30 )
781 verify( main, external=False )
782 lib.recoverSwitch( main, "leaf5", 9, 38 )
783 lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True,
784 hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
785 main.disconnectedIpv4Hosts = []
786 main.disconnectedIpv6Hosts = []
787 verify( main, disconnected=False )
788 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
789
790 def CASE620( self, main ):
791 """
792 Take down one of double links towards the spine from all leaf switches and
793 check that buckets in select groups change accordingly
794 Bring up links again and check that buckets in select groups change accordingly
795 """
You Wang6d2d6312018-05-08 12:02:02 -0700796 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
797 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
798 main.case( "Take down one of double links towards the spine" )
799 setupTest( main, test_idx=620, onosNodes=3 )
800 verify( main, disconnected=False )
You Wangc02f3be2018-05-18 12:14:23 -0700801 groupBuckets = { "of:0000000000000002": { "10.1.0.0/24": 4, "10.1.10.0/24": 4,
802 "10.2.0.0/24": 1, "10.2.30.0/24": 1, "10.2.20.0/24": 1,
803 "10.2.10.0/24": 4, "10.2.40.0/24": 4,
804 "10.3.0.0/24": 4, "10.3.10.0/24": 8, "10.3.30.0/24": 8,
805 "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 },
806 "of:0000000000000003": { "10.1.0.0/24": 4, "10.1.10.0/24": 4,
807 "10.2.0.0/24": 4, "10.2.30.0/24": 1, "10.2.20.0/24": 1,
808 "10.2.10.0/24": 1, "10.2.40.0/24": 1,
809 "10.3.0.0/24": 4, "10.3.10.0/24": 8, "10.3.30.0/24": 8,
810 "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 },
811 "of:0000000000000004": { "10.1.0.0/24": 4, "10.1.10.0/24": 4,
812 "10.2.0.0/24": 4, "10.2.30.0/24": 8, "10.2.20.0/24": 8,
813 "10.2.10.0/24": 4, "10.2.40.0/24": 4,
814 "10.3.0.0/24": 1, "10.3.10.0/24": 1, "10.3.30.0/24": 1,
815 "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 },
816 "of:0000000000000005": { "10.1.0.0/24": 4, "10.1.10.0/24": 4,
817 "10.2.0.0/24": 4, "10.2.30.0/24": 8, "10.2.20.0/24": 8,
818 "10.2.10.0/24": 4, "10.2.40.0/24": 4,
819 "10.3.0.0/24": 4, "10.3.10.0/24": 1, "10.3.30.0/24": 1,
820 "10.3.20.0/24": 1, "10.5.10.0/24": 4, "10.5.20.0/24": 4 } }
821 for switch, subnets in groupBuckets.items():
822 lib.checkGroupsForBuckets( main, switch, subnets )
823 # Take down one of double links
You Wang6d2d6312018-05-08 12:02:02 -0700824 portsToDisable = [ [ "of:0000000000000002", 1 ], [ "of:0000000000000002", 3 ],
825 [ "of:0000000000000003", 1 ], [ "of:0000000000000003", 3 ],
826 [ "of:0000000000000004", 1 ], [ "of:0000000000000004", 3 ],
827 [ "of:0000000000000005", 1 ], [ "of:0000000000000005", 3 ] ]
You Wang85747762018-05-11 15:51:50 -0700828 lib.disablePortBatch( main, portsToDisable, 10, 32 )
You Wangc02f3be2018-05-18 12:14:23 -0700829 groupBucketsNew = { "of:0000000000000002": { "10.1.0.0/24": 2, "10.1.10.0/24": 2,
830 "10.2.0.0/24": 1, "10.2.30.0/24": 1, "10.2.20.0/24": 1,
831 "10.2.10.0/24": 2, "10.2.40.0/24": 2,
832 "10.3.0.0/24": 2, "10.3.10.0/24": 4, "10.3.30.0/24": 4,
833 "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 },
834 "of:0000000000000003": { "10.1.0.0/24": 2, "10.1.10.0/24": 2,
835 "10.2.0.0/24": 2, "10.2.30.0/24": 1, "10.2.20.0/24": 1,
836 "10.2.10.0/24": 1, "10.2.40.0/24": 1,
837 "10.3.0.0/24": 2, "10.3.10.0/24": 4, "10.3.30.0/24": 4,
838 "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 },
839 "of:0000000000000004": { "10.1.0.0/24": 2, "10.1.10.0/24": 2,
840 "10.2.0.0/24": 2, "10.2.30.0/24": 4, "10.2.20.0/24": 4,
841 "10.2.10.0/24": 2, "10.2.40.0/24": 2,
842 "10.3.0.0/24": 1, "10.3.10.0/24": 1, "10.3.30.0/24": 1,
843 "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 },
844 "of:0000000000000005": { "10.1.0.0/24": 2, "10.1.10.0/24": 2,
845 "10.2.0.0/24": 2, "10.2.30.0/24": 4, "10.2.20.0/24": 4,
846 "10.2.10.0/24": 2, "10.2.40.0/24": 2,
847 "10.3.0.0/24": 2, "10.3.10.0/24": 1, "10.3.30.0/24": 1,
848 "10.3.20.0/24": 1, "10.5.10.0/24": 2, "10.5.20.0/24": 2 } }
849 for switch, subnets in groupBucketsNew.items():
850 lib.checkGroupsForBuckets( main, switch, subnets )
You Wang6d2d6312018-05-08 12:02:02 -0700851 verify( main, disconnected=False )
You Wangc02f3be2018-05-18 12:14:23 -0700852 # Bring up the links
You Wang85747762018-05-11 15:51:50 -0700853 lib.enablePortBatch( main, portsToDisable, 10, 48 )
You Wangc02f3be2018-05-18 12:14:23 -0700854 for switch, subnets in groupBuckets.items():
855 lib.checkGroupsForBuckets( main, switch, subnets )
You Wang6d2d6312018-05-08 12:02:02 -0700856 verify( main, disconnected=False )
857 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
858
859 def CASE621( self, main ):
860 """
861 Remove all the links in the network and restore all Links (repeat x3)
862 """
863 import time
864 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
865 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
866 main.case( "Remove all the links in the network and restore all Links" )
867 setupTest( main, test_idx=621, onosNodes=3 )
868 verify( main, disconnected=False )
869 linksToRemove = [ ["spine101", "spine103"], ["spine102", "spine104"],
870 ["spine103", "leaf6"], ["spine103", "leaf1"],
871 ["spine104", "leaf6"], ["spine104", "leaf1"],
872 ["spine101", "leaf2"], ["spine101", "leaf3"], ["spine101", "leaf4"], ["spine101", "leaf5"],
873 ["spine102", "leaf2"], ["spine102", "leaf3"], ["spine102", "leaf4"], ["spine102", "leaf5"],
874 ["leaf2", "leaf3"], ["leaf4", "leaf5"] ]
875 portsToDisable = [ [ "of:0000000000000001", 3 ], [ "of:0000000000000001", 4 ],
876 [ "of:0000000000000001", 5 ], [ "of:0000000000000001", 6 ],
877 [ "of:0000000000000002", 6 ], [ "of:0000000000000002", 7 ],
878 [ "of:0000000000000002", 8 ], [ "of:0000000000000002", 9 ],
879 [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ],
880 [ "of:0000000000000003", 6 ], [ "of:0000000000000003", 7 ],
881 [ "of:0000000000000003", 8 ], [ "of:0000000000000003", 9 ],
882 [ "of:0000000000000003", 10 ], [ "of:0000000000000003", 11 ],
883 [ "of:0000000000000003", 12 ], [ "of:0000000000000003", 13 ],
884 [ "of:0000000000000004", 6 ], [ "of:0000000000000004", 7 ],
885 [ "of:0000000000000004", 8 ], [ "of:0000000000000004", 9 ],
886 [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ],
887 [ "of:0000000000000004", 12 ], [ "of:0000000000000004", 13 ], [ "of:0000000000000004", 14 ],
888 [ "of:0000000000000005", 6 ], [ "of:0000000000000005", 7 ],
889 [ "of:0000000000000005", 8 ], [ "of:0000000000000005", 9 ],
890 [ "of:0000000000000005", 10 ], [ "of:0000000000000005", 11 ],
891 [ "of:0000000000000005", 12 ], [ "of:0000000000000005", 13 ],
892 [ "of:0000000000000005", 14 ], [ "of:0000000000000005", 15 ],
893 [ "of:0000000000000006", 3 ], [ "of:0000000000000006", 4 ],
894 [ "of:0000000000000006", 5 ], [ "of:0000000000000006", 6 ] ]
895 for i in range( 0, 3 ):
896 lib.killLinkBatch( main, linksToRemove, 0, 10 )
You Wang85747762018-05-11 15:51:50 -0700897 lib.disablePortBatch( main, portsToDisable, 10, 0 )
You Wang6d2d6312018-05-08 12:02:02 -0700898 main.disconnectedIpv4Hosts = main.internalIpv4Hosts
899 main.disconnectedIpv6Hosts = main.internalIpv6Hosts
900 verify( main )
901 lib.restoreLinkBatch( main, linksToRemove, 48, 10 )
You Wang85747762018-05-11 15:51:50 -0700902 lib.enablePortBatch( main, portsToDisable, 10, 48 )
You Wang6d2d6312018-05-08 12:02:02 -0700903 main.Network.discoverHosts( hostList=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
904 time.sleep( 10 )
905 main.disconnectedIpv4Hosts = []
906 main.disconnectedIpv6Hosts = []
907 verify( main )
908 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
909
910 def CASE622( self, main ):
911 """
912 Take down all uplinks from a paired leaf switch
913 """
You Wang6d2d6312018-05-08 12:02:02 -0700914 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
915 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
916 from core import utilities
917 main.case( "Take down all uplinks from a paired leaf switch" )
918 setupTest( main, test_idx=622, onosNodes=3 )
919 verify( main, disconnected=False )
You Wang85747762018-05-11 15:51:50 -0700920 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
921 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
922 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
923 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
924 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700925 linksToRemove = [ ["spine101", "leaf2"], ["spine102", "leaf2"] ]
926 lib.killLinkBatch( main, linksToRemove, 40, 10 )
927 # TODO: more verifications are required
You Wangc02f3be2018-05-18 12:14:23 -0700928 main.disconnectedIpv4Hosts = [ "h3v4" ]
929 main.disconnectedIpv6Hosts = [ "h3v6" ]
You Wangd66de192018-04-30 17:30:12 -0700930 verify( main )
You Wang85747762018-05-11 15:51:50 -0700931 hostLocations = { "h4v6": "of:0000000000000003/6",
932 "h5v6": "of:0000000000000003/7",
933 "h4v4": "of:0000000000000003/10",
934 "h5v4": "of:0000000000000003/11" }
935 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700936 lib.restoreLinkBatch( main, linksToRemove, 48, 10 )
You Wangc02f3be2018-05-18 12:14:23 -0700937 main.disconnectedIpv4Hosts = []
938 main.disconnectedIpv6Hosts = []
939 verify( main, disconnected=False )
You Wang85747762018-05-11 15:51:50 -0700940 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
941 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
942 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
943 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
944 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700945 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
946
947 def CASE630( self, main ):
948 """
949 Bring an instance down
950 Drop a device
951 Bring that same instance up again and observe that this specific instance sees that the device is down.
952 """
You Wang6d2d6312018-05-08 12:02:02 -0700953 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
954 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
955 from core import utilities
956 main.case( "Bring an instance down and drop a device" )
957 setupTest( main, test_idx=630, onosNodes=3 )
958 onosToKill = 0
959 deviceToDrop = "spine101"
960 lib.killOnos( main, [ onosToKill ], 10, 48, 2 )
961 lib.killSwitch( main, deviceToDrop, 9, 30 )
962 lib.recoverOnos( main, [ onosToKill ], 9, 30, 3 )
963 result = main.Cluster.runningNodes[ onosToKill ].CLI.checkStatus( 9, 30, 3 )
964 utilities.assert_equals( expect=main.TRUE, actual=result,
965 onpass="ONOS instance {} sees correct device numbers".format( onosToKill ),
966 onfail="ONOS instance {} doesn't see correct device numbers".format( onosToKill ) )
You Wang5da39c82018-04-26 22:55:08 -0700967 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700968
Jon Halla604fd42018-05-04 14:27:27 -0700969 def CASE640( self, main ):
970 """
971 Controller instance going down and switch coming down at the same time and then we bring them up together
972
973 A. Instance goes down and SPINE-1 goes down
974 - All connectivity should be there
975 - Bring them up together
976 - All connectivity should be there
977 B. Instance goes down and HAGG-1 goes down
978 - All connectivity should be there
979 - Bring them up together
980 - All connectivity should be there
981 C. Instance goes down and a paired leaf switch goes down
982 - Single homed hosts in this leaf should lose connectivity all others should be ok
983 - Bring them up together
984 - Test connectivity
985 """
986 import time
987 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
988 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
989 main.case( "Drop an ONOS instance and switch(es) at the same time" )
990 caseDict = { 'A': { 'switches': "spine101",
991 'disconnectedV4': [],
992 'disconnectedV6': [],
993 'expectedSwitches': 9,
994 'expectedLinks': 30 },
995 'B': { 'switches': "spine103",
996 'disconnectedV4': [],
997 'disconnectedV6': [],
998 'expectedSwitches': 9,
999 'expectedLinks': 42 },
1000 'C': { 'switches': "leaf2",
1001 'disconnectedV4': [ "h3v4" ],
1002 'disconnectedV6': [ "h3v6" ],
1003 'expectedSwitches': 9,
1004 'expectedLinks': 38 } }
1005 totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] )
1006 totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] )
1007 nodeIndex = 0
1008 cases = sorted( caseDict.keys() )
1009 for case in cases:
1010 switches = caseDict[ case ][ 'switches' ]
1011 expectedSwitches = caseDict[ case ][ 'expectedSwitches' ]
1012 expectedLinks = caseDict[ case ][ 'expectedLinks' ]
1013 main.step( "\n640{}: Drop ONOS{} and switch(es) {} at the same time".format( case,
1014 nodeIndex + 1,
1015 switches ) )
1016 setupTest( main, test_idx=640 )
1017 main.Cluster.next().CLI.balanceMasters()
1018 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1019 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
1020 instance = main.Cluster.controllers[ nodeIndex ]
1021 verify( main, disconnected=False, external=False )
1022
1023 # Simultaneous failures
1024 main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) )
1025 killResult = main.ONOSbench.onosDie( instance.ipAddress )
1026 utilities.assert_equals( expect=main.TRUE, actual=killResult,
1027 onpass="ONOS node killed",
1028 onfail="Failed to kill ONOS node" )
1029 instance.active = False
1030 main.Cluster.reset()
1031 # TODO: Remove sleeps from the concurrent events
1032 lib.killSwitch( main, switches, expectedSwitches, expectedLinks )
1033 main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ]
1034 main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ]
1035
1036 # verify functionality
1037 main.log.debug( main.Cluster.next().summary() )
1038 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
1039 main.log.debug( main.Cluster.next().summary() )
1040 lib.verifyTopology( main, expectedSwitches, expectedLinks, main.Cluster.numCtrls - 1 )
1041 lib.verifyNodes( main )
1042 verify( main, external=False )
1043
1044 # Bring everything back up
1045 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
1046 main.disconnectedIpv4Hosts = []
1047 main.disconnectedIpv6Hosts = []
1048 lib.recoverOnos( main, [ nodeIndex ], expectedSwitches, expectedLinks, main.Cluster.numCtrls )
1049
1050 # Verify functionality
1051 lib.verifyNodes( main )
1052 verify( main, disconnected=False, external=False )
1053 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
1054 nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls
1055
1056 def CASE641( self, main ):
1057 """
1058 Controller instance going down while switch comes up at the same time
1059
1060 A. Take down SPINE-1
1061 - Test connectivity
1062 - Bring up SPINE-1 and drop an instance at the same time
1063 - Test connectivity
1064 - Bring up instance one
1065 - Test connectivity
1066 B. Take down HAGG-1
1067 - Test connectivity
1068 - Bring up HAGG-1 and drop an instance at the same time
1069 - Test connectivity
1070 - Bring up instance one
1071 - Test connectivity
1072 C. Take down a paired leaf switch
1073 - Test connectivity ( single homed hosts on this leaf will lose it )
1074 - Bring up paired leaf switch and drop a controller instance at the same time
1075 - Test connectivity
1076 - Bring up the instance
1077 - Test connectivity
1078 """
1079 import time
1080 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1081 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1082 main.case( "Drop an ONOS instance and recover switch(es) at the same time" )
1083 caseDict = { 'A': { 'switches': "spine101",
1084 'disconnectedV4': [],
1085 'disconnectedV6': [],
1086 'expectedSwitches': 9,
1087 'expectedLinks': 30 },
1088 'B': { 'switches': "spine103",
1089 'disconnectedV4': [],
1090 'disconnectedV6': [],
1091 'expectedSwitches': 9,
1092 'expectedLinks': 42 },
1093 'C': { 'switches': "leaf2",
1094 'disconnectedV4': [ "h3v4" ],
1095 'disconnectedV6': [ "h3v6" ],
1096 'expectedSwitches': 9,
1097 'expectedLinks': 38 } }
1098 totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] )
1099 totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] )
1100 nodeIndex = 0
1101 cases = sorted( caseDict.keys() )
1102 for case in cases:
1103 switches = caseDict[ case ][ 'switches' ]
1104 expectedSwitches = caseDict[ case ][ 'expectedSwitches' ]
1105 expectedLinks = caseDict[ case ][ 'expectedLinks' ]
1106 main.step( "\n641{}: Drop ONOS{} and recover switch(es) {} at the same time".format( case,
1107 nodeIndex + 1,
1108 switches ) )
1109 setupTest( main, test_idx=641 )
1110 main.Cluster.next().CLI.balanceMasters()
1111 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1112 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
1113 instance = main.Cluster.controllers[ nodeIndex ]
1114 verify( main, disconnected=False, external=False )
1115 # Drop the switch to setup scenario
1116 lib.killSwitch( main, switches, expectedSwitches, expectedLinks )
1117 main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ]
1118 main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ]
1119 verify( main, external=False )
1120
1121 # Simultaneous node failure and switch recovery
1122 main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) )
1123 killResult = main.ONOSbench.onosDie( instance.ipAddress )
1124 utilities.assert_equals( expect=main.TRUE, actual=killResult,
1125 onpass="ONOS node killed",
1126 onfail="Failed to kill ONOS node" )
1127 instance.active = False
1128 main.Cluster.reset()
1129 # TODO: Remove sleeps from the concurrent events
1130 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
1131 main.disconnectedIpv4Hosts = []
1132 main.disconnectedIpv6Hosts = []
1133
1134 # verify functionality
1135 main.log.debug( main.Cluster.next().summary() )
1136 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
1137 main.log.debug( main.Cluster.next().summary() )
1138 lib.verifyTopology( main, totalSwitches, totalLinks, main.Cluster.numCtrls - 1 )
1139 lib.verifyNodes( main )
1140 verify( main, disconnected=False, external=False )
1141
1142 # Bring everything back up and verify functionality
1143 lib.recoverOnos( main, [ nodeIndex ], totalSwitches, totalLinks, main.Cluster.numCtrls )
1144 lib.verifyNodes( main )
1145 verify( main, external=False )
1146 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
1147 nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls
1148
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001149 def CASE642( self, main ):
1150 """
1151 Drop one link from each double link
1152 Drop a link between DAAS-1 and HAAG-1
1153 Drop a link between HAGG-2 and SPINE-2
1154 Drop one ONOS instance
1155 Test connectivity (expect no failure)
1156 Bring up all links and ONOS instance
1157 Test connectivity (expect no failure)
1158 """
1159 import time
1160 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1161 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1162 main.case( "Drop ONOS instance and links at the same time" )
1163 setupTest( main, test_idx=642, onosNodes=3 )
1164 main.Cluster.active( 0 ).CLI.balanceMasters()
1165 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1166 verify( main )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001167 portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ],
1168 [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ],
1169 [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ],
1170 [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ],
1171 [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ],
1172 [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ],
1173 [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ],
1174 [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ],
1175 [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ],
1176 [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ],
1177 [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ]
You Wang85747762018-05-11 15:51:50 -07001178 lib.disablePortBatch( main, portsToDisable,
1179 int( main.params[ "TOPO" ][ "switchNum" ] ),
1180 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ),
1181 sleep=0 )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001182 lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1183 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ), 2 )
1184 verify( main )
You Wang85747762018-05-11 15:51:50 -07001185 lib.enablePortBatch( main, portsToDisable,
1186 int( main.params[ "TOPO" ][ "switchNum" ] ),
1187 int( main.params[ "TOPO" ][ "linkNum" ] ),
1188 sleep=0 )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001189 lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1190 int( main.params[ "TOPO" ][ "linkNum" ] ), 3 )
1191 verify( main )
1192 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
1193
1194 def CASE643( self, main ):
1195 """
1196 Drop one link from each double link
1197 Drop a link between DAAS-1 and HAAG-1
1198 Drop a link between HAGG-2 and SPINE-2
1199 Test connectivity (expect no failure)
1200 Bring up all links
1201 Drop one ONOS instance
1202 Test connectivity (expect no failure)
1203 Bring up ONOS instance
1204 Test connectivity (expect no failure)
1205 """
1206 import time
1207 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1208 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1209 main.case( "Drop ONOS instances and bring up links at the same time" )
1210 setupTest( main, test_idx=643, onosNodes=3 )
1211 main.Cluster.active( 0 ).CLI.balanceMasters()
1212 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1213 verify( main )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001214 portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ],
1215 [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ],
1216 [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ],
1217 [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ],
1218 [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ],
1219 [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ],
1220 [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ],
1221 [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ],
1222 [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ],
1223 [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ],
1224 [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ]
You Wang85747762018-05-11 15:51:50 -07001225 lib.disablePortBatch( main, portsToDisable,
1226 int( main.params[ "TOPO" ][ "switchNum" ] ),
1227 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ) )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001228 verify( main )
You Wang85747762018-05-11 15:51:50 -07001229 lib.enablePortBatch( main, portsToDisable,
1230 int( main.params[ "TOPO" ][ "switchNum" ] ),
1231 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001232 lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1233 int( main.params[ "TOPO" ][ "linkNum" ] ), 2 )
1234 verify( main )
1235 lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1236 int( main.params[ "TOPO" ][ "linkNum" ] ), 3 )
1237 verify( main )
1238 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jonghwan Hyun785471d2018-05-14 14:48:19 -07001239
1240 def CASE651( self, main ):
1241 """
1242 Move a single-homed host from port A to port B in DAAS-1
1243 Test connectivity (expect no failure)
1244
1245 Repeat with DAAS-2
1246 """
1247 import time
1248 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1249 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1250 main.case( "Move a single-homed host to another port in the same DAAS" )
1251 setupTest( main, test_idx=651, onosNodes=3 )
1252 main.Cluster.active( 0 ).CLI.balanceMasters()
1253 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1254 verify( main )
1255
1256 h1v4cfg = '{"of:0000000000000001/7" : { "interfaces" : [ { "ips" : [ "10.1.0.254/24" ], "vlan-untagged": 10 } ] } }'
1257 lib.moveHost( main, "h1v4", "leaf1", "leaf1", "10.1.0.254", prefixLen=24, cfg=h1v4cfg )
1258 verify( main )
1259
1260 h13v4cfg = '''{"of:0000000000000006/7" : { "interfaces" : [ { "ips" : [ "10.5.20.254/24" ], "vlan-untagged": 20 } ] } }'''
1261 lib.moveHost( main, "h13v4", "leaf6", "leaf6", "10.5.20.254", prefixLen=24, cfg=h13v4cfg )
1262 verify( main )