blob: 95d21c07a4be3ecd483cc86ae9a2c5deddbe4d66 [file] [log] [blame]
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07001"""
2Copyright 2015 Open Networking Foundation (ONF)
3
4Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
5the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
6or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
7
8 TestON is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 2 of the License, or
11 (at your option) any later version.
12
13 TestON is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with TestON. If not, see <http://www.gnu.org/licenses/>.
20"""
21
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080022# Testing the basic intent for ipv6 functionality of ONOS
23
Jon Hall314b74a2017-05-24 16:25:52 -070024
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080025class FUNCipv6Intent:
26
27 def __init__( self ):
28 self.default = ''
29
30 def CASE1( self, main ):
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080031 import imp
32 import re
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080033 """
34 - Construct tests variables
35 - GIT ( optional )
36 - Checkout ONOS master branch
37 - Pull latest ONOS code
38 - Building ONOS ( optional )
39 - Install ONOS package
40 - Build ONOS package
41 """
Devin Lim58046fa2017-07-05 16:55:00 -070042 try:
43 from tests.dependencies.ONOSSetup import ONOSSetup
44 main.testSetUp = ONOSSetup()
45 except ImportError:
46 main.log.error( "ONOSSetup not found. exiting the test" )
47 main.exit()
48 main.testSetUp.envSetupDescription()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080049 stepResult = main.FALSE
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080050 # Test variables
51 try:
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080052 main.apps = main.params[ 'ENV' ][ 'cellApps' ]
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080053 main.dependencyPath = main.testOnDirectory + \
54 main.params[ 'DEPENDENCY' ][ 'path' ]
55 main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
56 main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080057 wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
58 wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
59 wrapperFile3 = main.params[ 'DEPENDENCY' ][ 'wrapper3' ]
60 main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
61 main.checkIntentSleep = int( main.params[ 'SLEEP' ][ 'checkintent' ] )
62 main.removeIntentSleep = int( main.params[ 'SLEEP' ][ 'removeintent' ] )
63 main.rerouteSleep = int( main.params[ 'SLEEP' ][ 'reroute' ] )
64 main.fwdSleep = int( main.params[ 'SLEEP' ][ 'fwd' ] )
65 main.checkTopoAttempts = int( main.params[ 'SLEEP' ][ 'topoAttempts' ] )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080066 main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
67 main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080068 main.hostsData = {}
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080069 main.assertReturnString = '' # Assembled assert return string
70
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080071 # -- INIT SECTION, ONLY RUNS ONCE -- #
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080072
73 main.intentFunction = imp.load_source( wrapperFile2,
Jon Hall314b74a2017-05-24 16:25:52 -070074 main.dependencyPath +
75 wrapperFile2 +
76 ".py" )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080077
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080078 copyResult1 = main.ONOSbench.scp( main.Mininet1,
79 main.dependencyPath +
80 main.topology,
81 main.Mininet1.home,
82 direction="to" )
Devin Lim58046fa2017-07-05 16:55:00 -070083 stepResult = main.testSetUp.envSetup( True )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080084 except Exception as e:
Devin Lim58046fa2017-07-05 16:55:00 -070085 main.testSetUp.envSetupException( e )
86 main.testSetUp.evnSetupConclusion( stepResult )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080087
88 def CASE2( self, main ):
89 """
90 - Set up cell
91 - Create cell file
92 - Set cell file
93 - Verify cell file
94 - Kill ONOS process
95 - Uninstall ONOS cluster
96 - Verify ONOS start up
97 - Install ONOS cluster
98 - Connect to cli
99 """
alisona2905c12016-09-19 15:18:07 -0700100 import time
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800101
Devin Lim58046fa2017-07-05 16:55:00 -0700102 main.initialized = main.testSetUp.ONOSSetUp( main.Mininet1, True )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800103
Jon Hall11845ed2016-02-11 11:25:31 -0800104 main.step( "Checking that ONOS is ready" )
sathishmad953462015-12-03 17:42:07 +0530105 for i in range( 3 ):
Jon Hall11845ed2016-02-11 11:25:31 -0800106 ready = True
Devin Lim58046fa2017-07-05 16:55:00 -0700107 for i in range ( main.numCtrls ):
Jeremy5f820072016-02-11 13:50:35 -0800108 output = main.CLIs[ i ].summary()
Jon Hall11845ed2016-02-11 11:25:31 -0800109 if not output:
110 ready = False
111 time.sleep( 30 )
112 utilities.assert_equals( expect=True, actual=ready,
113 onpass="ONOS summary command succeded",
114 onfail="ONOS summary command failed" )
115 if not ready:
116 main.cleanup()
117 main.exit()
118
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530119 main.step( "setup the ipv6NeighbourDiscovery" )
Jon Hall314b74a2017-05-24 16:25:52 -0700120 cfgResult1 = main.CLIs[ 0 ].setCfg( "org.onosproject.incubator.net.neighbour.impl.NeighbourResolutionManager", "ndpEnabled", "true" )
121 cfgResult2 = main.CLIs[ 0 ].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "useIpv6ND", "true" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530122 cfgResult = cfgResult1 and cfgResult2
123 utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
Jon Hall314b74a2017-05-24 16:25:52 -0700124 onpass="ipv6NeighborDiscovery cfg is set to true",
125 onfail="Failed to cfg set ipv6NeighborDiscovery" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530126
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800127 main.intentFunction.report( main )
128
129 def CASE11( self, main ):
130 """
131 Start Mininet topology with OF 1.3 switches
132 """
133 main.OFProtocol = "1.3"
134 main.log.report( "Start Mininet topology with OF 1.3 switches" )
135 main.case( "Start Mininet topology with OF 1.3 switches" )
136 main.caseExplanation = "Start mininet topology with OF 1.3 " +\
137 "switches to test intents, exits out if " +\
138 "topology did not start correctly"
139
140 main.step( "Starting Mininet topology with OF 1.3 switches" )
141 args = "--switch ovs,protocols=OpenFlow13"
142 topoResult = main.Mininet1.startNet( topoFile=main.dependencyPath +
143 main.topology,
144 args=args )
145 stepResult = topoResult
146 utilities.assert_equals( expect=main.TRUE,
147 actual=stepResult,
148 onpass="Successfully loaded topology",
149 onfail="Failed to load topology" )
150 # Exit if topology did not load properly
151 if not topoResult:
152 main.cleanup()
153 main.exit()
154
155 def CASE12( self, main ):
156 """
157 Assign mastership to controllers
158 """
159 import re
160
161 main.case( "Assign switches to controllers" )
162 main.step( "Assigning switches to controllers" )
163 main.caseExplanation = "Assign OF " + main.OFProtocol +\
164 " switches to ONOS nodes"
165
166 assignResult = main.TRUE
167 switchList = []
168
169 # Creates a list switch name, use getSwitch() function later...
170 for i in range( 1, ( main.numSwitch + 1 ) ):
171 switchList.append( 's' + str( i ) )
172
173 tempONOSip = []
174 for i in range( main.numCtrls ):
175 tempONOSip.append( main.ONOSip[ i ] )
176
177 assignResult = main.Mininet1.assignSwController( sw=switchList,
178 ip=tempONOSip,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530179 port='6633' )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800180 if not assignResult:
181 main.cleanup()
182 main.exit()
183
184 for i in range( 1, ( main.numSwitch + 1 ) ):
185 response = main.Mininet1.getSwController( "s" + str( i ) )
186 print( "Response is " + str( response ) )
187 if re.search( "tcp:" + main.ONOSip[ 0 ], response ):
188 assignResult = assignResult and main.TRUE
189 else:
190 assignResult = main.FALSE
191 stepResult = assignResult
192 utilities.assert_equals( expect=main.TRUE,
193 actual=stepResult,
194 onpass="Successfully assigned switches" +
195 "to controller",
196 onfail="Failed to assign switches to " +
197 "controller" )
198
sathishmad953462015-12-03 17:42:07 +0530199 def CASE13( self, main ):
200 """
201 Discover all hosts and store its data to a dictionary
202 """
203 main.case( "Discover all hosts" )
204
sathishmad953462015-12-03 17:42:07 +0530205 main.step( "Discover all hosts using pingall " )
206 stepResult = main.intentFunction.getHostsData( main )
207 utilities.assert_equals( expect=main.TRUE,
Jon Hall314b74a2017-05-24 16:25:52 -0700208 actual=stepResult,
209 onpass="Successfully discovered hosts",
210 onfail="Failed to discover hosts" )
sathishmad953462015-12-03 17:42:07 +0530211
sathishmc4362252016-04-20 18:29:48 +0530212 def CASE16( self, main ):
213 """
214 Balance Masters
215 """
216 main.case( "Balance mastership of switches" )
217 main.step( "Balancing mastership of switches" )
218
219 balanceResult = main.FALSE
220 balanceResult = utilities.retry( f=main.CLIs[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
221
222 utilities.assert_equals( expect=main.TRUE,
223 actual=balanceResult,
224 onpass="Successfully balanced mastership of switches",
225 onfail="Failed to balance mastership of switches" )
226
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800227 def CASE14( self, main ):
228 """
229 Stop mininet
230 """
Devin Lim58046fa2017-07-05 16:55:00 -0700231 try:
232 from tests.dependencies.utils import Utils
233 except ImportError:
234 main.log.error( "Utils not found exiting the test" )
235 main.exit()
236 try:
237 main.Utils
238 except ( NameError, AttributeError ):
239 main.Utils = Utils()
240 main.Utils.mininetCleanIntro()
241 topoResult = main.Utils.mininetCleanup( main.Mininet1 )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800242 # Exit if topology did not load properly
243 if not topoResult:
244 main.cleanup()
245 main.exit()
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530246
sathishmc4362252016-04-20 18:29:48 +0530247 def CASE1000( self, main ):
248 """
249 Add host intents between 2 host:
250 - Discover hosts
251 - Add host intents
252 - Check intents
253 - Verify flows
254 - Ping hosts
255 - Reroute
256 - Link down
257 - Verify flows
258 - Check topology
259 - Ping hosts
260 - Link up
261 - Verify flows
262 - Check topology
263 - Ping hosts
264 - Remove intents
265 """
266 import time
267 import json
268 import re
269
270 # Assert variables - These variable's name|format must be followed
271 # if you want to use the wrapper function
272 assert main, "There is no main"
273 assert main.CLIs, "There is no main.CLIs"
274 assert main.Mininet1, "Mininet handle should be named Mininet1"
275 assert main.numSwitch, "Placed the total number of switch topology in \
276 main.numSwitch"
277
278 intentLeadersOld = main.CLIs[ 0 ].leaderCandidates()
279
280 main.testName = "Host Intents"
281 main.case( main.testName + " Test - " + str( main.numCtrls ) +
282 " NODE(S) - OF " + main.OFProtocol )
283 main.caseExplanation = "This test case tests Host intents using " +\
284 str( main.numCtrls ) + " node(s) cluster;\n" +\
285 "Different type of hosts will be tested in " +\
286 "each step such as IPV6, Dual stack, VLAN " +\
287 "etc;\nThe test will use OF " + main.OFProtocol\
288 + " OVS running in Mininet"
289
290 main.step( "IPV6: Add host intents between h1 and h9" )
291 stepResult = main.TRUE
292 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700293 name='IPV6',
294 host1='h1',
295 host2='h9',
296 host1Id='00:00:00:00:00:01/-1',
297 host2Id='00:00:00:00:00:09/-1',
298 sw1='s5',
299 sw2='s2',
300 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530301
302 utilities.assert_equals( expect=main.TRUE,
303 actual=stepResult,
304 onpass="IPV6: Host intent test successful " +
305 "between two IPV6 hosts",
306 onfail="IPV6: Host intent test failed " +
Jon Hall314b74a2017-05-24 16:25:52 -0700307 "between two IPV6 hosts" )
sathishmc4362252016-04-20 18:29:48 +0530308
309 main.step( "DUALSTACK1: Add host intents between h3 and h11" )
310 stepResult = main.TRUE
311 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700312 name='DUALSTACK',
313 host1='h3',
314 host2='h11',
315 host1Id='00:00:00:00:00:03/-1',
316 host2Id='00:00:00:00:00:0B/-1',
317 sw1='s5',
318 sw2='s2',
319 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530320
321 utilities.assert_equals( expect=main.TRUE,
322 actual=stepResult,
323 onpass="DUALSTACK: Host intent test " +
324 "successful between two " +
325 "dual stack host using IPV6",
326 onfail="DUALSTACK: Host intent test " +
327 "failed between two" +
328 "dual stack host using IPV6" )
329
330 main.step( "1HOP: Add host intents between h1 and h3" )
331 stepResult = main.TRUE
332 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700333 name='1HOP',
334 host1='h1',
335 host2='h9',
336 host1Id='00:00:00:00:00:01/-1',
337 host2Id='00:00:00:00:00:09/-1' )
sathishmc4362252016-04-20 18:29:48 +0530338
339 utilities.assert_equals( expect=main.TRUE,
340 actual=stepResult,
341 onpass="1HOP: Host intent test " +
342 "successful between two " +
343 "host using IPV6 in the same switch",
344 onfail="1HOP: Host intent test " +
345 "failed between two" +
346 "host using IPV6 in the same switch" )
347
348 main.step( "VLAN: Add vlan host intents between h5 and h24" )
349 stepResult = main.TRUE
350 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700351 name='VLAN1',
352 host1='h5',
353 host2='h24',
354 host1Id='00:00:00:00:00:05/100',
355 host2Id='00:00:00:00:00:18/100',
356 sw1='s5',
357 sw2='s2',
358 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530359
360 utilities.assert_equals( expect=main.TRUE,
361 actual=stepResult,
362 onpass="VLAN: Host intent test " +
363 "successful between two " +
364 "host using IPV6 in the same VLAN",
365 onfail="VLAN1: Host intent test " +
366 "failed between two" +
367 "host using IPV6 in the same VLAN" )
368
369 main.intentFunction.report( main )
370
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530371 def CASE2000( self, main ):
372 """
373 add point intents between 2 hosts:
374 - Get device ids | ports
375 - Add point intents
376 - Check intents
377 - Verify flows
378 - Ping hosts
379 - Reroute
380 - Link down
381 - Verify flows
382 - Check topology
383 - Ping hosts
384 - Link up
385 - Verify flows
386 - Check topology
387 - Ping hosts
388 - Remove intents
389 """
390 import time
391 import json
392 import re
393
394 # Assert variables - These variable's name|format must be followed
395 # if you want to use the wrapper function
396 assert main, "There is no main"
397 assert main.CLIs, "There is no main.CLIs"
398 assert main.Mininet1, "Mininet handle should be named Mininet1"
399 assert main.numSwitch, "Placed the total number of switch topology in \
400 main.numSwitch"
401
402 main.testName = "Point Intents"
403 main.case( main.testName + " Test - " + str( main.numCtrls ) +
404 " NODE(S) - OF " + main.OFProtocol )
405 main.caseExplanation = "This test case will test point to point" +\
406 " intents using " + str( main.numCtrls ) +\
407 " node(s) cluster;\n" +\
408 "Different type of hosts will be tested in " +\
Jon Hall439c8912016-04-15 02:22:03 -0700409 "each step such as IPV6, Dual stack, VLAN etc" +\
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530410 ";\nThe test will use OF " + main.OFProtocol +\
411 " OVS running in Mininet"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530412 # No option point intents
413 main.step( "NOOPTION: Add point intents between h1 and h9, ipv6 hosts" )
414 main.assertReturnString = "Assertion Result for NOOPTION point intent\n"
415 stepResult = main.TRUE
416 stepResult = main.intentFunction.pointIntent(
417 main,
418 name="NOOPTION",
419 host1="h1",
420 host2="h9",
421 deviceId1="of:0000000000000005/1",
Jon Hall314b74a2017-05-24 16:25:52 -0700422 deviceId2="of:0000000000000006/1" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530423
424 utilities.assert_equals( expect=main.TRUE,
425 actual=stepResult,
426 onpass=main.assertReturnString,
427 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530428 stepResult = main.TRUE
429 main.step( "IPV6: Add point intents between h1 and h9" )
430 main.assertReturnString = "Assertion Result for IPV6 point intent\n"
431 stepResult = main.intentFunction.pointIntent(
432 main,
433 name="IPV6",
434 host1="h1",
435 host2="h9",
436 deviceId1="of:0000000000000005/1",
437 deviceId2="of:0000000000000006/1",
438 port1="",
439 port2="",
440 ethType="IPV6",
441 mac1="00:00:00:00:00:01",
442 mac2="00:00:00:00:00:09",
443 bandwidth="",
444 lambdaAlloc=False,
445 ipProto="",
446 ip1="",
447 ip2="",
448 tcp1="",
449 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700450 sw1="s5",
451 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530452 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530453 utilities.assert_equals( expect=main.TRUE,
454 actual=stepResult,
455 onpass=main.assertReturnString,
456 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530457 main.step( "IPV6_2: Add point intents between h1 and h9" )
458 main.assertReturnString = "Assertion Result for IPV6 no mac address point intents\n"
459 stepResult = main.intentFunction.pointIntent(
460 main,
461 name="IPV6_2",
462 host1="h1",
463 host2="h9",
464 deviceId1="of:0000000000000005/1",
465 deviceId2="of:0000000000000006/1",
466 ipProto="",
467 ip1="",
468 ip2="",
469 tcp1="",
470 tcp2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700471 expectedLink="" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530472 utilities.assert_equals( expect=main.TRUE,
473 actual=stepResult,
474 onpass=main.assertReturnString,
475 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530476 main.step( "SDNIP-ICMP: Add point intents between h1 and h9" )
sathishmad953462015-12-03 17:42:07 +0530477 main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV6 using ICMP point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530478 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
479 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700480 main.log.debug( mac2 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530481 ipProto = main.params[ 'SDNIP' ][ 'icmpProto' ]
sathishmad953462015-12-03 17:42:07 +0530482 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
483 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530484 stepResult = main.intentFunction.pointIntent(
485 main,
486 name="SDNIP-ICMP",
487 host1="h1",
488 host2="h9",
489 deviceId1="of:0000000000000005/1",
490 deviceId2="of:0000000000000006/1",
491 mac1=mac1,
492 mac2=mac2,
493 ethType="IPV6",
494 ipProto=ipProto,
495 ip1=ip1,
496 ip2=ip2 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530497 utilities.assert_equals( expect=main.TRUE,
498 actual=stepResult,
499 onpass=main.assertReturnString,
500 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530501 main.step( "SDNIP-TCP: Add point intents between h1 and h9" )
sathishmad953462015-12-03 17:42:07 +0530502 main.assertReturnString = "Assertion Result for SDNIP-TCP IPV6 using TCP point intents\n"
Jon Hall439c8912016-04-15 02:22:03 -0700503 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
504 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
505 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
506 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530507 ipProto = main.params[ 'SDNIP' ][ 'tcpProto' ]
508 tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
509 tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530510 stepResult = main.intentFunction.pointIntentTcp(
511 main,
512 name="SDNIP-TCP",
Jon Hall439c8912016-04-15 02:22:03 -0700513 host1="h1",
514 host2="h9",
515 deviceId1="of:0000000000000005/1",
516 deviceId2="of:0000000000000006/1",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530517 mac1=mac1,
518 mac2=mac2,
Jon Hall439c8912016-04-15 02:22:03 -0700519 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530520 ipProto=ipProto,
521 ip1=ip1,
522 ip2=ip2,
523 tcp1=tcp1,
Jon Hall439c8912016-04-15 02:22:03 -0700524 tcp2=tcp2,
525 sw1="",
526 sw2="",
527 expectedLink="" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530528 utilities.assert_equals( expect=main.TRUE,
sathishmad953462015-12-03 17:42:07 +0530529 actual=stepResult,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530530 onpass=main.assertReturnString,
531 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530532 main.step( "DUALSTACK1: Add point intents between h3 and h11" )
sathishmad953462015-12-03 17:42:07 +0530533 main.assertReturnString = "Assertion Result for Dualstack1 IPV6 with mac address point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530534 stepResult = main.intentFunction.pointIntent(
535 main,
536 name="DUALSTACK1",
537 host1="h3",
538 host2="h11",
sathishmad953462015-12-03 17:42:07 +0530539 deviceId1="of:0000000000000005/3",
540 deviceId2="of:0000000000000006/3",
541 port1="",
542 port2="",
543 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530544 mac1="00:00:00:00:00:03",
545 mac2="00:00:00:00:00:0B",
546 bandwidth="",
547 lambdaAlloc=False,
548 ipProto="",
549 ip1="",
550 ip2="",
551 tcp1="",
552 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700553 sw1="s5",
554 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530555 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530556 utilities.assert_equals( expect=main.TRUE,
557 actual=stepResult,
558 onpass=main.assertReturnString,
559 onfail=main.assertReturnString )
sathishmad953462015-12-03 17:42:07 +0530560 main.step( "VLAN: Add point intents between h5 and h24" )
561 main.assertReturnString = "Assertion Result for VLAN IPV6 with mac address point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530562 stepResult = main.intentFunction.pointIntent(
563 main,
564 name="VLAN",
565 host1="h5",
sathishmad953462015-12-03 17:42:07 +0530566 host2="h24",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530567 deviceId1="of:0000000000000005/5",
sathishmad953462015-12-03 17:42:07 +0530568 deviceId2="of:0000000000000007/8",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530569 port1="",
570 port2="",
sathishmad953462015-12-03 17:42:07 +0530571 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530572 mac1="00:00:00:00:00:05",
sathishmad953462015-12-03 17:42:07 +0530573 mac2="00:00:00:00:00:18",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530574 bandwidth="",
575 lambdaAlloc=False,
576 ipProto="",
577 ip1="",
578 ip2="",
579 tcp1="",
580 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700581 sw1="s5",
582 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530583 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530584 utilities.assert_equals( expect=main.TRUE,
585 actual=stepResult,
586 onpass=main.assertReturnString,
587 onfail=main.assertReturnString )
sathishmad953462015-12-03 17:42:07 +0530588 main.step( "1HOP: Add point intents between h1 and h9" )
589 main.assertReturnString = "Assertion Result for 1HOP IPV6 with no mac address point intents\n"
sathishmc4362252016-04-20 18:29:48 +0530590 stepResult = main.intentFunction.pointIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700591 name='1HOP',
592 host1="h1",
593 host2="h9",
594 deviceId1="of:0000000000000005/1",
595 deviceId2="of:0000000000000006/1" )
Jon Hall439c8912016-04-15 02:22:03 -0700596 utilities.assert_equals( expect=main.TRUE,
597 actual=stepResult,
598 onpass=main.assertReturnString,
599 onfail=main.assertReturnString )
600 main.intentFunction.report( main )
601
602 def CASE3000( self, main ):
603 """
604 Add single point to multi point intents
605 - Get device ids
606 - Add single point to multi point intents
607 - Check intents
608 - Verify flows
609 - Ping hosts
610 - Reroute
611 - Link down
612 - Verify flows
613 - Check topology
614 - Ping hosts
615 - Link up
616 - Verify flows
617 - Check topology
618 - Ping hosts
619 - Remove intents
620 """
621 import time
622 import json
623 import re
624 assert main, "There is no main"
625 assert main.CLIs, "There is no main.CLIs"
626 assert main.Mininet1, "Mininet handle should be named Mininet1"
627 assert main.numSwitch, "Placed the total number of switch topology in \
628 main.numSwitch"
629 main.testName = "Single to Multi Point Intents"
630 main.case( main.testName + " Test - " + str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
631 main.caseExplanation = "This test case will test single point to" +\
632 " multi point intents using " +\
633 str( main.numCtrls ) + " node(s) cluster;\n" +\
634 "Different type of hosts will be tested in " +\
635 "each step such as IPV6, Dual stack, VLAN etc" +\
636 ";\nThe test will use OF " + main.OFProtocol +\
637 " OVS running in Mininet "
638 main.step( "NOOPTION: Add single point to multi point intents" )
639 hostNames = [ 'h1', 'h9', 'h17' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700640 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall439c8912016-04-15 02:22:03 -0700641 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with no options set\n"
642 stepResult = main.TRUE
643 stepResult = main.intentFunction.singleToMultiIntent(
644 main,
645 name="NOOPTION",
646 hostNames=hostNames,
647 devices=devices,
648 sw1="s5",
649 sw2="s2",
Jon Hall314b74a2017-05-24 16:25:52 -0700650 expectedLink=18 )
Jon Hall439c8912016-04-15 02:22:03 -0700651 utilities.assert_equals( expect=main.TRUE,
652 actual=stepResult,
653 onpass=main.assertReturnString,
654 onfail=main.assertReturnString )
655 main.step( "IPV6: Add single point to multi point intents" )
656 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses\n"
657 hostNames = [ 'h1', 'h9', 'h17' ]
658 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700659 macs = [ '00:00:00:00:00:01', '00:00:00:00:00:09', '00:00:00:00:00:11' ]
Jon Hall439c8912016-04-15 02:22:03 -0700660 stepResult = main.TRUE
661 stepResult = main.intentFunction.singleToMultiIntent(
662 main,
663 name="IPV6",
664 hostNames=hostNames,
665 devices=devices,
666 macs=macs,
667 ethType="IPV6",
668 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700669 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700670 utilities.assert_equals( expect=main.TRUE,
671 actual=stepResult,
672 onpass=main.assertReturnString,
673 onfail=main.assertReturnString )
674 main.step( "IPV6_2: Add single point to multi point intents" )
675 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and no MAC addresses\n"
676 hostNames = [ 'h1', 'h9', 'h17' ]
677 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
678 stepResult = main.TRUE
679 stepResult = main.intentFunction.singleToMultiIntent(
680 main,
681 name="IPV6_2",
682 hostNames=hostNames,
683 devices=devices,
684 ethType="IPV6",
685 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700686 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700687 utilities.assert_equals( expect=main.TRUE,
688 actual=stepResult,
689 onpass=main.assertReturnString,
690 onfail=main.assertReturnString )
691 main.step( "VLAN: Add single point to multi point intents" )
692 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses in the same VLAN\n"
693 hostNames = [ 'h5', 'h24' ]
694 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700695 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
Jon Hall439c8912016-04-15 02:22:03 -0700696 stepResult = main.TRUE
697 stepResult = main.intentFunction.singleToMultiIntent(
698 main,
699 name="IPV6",
700 hostNames=hostNames,
701 devices=devices,
702 macs=macs,
703 ethType="IPV6",
704 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700705 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700706 utilities.assert_equals( expect=main.TRUE,
707 actual=stepResult,
708 onpass=main.assertReturnString,
709 onfail=main.assertReturnString )
710 main.intentFunction.report( main )
Jon Hall314b74a2017-05-24 16:25:52 -0700711
Jon Hall439c8912016-04-15 02:22:03 -0700712 def CASE4000( self, main ):
713 """
714 Add multi point to single point intents
715 - Get device ids
716 - Add multi point to single point intents
717 - Check intents
718 - Verify flows
719 - Ping hosts
720 - Reroute
721 - Link down
722 - Verify flows
723 - Check topology
724 - Ping hosts
725 - Link up
726 - Verify flows
727 - Check topology
728 - Ping hosts
729 - Remove intents
730 """
731 assert main, "There is no main"
732 assert main.CLIs, "There is no main.CLIs"
733 assert main.Mininet1, "Mininet handle should be named Mininet1"
734 assert main.numSwitch, "Placed the total number of switch topology in \
735 main.numSwitch"
736
737 main.testName = "Multi To Single Point Intents"
738 main.case( main.testName + " Test - " + str( main.numCtrls ) +
739 " NODE(S) - OF " + main.OFProtocol )
740 main.caseExplanation = "This test case will test single point to" +\
741 " multi point intents using " +\
742 str( main.numCtrls ) + " node(s) cluster;\n" +\
743 "Different type of hosts will be tested in " +\
744 "each step such as IPV6, Dual stack, VLAN etc" +\
745 ";\nThe test will use OF " + main.OFProtocol +\
746 " OVS running in Mininet"
747
748 main.step( "NOOPTION: Add multi point to single point intents" )
749 main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
750 stepResult = main.TRUE
751 hostNames = [ 'h17', 'h9' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700752 devices = [ 'of:0000000000000007/1', 'of:0000000000000006/1' ]
Jon Hall439c8912016-04-15 02:22:03 -0700753 stepResult = main.intentFunction.multiToSingleIntent(
754 main,
755 name="NOOPTION",
756 hostNames=hostNames,
757 devices=devices,
758 sw1="s6",
759 sw2="s2",
760 expectedLink=18 )
761 utilities.assert_equals( expect=main.TRUE,
762 actual=stepResult,
763 onpass=main.assertReturnString,
764 onfail=main.assertReturnString )
765 main.step( "IPV6: Add multi point to single point intents" )
766 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and MAC addresses\n"
767 hostNames = [ 'h1', 'h9', 'h17' ]
768 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700769 macs = [ '00:00:00:00:00:01', '00:00:00:00:00:09', '00:00:00:00:00:11' ]
Jon Hall439c8912016-04-15 02:22:03 -0700770 stepResult = main.TRUE
771 installResult = main.intentFunction.multiToSingleIntent(
772 main,
773 name="IPV6",
774 hostNames=hostNames,
775 devices=devices,
776 macs=macs,
777 ethType="IPV6",
778 sw1="",
779 sw2="",
780 expectedLink="" )
781 utilities.assert_equals( expect=main.TRUE,
782 actual=stepResult,
783 onpass=main.assertReturnString,
784 onfail=main.assertReturnString )
785 main.step( "IPV6_2: Add multi point to single point intents" )
786 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses\n"
787 hostNames = [ 'h1', 'h9' ]
788 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1' ]
789 stepResult = main.TRUE
790 stepResult = main.intentFunction.multiToSingleIntent(
791 main,
792 name="IPV6_2",
793 hostNames=hostNames,
794 devices=devices,
795 ethType="IPV6",
796 sw1="",
797 sw2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700798 expectedLink="" )
Jon Hall439c8912016-04-15 02:22:03 -0700799 utilities.assert_equals( expect=main.TRUE,
800 actual=stepResult,
801 onpass=main.assertReturnString,
802 onfail=main.assertReturnString )
803
804 main.step( "VLAN: Add multi point to single point intents" )
805 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses in the same VLAN\n"
806 hostNames = [ 'h5', 'h24' ]
807 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700808 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
Jon Hall439c8912016-04-15 02:22:03 -0700809 stepResult = main.TRUE
810 stepResult = main.intentFunction.multiToSingleIntent(
811 main,
812 name="VLAN",
813 hostNames=hostNames,
814 devices=devices,
815 macs=macs,
816 ethType="IPV6",
817 sw1="",
818 sw2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700819 expectedLink="" )
Jon Hall439c8912016-04-15 02:22:03 -0700820 utilities.assert_equals( expect=main.TRUE,
821 actual=stepResult,
822 onpass=main.assertReturnString,
823 onfail=main.assertReturnString )
824 main.intentFunction.report( main )
825
826 def CASE5000( self, main ):
827 """
828 Tests Host Mobility
829 Modifies the topology location of h1
830 """
831 assert main, "There is no main"
832 assert main.CLIs, "There is no main.CLIs"
833 assert main.Mininet1, "Mininet handle should be named Mininet1"
834 assert main.numSwitch, "Placed the total number of switch topology in \
835 main.numSwitch"
836 main.case( "Test host mobility with host intents " )
837 main.step( "Testing host mobility by moving h1 from s5 to s6" )
838 h1PreMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
839
Jon Hall314b74a2017-05-24 16:25:52 -0700840 main.log.info( "Moving h1 from s5 to s6" )
841 main.Mininet1.moveHostv6( "h1", "s5", "s6" )
Jon Hall439c8912016-04-15 02:22:03 -0700842 main.intentFunction.getHostsData( main )
843 h1PostMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
844
845 utilities.assert_equals( expect="of:0000000000000006",
846 actual=h1PostMove,
847 onpass="Mobility: Successfully moved h1 to s6",
848 onfail="Mobility: Failed to move h1 to s6" +
849 " to single point intents" +
850 " with IPV6 type and MAC addresses" +
851 " in the same VLAN" )
852 main.step( "IPV6: Add host intents between h1 and h9" )
853 main.assertReturnString = "Assert result for IPV6 host intent between h1, moved, and h9\n"
854 stepResult = main.TRUE
855 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700856 name='IPV6 Mobility IPV6',
857 host1='h1',
858 host2='h9',
859 host1Id='00:00:00:00:00:01/-1',
860 host2Id='00:00:00:00:00:09/-1' )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530861
862 utilities.assert_equals( expect=main.TRUE,
863 actual=stepResult,
864 onpass=main.assertReturnString,
865 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530866 main.intentFunction.report( main )
sathishmc4362252016-04-20 18:29:48 +0530867
868 def CASE6000( self, main ):
869 """
870 Tests Multi to Single Point Intent and Single to Multi Point Intent End Point Failure
871 """
872 assert main, "There is no main"
873 assert main.CLIs, "There is no main.CLIs"
874 assert main.Mininet1, "Mininet handle should be named Mininet1"
875 assert main.numSwitch, "Placed the total number of switch topology in \
876 main.numSwitch"
877 main.case( "Test Multi to Single End Point Failure" )
878 main.step( "NOOPTION: test end point failure for multi point to single point intents" )
879 main.assertReturnString = "Assertion results for IPV6 multi to single \
880 point intent end point failure with no options set\n"
881 hostNames = [ 'h8', 'h17' ]
882 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
883 testResult = main.TRUE
884 testResult = main.intentFunction.testEndPointFail(
885 main,
886 name="NOOPTION",
887 test="MultipletoSingle",
888 hostNames=hostNames,
889 devices=devices,
890 sw1="s6",
891 sw2="s2",
892 sw3="s4",
893 sw4="s1",
894 sw5="s3",
895 expectedLink1=16,
896 expectedLink2=14 )
897 utilities.assert_equals( expect=main.TRUE,
898 actual=testResult,
899 onpass=main.assertReturnString,
900 onfail=main.assertReturnString )
901
902 main.step( "IPV6: test end point failure for multi point to single point intents" )
903 main.assertReturnString = "Assertion results for IPV6 multi to single \
904 point intent end point failure with IPV6 type and MAC addresses\n"
905 hostNames = [ 'h8', 'h9', 'h17' ]
906 devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700907 macs = [ '00:00:00:00:00:08', '00:00:00:00:00:09', '00:00:00:00:00:11' ]
sathishmc4362252016-04-20 18:29:48 +0530908 testResult = main.TRUE
909 testResult = main.intentFunction.testEndPointFail(
910 main,
911 test="MultipletoSingle",
912 name="IPV6",
913 hostNames=hostNames,
914 devices=devices,
915 macs=macs,
916 ethType="IPV6",
917 sw1="s6",
918 sw2="s2",
919 sw3="s4",
920 sw4="s1",
921 sw5="s3",
922 expectedLink1=16,
923 expectedLink2=14 )
924 utilities.assert_equals( expect=main.TRUE,
925 actual=testResult,
926 onpass=main.assertReturnString,
927 onfail=main.assertReturnString )
928
929 main.step( "IPV6_2: test end point faliure for multi point to single point intents" )
930 main.assertReturnString = "Assertion results for IPV6 multi to single \
931 point intent end point failure with IPV6 type and no MAC addresses\n"
932 hostNames = [ 'h8', 'h17' ]
933 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
934 testResult = main.TRUE
935 testResult = main.intentFunction.testEndPointFail(
936 main,
937 test="MultipletoSingle",
938 name="IPV6_2",
939 hostNames=hostNames,
940 devices=devices,
941 ethType="IPV6",
942 sw1="s6",
943 sw2="s2",
944 sw3="s4",
945 sw4="s1",
946 sw5="s3",
947 expectedLink1=16,
948 expectedLink2=14 )
949
950 utilities.assert_equals( expect=main.TRUE,
951 actual=testResult,
952 onpass=main.assertReturnString,
953 onfail=main.assertReturnString )
954
955 main.step( "VLAN: test end point failure for multi point to single point intents" )
956 main.assertReturnString = "Assertion results for IPV6 multi to single \
957 point intent end point failure with IPV6 type and no MAC addresses in the same VLAN\n"
958 hostNames = [ 'h5', 'h24' ]
959 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700960 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
sathishmc4362252016-04-20 18:29:48 +0530961 testResult = main.TRUE
962 testResult = main.intentFunction.testEndPointFail(
963 main,
964 test="MultipletoSingle",
965 name="VLAN",
966 hostNames=hostNames,
967 devices=devices,
968 ethType="IPV6",
969 sw1="s6",
970 sw2="s2",
971 sw3="s4",
972 sw4="s1",
973 sw5="s3",
974 expectedLink1=16,
975 expectedLink2=14 )
976 utilities.assert_equals( expect=main.TRUE,
977 actual=testResult,
978 onpass=main.assertReturnString,
979 onfail=main.assertReturnString )
980
981 main.case( "Test Single to Multiple End Point Failure" )
982 main.step( "NOOPTION: test end point failure for single point to multi point intents" )
983 main.assertReturnString = "Assertion results for IPV6 single to multi \
984 point intent end point failure with no options set\n"
985 hostNames = [ 'h8', 'h17' ]
986 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
987 testResult = main.TRUE
988 testResult = main.intentFunction.testEndPointFail(
989 main,
990 test="SingletoMultiple",
991 name="NOOPTION",
992 hostNames=hostNames,
993 devices=devices,
994 sw1="s6",
995 sw2="s2",
996 sw3="s4",
997 sw4="s1",
998 sw5="s3",
999 expectedLink1=16,
1000 expectedLink2=14 )
1001 utilities.assert_equals( expect=main.TRUE,
1002 actual=testResult,
1003 onpass=main.assertReturnString,
1004 onfail=main.assertReturnString )
1005 main.step( "IPV6: test end point failure for single point to multi point intents" )
1006 main.assertReturnString = "Assertion results for IPV6 single to multi \
1007 point intent end point failure with IPV6 type and MAC addresses\n"
1008 hostNames = [ 'h8', 'h9', 'h17' ]
1009 devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -07001010 macs = [ '00:00:00:00:00:08', '00:00:00:00:00:09', '00:00:00:00:00:11' ]
sathishmc4362252016-04-20 18:29:48 +05301011 testResult = main.TRUE
1012 testResult = main.intentFunction.testEndPointFail(
1013 main,
1014 test="SingletoMultiple",
1015 name="IPV6",
1016 hostNames=hostNames,
1017 devices=devices,
1018 ethType="IPV6",
1019 macs=macs,
1020 sw1="s6",
1021 sw2="s2",
1022 sw3="s4",
1023 sw4="s1",
1024 sw5="s3",
1025 expectedLink1=16,
1026 expectedLink2=14 )
1027 utilities.assert_equals( expect=main.TRUE,
1028 actual=testResult,
1029 onpass=main.assertReturnString,
1030 onfail=main.assertReturnString )
1031
1032 main.step( "IPV6_2: test end point failure for single point to multi point intents" )
1033 main.assertReturnString = "Assertion results for IPV6 single to multi\
1034 point intent endpoint failure with IPV6 type and no MAC addresses\n"
1035 hostNames = [ 'h8', 'h17' ]
1036 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
1037 testResult = main.TRUE
1038 testResult = main.intentFunction.testEndPointFail(
1039 main,
1040 test="SingletoMultiple",
1041 name="IPV6_2",
1042 hostNames=hostNames,
1043 devices=devices,
1044 ethType="IPV6",
1045 sw1="s6",
1046 sw2="s2",
1047 sw3="s4",
1048 sw4="s1",
1049 sw5="s3",
1050 expectedLink1=16,
1051 expectedLink2=14 )
1052 utilities.assert_equals( expect=main.TRUE,
1053 actual=testResult,
1054 onpass=main.assertReturnString,
1055 onfail=main.assertReturnString )
1056
1057 main.step( "VLAN: test end point failure for single point to multi point intents" )
1058 main.assertReturnString = "Assertion results for IPV6 single to multi point\
1059 intent endpoint failure with IPV6 type and MAC addresses in the same VLAN\n"
1060 hostNames = [ 'h5', 'h24' ]
1061 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -07001062 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
sathishmc4362252016-04-20 18:29:48 +05301063 testResult = main.TRUE
1064 testResult = main.intentFunction.testEndPointFail(
1065 main,
1066 test="SingletoMultiple",
1067 name="IPV6",
1068 hostNames=hostNames,
1069 devices=devices,
1070 macs=macs,
1071 ethType="IPV6",
1072 sw1="s6",
1073 sw2="s2",
1074 sw3="s4",
1075 sw4="s1",
1076 sw5="s3",
1077 expectedLink1=16,
1078 expectedLink2=14 )
1079 utilities.assert_equals( expect=main.TRUE,
1080 actual=testResult,
1081 onpass=main.assertReturnString,
1082 onfail=main.assertReturnString )
1083
1084 main.intentFunction.report( main )