blob: dafbacd345be0d6bd7d87c4d08da293a31c226fe [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
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700530 def CASE603( self, main ):
531 """"
532 Drop HAGG-1 device and test connectivity.
533 Drop DAAS-1 device and test connectivity (some hosts lost it)
534 Bring up DAAS-1 and test connectivity (all hosts gained it again)
535
536 Repeat the same with HAGG-2 and DAAS-2.
537 """
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700538 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
539 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
540 main.case( "Drop hagg spine switch along with dass leaf switch." )
541 setupTest( main, test_idx=603, onosNodes=3 )
542 main.disconnectedIpv4Hosts = []
543 main.disconnectedIpv6Hosts = []
544
545 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700546 lib.killSwitch( main, "spine103",
547 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
548 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700549 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700550 lib.killSwitch( main, "leaf6",
551 int( main.params[ "TOPO" ]["switchNum" ] ) - 2,
552 int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700553 main.disconnectedIpv4Hosts = [ 'h12v4', 'h13v4']
554 main.disconnectedIpv6Hosts = [ 'h12v6', 'h13v6']
555 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700556 lib.recoverSwitch( main, "leaf6",
557 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
558 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6,
559 rediscoverHosts=True)
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700560 main.disconnectedIpv4Hosts = []
561 main.disconnectedIpv6Hosts = []
562 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700563 lib.recoverSwitch( main, "spine103",
564 int( main.params[ "TOPO" ][ "switchNum" ] ),
565 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700566 verify( main )
567
Jon Halla604fd42018-05-04 14:27:27 -0700568 lib.killSwitch( main, "spine104",
569 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
570 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700571 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700572 lib.killSwitch( main, "leaf1",
573 int( main.params[ "TOPO" ]["switchNum" ] ) - 2,
574 int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700575 main.disconnectedIpv4Hosts = [ 'h1v4', 'h2v4']
576 main.disconnectedIpv6Hosts = [ 'h1v6', 'h2v6']
577 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700578 lib.recoverSwitch( main, "leaf1",
579 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
580 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6,
581 rediscoverHosts=True )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700582 main.disconnectedIpv4Hosts = []
583 main.disconnectedIpv6Hosts = []
584 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700585 lib.recoverSwitch( main, "spine104",
586 int( main.params[ "TOPO" ][ "switchNum" ] ),
587 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700588 verify( main )
589
590 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
591
592 def CASE604( self, main ):
593 """"
594 Drop HAGG-1 device and test connectivity.
595 Bring up HAGG-1 and test connectivity.
596 Drop HAGG-2 device and test connectivity.
597 Bring up HAGG-2 device and test connectivity
598 """
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700599 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
600 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
601 main.case( "Drop hagg spine switches." )
602 setupTest( main, test_idx=604, onosNodes=3 )
603 main.disconnectedIpv4Hosts = []
604 main.disconnectedIpv6Hosts = []
605 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700606 lib.killSwitch( main, "spine103",
607 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
608 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700609 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700610 lib.recoverSwitch( main, "spine103",
611 int( main.params[ "TOPO" ][ "switchNum" ] ),
612 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700613 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700614 lib.killSwitch( main, "spine104",
615 int( main.params[ "TOPO" ]["switchNum" ] ) - 1,
616 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700617 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700618 lib.recoverSwitch( main, "spine104",
619 int( main.params[ "TOPO" ][ "switchNum" ] ),
620 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700621 verify( main )
622 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
623
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700624 def CASE605( self, main ):
625 """
626 Drop HAGG-1 and test connectivity (expect no failure)
627 Drop all leafs in big fabric and test connectivity (expect some failures)
628 Bring up HAGG-1 and test connectivity (still expect some failures)
629 Bring up all leafs in big fabric and test connectivity (expect no failure)
630 Repeat above with HAGG-2
631 """
632 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
633 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
634 main.case( "Drop one hagg and all leafs in big fabric" )
635 setupTest( main, test_idx=605, onosNodes=3 )
636 main.disconnectedIpv4Hosts = []
637 main.disconnectedIpv6Hosts = []
638 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700639 lib.killSwitch( main, "spine103",
640 int( main.params[ "TOPO" ][ "switchNum" ] ) - 1,
641 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700642 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700643 lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
644 int( main.params[ "TOPO" ][ "switchNum" ] ) - 5,
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700645 int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 )
646 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ]
647 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ]
648 main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ]
649 main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ]
650 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700651 lib.recoverSwitch( main, "spine103",
652 int( main.params[ "TOPO" ][ "switchNum" ] ) - 4,
653 int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700654 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700655 lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
656 int( main.params[ "TOPO" ][ "switchNum" ] ),
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700657 int( main.params[ "TOPO" ][ "linkNum" ] ) )
658 main.disconnectedIpv4Hosts = []
659 main.disconnectedIpv6Hosts = []
660 main.disconnectedExternalIpv4Hosts = [ ]
661 main.disconnectedExternalIpv6Hosts = [ ]
662 verify( main )
663
Jon Halla604fd42018-05-04 14:27:27 -0700664 lib.killSwitch( main, "spine104",
665 int( main.params[ "TOPO" ][ "switchNum" ] ) - 1,
666 int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700667 verify( main )
Jon Halla604fd42018-05-04 14:27:27 -0700668 lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
669 int( main.params[ "TOPO" ][ "switchNum" ] ) - 5,
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700670 int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 )
671 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ]
672 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ]
673 main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ]
674 main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ]
675 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700676 lib.recoverSwitch( main, "spine104",
677 int( main.params[ "TOPO" ][ "switchNum" ] ) - 4,
678 int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 )
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700679 verify( main, disconnected=True )
Jon Halla604fd42018-05-04 14:27:27 -0700680 lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ],
681 int( main.params[ "TOPO" ][ "switchNum" ] ),
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700682 int( main.params[ "TOPO" ][ "linkNum" ] ) )
683 main.disconnectedIpv4Hosts = []
684 main.disconnectedIpv6Hosts = []
685 main.disconnectedExternalIpv4Hosts = [ ]
686 main.disconnectedExternalIpv6Hosts = [ ]
687 verify( main )
688 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
689
You Wang5da39c82018-04-26 22:55:08 -0700690 def CASE606( self, main ):
691 """
692 Drop SPINE-1 and test connectivity
693 Drop paired leaf and test connectivity (expect some failures)
694 Bring up SPINE-1 and test connectivity (still expect some failures)
695 Bring up the paired leaf and test connectivity
696 Repeat above with SPINE-2 and a different paired leaf
697 """
You Wang5da39c82018-04-26 22:55:08 -0700698 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
699 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
700 main.case( "Drop spine and paired leaf" )
701 setupTest( main, test_idx=606, onosNodes=3 )
You Wangd66de192018-04-30 17:30:12 -0700702 verify( main, disconnected=False )
You Wang6d2d6312018-05-08 12:02:02 -0700703 # Drop spine101 and leaf-2/3
You Wangd66de192018-04-30 17:30:12 -0700704 lib.killSwitch( main, "spine101", 9, 30 )
705 verify( main, disconnected=False )
706 lib.killSwitch( main, "leaf2", 8, 24 )
707 lib.killSwitch( main, "leaf3", 7, 20 )
You Wang5da39c82018-04-26 22:55:08 -0700708 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4" ]
709 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6" ]
You Wangd66de192018-04-30 17:30:12 -0700710 verify( main )
711 lib.recoverSwitch( main, "spine101", 8, 30 )
712 verify( main )
713 lib.recoverSwitch( main, "leaf3", 9, 38 )
You Wang6d2d6312018-05-08 12:02:02 -0700714 lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True,
715 hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
You Wang5da39c82018-04-26 22:55:08 -0700716 main.disconnectedIpv4Hosts = []
717 main.disconnectedIpv6Hosts = []
You Wang6d2d6312018-05-08 12:02:02 -0700718 verify( main, disconnected=False )
719 # Drop spine102 and leaf-4/5
720 lib.killSwitch( main, "spine102", 9, 30 )
721 verify( main, disconnected=False )
722 lib.killSwitch( main, "leaf4", 8, 24 )
723 lib.killSwitch( main, "leaf5", 7, 20 )
724 main.disconnectedIpv4Hosts = [ "h8v4", "h9v4", "h10v4", "h11v4" ]
725 main.disconnectedIpv6Hosts = [ "h8v6", "h9v6", "h10v6", "h11v6" ]
726 verify( main, external=False )
727 lib.recoverSwitch( main, "spine102", 8, 30 )
728 verify( main, external=False )
729 lib.recoverSwitch( main, "leaf5", 9, 38 )
730 lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True,
731 hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
732 main.disconnectedIpv4Hosts = []
733 main.disconnectedIpv6Hosts = []
734 verify( main, disconnected=False )
735 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
736
737 def CASE620( self, main ):
738 """
739 Take down one of double links towards the spine from all leaf switches and
740 check that buckets in select groups change accordingly
741 Bring up links again and check that buckets in select groups change accordingly
742 """
You Wang6d2d6312018-05-08 12:02:02 -0700743 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
744 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
745 main.case( "Take down one of double links towards the spine" )
746 setupTest( main, test_idx=620, onosNodes=3 )
747 verify( main, disconnected=False )
748 portsToDisable = [ [ "of:0000000000000002", 1 ], [ "of:0000000000000002", 3 ],
749 [ "of:0000000000000003", 1 ], [ "of:0000000000000003", 3 ],
750 [ "of:0000000000000004", 1 ], [ "of:0000000000000004", 3 ],
751 [ "of:0000000000000005", 1 ], [ "of:0000000000000005", 3 ] ]
You Wang85747762018-05-11 15:51:50 -0700752 lib.disablePortBatch( main, portsToDisable, 10, 32 )
You Wang6d2d6312018-05-08 12:02:02 -0700753 # TODO: check buckets in groups
754 verify( main, disconnected=False )
You Wang85747762018-05-11 15:51:50 -0700755 lib.enablePortBatch( main, portsToDisable, 10, 48 )
You Wang6d2d6312018-05-08 12:02:02 -0700756 # TODO: check buckets in groups
757 verify( main, disconnected=False )
758 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
759
760 def CASE621( self, main ):
761 """
762 Remove all the links in the network and restore all Links (repeat x3)
763 """
764 import time
765 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
766 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
767 main.case( "Remove all the links in the network and restore all Links" )
768 setupTest( main, test_idx=621, onosNodes=3 )
769 verify( main, disconnected=False )
770 linksToRemove = [ ["spine101", "spine103"], ["spine102", "spine104"],
771 ["spine103", "leaf6"], ["spine103", "leaf1"],
772 ["spine104", "leaf6"], ["spine104", "leaf1"],
773 ["spine101", "leaf2"], ["spine101", "leaf3"], ["spine101", "leaf4"], ["spine101", "leaf5"],
774 ["spine102", "leaf2"], ["spine102", "leaf3"], ["spine102", "leaf4"], ["spine102", "leaf5"],
775 ["leaf2", "leaf3"], ["leaf4", "leaf5"] ]
776 portsToDisable = [ [ "of:0000000000000001", 3 ], [ "of:0000000000000001", 4 ],
777 [ "of:0000000000000001", 5 ], [ "of:0000000000000001", 6 ],
778 [ "of:0000000000000002", 6 ], [ "of:0000000000000002", 7 ],
779 [ "of:0000000000000002", 8 ], [ "of:0000000000000002", 9 ],
780 [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ],
781 [ "of:0000000000000003", 6 ], [ "of:0000000000000003", 7 ],
782 [ "of:0000000000000003", 8 ], [ "of:0000000000000003", 9 ],
783 [ "of:0000000000000003", 10 ], [ "of:0000000000000003", 11 ],
784 [ "of:0000000000000003", 12 ], [ "of:0000000000000003", 13 ],
785 [ "of:0000000000000004", 6 ], [ "of:0000000000000004", 7 ],
786 [ "of:0000000000000004", 8 ], [ "of:0000000000000004", 9 ],
787 [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ],
788 [ "of:0000000000000004", 12 ], [ "of:0000000000000004", 13 ], [ "of:0000000000000004", 14 ],
789 [ "of:0000000000000005", 6 ], [ "of:0000000000000005", 7 ],
790 [ "of:0000000000000005", 8 ], [ "of:0000000000000005", 9 ],
791 [ "of:0000000000000005", 10 ], [ "of:0000000000000005", 11 ],
792 [ "of:0000000000000005", 12 ], [ "of:0000000000000005", 13 ],
793 [ "of:0000000000000005", 14 ], [ "of:0000000000000005", 15 ],
794 [ "of:0000000000000006", 3 ], [ "of:0000000000000006", 4 ],
795 [ "of:0000000000000006", 5 ], [ "of:0000000000000006", 6 ] ]
796 for i in range( 0, 3 ):
797 lib.killLinkBatch( main, linksToRemove, 0, 10 )
You Wang85747762018-05-11 15:51:50 -0700798 lib.disablePortBatch( main, portsToDisable, 10, 0 )
You Wang6d2d6312018-05-08 12:02:02 -0700799 main.disconnectedIpv4Hosts = main.internalIpv4Hosts
800 main.disconnectedIpv6Hosts = main.internalIpv6Hosts
801 verify( main )
802 lib.restoreLinkBatch( main, linksToRemove, 48, 10 )
You Wang85747762018-05-11 15:51:50 -0700803 lib.enablePortBatch( main, portsToDisable, 10, 48 )
You Wang6d2d6312018-05-08 12:02:02 -0700804 main.Network.discoverHosts( hostList=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
805 time.sleep( 10 )
806 main.disconnectedIpv4Hosts = []
807 main.disconnectedIpv6Hosts = []
808 verify( main )
809 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
810
811 def CASE622( self, main ):
812 """
813 Take down all uplinks from a paired leaf switch
814 """
You Wang6d2d6312018-05-08 12:02:02 -0700815 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
816 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
817 from core import utilities
818 main.case( "Take down all uplinks from a paired leaf switch" )
819 setupTest( main, test_idx=622, onosNodes=3 )
820 verify( main, disconnected=False )
821 ctrl = main.Cluster.active( 0 )
You Wang85747762018-05-11 15:51:50 -0700822 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
823 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
824 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
825 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
826 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700827 linksToRemove = [ ["spine101", "leaf2"], ["spine102", "leaf2"] ]
828 lib.killLinkBatch( main, linksToRemove, 40, 10 )
829 # TODO: more verifications are required
You Wangd66de192018-04-30 17:30:12 -0700830 verify( main )
You Wang85747762018-05-11 15:51:50 -0700831 hostLocations = { "h4v6": "of:0000000000000003/6",
832 "h5v6": "of:0000000000000003/7",
833 "h4v4": "of:0000000000000003/10",
834 "h5v4": "of:0000000000000003/11" }
835 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700836 lib.restoreLinkBatch( main, linksToRemove, 48, 10 )
837 verify( main )
You Wang85747762018-05-11 15:51:50 -0700838 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
839 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
840 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
841 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
842 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700843 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
844
845 def CASE630( self, main ):
846 """
847 Bring an instance down
848 Drop a device
849 Bring that same instance up again and observe that this specific instance sees that the device is down.
850 """
You Wang6d2d6312018-05-08 12:02:02 -0700851 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
852 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
853 from core import utilities
854 main.case( "Bring an instance down and drop a device" )
855 setupTest( main, test_idx=630, onosNodes=3 )
856 onosToKill = 0
857 deviceToDrop = "spine101"
858 lib.killOnos( main, [ onosToKill ], 10, 48, 2 )
859 lib.killSwitch( main, deviceToDrop, 9, 30 )
860 lib.recoverOnos( main, [ onosToKill ], 9, 30, 3 )
861 result = main.Cluster.runningNodes[ onosToKill ].CLI.checkStatus( 9, 30, 3 )
862 utilities.assert_equals( expect=main.TRUE, actual=result,
863 onpass="ONOS instance {} sees correct device numbers".format( onosToKill ),
864 onfail="ONOS instance {} doesn't see correct device numbers".format( onosToKill ) )
You Wang5da39c82018-04-26 22:55:08 -0700865 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700866
Jon Halla604fd42018-05-04 14:27:27 -0700867 def CASE640( self, main ):
868 """
869 Controller instance going down and switch coming down at the same time and then we bring them up together
870
871 A. Instance goes down and SPINE-1 goes down
872 - All connectivity should be there
873 - Bring them up together
874 - All connectivity should be there
875 B. Instance goes down and HAGG-1 goes down
876 - All connectivity should be there
877 - Bring them up together
878 - All connectivity should be there
879 C. Instance goes down and a paired leaf switch goes down
880 - Single homed hosts in this leaf should lose connectivity all others should be ok
881 - Bring them up together
882 - Test connectivity
883 """
884 import time
885 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
886 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
887 main.case( "Drop an ONOS instance and switch(es) at the same time" )
888 caseDict = { 'A': { 'switches': "spine101",
889 'disconnectedV4': [],
890 'disconnectedV6': [],
891 'expectedSwitches': 9,
892 'expectedLinks': 30 },
893 'B': { 'switches': "spine103",
894 'disconnectedV4': [],
895 'disconnectedV6': [],
896 'expectedSwitches': 9,
897 'expectedLinks': 42 },
898 'C': { 'switches': "leaf2",
899 'disconnectedV4': [ "h3v4" ],
900 'disconnectedV6': [ "h3v6" ],
901 'expectedSwitches': 9,
902 'expectedLinks': 38 } }
903 totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] )
904 totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] )
905 nodeIndex = 0
906 cases = sorted( caseDict.keys() )
907 for case in cases:
908 switches = caseDict[ case ][ 'switches' ]
909 expectedSwitches = caseDict[ case ][ 'expectedSwitches' ]
910 expectedLinks = caseDict[ case ][ 'expectedLinks' ]
911 main.step( "\n640{}: Drop ONOS{} and switch(es) {} at the same time".format( case,
912 nodeIndex + 1,
913 switches ) )
914 setupTest( main, test_idx=640 )
915 main.Cluster.next().CLI.balanceMasters()
916 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
917 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
918 instance = main.Cluster.controllers[ nodeIndex ]
919 verify( main, disconnected=False, external=False )
920
921 # Simultaneous failures
922 main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) )
923 killResult = main.ONOSbench.onosDie( instance.ipAddress )
924 utilities.assert_equals( expect=main.TRUE, actual=killResult,
925 onpass="ONOS node killed",
926 onfail="Failed to kill ONOS node" )
927 instance.active = False
928 main.Cluster.reset()
929 # TODO: Remove sleeps from the concurrent events
930 lib.killSwitch( main, switches, expectedSwitches, expectedLinks )
931 main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ]
932 main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ]
933
934 # verify functionality
935 main.log.debug( main.Cluster.next().summary() )
936 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
937 main.log.debug( main.Cluster.next().summary() )
938 lib.verifyTopology( main, expectedSwitches, expectedLinks, main.Cluster.numCtrls - 1 )
939 lib.verifyNodes( main )
940 verify( main, external=False )
941
942 # Bring everything back up
943 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
944 main.disconnectedIpv4Hosts = []
945 main.disconnectedIpv6Hosts = []
946 lib.recoverOnos( main, [ nodeIndex ], expectedSwitches, expectedLinks, main.Cluster.numCtrls )
947
948 # Verify functionality
949 lib.verifyNodes( main )
950 verify( main, disconnected=False, external=False )
951 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
952 nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls
953
954 def CASE641( self, main ):
955 """
956 Controller instance going down while switch comes up at the same time
957
958 A. Take down SPINE-1
959 - Test connectivity
960 - Bring up SPINE-1 and drop an instance at the same time
961 - Test connectivity
962 - Bring up instance one
963 - Test connectivity
964 B. Take down HAGG-1
965 - Test connectivity
966 - Bring up HAGG-1 and drop an instance at the same time
967 - Test connectivity
968 - Bring up instance one
969 - Test connectivity
970 C. Take down a paired leaf switch
971 - Test connectivity ( single homed hosts on this leaf will lose it )
972 - Bring up paired leaf switch and drop a controller instance at the same time
973 - Test connectivity
974 - Bring up the instance
975 - Test connectivity
976 """
977 import time
978 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
979 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
980 main.case( "Drop an ONOS instance and recover switch(es) at the same time" )
981 caseDict = { 'A': { 'switches': "spine101",
982 'disconnectedV4': [],
983 'disconnectedV6': [],
984 'expectedSwitches': 9,
985 'expectedLinks': 30 },
986 'B': { 'switches': "spine103",
987 'disconnectedV4': [],
988 'disconnectedV6': [],
989 'expectedSwitches': 9,
990 'expectedLinks': 42 },
991 'C': { 'switches': "leaf2",
992 'disconnectedV4': [ "h3v4" ],
993 'disconnectedV6': [ "h3v6" ],
994 'expectedSwitches': 9,
995 'expectedLinks': 38 } }
996 totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] )
997 totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] )
998 nodeIndex = 0
999 cases = sorted( caseDict.keys() )
1000 for case in cases:
1001 switches = caseDict[ case ][ 'switches' ]
1002 expectedSwitches = caseDict[ case ][ 'expectedSwitches' ]
1003 expectedLinks = caseDict[ case ][ 'expectedLinks' ]
1004 main.step( "\n641{}: Drop ONOS{} and recover switch(es) {} at the same time".format( case,
1005 nodeIndex + 1,
1006 switches ) )
1007 setupTest( main, test_idx=641 )
1008 main.Cluster.next().CLI.balanceMasters()
1009 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1010 main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts )
1011 instance = main.Cluster.controllers[ nodeIndex ]
1012 verify( main, disconnected=False, external=False )
1013 # Drop the switch to setup scenario
1014 lib.killSwitch( main, switches, expectedSwitches, expectedLinks )
1015 main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ]
1016 main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ]
1017 verify( main, external=False )
1018
1019 # Simultaneous node failure and switch recovery
1020 main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) )
1021 killResult = main.ONOSbench.onosDie( instance.ipAddress )
1022 utilities.assert_equals( expect=main.TRUE, actual=killResult,
1023 onpass="ONOS node killed",
1024 onfail="Failed to kill ONOS node" )
1025 instance.active = False
1026 main.Cluster.reset()
1027 # TODO: Remove sleeps from the concurrent events
1028 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
1029 main.disconnectedIpv4Hosts = []
1030 main.disconnectedIpv6Hosts = []
1031
1032 # verify functionality
1033 main.log.debug( main.Cluster.next().summary() )
1034 lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True )
1035 main.log.debug( main.Cluster.next().summary() )
1036 lib.verifyTopology( main, totalSwitches, totalLinks, main.Cluster.numCtrls - 1 )
1037 lib.verifyNodes( main )
1038 verify( main, disconnected=False, external=False )
1039
1040 # Bring everything back up and verify functionality
1041 lib.recoverOnos( main, [ nodeIndex ], totalSwitches, totalLinks, main.Cluster.numCtrls )
1042 lib.verifyNodes( main )
1043 verify( main, external=False )
1044 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
1045 nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls
1046
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001047 def CASE642( self, main ):
1048 """
1049 Drop one link from each double link
1050 Drop a link between DAAS-1 and HAAG-1
1051 Drop a link between HAGG-2 and SPINE-2
1052 Drop one ONOS instance
1053 Test connectivity (expect no failure)
1054 Bring up all links and ONOS instance
1055 Test connectivity (expect no failure)
1056 """
1057 import time
1058 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1059 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1060 main.case( "Drop ONOS instance and links at the same time" )
1061 setupTest( main, test_idx=642, onosNodes=3 )
1062 main.Cluster.active( 0 ).CLI.balanceMasters()
1063 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1064 verify( main )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001065 portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ],
1066 [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ],
1067 [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ],
1068 [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ],
1069 [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ],
1070 [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ],
1071 [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ],
1072 [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ],
1073 [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ],
1074 [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ],
1075 [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ]
You Wang85747762018-05-11 15:51:50 -07001076 lib.disablePortBatch( main, portsToDisable,
1077 int( main.params[ "TOPO" ][ "switchNum" ] ),
1078 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ),
1079 sleep=0 )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001080 lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1081 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ), 2 )
1082 verify( main )
You Wang85747762018-05-11 15:51:50 -07001083 lib.enablePortBatch( main, portsToDisable,
1084 int( main.params[ "TOPO" ][ "switchNum" ] ),
1085 int( main.params[ "TOPO" ][ "linkNum" ] ),
1086 sleep=0 )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001087 lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1088 int( main.params[ "TOPO" ][ "linkNum" ] ), 3 )
1089 verify( main )
1090 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
1091
1092 def CASE643( self, main ):
1093 """
1094 Drop one link from each double link
1095 Drop a link between DAAS-1 and HAAG-1
1096 Drop a link between HAGG-2 and SPINE-2
1097 Test connectivity (expect no failure)
1098 Bring up all links
1099 Drop one ONOS instance
1100 Test connectivity (expect no failure)
1101 Bring up ONOS instance
1102 Test connectivity (expect no failure)
1103 """
1104 import time
1105 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1106 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1107 main.case( "Drop ONOS instances and bring up links at the same time" )
1108 setupTest( main, test_idx=643, onosNodes=3 )
1109 main.Cluster.active( 0 ).CLI.balanceMasters()
1110 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1111 verify( main )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001112 portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ],
1113 [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ],
1114 [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ],
1115 [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ],
1116 [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ],
1117 [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ],
1118 [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ],
1119 [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ],
1120 [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ],
1121 [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ],
1122 [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ]
You Wang85747762018-05-11 15:51:50 -07001123 lib.disablePortBatch( main, portsToDisable,
1124 int( main.params[ "TOPO" ][ "switchNum" ] ),
1125 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ) )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001126 verify( main )
You Wang85747762018-05-11 15:51:50 -07001127 lib.enablePortBatch( main, portsToDisable,
1128 int( main.params[ "TOPO" ][ "switchNum" ] ),
1129 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -07001130 lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1131 int( main.params[ "TOPO" ][ "linkNum" ] ), 2 )
1132 verify( main )
1133 lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
1134 int( main.params[ "TOPO" ][ "linkNum" ] ), 3 )
1135 verify( main )
1136 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jonghwan Hyun785471d2018-05-14 14:48:19 -07001137
1138 def CASE651( self, main ):
1139 """
1140 Move a single-homed host from port A to port B in DAAS-1
1141 Test connectivity (expect no failure)
1142
1143 Repeat with DAAS-2
1144 """
1145 import time
1146 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
1147 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
1148 main.case( "Move a single-homed host to another port in the same DAAS" )
1149 setupTest( main, test_idx=651, onosNodes=3 )
1150 main.Cluster.active( 0 ).CLI.balanceMasters()
1151 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
1152 verify( main )
1153
1154 h1v4cfg = '{"of:0000000000000001/7" : { "interfaces" : [ { "ips" : [ "10.1.0.254/24" ], "vlan-untagged": 10 } ] } }'
1155 lib.moveHost( main, "h1v4", "leaf1", "leaf1", "10.1.0.254", prefixLen=24, cfg=h1v4cfg )
1156 verify( main )
1157
1158 h13v4cfg = '''{"of:0000000000000006/7" : { "interfaces" : [ { "ips" : [ "10.5.20.254/24" ], "vlan-untagged": 20 } ] } }'''
1159 lib.moveHost( main, "h13v4", "leaf6", "leaf6", "10.5.20.254", prefixLen=24, cfg=h13v4cfg )
1160 verify( main )