blob: df19aedc41ea5be5750a94011bc56d20188be905 [file] [log] [blame]
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07001"""
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -07002Copyright 2015 Open Networking Foundation ( ONF )
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07003
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
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070011 ( at your option ) any later version.
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -070012
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"""
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080021# Testing the basic intent for ipv6 functionality of ONOS
22
Jon Hall314b74a2017-05-24 16:25:52 -070023
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080024class FUNCipv6Intent:
25
26 def __init__( self ):
27 self.default = ''
28
29 def CASE1( self, main ):
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080030 import imp
31 import re
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080032 """
33 - Construct tests variables
34 - GIT ( optional )
35 - Checkout ONOS master branch
36 - Pull latest ONOS code
37 - Building ONOS ( optional )
38 - Install ONOS package
39 - Build ONOS package
40 """
Devin Lim58046fa2017-07-05 16:55:00 -070041 try:
42 from tests.dependencies.ONOSSetup import ONOSSetup
43 main.testSetUp = ONOSSetup()
44 except ImportError:
45 main.log.error( "ONOSSetup not found. exiting the test" )
Devin Lim44075962017-08-11 10:56:37 -070046 main.cleanAndExit()
Devin Lim58046fa2017-07-05 16:55:00 -070047 main.testSetUp.envSetupDescription()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080048 stepResult = main.FALSE
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080049 # Test variables
50 try:
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080051 main.apps = main.params[ 'ENV' ][ 'cellApps' ]
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080052 main.dependencyPath = main.testOnDirectory + \
53 main.params[ 'DEPENDENCY' ][ 'path' ]
54 main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
55 main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080056 wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
57 wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
58 wrapperFile3 = main.params[ 'DEPENDENCY' ][ 'wrapper3' ]
59 main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
60 main.checkIntentSleep = int( main.params[ 'SLEEP' ][ 'checkintent' ] )
61 main.removeIntentSleep = int( main.params[ 'SLEEP' ][ 'removeintent' ] )
62 main.rerouteSleep = int( main.params[ 'SLEEP' ][ 'reroute' ] )
63 main.fwdSleep = int( main.params[ 'SLEEP' ][ 'fwd' ] )
64 main.checkTopoAttempts = int( main.params[ 'SLEEP' ][ 'topoAttempts' ] )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080065 main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
66 main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080067 main.hostsData = {}
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080068 main.assertReturnString = '' # Assembled assert return string
69
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080070 # -- INIT SECTION, ONLY RUNS ONCE -- #
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080071
72 main.intentFunction = imp.load_source( wrapperFile2,
Jon Hall314b74a2017-05-24 16:25:52 -070073 main.dependencyPath +
74 wrapperFile2 +
75 ".py" )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080076
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080077 copyResult1 = main.ONOSbench.scp( main.Mininet1,
78 main.dependencyPath +
79 main.topology,
Devin Lim29a9e3d2018-01-30 14:09:47 -080080 main.Mininet1.home + "custom/",
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080081 direction="to" )
Devin Lim142b5342017-07-20 15:22:39 -070082 stepResult = main.testSetUp.envSetup()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080083 except Exception as e:
Devin Lim58046fa2017-07-05 16:55:00 -070084 main.testSetUp.envSetupException( e )
85 main.testSetUp.evnSetupConclusion( stepResult )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -080086
87 def CASE2( self, main ):
88 """
89 - Set up cell
90 - Create cell file
91 - Set cell file
92 - Verify cell file
93 - Kill ONOS process
94 - Uninstall ONOS cluster
95 - Verify ONOS start up
96 - Install ONOS cluster
97 - Connect to cli
98 """
alisona2905c12016-09-19 15:18:07 -070099 import time
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800100
You Wanga0f6ff62018-01-11 15:46:30 -0800101 main.initialized = main.testSetUp.ONOSSetUp( main.Cluster, True )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800102
Jon Hall11845ed2016-02-11 11:25:31 -0800103 main.step( "Checking that ONOS is ready" )
Devin Lim142b5342017-07-20 15:22:39 -0700104
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -0700105 ready = utilities.retry( main.Cluster.command,
Devin Lim142b5342017-07-20 15:22:39 -0700106 False,
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -0700107 kwargs={ "function": "summary", "contentCheck": True },
Devin Lim142b5342017-07-20 15:22:39 -0700108 sleep=30,
109 attempts=3 )
Jon Hall11845ed2016-02-11 11:25:31 -0800110 utilities.assert_equals( expect=True, actual=ready,
111 onpass="ONOS summary command succeded",
112 onfail="ONOS summary command failed" )
113 if not ready:
Devin Lim44075962017-08-11 10:56:37 -0700114 main.cleanAndExit()
115 main.cleanAndExit()
Jon Hall11845ed2016-02-11 11:25:31 -0800116
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530117 main.step( "setup the ipv6NeighbourDiscovery" )
You Wang6ce33b02017-08-08 13:05:09 -0700118 cfgResult1 = main.Cluster.active( 0 ).CLI.setCfg( "org.onosproject.net.neighbour.impl.NeighbourResolutionManager", "ndpEnabled", "true" )
119 cfgResult2 = main.Cluster.active( 0 ).CLI.setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "requestIpv6ND", "true" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530120 cfgResult = cfgResult1 and cfgResult2
121 utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
Jon Hall314b74a2017-05-24 16:25:52 -0700122 onpass="ipv6NeighborDiscovery cfg is set to true",
123 onfail="Failed to cfg set ipv6NeighborDiscovery" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530124
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800125 main.intentFunction.report( main )
126
127 def CASE11( self, main ):
128 """
129 Start Mininet topology with OF 1.3 switches
130 """
131 main.OFProtocol = "1.3"
132 main.log.report( "Start Mininet topology with OF 1.3 switches" )
133 main.case( "Start Mininet topology with OF 1.3 switches" )
134 main.caseExplanation = "Start mininet topology with OF 1.3 " +\
135 "switches to test intents, exits out if " +\
136 "topology did not start correctly"
137
138 main.step( "Starting Mininet topology with OF 1.3 switches" )
139 args = "--switch ovs,protocols=OpenFlow13"
Devin Lim29a9e3d2018-01-30 14:09:47 -0800140 topoResult = main.Mininet1.startNet( topoFile=main.Mininet1.home + "custom/" + main.topology,
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800141 args=args )
142 stepResult = topoResult
143 utilities.assert_equals( expect=main.TRUE,
144 actual=stepResult,
145 onpass="Successfully loaded topology",
146 onfail="Failed to load topology" )
147 # Exit if topology did not load properly
148 if not topoResult:
Devin Lim44075962017-08-11 10:56:37 -0700149 main.cleanAndExit()
150 main.cleanAndExit()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800151
152 def CASE12( self, main ):
153 """
154 Assign mastership to controllers
155 """
156 import re
157
158 main.case( "Assign switches to controllers" )
159 main.step( "Assigning switches to controllers" )
160 main.caseExplanation = "Assign OF " + main.OFProtocol +\
161 " switches to ONOS nodes"
162
163 assignResult = main.TRUE
164 switchList = []
165
166 # Creates a list switch name, use getSwitch() function later...
167 for i in range( 1, ( main.numSwitch + 1 ) ):
168 switchList.append( 's' + str( i ) )
169
170 tempONOSip = []
Devin Lim142b5342017-07-20 15:22:39 -0700171 for ctrl in main.Cluster.active():
172 tempONOSip.append( ctrl.ipAddress )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800173
174 assignResult = main.Mininet1.assignSwController( sw=switchList,
175 ip=tempONOSip,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530176 port='6633' )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800177 if not assignResult:
Devin Lim44075962017-08-11 10:56:37 -0700178 main.cleanAndExit()
179 main.cleanAndExit()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800180
181 for i in range( 1, ( main.numSwitch + 1 ) ):
182 response = main.Mininet1.getSwController( "s" + str( i ) )
183 print( "Response is " + str( response ) )
Devin Lim142b5342017-07-20 15:22:39 -0700184 if re.search( "tcp:" + main.Cluster.active( 0 ).ipAddress, response ):
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800185 assignResult = assignResult and main.TRUE
186 else:
187 assignResult = main.FALSE
188 stepResult = assignResult
189 utilities.assert_equals( expect=main.TRUE,
190 actual=stepResult,
191 onpass="Successfully assigned switches" +
192 "to controller",
193 onfail="Failed to assign switches to " +
194 "controller" )
195
sathishmad953462015-12-03 17:42:07 +0530196 def CASE13( self, main ):
197 """
198 Discover all hosts and store its data to a dictionary
199 """
200 main.case( "Discover all hosts" )
201
sathishmad953462015-12-03 17:42:07 +0530202 main.step( "Discover all hosts using pingall " )
203 stepResult = main.intentFunction.getHostsData( main )
204 utilities.assert_equals( expect=main.TRUE,
Jon Hall314b74a2017-05-24 16:25:52 -0700205 actual=stepResult,
206 onpass="Successfully discovered hosts",
207 onfail="Failed to discover hosts" )
sathishmad953462015-12-03 17:42:07 +0530208
sathishmc4362252016-04-20 18:29:48 +0530209 def CASE16( self, main ):
210 """
211 Balance Masters
212 """
213 main.case( "Balance mastership of switches" )
214 main.step( "Balancing mastership of switches" )
215
216 balanceResult = main.FALSE
Devin Lim142b5342017-07-20 15:22:39 -0700217 balanceResult = utilities.retry( f=main.Cluster.active( 0 ).CLI.balanceMasters, retValue=main.FALSE, args=[] )
sathishmc4362252016-04-20 18:29:48 +0530218
219 utilities.assert_equals( expect=main.TRUE,
220 actual=balanceResult,
221 onpass="Successfully balanced mastership of switches",
222 onfail="Failed to balance mastership of switches" )
223
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800224 def CASE14( self, main ):
225 """
226 Stop mininet
227 """
Devin Lim58046fa2017-07-05 16:55:00 -0700228 try:
229 from tests.dependencies.utils import Utils
230 except ImportError:
231 main.log.error( "Utils not found exiting the test" )
Devin Lim44075962017-08-11 10:56:37 -0700232 main.cleanAndExit()
Devin Lim58046fa2017-07-05 16:55:00 -0700233 try:
234 main.Utils
235 except ( NameError, AttributeError ):
236 main.Utils = Utils()
237 main.Utils.mininetCleanIntro()
238 topoResult = main.Utils.mininetCleanup( main.Mininet1 )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800239 # Exit if topology did not load properly
240 if not topoResult:
Devin Lim44075962017-08-11 10:56:37 -0700241 main.cleanAndExit()
242 main.cleanAndExit()
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530243
sathishmc4362252016-04-20 18:29:48 +0530244 def CASE1000( self, main ):
245 """
246 Add host intents between 2 host:
247 - Discover hosts
248 - Add host intents
249 - Check intents
250 - Verify flows
251 - Ping hosts
252 - Reroute
253 - Link down
254 - Verify flows
255 - Check topology
256 - Ping hosts
257 - Link up
258 - Verify flows
259 - Check topology
260 - Ping hosts
261 - Remove intents
262 """
263 import time
264 import json
265 import re
266
267 # Assert variables - These variable's name|format must be followed
268 # if you want to use the wrapper function
269 assert main, "There is no main"
sathishmc4362252016-04-20 18:29:48 +0530270 assert main.Mininet1, "Mininet handle should be named Mininet1"
271 assert main.numSwitch, "Placed the total number of switch topology in \
272 main.numSwitch"
273
Devin Lim142b5342017-07-20 15:22:39 -0700274 intentLeadersOld = main.Cluster.active( 0 ).CLI.leaderCandidates()
sathishmc4362252016-04-20 18:29:48 +0530275
276 main.testName = "Host Intents"
Devin Lim142b5342017-07-20 15:22:39 -0700277 main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) +
sathishmc4362252016-04-20 18:29:48 +0530278 " NODE(S) - OF " + main.OFProtocol )
279 main.caseExplanation = "This test case tests Host intents using " +\
Devin Lim142b5342017-07-20 15:22:39 -0700280 str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\
sathishmc4362252016-04-20 18:29:48 +0530281 "Different type of hosts will be tested in " +\
282 "each step such as IPV6, Dual stack, VLAN " +\
283 "etc;\nThe test will use OF " + main.OFProtocol\
284 + " OVS running in Mininet"
285
286 main.step( "IPV6: Add host intents between h1 and h9" )
287 stepResult = main.TRUE
288 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700289 name='IPV6',
290 host1='h1',
291 host2='h9',
292 host1Id='00:00:00:00:00:01/-1',
293 host2Id='00:00:00:00:00:09/-1',
294 sw1='s5',
295 sw2='s2',
296 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530297
298 utilities.assert_equals( expect=main.TRUE,
299 actual=stepResult,
300 onpass="IPV6: Host intent test successful " +
301 "between two IPV6 hosts",
302 onfail="IPV6: Host intent test failed " +
Jon Hall314b74a2017-05-24 16:25:52 -0700303 "between two IPV6 hosts" )
sathishmc4362252016-04-20 18:29:48 +0530304
305 main.step( "DUALSTACK1: Add host intents between h3 and h11" )
306 stepResult = main.TRUE
307 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700308 name='DUALSTACK',
309 host1='h3',
310 host2='h11',
311 host1Id='00:00:00:00:00:03/-1',
312 host2Id='00:00:00:00:00:0B/-1',
313 sw1='s5',
314 sw2='s2',
315 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530316
317 utilities.assert_equals( expect=main.TRUE,
318 actual=stepResult,
319 onpass="DUALSTACK: Host intent test " +
320 "successful between two " +
321 "dual stack host using IPV6",
322 onfail="DUALSTACK: Host intent test " +
323 "failed between two" +
324 "dual stack host using IPV6" )
325
326 main.step( "1HOP: Add host intents between h1 and h3" )
327 stepResult = main.TRUE
328 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700329 name='1HOP',
330 host1='h1',
331 host2='h9',
332 host1Id='00:00:00:00:00:01/-1',
333 host2Id='00:00:00:00:00:09/-1' )
sathishmc4362252016-04-20 18:29:48 +0530334
335 utilities.assert_equals( expect=main.TRUE,
336 actual=stepResult,
337 onpass="1HOP: Host intent test " +
338 "successful between two " +
339 "host using IPV6 in the same switch",
340 onfail="1HOP: Host intent test " +
341 "failed between two" +
342 "host using IPV6 in the same switch" )
343
344 main.step( "VLAN: Add vlan host intents between h5 and h24" )
345 stepResult = main.TRUE
346 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700347 name='VLAN1',
348 host1='h5',
349 host2='h24',
350 host1Id='00:00:00:00:00:05/100',
351 host2Id='00:00:00:00:00:18/100',
352 sw1='s5',
353 sw2='s2',
354 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530355
356 utilities.assert_equals( expect=main.TRUE,
357 actual=stepResult,
358 onpass="VLAN: Host intent test " +
359 "successful between two " +
360 "host using IPV6 in the same VLAN",
361 onfail="VLAN1: Host intent test " +
362 "failed between two" +
363 "host using IPV6 in the same VLAN" )
364
365 main.intentFunction.report( main )
366
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530367 def CASE2000( self, main ):
368 """
369 add point intents between 2 hosts:
370 - Get device ids | ports
371 - Add point intents
372 - Check intents
373 - Verify flows
374 - Ping hosts
375 - Reroute
376 - Link down
377 - Verify flows
378 - Check topology
379 - Ping hosts
380 - Link up
381 - Verify flows
382 - Check topology
383 - Ping hosts
384 - Remove intents
385 """
386 import time
387 import json
388 import re
389
390 # Assert variables - These variable's name|format must be followed
391 # if you want to use the wrapper function
392 assert main, "There is no main"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530393 assert main.Mininet1, "Mininet handle should be named Mininet1"
394 assert main.numSwitch, "Placed the total number of switch topology in \
395 main.numSwitch"
396
397 main.testName = "Point Intents"
Devin Lim142b5342017-07-20 15:22:39 -0700398 main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) +
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530399 " NODE(S) - OF " + main.OFProtocol )
400 main.caseExplanation = "This test case will test point to point" +\
Devin Lim142b5342017-07-20 15:22:39 -0700401 " intents using " + str( main.Cluster.numCtrls ) +\
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530402 " node(s) cluster;\n" +\
403 "Different type of hosts will be tested in " +\
Jon Hall439c8912016-04-15 02:22:03 -0700404 "each step such as IPV6, Dual stack, VLAN etc" +\
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530405 ";\nThe test will use OF " + main.OFProtocol +\
406 " OVS running in Mininet"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530407 # No option point intents
408 main.step( "NOOPTION: Add point intents between h1 and h9, ipv6 hosts" )
409 main.assertReturnString = "Assertion Result for NOOPTION point intent\n"
410 stepResult = main.TRUE
411 stepResult = main.intentFunction.pointIntent(
412 main,
413 name="NOOPTION",
414 host1="h1",
415 host2="h9",
416 deviceId1="of:0000000000000005/1",
Jon Hall314b74a2017-05-24 16:25:52 -0700417 deviceId2="of:0000000000000006/1" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530418
419 utilities.assert_equals( expect=main.TRUE,
420 actual=stepResult,
421 onpass=main.assertReturnString,
422 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530423 stepResult = main.TRUE
424 main.step( "IPV6: Add point intents between h1 and h9" )
425 main.assertReturnString = "Assertion Result for IPV6 point intent\n"
426 stepResult = main.intentFunction.pointIntent(
427 main,
428 name="IPV6",
429 host1="h1",
430 host2="h9",
431 deviceId1="of:0000000000000005/1",
432 deviceId2="of:0000000000000006/1",
433 port1="",
434 port2="",
435 ethType="IPV6",
436 mac1="00:00:00:00:00:01",
437 mac2="00:00:00:00:00:09",
438 bandwidth="",
439 lambdaAlloc=False,
440 ipProto="",
441 ip1="",
442 ip2="",
443 tcp1="",
444 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700445 sw1="s5",
446 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530447 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530448 utilities.assert_equals( expect=main.TRUE,
449 actual=stepResult,
450 onpass=main.assertReturnString,
451 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530452 main.step( "IPV6_2: Add point intents between h1 and h9" )
453 main.assertReturnString = "Assertion Result for IPV6 no mac address point intents\n"
454 stepResult = main.intentFunction.pointIntent(
455 main,
456 name="IPV6_2",
457 host1="h1",
458 host2="h9",
459 deviceId1="of:0000000000000005/1",
460 deviceId2="of:0000000000000006/1",
461 ipProto="",
462 ip1="",
463 ip2="",
464 tcp1="",
465 tcp2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700466 expectedLink="" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530467 utilities.assert_equals( expect=main.TRUE,
468 actual=stepResult,
469 onpass=main.assertReturnString,
470 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530471 main.step( "SDNIP-ICMP: Add point intents between h1 and h9" )
sathishmad953462015-12-03 17:42:07 +0530472 main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV6 using ICMP point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530473 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
474 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700475 main.log.debug( mac2 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530476 ipProto = main.params[ 'SDNIP' ][ 'icmpProto' ]
sathishmad953462015-12-03 17:42:07 +0530477 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
478 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530479 stepResult = main.intentFunction.pointIntent(
480 main,
481 name="SDNIP-ICMP",
482 host1="h1",
483 host2="h9",
484 deviceId1="of:0000000000000005/1",
485 deviceId2="of:0000000000000006/1",
486 mac1=mac1,
487 mac2=mac2,
488 ethType="IPV6",
489 ipProto=ipProto,
490 ip1=ip1,
491 ip2=ip2 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530492 utilities.assert_equals( expect=main.TRUE,
493 actual=stepResult,
494 onpass=main.assertReturnString,
495 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530496 main.step( "SDNIP-TCP: Add point intents between h1 and h9" )
sathishmad953462015-12-03 17:42:07 +0530497 main.assertReturnString = "Assertion Result for SDNIP-TCP IPV6 using TCP point intents\n"
Jon Hall439c8912016-04-15 02:22:03 -0700498 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
499 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
500 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
501 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530502 ipProto = main.params[ 'SDNIP' ][ 'tcpProto' ]
503 tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
504 tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530505 stepResult = main.intentFunction.pointIntentTcp(
506 main,
507 name="SDNIP-TCP",
Jon Hall439c8912016-04-15 02:22:03 -0700508 host1="h1",
509 host2="h9",
510 deviceId1="of:0000000000000005/1",
511 deviceId2="of:0000000000000006/1",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530512 mac1=mac1,
513 mac2=mac2,
Jon Hall439c8912016-04-15 02:22:03 -0700514 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530515 ipProto=ipProto,
516 ip1=ip1,
517 ip2=ip2,
518 tcp1=tcp1,
Jon Hall439c8912016-04-15 02:22:03 -0700519 tcp2=tcp2,
520 sw1="",
521 sw2="",
522 expectedLink="" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530523 utilities.assert_equals( expect=main.TRUE,
sathishmad953462015-12-03 17:42:07 +0530524 actual=stepResult,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530525 onpass=main.assertReturnString,
526 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530527 main.step( "DUALSTACK1: Add point intents between h3 and h11" )
sathishmad953462015-12-03 17:42:07 +0530528 main.assertReturnString = "Assertion Result for Dualstack1 IPV6 with mac address point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530529 stepResult = main.intentFunction.pointIntent(
530 main,
531 name="DUALSTACK1",
532 host1="h3",
533 host2="h11",
sathishmad953462015-12-03 17:42:07 +0530534 deviceId1="of:0000000000000005/3",
535 deviceId2="of:0000000000000006/3",
536 port1="",
537 port2="",
538 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530539 mac1="00:00:00:00:00:03",
540 mac2="00:00:00:00:00:0B",
541 bandwidth="",
542 lambdaAlloc=False,
543 ipProto="",
544 ip1="",
545 ip2="",
546 tcp1="",
547 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700548 sw1="s5",
549 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530550 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530551 utilities.assert_equals( expect=main.TRUE,
552 actual=stepResult,
553 onpass=main.assertReturnString,
554 onfail=main.assertReturnString )
sathishmad953462015-12-03 17:42:07 +0530555 main.step( "VLAN: Add point intents between h5 and h24" )
556 main.assertReturnString = "Assertion Result for VLAN IPV6 with mac address point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530557 stepResult = main.intentFunction.pointIntent(
558 main,
559 name="VLAN",
560 host1="h5",
sathishmad953462015-12-03 17:42:07 +0530561 host2="h24",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530562 deviceId1="of:0000000000000005/5",
sathishmad953462015-12-03 17:42:07 +0530563 deviceId2="of:0000000000000007/8",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530564 port1="",
565 port2="",
sathishmad953462015-12-03 17:42:07 +0530566 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530567 mac1="00:00:00:00:00:05",
sathishmad953462015-12-03 17:42:07 +0530568 mac2="00:00:00:00:00:18",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530569 bandwidth="",
570 lambdaAlloc=False,
571 ipProto="",
572 ip1="",
573 ip2="",
574 tcp1="",
575 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700576 sw1="s5",
577 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530578 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530579 utilities.assert_equals( expect=main.TRUE,
580 actual=stepResult,
581 onpass=main.assertReturnString,
582 onfail=main.assertReturnString )
sathishmad953462015-12-03 17:42:07 +0530583 main.step( "1HOP: Add point intents between h1 and h9" )
584 main.assertReturnString = "Assertion Result for 1HOP IPV6 with no mac address point intents\n"
sathishmc4362252016-04-20 18:29:48 +0530585 stepResult = main.intentFunction.pointIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700586 name='1HOP',
587 host1="h1",
588 host2="h9",
589 deviceId1="of:0000000000000005/1",
590 deviceId2="of:0000000000000006/1" )
Jon Hall439c8912016-04-15 02:22:03 -0700591 utilities.assert_equals( expect=main.TRUE,
592 actual=stepResult,
593 onpass=main.assertReturnString,
594 onfail=main.assertReturnString )
595 main.intentFunction.report( main )
596
597 def CASE3000( self, main ):
598 """
599 Add single point to multi point intents
600 - Get device ids
601 - Add single point to multi point intents
602 - Check intents
603 - Verify flows
604 - Ping hosts
605 - Reroute
606 - Link down
607 - Verify flows
608 - Check topology
609 - Ping hosts
610 - Link up
611 - Verify flows
612 - Check topology
613 - Ping hosts
614 - Remove intents
615 """
616 import time
617 import json
618 import re
619 assert main, "There is no main"
Jon Hall439c8912016-04-15 02:22:03 -0700620 assert main.Mininet1, "Mininet handle should be named Mininet1"
621 assert main.numSwitch, "Placed the total number of switch topology in \
622 main.numSwitch"
623 main.testName = "Single to Multi Point Intents"
Devin Lim142b5342017-07-20 15:22:39 -0700624 main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
Jon Hall439c8912016-04-15 02:22:03 -0700625 main.caseExplanation = "This test case will test single point to" +\
626 " multi point intents using " +\
Devin Lim142b5342017-07-20 15:22:39 -0700627 str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\
Jon Hall439c8912016-04-15 02:22:03 -0700628 "Different type of hosts will be tested in " +\
629 "each step such as IPV6, Dual stack, VLAN etc" +\
630 ";\nThe test will use OF " + main.OFProtocol +\
631 " OVS running in Mininet "
632 main.step( "NOOPTION: Add single point to multi point intents" )
633 hostNames = [ 'h1', 'h9', 'h17' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700634 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall439c8912016-04-15 02:22:03 -0700635 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with no options set\n"
636 stepResult = main.TRUE
637 stepResult = main.intentFunction.singleToMultiIntent(
638 main,
639 name="NOOPTION",
640 hostNames=hostNames,
641 devices=devices,
642 sw1="s5",
643 sw2="s2",
Jon Hall314b74a2017-05-24 16:25:52 -0700644 expectedLink=18 )
Jon Hall439c8912016-04-15 02:22:03 -0700645 utilities.assert_equals( expect=main.TRUE,
646 actual=stepResult,
647 onpass=main.assertReturnString,
648 onfail=main.assertReturnString )
649 main.step( "IPV6: Add single point to multi point intents" )
650 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses\n"
651 hostNames = [ 'h1', 'h9', 'h17' ]
652 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700653 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 -0700654 stepResult = main.TRUE
655 stepResult = main.intentFunction.singleToMultiIntent(
656 main,
657 name="IPV6",
658 hostNames=hostNames,
659 devices=devices,
660 macs=macs,
661 ethType="IPV6",
662 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700663 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700664 utilities.assert_equals( expect=main.TRUE,
665 actual=stepResult,
666 onpass=main.assertReturnString,
667 onfail=main.assertReturnString )
668 main.step( "IPV6_2: Add single point to multi point intents" )
669 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and no MAC addresses\n"
670 hostNames = [ 'h1', 'h9', 'h17' ]
671 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
672 stepResult = main.TRUE
673 stepResult = main.intentFunction.singleToMultiIntent(
674 main,
675 name="IPV6_2",
676 hostNames=hostNames,
677 devices=devices,
678 ethType="IPV6",
679 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700680 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700681 utilities.assert_equals( expect=main.TRUE,
682 actual=stepResult,
683 onpass=main.assertReturnString,
684 onfail=main.assertReturnString )
685 main.step( "VLAN: Add single point to multi point intents" )
686 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses in the same VLAN\n"
687 hostNames = [ 'h5', 'h24' ]
688 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700689 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
Jon Hall439c8912016-04-15 02:22:03 -0700690 stepResult = main.TRUE
691 stepResult = main.intentFunction.singleToMultiIntent(
692 main,
693 name="IPV6",
694 hostNames=hostNames,
695 devices=devices,
696 macs=macs,
697 ethType="IPV6",
698 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700699 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700700 utilities.assert_equals( expect=main.TRUE,
701 actual=stepResult,
702 onpass=main.assertReturnString,
703 onfail=main.assertReturnString )
704 main.intentFunction.report( main )
Jon Hall314b74a2017-05-24 16:25:52 -0700705
Jon Hall439c8912016-04-15 02:22:03 -0700706 def CASE4000( self, main ):
707 """
708 Add multi point to single point intents
709 - Get device ids
710 - Add multi point to single point intents
711 - Check intents
712 - Verify flows
713 - Ping hosts
714 - Reroute
715 - Link down
716 - Verify flows
717 - Check topology
718 - Ping hosts
719 - Link up
720 - Verify flows
721 - Check topology
722 - Ping hosts
723 - Remove intents
724 """
725 assert main, "There is no main"
Jon Hall439c8912016-04-15 02:22:03 -0700726 assert main.Mininet1, "Mininet handle should be named Mininet1"
727 assert main.numSwitch, "Placed the total number of switch topology in \
728 main.numSwitch"
729
730 main.testName = "Multi To Single Point Intents"
Devin Lim142b5342017-07-20 15:22:39 -0700731 main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) +
Jon Hall439c8912016-04-15 02:22:03 -0700732 " NODE(S) - OF " + main.OFProtocol )
733 main.caseExplanation = "This test case will test single point to" +\
734 " multi point intents using " +\
Devin Lim142b5342017-07-20 15:22:39 -0700735 str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\
Jon Hall439c8912016-04-15 02:22:03 -0700736 "Different type of hosts will be tested in " +\
737 "each step such as IPV6, Dual stack, VLAN etc" +\
738 ";\nThe test will use OF " + main.OFProtocol +\
739 " OVS running in Mininet"
740
741 main.step( "NOOPTION: Add multi point to single point intents" )
742 main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
743 stepResult = main.TRUE
744 hostNames = [ 'h17', 'h9' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700745 devices = [ 'of:0000000000000007/1', 'of:0000000000000006/1' ]
Jon Hall439c8912016-04-15 02:22:03 -0700746 stepResult = main.intentFunction.multiToSingleIntent(
747 main,
748 name="NOOPTION",
749 hostNames=hostNames,
750 devices=devices,
751 sw1="s6",
752 sw2="s2",
753 expectedLink=18 )
754 utilities.assert_equals( expect=main.TRUE,
755 actual=stepResult,
756 onpass=main.assertReturnString,
757 onfail=main.assertReturnString )
758 main.step( "IPV6: Add multi point to single point intents" )
759 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and MAC addresses\n"
760 hostNames = [ 'h1', 'h9', 'h17' ]
761 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700762 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 -0700763 stepResult = main.TRUE
764 installResult = main.intentFunction.multiToSingleIntent(
765 main,
766 name="IPV6",
767 hostNames=hostNames,
768 devices=devices,
769 macs=macs,
770 ethType="IPV6",
771 sw1="",
772 sw2="",
773 expectedLink="" )
774 utilities.assert_equals( expect=main.TRUE,
775 actual=stepResult,
776 onpass=main.assertReturnString,
777 onfail=main.assertReturnString )
778 main.step( "IPV6_2: Add multi point to single point intents" )
779 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses\n"
780 hostNames = [ 'h1', 'h9' ]
781 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1' ]
782 stepResult = main.TRUE
783 stepResult = main.intentFunction.multiToSingleIntent(
784 main,
785 name="IPV6_2",
786 hostNames=hostNames,
787 devices=devices,
788 ethType="IPV6",
789 sw1="",
790 sw2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700791 expectedLink="" )
Jon Hall439c8912016-04-15 02:22:03 -0700792 utilities.assert_equals( expect=main.TRUE,
793 actual=stepResult,
794 onpass=main.assertReturnString,
795 onfail=main.assertReturnString )
796
797 main.step( "VLAN: Add multi point to single point intents" )
798 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses in the same VLAN\n"
799 hostNames = [ 'h5', 'h24' ]
800 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700801 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
Jon Hall439c8912016-04-15 02:22:03 -0700802 stepResult = main.TRUE
803 stepResult = main.intentFunction.multiToSingleIntent(
804 main,
805 name="VLAN",
806 hostNames=hostNames,
807 devices=devices,
808 macs=macs,
809 ethType="IPV6",
810 sw1="",
811 sw2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700812 expectedLink="" )
Jon Hall439c8912016-04-15 02:22:03 -0700813 utilities.assert_equals( expect=main.TRUE,
814 actual=stepResult,
815 onpass=main.assertReturnString,
816 onfail=main.assertReturnString )
817 main.intentFunction.report( main )
818
819 def CASE5000( self, main ):
820 """
821 Tests Host Mobility
822 Modifies the topology location of h1
823 """
824 assert main, "There is no main"
Jon Hall439c8912016-04-15 02:22:03 -0700825 assert main.Mininet1, "Mininet handle should be named Mininet1"
826 assert main.numSwitch, "Placed the total number of switch topology in \
827 main.numSwitch"
828 main.case( "Test host mobility with host intents " )
829 main.step( "Testing host mobility by moving h1 from s5 to s6" )
830 h1PreMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
831
Jon Hall314b74a2017-05-24 16:25:52 -0700832 main.log.info( "Moving h1 from s5 to s6" )
833 main.Mininet1.moveHostv6( "h1", "s5", "s6" )
Jon Hall439c8912016-04-15 02:22:03 -0700834 main.intentFunction.getHostsData( main )
835 h1PostMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
836
837 utilities.assert_equals( expect="of:0000000000000006",
838 actual=h1PostMove,
839 onpass="Mobility: Successfully moved h1 to s6",
840 onfail="Mobility: Failed to move h1 to s6" +
841 " to single point intents" +
842 " with IPV6 type and MAC addresses" +
843 " in the same VLAN" )
844 main.step( "IPV6: Add host intents between h1 and h9" )
845 main.assertReturnString = "Assert result for IPV6 host intent between h1, moved, and h9\n"
846 stepResult = main.TRUE
847 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700848 name='IPV6 Mobility IPV6',
849 host1='h1',
850 host2='h9',
851 host1Id='00:00:00:00:00:01/-1',
852 host2Id='00:00:00:00:00:09/-1' )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530853
854 utilities.assert_equals( expect=main.TRUE,
855 actual=stepResult,
856 onpass=main.assertReturnString,
857 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530858 main.intentFunction.report( main )
sathishmc4362252016-04-20 18:29:48 +0530859
860 def CASE6000( self, main ):
861 """
862 Tests Multi to Single Point Intent and Single to Multi Point Intent End Point Failure
863 """
864 assert main, "There is no main"
sathishmc4362252016-04-20 18:29:48 +0530865 assert main.Mininet1, "Mininet handle should be named Mininet1"
866 assert main.numSwitch, "Placed the total number of switch topology in \
867 main.numSwitch"
868 main.case( "Test Multi to Single End Point Failure" )
869 main.step( "NOOPTION: test end point failure for multi point to single point intents" )
870 main.assertReturnString = "Assertion results for IPV6 multi to single \
871 point intent end point failure with no options set\n"
872 hostNames = [ 'h8', 'h17' ]
873 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
874 testResult = main.TRUE
875 testResult = main.intentFunction.testEndPointFail(
876 main,
877 name="NOOPTION",
878 test="MultipletoSingle",
879 hostNames=hostNames,
880 devices=devices,
881 sw1="s6",
882 sw2="s2",
883 sw3="s4",
884 sw4="s1",
885 sw5="s3",
886 expectedLink1=16,
887 expectedLink2=14 )
888 utilities.assert_equals( expect=main.TRUE,
889 actual=testResult,
890 onpass=main.assertReturnString,
891 onfail=main.assertReturnString )
892
893 main.step( "IPV6: test end point failure for multi point to single point intents" )
894 main.assertReturnString = "Assertion results for IPV6 multi to single \
895 point intent end point failure with IPV6 type and MAC addresses\n"
896 hostNames = [ 'h8', 'h9', 'h17' ]
897 devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700898 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 +0530899 testResult = main.TRUE
900 testResult = main.intentFunction.testEndPointFail(
901 main,
902 test="MultipletoSingle",
903 name="IPV6",
904 hostNames=hostNames,
905 devices=devices,
906 macs=macs,
907 ethType="IPV6",
908 sw1="s6",
909 sw2="s2",
910 sw3="s4",
911 sw4="s1",
912 sw5="s3",
913 expectedLink1=16,
914 expectedLink2=14 )
915 utilities.assert_equals( expect=main.TRUE,
916 actual=testResult,
917 onpass=main.assertReturnString,
918 onfail=main.assertReturnString )
919
920 main.step( "IPV6_2: test end point faliure for multi point to single point intents" )
921 main.assertReturnString = "Assertion results for IPV6 multi to single \
922 point intent end point failure with IPV6 type and no MAC addresses\n"
923 hostNames = [ 'h8', 'h17' ]
924 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
925 testResult = main.TRUE
926 testResult = main.intentFunction.testEndPointFail(
927 main,
928 test="MultipletoSingle",
929 name="IPV6_2",
930 hostNames=hostNames,
931 devices=devices,
932 ethType="IPV6",
933 sw1="s6",
934 sw2="s2",
935 sw3="s4",
936 sw4="s1",
937 sw5="s3",
938 expectedLink1=16,
939 expectedLink2=14 )
940
941 utilities.assert_equals( expect=main.TRUE,
942 actual=testResult,
943 onpass=main.assertReturnString,
944 onfail=main.assertReturnString )
945
946 main.step( "VLAN: test end point failure for multi point to single point intents" )
947 main.assertReturnString = "Assertion results for IPV6 multi to single \
948 point intent end point failure with IPV6 type and no MAC addresses in the same VLAN\n"
949 hostNames = [ 'h5', 'h24' ]
950 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700951 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
sathishmc4362252016-04-20 18:29:48 +0530952 testResult = main.TRUE
953 testResult = main.intentFunction.testEndPointFail(
954 main,
955 test="MultipletoSingle",
956 name="VLAN",
957 hostNames=hostNames,
958 devices=devices,
959 ethType="IPV6",
960 sw1="s6",
961 sw2="s2",
962 sw3="s4",
963 sw4="s1",
964 sw5="s3",
965 expectedLink1=16,
966 expectedLink2=14 )
967 utilities.assert_equals( expect=main.TRUE,
968 actual=testResult,
969 onpass=main.assertReturnString,
970 onfail=main.assertReturnString )
971
972 main.case( "Test Single to Multiple End Point Failure" )
973 main.step( "NOOPTION: test end point failure for single point to multi point intents" )
974 main.assertReturnString = "Assertion results for IPV6 single to multi \
975 point intent end point failure with no options set\n"
976 hostNames = [ 'h8', 'h17' ]
977 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
978 testResult = main.TRUE
979 testResult = main.intentFunction.testEndPointFail(
980 main,
981 test="SingletoMultiple",
982 name="NOOPTION",
983 hostNames=hostNames,
984 devices=devices,
985 sw1="s6",
986 sw2="s2",
987 sw3="s4",
988 sw4="s1",
989 sw5="s3",
990 expectedLink1=16,
991 expectedLink2=14 )
992 utilities.assert_equals( expect=main.TRUE,
993 actual=testResult,
994 onpass=main.assertReturnString,
995 onfail=main.assertReturnString )
996 main.step( "IPV6: test end point failure for single point to multi point intents" )
997 main.assertReturnString = "Assertion results for IPV6 single to multi \
998 point intent end point failure with IPV6 type and MAC addresses\n"
999 hostNames = [ 'h8', 'h9', 'h17' ]
1000 devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -07001001 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 +05301002 testResult = main.TRUE
1003 testResult = main.intentFunction.testEndPointFail(
1004 main,
1005 test="SingletoMultiple",
1006 name="IPV6",
1007 hostNames=hostNames,
1008 devices=devices,
1009 ethType="IPV6",
1010 macs=macs,
1011 sw1="s6",
1012 sw2="s2",
1013 sw3="s4",
1014 sw4="s1",
1015 sw5="s3",
1016 expectedLink1=16,
1017 expectedLink2=14 )
1018 utilities.assert_equals( expect=main.TRUE,
1019 actual=testResult,
1020 onpass=main.assertReturnString,
1021 onfail=main.assertReturnString )
1022
1023 main.step( "IPV6_2: test end point failure for single point to multi point intents" )
1024 main.assertReturnString = "Assertion results for IPV6 single to multi\
1025 point intent endpoint failure with IPV6 type and no MAC addresses\n"
1026 hostNames = [ 'h8', 'h17' ]
1027 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
1028 testResult = main.TRUE
1029 testResult = main.intentFunction.testEndPointFail(
1030 main,
1031 test="SingletoMultiple",
1032 name="IPV6_2",
1033 hostNames=hostNames,
1034 devices=devices,
1035 ethType="IPV6",
1036 sw1="s6",
1037 sw2="s2",
1038 sw3="s4",
1039 sw4="s1",
1040 sw5="s3",
1041 expectedLink1=16,
1042 expectedLink2=14 )
1043 utilities.assert_equals( expect=main.TRUE,
1044 actual=testResult,
1045 onpass=main.assertReturnString,
1046 onfail=main.assertReturnString )
1047
1048 main.step( "VLAN: test end point failure for single point to multi point intents" )
1049 main.assertReturnString = "Assertion results for IPV6 single to multi point\
1050 intent endpoint failure with IPV6 type and MAC addresses in the same VLAN\n"
1051 hostNames = [ 'h5', 'h24' ]
1052 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -07001053 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
sathishmc4362252016-04-20 18:29:48 +05301054 testResult = main.TRUE
1055 testResult = main.intentFunction.testEndPointFail(
1056 main,
1057 test="SingletoMultiple",
1058 name="IPV6",
1059 hostNames=hostNames,
1060 devices=devices,
1061 macs=macs,
1062 ethType="IPV6",
1063 sw1="s6",
1064 sw2="s2",
1065 sw3="s4",
1066 sw4="s1",
1067 sw5="s3",
1068 expectedLink1=16,
1069 expectedLink2=14 )
1070 utilities.assert_equals( expect=main.TRUE,
1071 actual=testResult,
1072 onpass=main.assertReturnString,
1073 onfail=main.assertReturnString )
1074
1075 main.intentFunction.report( main )