blob: 2f704201778a77de5c845aae9fbbce7daf376967 [file] [log] [blame]
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -08001# Testing the basic intent for ipv6 functionality of ONOS
2
3class FUNCipv6Intent:
4
5 def __init__( self ):
6 self.default = ''
7
8 def CASE1( self, main ):
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -08009 import imp
10 import re
11
12 """
13 - Construct tests variables
14 - GIT ( optional )
15 - Checkout ONOS master branch
16 - Pull latest ONOS code
17 - Building ONOS ( optional )
18 - Install ONOS package
19 - Build ONOS package
20 """
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080021 main.case( "Constructing test variables and building ONOS package" )
22 main.step( "Constructing test variables" )
23 main.caseExplanation = "This test case is mainly for loading " +\
24 "from params file, and pull and build the " +\
25 " latest ONOS package"
26 stepResult = main.FALSE
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080027 # Test variables
28 try:
29 main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
30 main.apps = main.params[ 'ENV' ][ 'cellApps' ]
31 gitBranch = main.params[ 'GIT' ][ 'branch' ]
32 main.dependencyPath = main.testOnDirectory + \
33 main.params[ 'DEPENDENCY' ][ 'path' ]
34 main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
35 main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
36 if main.ONOSbench.maxNodes:
37 main.maxNodes = int( main.ONOSbench.maxNodes )
38 else:
39 main.maxNodes = 0
40 wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
41 wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
42 wrapperFile3 = main.params[ 'DEPENDENCY' ][ 'wrapper3' ]
43 main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
44 main.checkIntentSleep = int( main.params[ 'SLEEP' ][ 'checkintent' ] )
45 main.removeIntentSleep = int( main.params[ 'SLEEP' ][ 'removeintent' ] )
46 main.rerouteSleep = int( main.params[ 'SLEEP' ][ 'reroute' ] )
47 main.fwdSleep = int( main.params[ 'SLEEP' ][ 'fwd' ] )
48 main.checkTopoAttempts = int( main.params[ 'SLEEP' ][ 'topoAttempts' ] )
49 gitPull = main.params[ 'GIT' ][ 'pull' ]
50 main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
51 main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
52 main.cellData = {} # for creating cell file
53 main.hostsData = {}
54 main.CLIs = []
55 main.ONOSip = []
56 main.assertReturnString = '' # Assembled assert return string
57
58 main.ONOSip = main.ONOSbench.getOnosIps()
59 print main.ONOSip
60
61 # Assigning ONOS cli handles to a list
62 for i in range( 1, main.maxNodes + 1 ):
63 main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
64
65 # -- INIT SECTION, ONLY RUNS ONCE -- #
66 main.startUp = imp.load_source( wrapperFile1,
67 main.dependencyPath +
68 wrapperFile1 +
69 ".py" )
70
71 main.intentFunction = imp.load_source( wrapperFile2,
72 main.dependencyPath +
73 wrapperFile2 +
74 ".py" )
75
76 main.topo = imp.load_source( wrapperFile3,
77 main.dependencyPath +
78 wrapperFile3 +
79 ".py" )
80
81 copyResult1 = main.ONOSbench.scp( main.Mininet1,
82 main.dependencyPath +
83 main.topology,
84 main.Mininet1.home,
85 direction="to" )
86 if main.CLIs:
87 stepResult = main.TRUE
88 else:
89 main.log.error( "Did not properly created list of ONOS CLI handle" )
90 stepResult = main.FALSE
91 except Exception as e:
92 main.log.exception(e)
93 main.cleanup()
94 main.exit()
95
96 utilities.assert_equals( expect=main.TRUE,
97 actual=stepResult,
98 onpass="Successfully construct " +
99 "test variables ",
100 onfail="Failed to construct test variables" )
101
102 if gitPull == 'True':
103 main.step( "Building ONOS in " + gitBranch + " branch" )
104 onosBuildResult = main.startUp.onosBuild( main, gitBranch )
105 stepResult = onosBuildResult
106 utilities.assert_equals( expect=main.TRUE,
107 actual=stepResult,
108 onpass="Successfully compiled " +
109 "latest ONOS",
110 onfail="Failed to compile " +
111 "latest ONOS" )
112 else:
113 main.log.warn( "Did not pull new code so skipping mvn " +
114 "clean install" )
115 main.ONOSbench.getVersion( report=True )
116
117 def CASE2( self, main ):
118 """
119 - Set up cell
120 - Create cell file
121 - Set cell file
122 - Verify cell file
123 - Kill ONOS process
124 - Uninstall ONOS cluster
125 - Verify ONOS start up
126 - Install ONOS cluster
127 - Connect to cli
128 """
alisona2905c12016-09-19 15:18:07 -0700129 import time
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800130 # main.scale[ 0 ] determines the current number of ONOS controller
131 main.numCtrls = int( main.scale[ 0 ] )
132
133 main.case( "Starting up " + str( main.numCtrls ) +
134 " node(s) ONOS cluster" )
135 main.caseExplanation = "Set up ONOS with " + str( main.numCtrls ) +\
136 " node(s) ONOS cluster"
137
138
139
140 #kill off all onos processes
141 main.log.info( "Safety check, killing all ONOS processes" +
Jon Hall70b2ff42015-11-17 15:49:44 -0800142 " before initiating environment setup" )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800143
144 for i in range( main.maxNodes ):
145 main.ONOSbench.onosDie( main.ONOSip[ i ] )
146
147 print "NODE COUNT = ", main.numCtrls
148
149 tempOnosIp = []
150 for i in range( main.numCtrls ):
151 tempOnosIp.append( main.ONOSip[i] )
152
153 main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
154 "temp", main.Mininet1.ip_address,
155 main.apps, tempOnosIp )
156
157 main.step( "Apply cell to environment" )
158 cellResult = main.ONOSbench.setCell( "temp" )
159 verifyResult = main.ONOSbench.verifyCell()
160 stepResult = cellResult and verifyResult
161 utilities.assert_equals( expect=main.TRUE,
162 actual=stepResult,
163 onpass="Successfully applied cell to " + \
164 "environment",
165 onfail="Failed to apply cell to environment " )
Jon Hall439c8912016-04-15 02:22:03 -0700166
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800167 main.step( "Creating ONOS package" )
Jon Hallbd60ea02016-08-23 10:03:59 -0700168 packageResult = main.ONOSbench.buckBuild()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800169 stepResult = packageResult
170 utilities.assert_equals( expect=main.TRUE,
171 actual=stepResult,
172 onpass="Successfully created ONOS package",
173 onfail="Failed to create ONOS package" )
174
175 time.sleep( main.startUpSleep )
176 main.step( "Uninstalling ONOS package" )
177 onosUninstallResult = main.TRUE
178 for ip in main.ONOSip:
179 onosUninstallResult = onosUninstallResult and \
180 main.ONOSbench.onosUninstall( nodeIp=ip )
181 stepResult = onosUninstallResult
182 utilities.assert_equals( expect=main.TRUE,
183 actual=stepResult,
184 onpass="Successfully uninstalled ONOS package",
185 onfail="Failed to uninstall ONOS package" )
186
187 time.sleep( main.startUpSleep )
188 main.step( "Installing ONOS package" )
189 onosInstallResult = main.TRUE
190 for i in range( main.numCtrls ):
191 onosInstallResult = onosInstallResult and \
192 main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
193 stepResult = onosInstallResult
194 utilities.assert_equals( expect=main.TRUE,
195 actual=stepResult,
196 onpass="Successfully installed ONOS package",
197 onfail="Failed to install ONOS package" )
198
199 time.sleep( main.startUpSleep )
200 main.step( "Starting ONOS service" )
201 stopResult = main.TRUE
202 startResult = main.TRUE
203 onosIsUp = main.TRUE
204
205 for i in range( main.numCtrls ):
206 onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
207 if onosIsUp == main.TRUE:
208 main.log.report( "ONOS instance is up and ready" )
209 else:
210 main.log.report( "ONOS instance may not be up, stop and " +
211 "start ONOS again " )
212
213 for i in range( main.numCtrls ):
214 stopResult = stopResult and \
215 main.ONOSbench.onosStop( main.ONOSip[ i ] )
216 for i in range( main.numCtrls ):
217 startResult = startResult and \
218 main.ONOSbench.onosStart( main.ONOSip[ i ] )
219 stepResult = onosIsUp and stopResult and startResult
220 utilities.assert_equals( expect=main.TRUE,
221 actual=stepResult,
222 onpass="ONOS service is ready",
223 onfail="ONOS service did not start properly" )
224
225 main.step( "Start ONOS cli" )
226 cliResult = main.TRUE
227 for i in range( main.numCtrls ):
228 cliResult = cliResult and \
229 main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
230 stepResult = cliResult
231 utilities.assert_equals( expect=main.TRUE,
232 actual=stepResult,
233 onpass="Successfully start ONOS cli",
234 onfail="Failed to start ONOS cli" )
235
Jon Hall11845ed2016-02-11 11:25:31 -0800236 main.step( "Checking that ONOS is ready" )
sathishmad953462015-12-03 17:42:07 +0530237 for i in range( 3 ):
Jon Hall11845ed2016-02-11 11:25:31 -0800238 ready = True
Jeremy5f820072016-02-11 13:50:35 -0800239 for i in range( int( main.scale[ 0 ] ) ):
240 output = main.CLIs[ i ].summary()
Jon Hall11845ed2016-02-11 11:25:31 -0800241 if not output:
242 ready = False
243 time.sleep( 30 )
244 utilities.assert_equals( expect=True, actual=ready,
245 onpass="ONOS summary command succeded",
246 onfail="ONOS summary command failed" )
247 if not ready:
248 main.cleanup()
249 main.exit()
250
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530251 main.step( "setup the ipv6NeighbourDiscovery" )
alisona2905c12016-09-19 15:18:07 -0700252 cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.incubator.net.neighbour.impl.NeighbourResolutionManager", "ndpEnabled", "true" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530253 cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "ipv6NeighborDiscovery", "true" )
254 cfgResult = cfgResult1 and cfgResult2
255 utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
256 onpass="ipv6NeighborDiscovery cfg is set to true",
257 onfail="Failed to cfg set ipv6NeighborDiscovery" )
258
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800259 # Remove the first element in main.scale list
260 main.scale.remove( main.scale[ 0 ] )
261
262 main.intentFunction.report( main )
263
264 def CASE11( self, main ):
265 """
266 Start Mininet topology with OF 1.3 switches
267 """
268 main.OFProtocol = "1.3"
269 main.log.report( "Start Mininet topology with OF 1.3 switches" )
270 main.case( "Start Mininet topology with OF 1.3 switches" )
271 main.caseExplanation = "Start mininet topology with OF 1.3 " +\
272 "switches to test intents, exits out if " +\
273 "topology did not start correctly"
274
275 main.step( "Starting Mininet topology with OF 1.3 switches" )
276 args = "--switch ovs,protocols=OpenFlow13"
277 topoResult = main.Mininet1.startNet( topoFile=main.dependencyPath +
278 main.topology,
279 args=args )
280 stepResult = topoResult
281 utilities.assert_equals( expect=main.TRUE,
282 actual=stepResult,
283 onpass="Successfully loaded topology",
284 onfail="Failed to load topology" )
285 # Exit if topology did not load properly
286 if not topoResult:
287 main.cleanup()
288 main.exit()
289
290 def CASE12( self, main ):
291 """
292 Assign mastership to controllers
293 """
294 import re
295
296 main.case( "Assign switches to controllers" )
297 main.step( "Assigning switches to controllers" )
298 main.caseExplanation = "Assign OF " + main.OFProtocol +\
299 " switches to ONOS nodes"
300
301 assignResult = main.TRUE
302 switchList = []
303
304 # Creates a list switch name, use getSwitch() function later...
305 for i in range( 1, ( main.numSwitch + 1 ) ):
306 switchList.append( 's' + str( i ) )
307
308 tempONOSip = []
309 for i in range( main.numCtrls ):
310 tempONOSip.append( main.ONOSip[ i ] )
311
312 assignResult = main.Mininet1.assignSwController( sw=switchList,
313 ip=tempONOSip,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530314 port='6633' )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800315 if not assignResult:
316 main.cleanup()
317 main.exit()
318
319 for i in range( 1, ( main.numSwitch + 1 ) ):
320 response = main.Mininet1.getSwController( "s" + str( i ) )
321 print( "Response is " + str( response ) )
322 if re.search( "tcp:" + main.ONOSip[ 0 ], response ):
323 assignResult = assignResult and main.TRUE
324 else:
325 assignResult = main.FALSE
326 stepResult = assignResult
327 utilities.assert_equals( expect=main.TRUE,
328 actual=stepResult,
329 onpass="Successfully assigned switches" +
330 "to controller",
331 onfail="Failed to assign switches to " +
332 "controller" )
333
sathishmad953462015-12-03 17:42:07 +0530334 def CASE13( self, main ):
335 """
336 Discover all hosts and store its data to a dictionary
337 """
338 main.case( "Discover all hosts" )
339
sathishmad953462015-12-03 17:42:07 +0530340 main.step( "Discover all hosts using pingall " )
341 stepResult = main.intentFunction.getHostsData( main )
342 utilities.assert_equals( expect=main.TRUE,
343 actual=stepResult,
344 onpass="Successfully discovered hosts",
345 onfail="Failed to discover hosts" )
346
sathishmc4362252016-04-20 18:29:48 +0530347 def CASE16( self, main ):
348 """
349 Balance Masters
350 """
351 main.case( "Balance mastership of switches" )
352 main.step( "Balancing mastership of switches" )
353
354 balanceResult = main.FALSE
355 balanceResult = utilities.retry( f=main.CLIs[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
356
357 utilities.assert_equals( expect=main.TRUE,
358 actual=balanceResult,
359 onpass="Successfully balanced mastership of switches",
360 onfail="Failed to balance mastership of switches" )
361
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800362 def CASE14( self, main ):
363 """
364 Stop mininet
365 """
366 main.log.report( "Stop Mininet topology" )
367 main.case( "Stop Mininet topology" )
368 main.caseExplanation = "Stopping the current mininet topology " +\
369 "to start up fresh"
370
371 main.step( "Stopping Mininet Topology" )
372 topoResult = main.Mininet1.stopNet( )
373 stepResult = topoResult
374 utilities.assert_equals( expect=main.TRUE,
375 actual=stepResult,
376 onpass="Successfully stop mininet",
377 onfail="Failed to stop mininet" )
378 # Exit if topology did not load properly
379 if not topoResult:
380 main.cleanup()
381 main.exit()
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530382
sathishmc4362252016-04-20 18:29:48 +0530383 def CASE1000( self, main ):
384 """
385 Add host intents between 2 host:
386 - Discover hosts
387 - Add host intents
388 - Check intents
389 - Verify flows
390 - Ping hosts
391 - Reroute
392 - Link down
393 - Verify flows
394 - Check topology
395 - Ping hosts
396 - Link up
397 - Verify flows
398 - Check topology
399 - Ping hosts
400 - Remove intents
401 """
402 import time
403 import json
404 import re
405
406 # Assert variables - These variable's name|format must be followed
407 # if you want to use the wrapper function
408 assert main, "There is no main"
409 assert main.CLIs, "There is no main.CLIs"
410 assert main.Mininet1, "Mininet handle should be named Mininet1"
411 assert main.numSwitch, "Placed the total number of switch topology in \
412 main.numSwitch"
413
414 intentLeadersOld = main.CLIs[ 0 ].leaderCandidates()
415
416 main.testName = "Host Intents"
417 main.case( main.testName + " Test - " + str( main.numCtrls ) +
418 " NODE(S) - OF " + main.OFProtocol )
419 main.caseExplanation = "This test case tests Host intents using " +\
420 str( main.numCtrls ) + " node(s) cluster;\n" +\
421 "Different type of hosts will be tested in " +\
422 "each step such as IPV6, Dual stack, VLAN " +\
423 "etc;\nThe test will use OF " + main.OFProtocol\
424 + " OVS running in Mininet"
425
426 main.step( "IPV6: Add host intents between h1 and h9" )
427 stepResult = main.TRUE
428 stepResult = main.intentFunction.hostIntent( main,
429 name='IPV6',
430 host1='h1',
431 host2='h9',
432 host1Id='00:00:00:00:00:01/-1',
433 host2Id='00:00:00:00:00:09/-1',
434 sw1='s5',
435 sw2='s2',
436 expectedLink=18 )
437
438 utilities.assert_equals( expect=main.TRUE,
439 actual=stepResult,
440 onpass="IPV6: Host intent test successful " +
441 "between two IPV6 hosts",
442 onfail="IPV6: Host intent test failed " +
443 "between two IPV6 hosts")
444
445 main.step( "DUALSTACK1: Add host intents between h3 and h11" )
446 stepResult = main.TRUE
447 stepResult = main.intentFunction.hostIntent( main,
448 name='DUALSTACK',
449 host1='h3',
450 host2='h11',
451 host1Id='00:00:00:00:00:03/-1',
452 host2Id='00:00:00:00:00:0B/-1',
453 sw1='s5',
454 sw2='s2',
455 expectedLink=18 )
456
457 utilities.assert_equals( expect=main.TRUE,
458 actual=stepResult,
459 onpass="DUALSTACK: Host intent test " +
460 "successful between two " +
461 "dual stack host using IPV6",
462 onfail="DUALSTACK: Host intent test " +
463 "failed between two" +
464 "dual stack host using IPV6" )
465
466 main.step( "1HOP: Add host intents between h1 and h3" )
467 stepResult = main.TRUE
468 stepResult = main.intentFunction.hostIntent( main,
469 name='1HOP',
470 host1='h1',
471 host2='h9',
472 host1Id='00:00:00:00:00:01/-1',
473 host2Id='00:00:00:00:00:09/-1')
474
475 utilities.assert_equals( expect=main.TRUE,
476 actual=stepResult,
477 onpass="1HOP: Host intent test " +
478 "successful between two " +
479 "host using IPV6 in the same switch",
480 onfail="1HOP: Host intent test " +
481 "failed between two" +
482 "host using IPV6 in the same switch" )
483
484 main.step( "VLAN: Add vlan host intents between h5 and h24" )
485 stepResult = main.TRUE
486 stepResult = main.intentFunction.hostIntent( main,
487 name='VLAN1',
488 host1='h5',
489 host2='h24',
490 host1Id='00:00:00:00:00:05/100',
491 host2Id='00:00:00:00:00:18/100',
492 sw1='s5',
493 sw2='s2',
494 expectedLink=18 )
495
496 utilities.assert_equals( expect=main.TRUE,
497 actual=stepResult,
498 onpass="VLAN: Host intent test " +
499 "successful between two " +
500 "host using IPV6 in the same VLAN",
501 onfail="VLAN1: Host intent test " +
502 "failed between two" +
503 "host using IPV6 in the same VLAN" )
504
505 main.intentFunction.report( main )
506
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530507 def CASE2000( self, main ):
508 """
509 add point intents between 2 hosts:
510 - Get device ids | ports
511 - Add point intents
512 - Check intents
513 - Verify flows
514 - Ping hosts
515 - Reroute
516 - Link down
517 - Verify flows
518 - Check topology
519 - Ping hosts
520 - Link up
521 - Verify flows
522 - Check topology
523 - Ping hosts
524 - Remove intents
525 """
526 import time
527 import json
528 import re
529
530 # Assert variables - These variable's name|format must be followed
531 # if you want to use the wrapper function
532 assert main, "There is no main"
533 assert main.CLIs, "There is no main.CLIs"
534 assert main.Mininet1, "Mininet handle should be named Mininet1"
535 assert main.numSwitch, "Placed the total number of switch topology in \
536 main.numSwitch"
537
538 main.testName = "Point Intents"
539 main.case( main.testName + " Test - " + str( main.numCtrls ) +
540 " NODE(S) - OF " + main.OFProtocol )
541 main.caseExplanation = "This test case will test point to point" +\
542 " intents using " + str( main.numCtrls ) +\
543 " node(s) cluster;\n" +\
544 "Different type of hosts will be tested in " +\
Jon Hall439c8912016-04-15 02:22:03 -0700545 "each step such as IPV6, Dual stack, VLAN etc" +\
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530546 ";\nThe test will use OF " + main.OFProtocol +\
547 " OVS running in Mininet"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530548 # No option point intents
549 main.step( "NOOPTION: Add point intents between h1 and h9, ipv6 hosts" )
550 main.assertReturnString = "Assertion Result for NOOPTION point intent\n"
551 stepResult = main.TRUE
552 stepResult = main.intentFunction.pointIntent(
553 main,
554 name="NOOPTION",
555 host1="h1",
556 host2="h9",
557 deviceId1="of:0000000000000005/1",
558 deviceId2="of:0000000000000006/1")
559
560 utilities.assert_equals( expect=main.TRUE,
561 actual=stepResult,
562 onpass=main.assertReturnString,
563 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530564 stepResult = main.TRUE
565 main.step( "IPV6: Add point intents between h1 and h9" )
566 main.assertReturnString = "Assertion Result for IPV6 point intent\n"
567 stepResult = main.intentFunction.pointIntent(
568 main,
569 name="IPV6",
570 host1="h1",
571 host2="h9",
572 deviceId1="of:0000000000000005/1",
573 deviceId2="of:0000000000000006/1",
574 port1="",
575 port2="",
576 ethType="IPV6",
577 mac1="00:00:00:00:00:01",
578 mac2="00:00:00:00:00:09",
579 bandwidth="",
580 lambdaAlloc=False,
581 ipProto="",
582 ip1="",
583 ip2="",
584 tcp1="",
585 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700586 sw1="s5",
587 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530588 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530589 utilities.assert_equals( expect=main.TRUE,
590 actual=stepResult,
591 onpass=main.assertReturnString,
592 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530593 main.step( "IPV6_2: Add point intents between h1 and h9" )
594 main.assertReturnString = "Assertion Result for IPV6 no mac address point intents\n"
595 stepResult = main.intentFunction.pointIntent(
596 main,
597 name="IPV6_2",
598 host1="h1",
599 host2="h9",
600 deviceId1="of:0000000000000005/1",
601 deviceId2="of:0000000000000006/1",
602 ipProto="",
603 ip1="",
604 ip2="",
605 tcp1="",
606 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700607 expectedLink="")
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530608 utilities.assert_equals( expect=main.TRUE,
609 actual=stepResult,
610 onpass=main.assertReturnString,
611 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530612 main.step( "SDNIP-ICMP: Add point intents between h1 and h9" )
sathishmad953462015-12-03 17:42:07 +0530613 main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV6 using ICMP point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530614 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
615 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
sathishmad953462015-12-03 17:42:07 +0530616 main.log.debug(mac2)
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530617 ipProto = main.params[ 'SDNIP' ][ 'icmpProto' ]
sathishmad953462015-12-03 17:42:07 +0530618 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
619 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530620 stepResult = main.intentFunction.pointIntent(
621 main,
622 name="SDNIP-ICMP",
623 host1="h1",
624 host2="h9",
625 deviceId1="of:0000000000000005/1",
626 deviceId2="of:0000000000000006/1",
627 mac1=mac1,
628 mac2=mac2,
629 ethType="IPV6",
630 ipProto=ipProto,
631 ip1=ip1,
632 ip2=ip2 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530633 utilities.assert_equals( expect=main.TRUE,
634 actual=stepResult,
635 onpass=main.assertReturnString,
636 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530637 main.step( "SDNIP-TCP: Add point intents between h1 and h9" )
sathishmad953462015-12-03 17:42:07 +0530638 main.assertReturnString = "Assertion Result for SDNIP-TCP IPV6 using TCP point intents\n"
Jon Hall439c8912016-04-15 02:22:03 -0700639 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
640 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
641 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
642 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530643 ipProto = main.params[ 'SDNIP' ][ 'tcpProto' ]
644 tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
645 tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530646 stepResult = main.intentFunction.pointIntentTcp(
647 main,
648 name="SDNIP-TCP",
Jon Hall439c8912016-04-15 02:22:03 -0700649 host1="h1",
650 host2="h9",
651 deviceId1="of:0000000000000005/1",
652 deviceId2="of:0000000000000006/1",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530653 mac1=mac1,
654 mac2=mac2,
Jon Hall439c8912016-04-15 02:22:03 -0700655 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530656 ipProto=ipProto,
657 ip1=ip1,
658 ip2=ip2,
659 tcp1=tcp1,
Jon Hall439c8912016-04-15 02:22:03 -0700660 tcp2=tcp2,
661 sw1="",
662 sw2="",
663 expectedLink="" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530664 utilities.assert_equals( expect=main.TRUE,
sathishmad953462015-12-03 17:42:07 +0530665 actual=stepResult,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530666 onpass=main.assertReturnString,
667 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530668 main.step( "DUALSTACK1: Add point intents between h3 and h11" )
sathishmad953462015-12-03 17:42:07 +0530669 main.assertReturnString = "Assertion Result for Dualstack1 IPV6 with mac address point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530670 stepResult = main.intentFunction.pointIntent(
671 main,
672 name="DUALSTACK1",
673 host1="h3",
674 host2="h11",
sathishmad953462015-12-03 17:42:07 +0530675 deviceId1="of:0000000000000005/3",
676 deviceId2="of:0000000000000006/3",
677 port1="",
678 port2="",
679 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530680 mac1="00:00:00:00:00:03",
681 mac2="00:00:00:00:00:0B",
682 bandwidth="",
683 lambdaAlloc=False,
684 ipProto="",
685 ip1="",
686 ip2="",
687 tcp1="",
688 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700689 sw1="s5",
690 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530691 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530692 utilities.assert_equals( expect=main.TRUE,
693 actual=stepResult,
694 onpass=main.assertReturnString,
695 onfail=main.assertReturnString )
sathishmad953462015-12-03 17:42:07 +0530696 main.step( "VLAN: Add point intents between h5 and h24" )
697 main.assertReturnString = "Assertion Result for VLAN IPV6 with mac address point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530698 stepResult = main.intentFunction.pointIntent(
699 main,
700 name="VLAN",
701 host1="h5",
sathishmad953462015-12-03 17:42:07 +0530702 host2="h24",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530703 deviceId1="of:0000000000000005/5",
sathishmad953462015-12-03 17:42:07 +0530704 deviceId2="of:0000000000000007/8",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530705 port1="",
706 port2="",
sathishmad953462015-12-03 17:42:07 +0530707 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530708 mac1="00:00:00:00:00:05",
sathishmad953462015-12-03 17:42:07 +0530709 mac2="00:00:00:00:00:18",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530710 bandwidth="",
711 lambdaAlloc=False,
712 ipProto="",
713 ip1="",
714 ip2="",
715 tcp1="",
716 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700717 sw1="s5",
718 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530719 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530720 utilities.assert_equals( expect=main.TRUE,
721 actual=stepResult,
722 onpass=main.assertReturnString,
723 onfail=main.assertReturnString )
sathishmad953462015-12-03 17:42:07 +0530724 main.step( "1HOP: Add point intents between h1 and h9" )
725 main.assertReturnString = "Assertion Result for 1HOP IPV6 with no mac address point intents\n"
sathishmc4362252016-04-20 18:29:48 +0530726 stepResult = main.intentFunction.pointIntent( main,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530727 name='1HOP',
sathishmc4362252016-04-20 18:29:48 +0530728 host1="h1",
729 host2="h9",
730 deviceId1="of:0000000000000005/1",
731 deviceId2="of:0000000000000006/1")
Jon Hall439c8912016-04-15 02:22:03 -0700732 utilities.assert_equals( expect=main.TRUE,
733 actual=stepResult,
734 onpass=main.assertReturnString,
735 onfail=main.assertReturnString )
736 main.intentFunction.report( main )
737
738 def CASE3000( self, main ):
739 """
740 Add single point to multi point intents
741 - Get device ids
742 - Add single point to multi point intents
743 - Check intents
744 - Verify flows
745 - Ping hosts
746 - Reroute
747 - Link down
748 - Verify flows
749 - Check topology
750 - Ping hosts
751 - Link up
752 - Verify flows
753 - Check topology
754 - Ping hosts
755 - Remove intents
756 """
757 import time
758 import json
759 import re
760 assert main, "There is no main"
761 assert main.CLIs, "There is no main.CLIs"
762 assert main.Mininet1, "Mininet handle should be named Mininet1"
763 assert main.numSwitch, "Placed the total number of switch topology in \
764 main.numSwitch"
765 main.testName = "Single to Multi Point Intents"
766 main.case( main.testName + " Test - " + str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
767 main.caseExplanation = "This test case will test single point to" +\
768 " multi point intents using " +\
769 str( main.numCtrls ) + " node(s) cluster;\n" +\
770 "Different type of hosts will be tested in " +\
771 "each step such as IPV6, Dual stack, VLAN etc" +\
772 ";\nThe test will use OF " + main.OFProtocol +\
773 " OVS running in Mininet "
774 main.step( "NOOPTION: Add single point to multi point intents" )
775 hostNames = [ 'h1', 'h9', 'h17' ]
776 devices = [ 'of:0000000000000005/1','of:0000000000000006/1', 'of:0000000000000007/1' ]
777 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with no options set\n"
778 stepResult = main.TRUE
779 stepResult = main.intentFunction.singleToMultiIntent(
780 main,
781 name="NOOPTION",
782 hostNames=hostNames,
783 devices=devices,
784 sw1="s5",
785 sw2="s2",
786 expectedLink=18)
787 utilities.assert_equals( expect=main.TRUE,
788 actual=stepResult,
789 onpass=main.assertReturnString,
790 onfail=main.assertReturnString )
791 main.step( "IPV6: Add single point to multi point intents" )
792 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses\n"
793 hostNames = [ 'h1', 'h9', 'h17' ]
794 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
795 macs = [ '00:00:00:00:00:01','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]
796 stepResult = main.TRUE
797 stepResult = main.intentFunction.singleToMultiIntent(
798 main,
799 name="IPV6",
800 hostNames=hostNames,
801 devices=devices,
802 macs=macs,
803 ethType="IPV6",
804 sw1="",
805 sw2="")
806 utilities.assert_equals( expect=main.TRUE,
807 actual=stepResult,
808 onpass=main.assertReturnString,
809 onfail=main.assertReturnString )
810 main.step( "IPV6_2: Add single point to multi point intents" )
811 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and no MAC addresses\n"
812 hostNames = [ 'h1', 'h9', 'h17' ]
813 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
814 stepResult = main.TRUE
815 stepResult = main.intentFunction.singleToMultiIntent(
816 main,
817 name="IPV6_2",
818 hostNames=hostNames,
819 devices=devices,
820 ethType="IPV6",
821 sw1="",
822 sw2="")
823 utilities.assert_equals( expect=main.TRUE,
824 actual=stepResult,
825 onpass=main.assertReturnString,
826 onfail=main.assertReturnString )
827 main.step( "VLAN: Add single point to multi point intents" )
828 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses in the same VLAN\n"
829 hostNames = [ 'h5', 'h24' ]
830 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
831 macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
832 stepResult = main.TRUE
833 stepResult = main.intentFunction.singleToMultiIntent(
834 main,
835 name="IPV6",
836 hostNames=hostNames,
837 devices=devices,
838 macs=macs,
839 ethType="IPV6",
840 sw1="",
841 sw2="")
842 utilities.assert_equals( expect=main.TRUE,
843 actual=stepResult,
844 onpass=main.assertReturnString,
845 onfail=main.assertReturnString )
846 main.intentFunction.report( main )
847
848 def CASE4000( self, main ):
849 """
850 Add multi point to single point intents
851 - Get device ids
852 - Add multi point to single point intents
853 - Check intents
854 - Verify flows
855 - Ping hosts
856 - Reroute
857 - Link down
858 - Verify flows
859 - Check topology
860 - Ping hosts
861 - Link up
862 - Verify flows
863 - Check topology
864 - Ping hosts
865 - Remove intents
866 """
867 assert main, "There is no main"
868 assert main.CLIs, "There is no main.CLIs"
869 assert main.Mininet1, "Mininet handle should be named Mininet1"
870 assert main.numSwitch, "Placed the total number of switch topology in \
871 main.numSwitch"
872
873 main.testName = "Multi To Single Point Intents"
874 main.case( main.testName + " Test - " + str( main.numCtrls ) +
875 " NODE(S) - OF " + main.OFProtocol )
876 main.caseExplanation = "This test case will test single point to" +\
877 " multi point intents using " +\
878 str( main.numCtrls ) + " node(s) cluster;\n" +\
879 "Different type of hosts will be tested in " +\
880 "each step such as IPV6, Dual stack, VLAN etc" +\
881 ";\nThe test will use OF " + main.OFProtocol +\
882 " OVS running in Mininet"
883
884 main.step( "NOOPTION: Add multi point to single point intents" )
885 main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
886 stepResult = main.TRUE
887 hostNames = [ 'h17', 'h9' ]
888 devices = ['of:0000000000000007/1', 'of:0000000000000006/1' ]
889 stepResult = main.intentFunction.multiToSingleIntent(
890 main,
891 name="NOOPTION",
892 hostNames=hostNames,
893 devices=devices,
894 sw1="s6",
895 sw2="s2",
896 expectedLink=18 )
897 utilities.assert_equals( expect=main.TRUE,
898 actual=stepResult,
899 onpass=main.assertReturnString,
900 onfail=main.assertReturnString )
901 main.step( "IPV6: Add multi point to single point intents" )
902 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and MAC addresses\n"
903 hostNames = [ 'h1', 'h9', 'h17' ]
904 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
905 macs = [ '00:00:00:00:00:01','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]
906 stepResult = main.TRUE
907 installResult = main.intentFunction.multiToSingleIntent(
908 main,
909 name="IPV6",
910 hostNames=hostNames,
911 devices=devices,
912 macs=macs,
913 ethType="IPV6",
914 sw1="",
915 sw2="",
916 expectedLink="" )
917 utilities.assert_equals( expect=main.TRUE,
918 actual=stepResult,
919 onpass=main.assertReturnString,
920 onfail=main.assertReturnString )
921 main.step( "IPV6_2: Add multi point to single point intents" )
922 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses\n"
923 hostNames = [ 'h1', 'h9' ]
924 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1' ]
925 stepResult = main.TRUE
926 stepResult = main.intentFunction.multiToSingleIntent(
927 main,
928 name="IPV6_2",
929 hostNames=hostNames,
930 devices=devices,
931 ethType="IPV6",
932 sw1="",
933 sw2="",
934 expectedLink="")
935 utilities.assert_equals( expect=main.TRUE,
936 actual=stepResult,
937 onpass=main.assertReturnString,
938 onfail=main.assertReturnString )
939
940 main.step( "VLAN: Add multi point to single point intents" )
941 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses in the same VLAN\n"
942 hostNames = [ 'h5', 'h24' ]
943 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
944 macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
945 stepResult = main.TRUE
946 stepResult = main.intentFunction.multiToSingleIntent(
947 main,
948 name="VLAN",
949 hostNames=hostNames,
950 devices=devices,
951 macs=macs,
952 ethType="IPV6",
953 sw1="",
954 sw2="",
955 expectedLink="")
956 utilities.assert_equals( expect=main.TRUE,
957 actual=stepResult,
958 onpass=main.assertReturnString,
959 onfail=main.assertReturnString )
960 main.intentFunction.report( main )
961
962 def CASE5000( self, main ):
963 """
964 Tests Host Mobility
965 Modifies the topology location of h1
966 """
967 assert main, "There is no main"
968 assert main.CLIs, "There is no main.CLIs"
969 assert main.Mininet1, "Mininet handle should be named Mininet1"
970 assert main.numSwitch, "Placed the total number of switch topology in \
971 main.numSwitch"
972 main.case( "Test host mobility with host intents " )
973 main.step( "Testing host mobility by moving h1 from s5 to s6" )
974 h1PreMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
975
976 main.log.info( "Moving h1 from s5 to s6")
977 main.Mininet1.moveHostv6( "h1","s5","s6" )
978 main.intentFunction.getHostsData( main )
979 h1PostMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
980
981 utilities.assert_equals( expect="of:0000000000000006",
982 actual=h1PostMove,
983 onpass="Mobility: Successfully moved h1 to s6",
984 onfail="Mobility: Failed to move h1 to s6" +
985 " to single point intents" +
986 " with IPV6 type and MAC addresses" +
987 " in the same VLAN" )
988 main.step( "IPV6: Add host intents between h1 and h9" )
989 main.assertReturnString = "Assert result for IPV6 host intent between h1, moved, and h9\n"
990 stepResult = main.TRUE
991 stepResult = main.intentFunction.hostIntent( main,
992 name='IPV6 Mobility IPV6',
993 host1='h1',
994 host2='h9',
995 host1Id='00:00:00:00:00:01/-1',
996 host2Id='00:00:00:00:00:09/-1')
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530997
998 utilities.assert_equals( expect=main.TRUE,
999 actual=stepResult,
1000 onpass=main.assertReturnString,
1001 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +05301002 main.intentFunction.report( main )
sathishmc4362252016-04-20 18:29:48 +05301003
1004 def CASE6000( self, main ):
1005 """
1006 Tests Multi to Single Point Intent and Single to Multi Point Intent End Point Failure
1007 """
1008 assert main, "There is no main"
1009 assert main.CLIs, "There is no main.CLIs"
1010 assert main.Mininet1, "Mininet handle should be named Mininet1"
1011 assert main.numSwitch, "Placed the total number of switch topology in \
1012 main.numSwitch"
1013 main.case( "Test Multi to Single End Point Failure" )
1014 main.step( "NOOPTION: test end point failure for multi point to single point intents" )
1015 main.assertReturnString = "Assertion results for IPV6 multi to single \
1016 point intent end point failure with no options set\n"
1017 hostNames = [ 'h8', 'h17' ]
1018 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
1019 testResult = main.TRUE
1020 testResult = main.intentFunction.testEndPointFail(
1021 main,
1022 name="NOOPTION",
1023 test="MultipletoSingle",
1024 hostNames=hostNames,
1025 devices=devices,
1026 sw1="s6",
1027 sw2="s2",
1028 sw3="s4",
1029 sw4="s1",
1030 sw5="s3",
1031 expectedLink1=16,
1032 expectedLink2=14 )
1033 utilities.assert_equals( expect=main.TRUE,
1034 actual=testResult,
1035 onpass=main.assertReturnString,
1036 onfail=main.assertReturnString )
1037
1038 main.step( "IPV6: test end point failure for multi point to single point intents" )
1039 main.assertReturnString = "Assertion results for IPV6 multi to single \
1040 point intent end point failure with IPV6 type and MAC addresses\n"
1041 hostNames = [ 'h8', 'h9', 'h17' ]
1042 devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
1043 macs = [ '00:00:00:00:00:08','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]
1044 testResult = main.TRUE
1045 testResult = main.intentFunction.testEndPointFail(
1046 main,
1047 test="MultipletoSingle",
1048 name="IPV6",
1049 hostNames=hostNames,
1050 devices=devices,
1051 macs=macs,
1052 ethType="IPV6",
1053 sw1="s6",
1054 sw2="s2",
1055 sw3="s4",
1056 sw4="s1",
1057 sw5="s3",
1058 expectedLink1=16,
1059 expectedLink2=14 )
1060 utilities.assert_equals( expect=main.TRUE,
1061 actual=testResult,
1062 onpass=main.assertReturnString,
1063 onfail=main.assertReturnString )
1064
1065 main.step( "IPV6_2: test end point faliure for multi point to single point intents" )
1066 main.assertReturnString = "Assertion results for IPV6 multi to single \
1067 point intent end point failure with IPV6 type and no MAC addresses\n"
1068 hostNames = [ 'h8', 'h17' ]
1069 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
1070 testResult = main.TRUE
1071 testResult = main.intentFunction.testEndPointFail(
1072 main,
1073 test="MultipletoSingle",
1074 name="IPV6_2",
1075 hostNames=hostNames,
1076 devices=devices,
1077 ethType="IPV6",
1078 sw1="s6",
1079 sw2="s2",
1080 sw3="s4",
1081 sw4="s1",
1082 sw5="s3",
1083 expectedLink1=16,
1084 expectedLink2=14 )
1085
1086 utilities.assert_equals( expect=main.TRUE,
1087 actual=testResult,
1088 onpass=main.assertReturnString,
1089 onfail=main.assertReturnString )
1090
1091 main.step( "VLAN: test end point failure for multi point to single point intents" )
1092 main.assertReturnString = "Assertion results for IPV6 multi to single \
1093 point intent end point failure with IPV6 type and no MAC addresses in the same VLAN\n"
1094 hostNames = [ 'h5', 'h24' ]
1095 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
1096 macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
1097 testResult = main.TRUE
1098 testResult = main.intentFunction.testEndPointFail(
1099 main,
1100 test="MultipletoSingle",
1101 name="VLAN",
1102 hostNames=hostNames,
1103 devices=devices,
1104 ethType="IPV6",
1105 sw1="s6",
1106 sw2="s2",
1107 sw3="s4",
1108 sw4="s1",
1109 sw5="s3",
1110 expectedLink1=16,
1111 expectedLink2=14 )
1112 utilities.assert_equals( expect=main.TRUE,
1113 actual=testResult,
1114 onpass=main.assertReturnString,
1115 onfail=main.assertReturnString )
1116
1117 main.case( "Test Single to Multiple End Point Failure" )
1118 main.step( "NOOPTION: test end point failure for single point to multi point intents" )
1119 main.assertReturnString = "Assertion results for IPV6 single to multi \
1120 point intent end point failure with no options set\n"
1121 hostNames = [ 'h8', 'h17' ]
1122 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
1123 testResult = main.TRUE
1124 testResult = main.intentFunction.testEndPointFail(
1125 main,
1126 test="SingletoMultiple",
1127 name="NOOPTION",
1128 hostNames=hostNames,
1129 devices=devices,
1130 sw1="s6",
1131 sw2="s2",
1132 sw3="s4",
1133 sw4="s1",
1134 sw5="s3",
1135 expectedLink1=16,
1136 expectedLink2=14 )
1137 utilities.assert_equals( expect=main.TRUE,
1138 actual=testResult,
1139 onpass=main.assertReturnString,
1140 onfail=main.assertReturnString )
1141 main.step( "IPV6: test end point failure for single point to multi point intents" )
1142 main.assertReturnString = "Assertion results for IPV6 single to multi \
1143 point intent end point failure with IPV6 type and MAC addresses\n"
1144 hostNames = [ 'h8', 'h9', 'h17' ]
1145 devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
1146 macs = [ '00:00:00:00:00:08','00:00:00:00:00:09' ,'00:00:00:00:00:11' ]
1147 testResult = main.TRUE
1148 testResult = main.intentFunction.testEndPointFail(
1149 main,
1150 test="SingletoMultiple",
1151 name="IPV6",
1152 hostNames=hostNames,
1153 devices=devices,
1154 ethType="IPV6",
1155 macs=macs,
1156 sw1="s6",
1157 sw2="s2",
1158 sw3="s4",
1159 sw4="s1",
1160 sw5="s3",
1161 expectedLink1=16,
1162 expectedLink2=14 )
1163 utilities.assert_equals( expect=main.TRUE,
1164 actual=testResult,
1165 onpass=main.assertReturnString,
1166 onfail=main.assertReturnString )
1167
1168 main.step( "IPV6_2: test end point failure for single point to multi point intents" )
1169 main.assertReturnString = "Assertion results for IPV6 single to multi\
1170 point intent endpoint failure with IPV6 type and no MAC addresses\n"
1171 hostNames = [ 'h8', 'h17' ]
1172 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
1173 testResult = main.TRUE
1174 testResult = main.intentFunction.testEndPointFail(
1175 main,
1176 test="SingletoMultiple",
1177 name="IPV6_2",
1178 hostNames=hostNames,
1179 devices=devices,
1180 ethType="IPV6",
1181 sw1="s6",
1182 sw2="s2",
1183 sw3="s4",
1184 sw4="s1",
1185 sw5="s3",
1186 expectedLink1=16,
1187 expectedLink2=14 )
1188 utilities.assert_equals( expect=main.TRUE,
1189 actual=testResult,
1190 onpass=main.assertReturnString,
1191 onfail=main.assertReturnString )
1192
1193 main.step( "VLAN: test end point failure for single point to multi point intents" )
1194 main.assertReturnString = "Assertion results for IPV6 single to multi point\
1195 intent endpoint failure with IPV6 type and MAC addresses in the same VLAN\n"
1196 hostNames = [ 'h5', 'h24' ]
1197 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
1198 macs = [ '00:00:00:00:00:05','00:00:00:00:00:18' ]
1199 testResult = main.TRUE
1200 testResult = main.intentFunction.testEndPointFail(
1201 main,
1202 test="SingletoMultiple",
1203 name="IPV6",
1204 hostNames=hostNames,
1205 devices=devices,
1206 macs=macs,
1207 ethType="IPV6",
1208 sw1="s6",
1209 sw2="s2",
1210 sw3="s4",
1211 sw4="s1",
1212 sw5="s3",
1213 expectedLink1=16,
1214 expectedLink2=14 )
1215 utilities.assert_equals( expect=main.TRUE,
1216 actual=testResult,
1217 onpass=main.assertReturnString,
1218 onfail=main.assertReturnString )
1219
1220 main.intentFunction.report( main )