blob: 9c97ebbc9f8588ad0eec10ad4bc09d56ec243eb0 [file] [log] [blame]
Andreas Pantelopoulos90f0b102018-02-01 13:21:45 -08001
2class SRRouting:
3 def __init__( self ):
4 self.default = ''
5
6 def CASE1( self, main ):
7 """
Andreas Pantelopoulosb7904ce2018-02-07 16:24:49 -08008 Ping between all ipv4 hosts in the topology.
Andreas Pantelopoulos90f0b102018-02-01 13:21:45 -08009 """
You Wangd66de192018-04-30 17:30:12 -070010 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
11 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
12 main.case( "Ping between all ipv4 hosts in the topology" )
13 setupTest( main, test_idx=1, onosNodes=3, ipv6=False, external=False )
14 verify( main, ipv6=False, disconnected=False, external=False )
15 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosf6ed5012018-02-08 21:26:01 -080016
17 def CASE2( self, main ):
18 """
19 Ping between all ipv6 hosts in the topology.
20 """
You Wangd66de192018-04-30 17:30:12 -070021 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
22 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
23 main.case( "Ping between all ipv6 hosts in the topology" )
24 setupTest( main, test_idx=2, onosNodes=3, ipv4=False, external=False )
25 verify( main, ipv4=False, disconnected=False, external=False )
26 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosf6ed5012018-02-08 21:26:01 -080027
You Wang79577812018-02-27 16:39:50 -080028 def CASE3( self, main ):
29 """
30 Ping between all ipv4 and ipv6 hosts in the topology.
31 """
You Wangd66de192018-04-30 17:30:12 -070032 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
33 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
34 main.case( "Ping between all ipv4 and ipv6 hosts in the topology" )
35 setupTest( main, test_idx=3, onosNodes=3, external=False )
36 verify( main, disconnected=False, external=False )
37 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wangba231e72018-03-01 13:18:21 -080038
39 def CASE4( self, main ):
40 """
41 Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts
42 """
You Wangd66de192018-04-30 17:30:12 -070043 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
44 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
45 main.case( "Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts" )
46 setupTest( main, test_idx=4, onosNodes=3, ipv6=False )
47 verify( main, ipv6=False, disconnected=False )
48 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wangba231e72018-03-01 13:18:21 -080049
50 def CASE5( self, main ):
51 """
52 Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts
53 """
You Wangd66de192018-04-30 17:30:12 -070054 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
55 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
56 main.case( "Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts" )
57 setupTest( main, test_idx=5, onosNodes=3, ipv4=False )
58 verify( main, ipv4=False, disconnected=False )
59 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wangba231e72018-03-01 13:18:21 -080060
61 def CASE6( self, main ):
62 """
63 Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts
64 """
You Wangd66de192018-04-30 17:30:12 -070065 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
66 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
67 main.case( "Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external hosts" )
68 setupTest( main, test_idx=6, onosNodes=3 )
69 verify( main, disconnected=False )
70 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulos2eae3242018-03-06 13:47:20 -080071
72 def CASE7( self, main ):
73 """
74 Ping between ipv4 hosts and an external host that is not configured in
75 external router config, but reachable through the use of route-add
76 command.
77 """
You Wangd66de192018-04-30 17:30:12 -070078 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
79 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
80 main.case( "Ping between from ipv4 hosts to external host configured with route-add command" )
81 setupTest( main, test_idx=7, onosNodes=3, ipv6=False, external=False )
82 verify( main, ipv6=False, internal=False, disconnected=False )
83 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulos2eae3242018-03-06 13:47:20 -080084
85 def CASE8( self, main ):
86 """
87 Ping between ipv6 hosts and an external host that is not configured in
88 external router config, but reachable through the use of route-add
89 command.
90 """
You Wangd66de192018-04-30 17:30:12 -070091 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
92 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
93 main.case( "Ping between from ipv6 hosts to external host configured with route-add command" )
94 setupTest( main, test_idx=8, onosNodes=3, ipv4=False, external=False )
95 verify( main, ipv6=False, internal=False, disconnected=False )
96 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulos2eae3242018-03-06 13:47:20 -080097
98 def CASE9( self, main ):
99 """
100 Ping between ipv4 and pv6 hosts and external hosts that is not configured in
101 external router config, but reachable through the use of route-add
102 command.
103 """
You Wangd66de192018-04-30 17:30:12 -0700104 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
105 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
106 main.case( "Ping between from ipv4 and ipv6 hosts to external host configured with route-add command" )
107 setupTest( main, test_idx=9, onosNodes=3, external=False )
108 verify( main, internal=False, disconnected=False )
109 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800110
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800111 def CASE101( self, main ):
112 """
113 Kill and recover links
114 Ping between all ipv4 hosts in the topology.
115 """
You Wangd66de192018-04-30 17:30:12 -0700116 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
117 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
118 main.case( "Test link failures with IPv4 hosts" )
119 setupTest( main, test_idx=101, onosNodes=3, ipv6=False, external=False )
120 verify( main, ipv6=False, external=False, disconnected=False )
121 verifyLinkFailure( main, ipv6=False, external=False )
122 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800123
124 def CASE102( self, main ):
125 """
126 Kill and recover links
127 Ping between all ipv6 hosts in the topology.
128 """
You Wangd66de192018-04-30 17:30:12 -0700129 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
130 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
131 main.case( "Test link failures with IPv6 hosts" )
132 setupTest( main, test_idx=102, onosNodes=3, ipv4=False, external=False )
133 verify( main, ipv4=False, external=False, disconnected=False )
134 verifyLinkFailure( main, ipv4=False, external=False )
135 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800136
137 def CASE103( self, main ):
138 """
139 Kill and recover links
140 Ping between all ipv4 and ipv6 hosts in the topology.
141 """
You Wangd66de192018-04-30 17:30:12 -0700142 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
143 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
144 main.case( "Test link failures with IPv4 and IPv6 hosts" )
145 setupTest( main, test_idx=103, onosNodes=3, external=False )
146 verify( main, external=False, disconnected=False )
147 verifyLinkFailure( main, external=False )
148 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800149
150 def CASE104( self, main ):
151 """
152 Kill and recover links
153 Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts
154 """
You Wangd66de192018-04-30 17:30:12 -0700155 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
156 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
157 main.case( "Test link failures with IPv4 hosts including external hosts" )
158 setupTest( main, test_idx=104, onosNodes=3, ipv6=False )
159 verify( main, ipv6=False, disconnected=False )
160 verifyLinkFailure( main, ipv6=False )
161 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800162
163 def CASE105( self, main ):
164 """
165 Kill and recover links
166 Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts
167 """
You Wangd66de192018-04-30 17:30:12 -0700168 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
169 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
170 main.case( "Test link failures with IPv6 hosts including external hosts" )
171 setupTest( main, test_idx=105, onosNodes=3, ipv4=False )
172 verify( main, ipv4=False, disconnected=False )
173 verifyLinkFailure( main, ipv4=False )
174 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800175
176 def CASE106( self, main ):
177 """
178 Kill and recover links
179 Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts
180 """
You Wangd66de192018-04-30 17:30:12 -0700181 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
182 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
183 main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts" )
184 setupTest( main, test_idx=106, onosNodes=3 )
185 verify( main, disconnected=False )
186 verifyLinkFailure( main )
187 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800188
189 def CASE107( self, main ):
190 """
191 Kill and recover links
192 Ping between ipv4 hosts and an external host that is not configured in
193 external router config, but reachable through the use of route-add command.
194 """
You Wangd66de192018-04-30 17:30:12 -0700195 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
196 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
197 main.case( "Test link failures with IPv4 hosts including external hosts configured with route-add command" )
198 setupTest( main, test_idx=107, onosNodes=3, ipv6=False, external=False )
199 verify( main, ipv6=False, disconnected=False )
200 verifyLinkFailure( main, ipv6=False, internal=False )
201 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800202
203 def CASE108( self, main ):
204 """
205 Kill and recover links
206 Ping between ipv6 hosts and an external host that is not configured in
207 external router config, but reachable through the use of route-add command.
208 """
You Wangd66de192018-04-30 17:30:12 -0700209 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
210 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
211 main.case( "Test link failures with IPv6 hosts including external hosts configured with route-add command" )
212 setupTest( main, test_idx=108, onosNodes=3, ipv4=False, external=False )
213 verify( main, ipv4=False, disconnected=False )
214 verifyLinkFailure( main, ipv4=False, internal=False )
215 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800216
217 def CASE109( self, main ):
218 """
219 Kill and recover links
220 Ping between ipv4 and pv6 hosts and external hosts that is not configured in
221 external router config, but reachable through the use of route-add command.
222 """
You Wangd66de192018-04-30 17:30:12 -0700223 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
224 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
225 main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
226 setupTest( main, test_idx=109, onosNodes=3, external=False )
227 verify( main, disconnected=False )
228 verifyLinkFailure( main, internal=False )
229 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800230
You Wang27317572018-03-06 12:13:11 -0800231 def CASE201( self, main ):
232 """
233 Kill and recover spine switches
234 Ping between all ipv4 hosts in the topology.
235 """
You Wangd66de192018-04-30 17:30:12 -0700236 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
237 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
238 main.case( "Test switch failures with IPv4 hosts" )
239 setupTest( main, test_idx=201, onosNodes=3, ipv6=False, external=False )
240 verify( main, ipv6=False, external=False, disconnected=False )
241 verifySwitchFailure( main, ipv6=False, external=False )
242 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800243
244 def CASE202( self, main ):
245 """
246 Kill and recover spine switches
247 Ping between all ipv6 hosts in the topology.
248 """
You Wangd66de192018-04-30 17:30:12 -0700249 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
250 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
251 main.case( "Test switch failures with IPv6 hosts" )
252 setupTest( main, test_idx=202, onosNodes=3, ipv4=False, external=False )
253 verify( main, ipv4=False, external=False, disconnected=False )
254 verifySwitchFailure( main, ipv4=False, external=False )
255 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800256
257 def CASE203( self, main ):
258 """
259 Kill and recover spine switches
260 Ping between all ipv4 and ipv6 hosts in the topology.
261 """
You Wangd66de192018-04-30 17:30:12 -0700262 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
263 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
264 main.case( "Test switch failures with IPv4 and IPv6 hosts" )
265 setupTest( main, test_idx=203, onosNodes=3, external=False )
266 verify( main, external=False, disconnected=False )
267 verifySwitchFailure( main, external=False )
268 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800269
270 def CASE204( self, main ):
271 """
272 Kill and recover spine switches
273 Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts
274 """
You Wangd66de192018-04-30 17:30:12 -0700275 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
276 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
277 main.case( "Test switch failures with IPv4 hosts including external hosts" )
278 setupTest( main, test_idx=204, onosNodes=3, ipv6=False )
279 verify( main, ipv6=False, disconnected=False )
280 verifySwitchFailure( main, ipv6=False )
281 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800282
283 def CASE205( self, main ):
284 """
285 Kill and recover spine switches
286 Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts
287 """
You Wangd66de192018-04-30 17:30:12 -0700288 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
289 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
290 main.case( "Test switch failures with IPv6 hosts including external hosts" )
291 setupTest( main, test_idx=205, onosNodes=3, ipv4=False )
292 verify( main, ipv4=False, disconnected=False )
293 verifySwitchFailure( main, ipv4=False )
294 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800295
296 def CASE206( self, main ):
297 """
298 Kill and recover spine switches
299 Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts
300 """
You Wangd66de192018-04-30 17:30:12 -0700301 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
302 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
303 main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts" )
304 setupTest( main, test_idx=206, onosNodes=3 )
305 verify( main, disconnected=False )
306 verifySwitchFailure( main )
307 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800308
309 def CASE207( self, main ):
310 """
311 Kill and recover spine switches
312 Ping between ipv4 hosts and an external host that is not configured in
313 external router config, but reachable through the use of route-add command.
314 """
You Wangd66de192018-04-30 17:30:12 -0700315 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
316 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
317 main.case( "Test switch failures with IPv4 hosts including external hosts configured with route-add command" )
318 setupTest( main, test_idx=207, onosNodes=3, ipv6=False, external=False )
319 verify( main, ipv6=False, disconnected=False )
320 verifySwitchFailure( main, ipv6=False, internal=False )
321 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800322
323 def CASE208( self, main ):
324 """
325 Kill and recover spine switches
326 Ping between ipv6 hosts and an external host that is not configured in
327 external router config, but reachable through the use of route-add command.
328 """
You Wangd66de192018-04-30 17:30:12 -0700329 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
330 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
331 main.case( "Test switch failures with IPv6 hosts including external hosts configured with route-add command" )
332 setupTest( main, test_idx=208, onosNodes=3, ipv4=False, external=False )
333 verify( main, ipv4=False, disconnected=False )
334 verifySwitchFailure( main, ipv4=False, internal=False )
335 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
You Wang27317572018-03-06 12:13:11 -0800336
337 def CASE209( self, main ):
338 """
339 Kill and recover spine switches
340 Ping between ipv4 and pv6 hosts and external hosts that is not configured in
341 external router config, but reachable through the use of route-add command.
342 """
You Wangd66de192018-04-30 17:30:12 -0700343 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
344 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
345 main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
346 setupTest( main, test_idx=209, onosNodes=3, external=False )
347 verify( main, disconnected=False )
348 verifySwitchFailure( main, internal=False )
349 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800350
Jon Hall3c910162018-03-07 14:42:16 -0800351 def CASE301( self, main ):
352 """
You Wangd66de192018-04-30 17:30:12 -0700353 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800354 Ping between all ipv4 hosts in the topology.
355 """
You Wangd66de192018-04-30 17:30:12 -0700356 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
357 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
358 main.case( "Test onos failures with IPv4 hosts" )
359 setupTest( main, test_idx=301, onosNodes=3, ipv6=False, external=False )
360 verify( main, ipv6=False, external=False, disconnected=False )
361 verifyOnosFailure( main, ipv6=False, external=False )
362 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800363
364 def CASE302( self, main ):
365 """
You Wangd66de192018-04-30 17:30:12 -0700366 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800367 Ping between all ipv6 hosts in the topology.
368 """
You Wangd66de192018-04-30 17:30:12 -0700369 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
370 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
371 main.case( "Test onos failures with IPv6 hosts" )
372 setupTest( main, test_idx=302, onosNodes=3, ipv4=False, external=False )
373 verify( main, ipv4=False, external=False, disconnected=False )
374 verifyOnosFailure( main, ipv4=False, external=False )
375 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800376
377 def CASE303( self, main ):
378 """
You Wangd66de192018-04-30 17:30:12 -0700379 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800380 Ping between all ipv4 and ipv6 hosts in the topology.
381 """
You Wangd66de192018-04-30 17:30:12 -0700382 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
383 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
384 main.case( "Test onos failures with IPv4 and IPv6 hosts" )
385 setupTest( main, test_idx=303, onosNodes=3, external=False )
386 verify( main, external=False, disconnected=False )
387 verifyOnosFailure( main, external=False )
388 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800389
390 def CASE304( self, main ):
391 """
You Wangd66de192018-04-30 17:30:12 -0700392 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800393 Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts
394 """
You Wangd66de192018-04-30 17:30:12 -0700395 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
396 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
397 main.case( "Test onos failures with IPv4 hosts including external hosts" )
398 setupTest( main, test_idx=304, onosNodes=3, ipv6=False )
399 verify( main, ipv6=False, disconnected=False )
400 verifyOnosFailure( main, ipv6=False )
401 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800402
403 def CASE305( self, main ):
404 """
You Wangd66de192018-04-30 17:30:12 -0700405 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800406 Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts
407 """
You Wangd66de192018-04-30 17:30:12 -0700408 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
409 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
410 main.case( "Test onos failures with IPv6 hosts including external hosts" )
411 setupTest( main, test_idx=305, onosNodes=3, ipv4=False )
412 verify( main, ipv4=False, disconnected=False )
413 verifyOnosFailure( main, ipv4=False )
414 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800415
416 def CASE306( self, main ):
417 """
You Wangd66de192018-04-30 17:30:12 -0700418 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800419 Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts
420 """
You Wangd66de192018-04-30 17:30:12 -0700421 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
422 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
423 main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts" )
424 setupTest( main, test_idx=306, onosNodes=3 )
425 verify( main, disconnected=False )
426 verifyOnosFailure( main )
427 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800428
429 def CASE307( self, main ):
430 """
You Wangd66de192018-04-30 17:30:12 -0700431 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800432 Ping between ipv4 hosts and an external host that is not configured in
433 external router config, but reachable through the use of route-add command.
434 """
You Wangd66de192018-04-30 17:30:12 -0700435 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
436 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
437 main.case( "Test onos failures with IPv4 hosts including external hosts configured with route-add command" )
438 setupTest( main, test_idx=307, onosNodes=3, ipv6=False, external=False )
439 verify( main, ipv6=False, disconnected=False )
440 verifyOnosFailure( main, ipv6=False, internal=False )
441 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800442
443 def CASE308( self, main ):
444 """
You Wangd66de192018-04-30 17:30:12 -0700445 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800446 Ping between ipv6 hosts and an external host that is not configured in
447 external router config, but reachable through the use of route-add command.
448 """
You Wangd66de192018-04-30 17:30:12 -0700449 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
450 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
451 main.case( "Test onos failures with IPv6 hosts including external hosts configured with route-add command" )
452 setupTest( main, test_idx=308, onosNodes=3, ipv4=False, external=False )
453 verify( main, ipv4=False, disconnected=False )
454 verifyOnosFailure( main, ipv4=False, internal=False )
455 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jon Hall3c910162018-03-07 14:42:16 -0800456
457 def CASE309( self, main ):
458 """
You Wangd66de192018-04-30 17:30:12 -0700459 Kill and recover onos nodes
Jon Hall3c910162018-03-07 14:42:16 -0800460 Ping between ipv4 and pv6 hosts and external hosts that is not configured in
461 external router config, but reachable through the use of route-add command.
462 """
You Wangd66de192018-04-30 17:30:12 -0700463 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
464 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
465 main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" )
466 setupTest( main, test_idx=309, onosNodes=3, external=False )
467 verify( main, disconnected=False )
468 verifyOnosFailure( main, internal=False )
469 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Andreas Pantelopoulosfab6bf32018-03-06 18:56:35 -0800470
Andreas Pantelopoulos74c7ff22018-05-01 15:42:02 -0700471 def CASE603( self, main ):
472 """"
473 Drop HAGG-1 device and test connectivity.
474 Drop DAAS-1 device and test connectivity (some hosts lost it)
475 Bring up DAAS-1 and test connectivity (all hosts gained it again)
476
477 Repeat the same with HAGG-2 and DAAS-2.
478 """
479 import time
480 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
481 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
482 main.case( "Drop hagg spine switch along with dass leaf switch." )
483 setupTest( main, test_idx=603, onosNodes=3 )
484 main.disconnectedIpv4Hosts = []
485 main.disconnectedIpv6Hosts = []
486
487 verify( main )
488 lib.killSwitch( main, "spine103", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
489 verify( main )
490 lib.killSwitch( main, "leaf6", int( main.params[ "TOPO" ]["switchNum" ] ) - 2, int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
491 main.disconnectedIpv4Hosts = [ 'h12v4', 'h13v4']
492 main.disconnectedIpv6Hosts = [ 'h12v6', 'h13v6']
493 verify( main )
494 lib.recoverSwitch( main, "leaf6", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6, rediscoverHosts=True)
495 main.disconnectedIpv4Hosts = []
496 main.disconnectedIpv6Hosts = []
497 verify( main )
498 lib.recoverSwitch( main, "spine103", int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ))
499 verify( main )
500
501 lib.killSwitch( main, "spine104", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
502 verify( main )
503 lib.killSwitch( main, "leaf1", int( main.params[ "TOPO" ]["switchNum" ] ) - 2, int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 )
504 main.disconnectedIpv4Hosts = [ 'h1v4', 'h2v4']
505 main.disconnectedIpv6Hosts = [ 'h1v6', 'h2v6']
506 verify( main )
507 lib.recoverSwitch( main, "leaf1", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6, rediscoverHosts=True)
508 main.disconnectedIpv4Hosts = []
509 main.disconnectedIpv6Hosts = []
510 verify( main )
511 lib.recoverSwitch( main, "spine104", int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ))
512 verify( main )
513
514 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
515
516 def CASE604( self, main ):
517 """"
518 Drop HAGG-1 device and test connectivity.
519 Bring up HAGG-1 and test connectivity.
520 Drop HAGG-2 device and test connectivity.
521 Bring up HAGG-2 device and test connectivity
522 """
523 import time
524 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
525 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
526 main.case( "Drop hagg spine switches." )
527 setupTest( main, test_idx=604, onosNodes=3 )
528 main.disconnectedIpv4Hosts = []
529 main.disconnectedIpv6Hosts = []
530 verify( main )
531 lib.killSwitch( main, "spine103", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
532 verify( main )
533 lib.recoverSwitch( main, "spine103", int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ))
534 verify( main )
535 lib.killSwitch( main, "spine104", int( main.params[ "TOPO" ]["switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
536 verify( main )
537 lib.recoverSwitch( main, "spine104", int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ))
538 verify( main )
539 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
540
Jonghwan Hyun3759e472018-05-01 15:40:08 -0700541 def CASE605( self, main ):
542 """
543 Drop HAGG-1 and test connectivity (expect no failure)
544 Drop all leafs in big fabric and test connectivity (expect some failures)
545 Bring up HAGG-1 and test connectivity (still expect some failures)
546 Bring up all leafs in big fabric and test connectivity (expect no failure)
547 Repeat above with HAGG-2
548 """
549 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
550 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
551 main.case( "Drop one hagg and all leafs in big fabric" )
552 setupTest( main, test_idx=605, onosNodes=3 )
553 main.disconnectedIpv4Hosts = []
554 main.disconnectedIpv6Hosts = []
555 verify( main )
556 lib.killSwitch( main, "spine103", int( main.params[ "TOPO" ][ "switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
557 verify( main )
558 lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], int( main.params[ "TOPO" ][ "switchNum" ] ) - 5,
559 int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 )
560 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ]
561 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ]
562 main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ]
563 main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ]
564 verify( main, disconnected=True )
565 lib.recoverSwitch( main, "spine103", int( main.params[ "TOPO" ][ "switchNum" ] ) - 4, int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 )
566 verify( main, disconnected=True )
567 lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], int( main.params[ "TOPO" ][ "switchNum" ] ),
568 int( main.params[ "TOPO" ][ "linkNum" ] ) )
569 main.disconnectedIpv4Hosts = []
570 main.disconnectedIpv6Hosts = []
571 main.disconnectedExternalIpv4Hosts = [ ]
572 main.disconnectedExternalIpv6Hosts = [ ]
573 verify( main )
574
575 lib.killSwitch( main, "spine104", int( main.params[ "TOPO" ][ "switchNum" ] ) - 1, int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 )
576 verify( main )
577 lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], int( main.params[ "TOPO" ][ "switchNum" ] ) - 5,
578 int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 )
579 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ]
580 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ]
581 main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ]
582 main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ]
583 verify( main, disconnected=True )
584 lib.recoverSwitch( main, "spine104", int( main.params[ "TOPO" ][ "switchNum" ] ) - 4, int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 )
585 verify( main, disconnected=True )
586 lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], int( main.params[ "TOPO" ][ "switchNum" ] ),
587 int( main.params[ "TOPO" ][ "linkNum" ] ) )
588 main.disconnectedIpv4Hosts = []
589 main.disconnectedIpv6Hosts = []
590 main.disconnectedExternalIpv4Hosts = [ ]
591 main.disconnectedExternalIpv6Hosts = [ ]
592 verify( main )
593 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
594
You Wang5da39c82018-04-26 22:55:08 -0700595 def CASE606( self, main ):
596 """
597 Drop SPINE-1 and test connectivity
598 Drop paired leaf and test connectivity (expect some failures)
599 Bring up SPINE-1 and test connectivity (still expect some failures)
600 Bring up the paired leaf and test connectivity
601 Repeat above with SPINE-2 and a different paired leaf
602 """
603 import time
604 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
605 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
606 main.case( "Drop spine and paired leaf" )
607 setupTest( main, test_idx=606, onosNodes=3 )
You Wangd66de192018-04-30 17:30:12 -0700608 verify( main, disconnected=False )
You Wang6d2d6312018-05-08 12:02:02 -0700609 # Drop spine101 and leaf-2/3
You Wangd66de192018-04-30 17:30:12 -0700610 lib.killSwitch( main, "spine101", 9, 30 )
611 verify( main, disconnected=False )
612 lib.killSwitch( main, "leaf2", 8, 24 )
613 lib.killSwitch( main, "leaf3", 7, 20 )
You Wang5da39c82018-04-26 22:55:08 -0700614 main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4" ]
615 main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6" ]
You Wangd66de192018-04-30 17:30:12 -0700616 verify( main )
617 lib.recoverSwitch( main, "spine101", 8, 30 )
618 verify( main )
619 lib.recoverSwitch( main, "leaf3", 9, 38 )
You Wang6d2d6312018-05-08 12:02:02 -0700620 lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True,
621 hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
You Wang5da39c82018-04-26 22:55:08 -0700622 main.disconnectedIpv4Hosts = []
623 main.disconnectedIpv6Hosts = []
You Wang6d2d6312018-05-08 12:02:02 -0700624 verify( main, disconnected=False )
625 # Drop spine102 and leaf-4/5
626 lib.killSwitch( main, "spine102", 9, 30 )
627 verify( main, disconnected=False )
628 lib.killSwitch( main, "leaf4", 8, 24 )
629 lib.killSwitch( main, "leaf5", 7, 20 )
630 main.disconnectedIpv4Hosts = [ "h8v4", "h9v4", "h10v4", "h11v4" ]
631 main.disconnectedIpv6Hosts = [ "h8v6", "h9v6", "h10v6", "h11v6" ]
632 verify( main, external=False )
633 lib.recoverSwitch( main, "spine102", 8, 30 )
634 verify( main, external=False )
635 lib.recoverSwitch( main, "leaf5", 9, 38 )
636 lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True,
637 hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
638 main.disconnectedIpv4Hosts = []
639 main.disconnectedIpv6Hosts = []
640 verify( main, disconnected=False )
641 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
642
643 def CASE620( self, main ):
644 """
645 Take down one of double links towards the spine from all leaf switches and
646 check that buckets in select groups change accordingly
647 Bring up links again and check that buckets in select groups change accordingly
648 """
649 import time
650 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
651 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
652 main.case( "Take down one of double links towards the spine" )
653 setupTest( main, test_idx=620, onosNodes=3 )
654 verify( main, disconnected=False )
655 portsToDisable = [ [ "of:0000000000000002", 1 ], [ "of:0000000000000002", 3 ],
656 [ "of:0000000000000003", 1 ], [ "of:0000000000000003", 3 ],
657 [ "of:0000000000000004", 1 ], [ "of:0000000000000004", 3 ],
658 [ "of:0000000000000005", 1 ], [ "of:0000000000000005", 3 ] ]
You Wang85747762018-05-11 15:51:50 -0700659 lib.disablePortBatch( main, portsToDisable, 10, 32 )
You Wang6d2d6312018-05-08 12:02:02 -0700660 # TODO: check buckets in groups
661 verify( main, disconnected=False )
You Wang85747762018-05-11 15:51:50 -0700662 lib.enablePortBatch( main, portsToDisable, 10, 48 )
You Wang6d2d6312018-05-08 12:02:02 -0700663 # TODO: check buckets in groups
664 verify( main, disconnected=False )
665 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
666
667 def CASE621( self, main ):
668 """
669 Remove all the links in the network and restore all Links (repeat x3)
670 """
671 import time
672 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
673 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
674 main.case( "Remove all the links in the network and restore all Links" )
675 setupTest( main, test_idx=621, onosNodes=3 )
676 verify( main, disconnected=False )
677 linksToRemove = [ ["spine101", "spine103"], ["spine102", "spine104"],
678 ["spine103", "leaf6"], ["spine103", "leaf1"],
679 ["spine104", "leaf6"], ["spine104", "leaf1"],
680 ["spine101", "leaf2"], ["spine101", "leaf3"], ["spine101", "leaf4"], ["spine101", "leaf5"],
681 ["spine102", "leaf2"], ["spine102", "leaf3"], ["spine102", "leaf4"], ["spine102", "leaf5"],
682 ["leaf2", "leaf3"], ["leaf4", "leaf5"] ]
683 portsToDisable = [ [ "of:0000000000000001", 3 ], [ "of:0000000000000001", 4 ],
684 [ "of:0000000000000001", 5 ], [ "of:0000000000000001", 6 ],
685 [ "of:0000000000000002", 6 ], [ "of:0000000000000002", 7 ],
686 [ "of:0000000000000002", 8 ], [ "of:0000000000000002", 9 ],
687 [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ],
688 [ "of:0000000000000003", 6 ], [ "of:0000000000000003", 7 ],
689 [ "of:0000000000000003", 8 ], [ "of:0000000000000003", 9 ],
690 [ "of:0000000000000003", 10 ], [ "of:0000000000000003", 11 ],
691 [ "of:0000000000000003", 12 ], [ "of:0000000000000003", 13 ],
692 [ "of:0000000000000004", 6 ], [ "of:0000000000000004", 7 ],
693 [ "of:0000000000000004", 8 ], [ "of:0000000000000004", 9 ],
694 [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ],
695 [ "of:0000000000000004", 12 ], [ "of:0000000000000004", 13 ], [ "of:0000000000000004", 14 ],
696 [ "of:0000000000000005", 6 ], [ "of:0000000000000005", 7 ],
697 [ "of:0000000000000005", 8 ], [ "of:0000000000000005", 9 ],
698 [ "of:0000000000000005", 10 ], [ "of:0000000000000005", 11 ],
699 [ "of:0000000000000005", 12 ], [ "of:0000000000000005", 13 ],
700 [ "of:0000000000000005", 14 ], [ "of:0000000000000005", 15 ],
701 [ "of:0000000000000006", 3 ], [ "of:0000000000000006", 4 ],
702 [ "of:0000000000000006", 5 ], [ "of:0000000000000006", 6 ] ]
703 for i in range( 0, 3 ):
704 lib.killLinkBatch( main, linksToRemove, 0, 10 )
You Wang85747762018-05-11 15:51:50 -0700705 lib.disablePortBatch( main, portsToDisable, 10, 0 )
You Wang6d2d6312018-05-08 12:02:02 -0700706 main.disconnectedIpv4Hosts = main.internalIpv4Hosts
707 main.disconnectedIpv6Hosts = main.internalIpv6Hosts
708 verify( main )
709 lib.restoreLinkBatch( main, linksToRemove, 48, 10 )
You Wang85747762018-05-11 15:51:50 -0700710 lib.enablePortBatch( main, portsToDisable, 10, 48 )
You Wang6d2d6312018-05-08 12:02:02 -0700711 main.Network.discoverHosts( hostList=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts )
712 time.sleep( 10 )
713 main.disconnectedIpv4Hosts = []
714 main.disconnectedIpv6Hosts = []
715 verify( main )
716 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
717
718 def CASE622( self, main ):
719 """
720 Take down all uplinks from a paired leaf switch
721 """
722 import time
723 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
724 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
725 from core import utilities
726 main.case( "Take down all uplinks from a paired leaf switch" )
727 setupTest( main, test_idx=622, onosNodes=3 )
728 verify( main, disconnected=False )
729 ctrl = main.Cluster.active( 0 )
You Wang85747762018-05-11 15:51:50 -0700730 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
731 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
732 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
733 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
734 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700735 linksToRemove = [ ["spine101", "leaf2"], ["spine102", "leaf2"] ]
736 lib.killLinkBatch( main, linksToRemove, 40, 10 )
737 # TODO: more verifications are required
You Wangd66de192018-04-30 17:30:12 -0700738 verify( main )
You Wang85747762018-05-11 15:51:50 -0700739 hostLocations = { "h4v6": "of:0000000000000003/6",
740 "h5v6": "of:0000000000000003/7",
741 "h4v4": "of:0000000000000003/10",
742 "h5v4": "of:0000000000000003/11" }
743 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700744 lib.restoreLinkBatch( main, linksToRemove, 48, 10 )
745 verify( main )
You Wang85747762018-05-11 15:51:50 -0700746 hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ],
747 "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ],
748 "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ],
749 "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] }
750 lib.verifyHostLocations( main, hostLocations )
You Wang6d2d6312018-05-08 12:02:02 -0700751 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
752
753 def CASE630( self, main ):
754 """
755 Bring an instance down
756 Drop a device
757 Bring that same instance up again and observe that this specific instance sees that the device is down.
758 """
759 import time
760 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
761 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
762 from core import utilities
763 main.case( "Bring an instance down and drop a device" )
764 setupTest( main, test_idx=630, onosNodes=3 )
765 onosToKill = 0
766 deviceToDrop = "spine101"
767 lib.killOnos( main, [ onosToKill ], 10, 48, 2 )
768 lib.killSwitch( main, deviceToDrop, 9, 30 )
769 lib.recoverOnos( main, [ onosToKill ], 9, 30, 3 )
770 result = main.Cluster.runningNodes[ onosToKill ].CLI.checkStatus( 9, 30, 3 )
771 utilities.assert_equals( expect=main.TRUE, actual=result,
772 onpass="ONOS instance {} sees correct device numbers".format( onosToKill ),
773 onfail="ONOS instance {} doesn't see correct device numbers".format( onosToKill ) )
You Wang5da39c82018-04-26 22:55:08 -0700774 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700775
776 def CASE642( self, main ):
777 """
778 Drop one link from each double link
779 Drop a link between DAAS-1 and HAAG-1
780 Drop a link between HAGG-2 and SPINE-2
781 Drop one ONOS instance
782 Test connectivity (expect no failure)
783 Bring up all links and ONOS instance
784 Test connectivity (expect no failure)
785 """
786 import time
787 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
788 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
789 main.case( "Drop ONOS instance and links at the same time" )
790 setupTest( main, test_idx=642, onosNodes=3 )
791 main.Cluster.active( 0 ).CLI.balanceMasters()
792 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
793 verify( main )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700794 portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ],
795 [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ],
796 [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ],
797 [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ],
798 [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ],
799 [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ],
800 [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ],
801 [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ],
802 [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ],
803 [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ],
804 [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ]
You Wang85747762018-05-11 15:51:50 -0700805 lib.disablePortBatch( main, portsToDisable,
806 int( main.params[ "TOPO" ][ "switchNum" ] ),
807 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ),
808 sleep=0 )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700809 lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
810 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ), 2 )
811 verify( main )
You Wang85747762018-05-11 15:51:50 -0700812 lib.enablePortBatch( main, portsToDisable,
813 int( main.params[ "TOPO" ][ "switchNum" ] ),
814 int( main.params[ "TOPO" ][ "linkNum" ] ),
815 sleep=0 )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700816 lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
817 int( main.params[ "TOPO" ][ "linkNum" ] ), 3 )
818 verify( main )
819 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )
820
821 def CASE643( self, main ):
822 """
823 Drop one link from each double link
824 Drop a link between DAAS-1 and HAAG-1
825 Drop a link between HAGG-2 and SPINE-2
826 Test connectivity (expect no failure)
827 Bring up all links
828 Drop one ONOS instance
829 Test connectivity (expect no failure)
830 Bring up ONOS instance
831 Test connectivity (expect no failure)
832 """
833 import time
834 from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import *
835 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
836 main.case( "Drop ONOS instances and bring up links at the same time" )
837 setupTest( main, test_idx=643, onosNodes=3 )
838 main.Cluster.active( 0 ).CLI.balanceMasters()
839 time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) )
840 verify( main )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700841 portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ],
842 [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ],
843 [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ],
844 [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ],
845 [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ],
846 [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ],
847 [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ],
848 [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ],
849 [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ],
850 [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ],
851 [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ]
You Wang85747762018-05-11 15:51:50 -0700852 lib.disablePortBatch( main, portsToDisable,
853 int( main.params[ "TOPO" ][ "switchNum" ] ),
854 int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ) )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700855 verify( main )
You Wang85747762018-05-11 15:51:50 -0700856 lib.enablePortBatch( main, portsToDisable,
857 int( main.params[ "TOPO" ][ "switchNum" ] ),
858 int( main.params[ "TOPO" ][ "linkNum" ] ) )
Jonghwan Hyun25c98a62018-05-04 13:59:09 -0700859 lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
860 int( main.params[ "TOPO" ][ "linkNum" ] ), 2 )
861 verify( main )
862 lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ),
863 int( main.params[ "TOPO" ][ "linkNum" ] ), 3 )
864 verify( main )
865 lib.cleanup( main, copyKarafLog=False, removeHostComponent=True )