blob: 44884582465bf5878d037c8de160837da5e5477f [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,
80 main.Mininet1.home,
81 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
Devin Lim142b5342017-07-20 15:22:39 -0700101 main.initialized = main.testSetUp.ONOSSetUp( main.Mininet1, 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"
140 topoResult = main.Mininet1.startNet( topoFile=main.dependencyPath +
141 main.topology,
142 args=args )
143 stepResult = topoResult
144 utilities.assert_equals( expect=main.TRUE,
145 actual=stepResult,
146 onpass="Successfully loaded topology",
147 onfail="Failed to load topology" )
148 # Exit if topology did not load properly
149 if not topoResult:
Devin Lim44075962017-08-11 10:56:37 -0700150 main.cleanAndExit()
151 main.cleanAndExit()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800152
153 def CASE12( self, main ):
154 """
155 Assign mastership to controllers
156 """
157 import re
158
159 main.case( "Assign switches to controllers" )
160 main.step( "Assigning switches to controllers" )
161 main.caseExplanation = "Assign OF " + main.OFProtocol +\
162 " switches to ONOS nodes"
163
164 assignResult = main.TRUE
165 switchList = []
166
167 # Creates a list switch name, use getSwitch() function later...
168 for i in range( 1, ( main.numSwitch + 1 ) ):
169 switchList.append( 's' + str( i ) )
170
171 tempONOSip = []
Devin Lim142b5342017-07-20 15:22:39 -0700172 for ctrl in main.Cluster.active():
173 tempONOSip.append( ctrl.ipAddress )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800174
175 assignResult = main.Mininet1.assignSwController( sw=switchList,
176 ip=tempONOSip,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530177 port='6633' )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800178 if not assignResult:
Devin Lim44075962017-08-11 10:56:37 -0700179 main.cleanAndExit()
180 main.cleanAndExit()
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800181
182 for i in range( 1, ( main.numSwitch + 1 ) ):
183 response = main.Mininet1.getSwController( "s" + str( i ) )
184 print( "Response is " + str( response ) )
Devin Lim142b5342017-07-20 15:22:39 -0700185 if re.search( "tcp:" + main.Cluster.active( 0 ).ipAddress, response ):
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800186 assignResult = assignResult and main.TRUE
187 else:
188 assignResult = main.FALSE
189 stepResult = assignResult
190 utilities.assert_equals( expect=main.TRUE,
191 actual=stepResult,
192 onpass="Successfully assigned switches" +
193 "to controller",
194 onfail="Failed to assign switches to " +
195 "controller" )
196
sathishmad953462015-12-03 17:42:07 +0530197 def CASE13( self, main ):
198 """
199 Discover all hosts and store its data to a dictionary
200 """
201 main.case( "Discover all hosts" )
202
sathishmad953462015-12-03 17:42:07 +0530203 main.step( "Discover all hosts using pingall " )
204 stepResult = main.intentFunction.getHostsData( main )
205 utilities.assert_equals( expect=main.TRUE,
Jon Hall314b74a2017-05-24 16:25:52 -0700206 actual=stepResult,
207 onpass="Successfully discovered hosts",
208 onfail="Failed to discover hosts" )
sathishmad953462015-12-03 17:42:07 +0530209
sathishmc4362252016-04-20 18:29:48 +0530210 def CASE16( self, main ):
211 """
212 Balance Masters
213 """
214 main.case( "Balance mastership of switches" )
215 main.step( "Balancing mastership of switches" )
216
217 balanceResult = main.FALSE
Devin Lim142b5342017-07-20 15:22:39 -0700218 balanceResult = utilities.retry( f=main.Cluster.active( 0 ).CLI.balanceMasters, retValue=main.FALSE, args=[] )
sathishmc4362252016-04-20 18:29:48 +0530219
220 utilities.assert_equals( expect=main.TRUE,
221 actual=balanceResult,
222 onpass="Successfully balanced mastership of switches",
223 onfail="Failed to balance mastership of switches" )
224
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800225 def CASE14( self, main ):
226 """
227 Stop mininet
228 """
Devin Lim58046fa2017-07-05 16:55:00 -0700229 try:
230 from tests.dependencies.utils import Utils
231 except ImportError:
232 main.log.error( "Utils not found exiting the test" )
Devin Lim44075962017-08-11 10:56:37 -0700233 main.cleanAndExit()
Devin Lim58046fa2017-07-05 16:55:00 -0700234 try:
235 main.Utils
236 except ( NameError, AttributeError ):
237 main.Utils = Utils()
238 main.Utils.mininetCleanIntro()
239 topoResult = main.Utils.mininetCleanup( main.Mininet1 )
Subhash Kumar Singhc73b3a72015-11-03 21:34:04 -0800240 # Exit if topology did not load properly
241 if not topoResult:
Devin Lim44075962017-08-11 10:56:37 -0700242 main.cleanAndExit()
243 main.cleanAndExit()
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530244
sathishmc4362252016-04-20 18:29:48 +0530245 def CASE1000( self, main ):
246 """
247 Add host intents between 2 host:
248 - Discover hosts
249 - Add host intents
250 - Check intents
251 - Verify flows
252 - Ping hosts
253 - Reroute
254 - Link down
255 - Verify flows
256 - Check topology
257 - Ping hosts
258 - Link up
259 - Verify flows
260 - Check topology
261 - Ping hosts
262 - Remove intents
263 """
264 import time
265 import json
266 import re
267
268 # Assert variables - These variable's name|format must be followed
269 # if you want to use the wrapper function
270 assert main, "There is no main"
sathishmc4362252016-04-20 18:29:48 +0530271 assert main.Mininet1, "Mininet handle should be named Mininet1"
272 assert main.numSwitch, "Placed the total number of switch topology in \
273 main.numSwitch"
274
Devin Lim142b5342017-07-20 15:22:39 -0700275 intentLeadersOld = main.Cluster.active( 0 ).CLI.leaderCandidates()
sathishmc4362252016-04-20 18:29:48 +0530276
277 main.testName = "Host Intents"
Devin Lim142b5342017-07-20 15:22:39 -0700278 main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) +
sathishmc4362252016-04-20 18:29:48 +0530279 " NODE(S) - OF " + main.OFProtocol )
280 main.caseExplanation = "This test case tests Host intents using " +\
Devin Lim142b5342017-07-20 15:22:39 -0700281 str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\
sathishmc4362252016-04-20 18:29:48 +0530282 "Different type of hosts will be tested in " +\
283 "each step such as IPV6, Dual stack, VLAN " +\
284 "etc;\nThe test will use OF " + main.OFProtocol\
285 + " OVS running in Mininet"
286
287 main.step( "IPV6: Add host intents between h1 and h9" )
288 stepResult = main.TRUE
289 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700290 name='IPV6',
291 host1='h1',
292 host2='h9',
293 host1Id='00:00:00:00:00:01/-1',
294 host2Id='00:00:00:00:00:09/-1',
295 sw1='s5',
296 sw2='s2',
297 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530298
299 utilities.assert_equals( expect=main.TRUE,
300 actual=stepResult,
301 onpass="IPV6: Host intent test successful " +
302 "between two IPV6 hosts",
303 onfail="IPV6: Host intent test failed " +
Jon Hall314b74a2017-05-24 16:25:52 -0700304 "between two IPV6 hosts" )
sathishmc4362252016-04-20 18:29:48 +0530305
306 main.step( "DUALSTACK1: Add host intents between h3 and h11" )
307 stepResult = main.TRUE
308 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700309 name='DUALSTACK',
310 host1='h3',
311 host2='h11',
312 host1Id='00:00:00:00:00:03/-1',
313 host2Id='00:00:00:00:00:0B/-1',
314 sw1='s5',
315 sw2='s2',
316 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530317
318 utilities.assert_equals( expect=main.TRUE,
319 actual=stepResult,
320 onpass="DUALSTACK: Host intent test " +
321 "successful between two " +
322 "dual stack host using IPV6",
323 onfail="DUALSTACK: Host intent test " +
324 "failed between two" +
325 "dual stack host using IPV6" )
326
327 main.step( "1HOP: Add host intents between h1 and h3" )
328 stepResult = main.TRUE
329 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700330 name='1HOP',
331 host1='h1',
332 host2='h9',
333 host1Id='00:00:00:00:00:01/-1',
334 host2Id='00:00:00:00:00:09/-1' )
sathishmc4362252016-04-20 18:29:48 +0530335
336 utilities.assert_equals( expect=main.TRUE,
337 actual=stepResult,
338 onpass="1HOP: Host intent test " +
339 "successful between two " +
340 "host using IPV6 in the same switch",
341 onfail="1HOP: Host intent test " +
342 "failed between two" +
343 "host using IPV6 in the same switch" )
344
345 main.step( "VLAN: Add vlan host intents between h5 and h24" )
346 stepResult = main.TRUE
347 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700348 name='VLAN1',
349 host1='h5',
350 host2='h24',
351 host1Id='00:00:00:00:00:05/100',
352 host2Id='00:00:00:00:00:18/100',
353 sw1='s5',
354 sw2='s2',
355 expectedLink=18 )
sathishmc4362252016-04-20 18:29:48 +0530356
357 utilities.assert_equals( expect=main.TRUE,
358 actual=stepResult,
359 onpass="VLAN: Host intent test " +
360 "successful between two " +
361 "host using IPV6 in the same VLAN",
362 onfail="VLAN1: Host intent test " +
363 "failed between two" +
364 "host using IPV6 in the same VLAN" )
365
366 main.intentFunction.report( main )
367
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530368 def CASE2000( self, main ):
369 """
370 add point intents between 2 hosts:
371 - Get device ids | ports
372 - Add point intents
373 - Check intents
374 - Verify flows
375 - Ping hosts
376 - Reroute
377 - Link down
378 - Verify flows
379 - Check topology
380 - Ping hosts
381 - Link up
382 - Verify flows
383 - Check topology
384 - Ping hosts
385 - Remove intents
386 """
387 import time
388 import json
389 import re
390
391 # Assert variables - These variable's name|format must be followed
392 # if you want to use the wrapper function
393 assert main, "There is no main"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530394 assert main.Mininet1, "Mininet handle should be named Mininet1"
395 assert main.numSwitch, "Placed the total number of switch topology in \
396 main.numSwitch"
397
398 main.testName = "Point Intents"
Devin Lim142b5342017-07-20 15:22:39 -0700399 main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) +
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530400 " NODE(S) - OF " + main.OFProtocol )
401 main.caseExplanation = "This test case will test point to point" +\
Devin Lim142b5342017-07-20 15:22:39 -0700402 " intents using " + str( main.Cluster.numCtrls ) +\
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530403 " node(s) cluster;\n" +\
404 "Different type of hosts will be tested in " +\
Jon Hall439c8912016-04-15 02:22:03 -0700405 "each step such as IPV6, Dual stack, VLAN etc" +\
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530406 ";\nThe test will use OF " + main.OFProtocol +\
407 " OVS running in Mininet"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530408 # No option point intents
409 main.step( "NOOPTION: Add point intents between h1 and h9, ipv6 hosts" )
410 main.assertReturnString = "Assertion Result for NOOPTION point intent\n"
411 stepResult = main.TRUE
412 stepResult = main.intentFunction.pointIntent(
413 main,
414 name="NOOPTION",
415 host1="h1",
416 host2="h9",
417 deviceId1="of:0000000000000005/1",
Jon Hall314b74a2017-05-24 16:25:52 -0700418 deviceId2="of:0000000000000006/1" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530419
420 utilities.assert_equals( expect=main.TRUE,
421 actual=stepResult,
422 onpass=main.assertReturnString,
423 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530424 stepResult = main.TRUE
425 main.step( "IPV6: Add point intents between h1 and h9" )
426 main.assertReturnString = "Assertion Result for IPV6 point intent\n"
427 stepResult = main.intentFunction.pointIntent(
428 main,
429 name="IPV6",
430 host1="h1",
431 host2="h9",
432 deviceId1="of:0000000000000005/1",
433 deviceId2="of:0000000000000006/1",
434 port1="",
435 port2="",
436 ethType="IPV6",
437 mac1="00:00:00:00:00:01",
438 mac2="00:00:00:00:00:09",
439 bandwidth="",
440 lambdaAlloc=False,
441 ipProto="",
442 ip1="",
443 ip2="",
444 tcp1="",
445 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700446 sw1="s5",
447 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530448 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530449 utilities.assert_equals( expect=main.TRUE,
450 actual=stepResult,
451 onpass=main.assertReturnString,
452 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530453 main.step( "IPV6_2: Add point intents between h1 and h9" )
454 main.assertReturnString = "Assertion Result for IPV6 no mac address point intents\n"
455 stepResult = main.intentFunction.pointIntent(
456 main,
457 name="IPV6_2",
458 host1="h1",
459 host2="h9",
460 deviceId1="of:0000000000000005/1",
461 deviceId2="of:0000000000000006/1",
462 ipProto="",
463 ip1="",
464 ip2="",
465 tcp1="",
466 tcp2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700467 expectedLink="" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530468 utilities.assert_equals( expect=main.TRUE,
469 actual=stepResult,
470 onpass=main.assertReturnString,
471 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530472 main.step( "SDNIP-ICMP: Add point intents between h1 and h9" )
sathishmad953462015-12-03 17:42:07 +0530473 main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV6 using ICMP point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530474 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
475 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700476 main.log.debug( mac2 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530477 ipProto = main.params[ 'SDNIP' ][ 'icmpProto' ]
sathishmad953462015-12-03 17:42:07 +0530478 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
479 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530480 stepResult = main.intentFunction.pointIntent(
481 main,
482 name="SDNIP-ICMP",
483 host1="h1",
484 host2="h9",
485 deviceId1="of:0000000000000005/1",
486 deviceId2="of:0000000000000006/1",
487 mac1=mac1,
488 mac2=mac2,
489 ethType="IPV6",
490 ipProto=ipProto,
491 ip1=ip1,
492 ip2=ip2 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530493 utilities.assert_equals( expect=main.TRUE,
494 actual=stepResult,
495 onpass=main.assertReturnString,
496 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530497 main.step( "SDNIP-TCP: Add point intents between h1 and h9" )
sathishmad953462015-12-03 17:42:07 +0530498 main.assertReturnString = "Assertion Result for SDNIP-TCP IPV6 using TCP point intents\n"
Jon Hall439c8912016-04-15 02:22:03 -0700499 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
500 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
501 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/128"
502 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/128"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530503 ipProto = main.params[ 'SDNIP' ][ 'tcpProto' ]
504 tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
505 tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530506 stepResult = main.intentFunction.pointIntentTcp(
507 main,
508 name="SDNIP-TCP",
Jon Hall439c8912016-04-15 02:22:03 -0700509 host1="h1",
510 host2="h9",
511 deviceId1="of:0000000000000005/1",
512 deviceId2="of:0000000000000006/1",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530513 mac1=mac1,
514 mac2=mac2,
Jon Hall439c8912016-04-15 02:22:03 -0700515 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530516 ipProto=ipProto,
517 ip1=ip1,
518 ip2=ip2,
519 tcp1=tcp1,
Jon Hall439c8912016-04-15 02:22:03 -0700520 tcp2=tcp2,
521 sw1="",
522 sw2="",
523 expectedLink="" )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530524 utilities.assert_equals( expect=main.TRUE,
sathishmad953462015-12-03 17:42:07 +0530525 actual=stepResult,
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530526 onpass=main.assertReturnString,
527 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530528 main.step( "DUALSTACK1: Add point intents between h3 and h11" )
sathishmad953462015-12-03 17:42:07 +0530529 main.assertReturnString = "Assertion Result for Dualstack1 IPV6 with mac address point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530530 stepResult = main.intentFunction.pointIntent(
531 main,
532 name="DUALSTACK1",
533 host1="h3",
534 host2="h11",
sathishmad953462015-12-03 17:42:07 +0530535 deviceId1="of:0000000000000005/3",
536 deviceId2="of:0000000000000006/3",
537 port1="",
538 port2="",
539 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530540 mac1="00:00:00:00:00:03",
541 mac2="00:00:00:00:00:0B",
542 bandwidth="",
543 lambdaAlloc=False,
544 ipProto="",
545 ip1="",
546 ip2="",
547 tcp1="",
548 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700549 sw1="s5",
550 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530551 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530552 utilities.assert_equals( expect=main.TRUE,
553 actual=stepResult,
554 onpass=main.assertReturnString,
555 onfail=main.assertReturnString )
sathishmad953462015-12-03 17:42:07 +0530556 main.step( "VLAN: Add point intents between h5 and h24" )
557 main.assertReturnString = "Assertion Result for VLAN IPV6 with mac address point intents\n"
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530558 stepResult = main.intentFunction.pointIntent(
559 main,
560 name="VLAN",
561 host1="h5",
sathishmad953462015-12-03 17:42:07 +0530562 host2="h24",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530563 deviceId1="of:0000000000000005/5",
sathishmad953462015-12-03 17:42:07 +0530564 deviceId2="of:0000000000000007/8",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530565 port1="",
566 port2="",
sathishmad953462015-12-03 17:42:07 +0530567 ethType="IPV6",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530568 mac1="00:00:00:00:00:05",
sathishmad953462015-12-03 17:42:07 +0530569 mac2="00:00:00:00:00:18",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530570 bandwidth="",
571 lambdaAlloc=False,
572 ipProto="",
573 ip1="",
574 ip2="",
575 tcp1="",
576 tcp2="",
Jon Hall439c8912016-04-15 02:22:03 -0700577 sw1="s5",
578 sw2="s2",
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530579 expectedLink=18 )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530580 utilities.assert_equals( expect=main.TRUE,
581 actual=stepResult,
582 onpass=main.assertReturnString,
583 onfail=main.assertReturnString )
sathishmad953462015-12-03 17:42:07 +0530584 main.step( "1HOP: Add point intents between h1 and h9" )
585 main.assertReturnString = "Assertion Result for 1HOP IPV6 with no mac address point intents\n"
sathishmc4362252016-04-20 18:29:48 +0530586 stepResult = main.intentFunction.pointIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700587 name='1HOP',
588 host1="h1",
589 host2="h9",
590 deviceId1="of:0000000000000005/1",
591 deviceId2="of:0000000000000006/1" )
Jon Hall439c8912016-04-15 02:22:03 -0700592 utilities.assert_equals( expect=main.TRUE,
593 actual=stepResult,
594 onpass=main.assertReturnString,
595 onfail=main.assertReturnString )
596 main.intentFunction.report( main )
597
598 def CASE3000( self, main ):
599 """
600 Add single point to multi point intents
601 - Get device ids
602 - Add single point to multi point intents
603 - Check intents
604 - Verify flows
605 - Ping hosts
606 - Reroute
607 - Link down
608 - Verify flows
609 - Check topology
610 - Ping hosts
611 - Link up
612 - Verify flows
613 - Check topology
614 - Ping hosts
615 - Remove intents
616 """
617 import time
618 import json
619 import re
620 assert main, "There is no main"
Jon Hall439c8912016-04-15 02:22:03 -0700621 assert main.Mininet1, "Mininet handle should be named Mininet1"
622 assert main.numSwitch, "Placed the total number of switch topology in \
623 main.numSwitch"
624 main.testName = "Single to Multi Point Intents"
Devin Lim142b5342017-07-20 15:22:39 -0700625 main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
Jon Hall439c8912016-04-15 02:22:03 -0700626 main.caseExplanation = "This test case will test single point to" +\
627 " multi point intents using " +\
Devin Lim142b5342017-07-20 15:22:39 -0700628 str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\
Jon Hall439c8912016-04-15 02:22:03 -0700629 "Different type of hosts will be tested in " +\
630 "each step such as IPV6, Dual stack, VLAN etc" +\
631 ";\nThe test will use OF " + main.OFProtocol +\
632 " OVS running in Mininet "
633 main.step( "NOOPTION: Add single point to multi point intents" )
634 hostNames = [ 'h1', 'h9', 'h17' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700635 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall439c8912016-04-15 02:22:03 -0700636 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with no options set\n"
637 stepResult = main.TRUE
638 stepResult = main.intentFunction.singleToMultiIntent(
639 main,
640 name="NOOPTION",
641 hostNames=hostNames,
642 devices=devices,
643 sw1="s5",
644 sw2="s2",
Jon Hall314b74a2017-05-24 16:25:52 -0700645 expectedLink=18 )
Jon Hall439c8912016-04-15 02:22:03 -0700646 utilities.assert_equals( expect=main.TRUE,
647 actual=stepResult,
648 onpass=main.assertReturnString,
649 onfail=main.assertReturnString )
650 main.step( "IPV6: Add single point to multi point intents" )
651 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses\n"
652 hostNames = [ 'h1', 'h9', 'h17' ]
653 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700654 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 -0700655 stepResult = main.TRUE
656 stepResult = main.intentFunction.singleToMultiIntent(
657 main,
658 name="IPV6",
659 hostNames=hostNames,
660 devices=devices,
661 macs=macs,
662 ethType="IPV6",
663 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700664 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700665 utilities.assert_equals( expect=main.TRUE,
666 actual=stepResult,
667 onpass=main.assertReturnString,
668 onfail=main.assertReturnString )
669 main.step( "IPV6_2: Add single point to multi point intents" )
670 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and no MAC addresses\n"
671 hostNames = [ 'h1', 'h9', 'h17' ]
672 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
673 stepResult = main.TRUE
674 stepResult = main.intentFunction.singleToMultiIntent(
675 main,
676 name="IPV6_2",
677 hostNames=hostNames,
678 devices=devices,
679 ethType="IPV6",
680 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700681 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700682 utilities.assert_equals( expect=main.TRUE,
683 actual=stepResult,
684 onpass=main.assertReturnString,
685 onfail=main.assertReturnString )
686 main.step( "VLAN: Add single point to multi point intents" )
687 main.assertReturnString = "Assertion results for IPV6 single to multi point intent with IPV6 type and MAC addresses in the same VLAN\n"
688 hostNames = [ 'h5', 'h24' ]
689 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700690 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
Jon Hall439c8912016-04-15 02:22:03 -0700691 stepResult = main.TRUE
692 stepResult = main.intentFunction.singleToMultiIntent(
693 main,
694 name="IPV6",
695 hostNames=hostNames,
696 devices=devices,
697 macs=macs,
698 ethType="IPV6",
699 sw1="",
Jon Hall314b74a2017-05-24 16:25:52 -0700700 sw2="" )
Jon Hall439c8912016-04-15 02:22:03 -0700701 utilities.assert_equals( expect=main.TRUE,
702 actual=stepResult,
703 onpass=main.assertReturnString,
704 onfail=main.assertReturnString )
705 main.intentFunction.report( main )
Jon Hall314b74a2017-05-24 16:25:52 -0700706
Jon Hall439c8912016-04-15 02:22:03 -0700707 def CASE4000( self, main ):
708 """
709 Add multi point to single point intents
710 - Get device ids
711 - Add multi point to single point intents
712 - Check intents
713 - Verify flows
714 - Ping hosts
715 - Reroute
716 - Link down
717 - Verify flows
718 - Check topology
719 - Ping hosts
720 - Link up
721 - Verify flows
722 - Check topology
723 - Ping hosts
724 - Remove intents
725 """
726 assert main, "There is no main"
Jon Hall439c8912016-04-15 02:22:03 -0700727 assert main.Mininet1, "Mininet handle should be named Mininet1"
728 assert main.numSwitch, "Placed the total number of switch topology in \
729 main.numSwitch"
730
731 main.testName = "Multi To Single Point Intents"
Devin Lim142b5342017-07-20 15:22:39 -0700732 main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) +
Jon Hall439c8912016-04-15 02:22:03 -0700733 " NODE(S) - OF " + main.OFProtocol )
734 main.caseExplanation = "This test case will test single point to" +\
735 " multi point intents using " +\
Devin Lim142b5342017-07-20 15:22:39 -0700736 str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\
Jon Hall439c8912016-04-15 02:22:03 -0700737 "Different type of hosts will be tested in " +\
738 "each step such as IPV6, Dual stack, VLAN etc" +\
739 ";\nThe test will use OF " + main.OFProtocol +\
740 " OVS running in Mininet"
741
742 main.step( "NOOPTION: Add multi point to single point intents" )
743 main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
744 stepResult = main.TRUE
745 hostNames = [ 'h17', 'h9' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700746 devices = [ 'of:0000000000000007/1', 'of:0000000000000006/1' ]
Jon Hall439c8912016-04-15 02:22:03 -0700747 stepResult = main.intentFunction.multiToSingleIntent(
748 main,
749 name="NOOPTION",
750 hostNames=hostNames,
751 devices=devices,
752 sw1="s6",
753 sw2="s2",
754 expectedLink=18 )
755 utilities.assert_equals( expect=main.TRUE,
756 actual=stepResult,
757 onpass=main.assertReturnString,
758 onfail=main.assertReturnString )
759 main.step( "IPV6: Add multi point to single point intents" )
760 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and MAC addresses\n"
761 hostNames = [ 'h1', 'h9', 'h17' ]
762 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700763 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 -0700764 stepResult = main.TRUE
765 installResult = main.intentFunction.multiToSingleIntent(
766 main,
767 name="IPV6",
768 hostNames=hostNames,
769 devices=devices,
770 macs=macs,
771 ethType="IPV6",
772 sw1="",
773 sw2="",
774 expectedLink="" )
775 utilities.assert_equals( expect=main.TRUE,
776 actual=stepResult,
777 onpass=main.assertReturnString,
778 onfail=main.assertReturnString )
779 main.step( "IPV6_2: Add multi point to single point intents" )
780 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses\n"
781 hostNames = [ 'h1', 'h9' ]
782 devices = [ 'of:0000000000000005/1', 'of:0000000000000006/1' ]
783 stepResult = main.TRUE
784 stepResult = main.intentFunction.multiToSingleIntent(
785 main,
786 name="IPV6_2",
787 hostNames=hostNames,
788 devices=devices,
789 ethType="IPV6",
790 sw1="",
791 sw2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700792 expectedLink="" )
Jon Hall439c8912016-04-15 02:22:03 -0700793 utilities.assert_equals( expect=main.TRUE,
794 actual=stepResult,
795 onpass=main.assertReturnString,
796 onfail=main.assertReturnString )
797
798 main.step( "VLAN: Add multi point to single point intents" )
799 main.assertReturnString = "Assertion results for IPV6 multi to single point intent with IPV6 type and no MAC addresses in the same VLAN\n"
800 hostNames = [ 'h5', 'h24' ]
801 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700802 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
Jon Hall439c8912016-04-15 02:22:03 -0700803 stepResult = main.TRUE
804 stepResult = main.intentFunction.multiToSingleIntent(
805 main,
806 name="VLAN",
807 hostNames=hostNames,
808 devices=devices,
809 macs=macs,
810 ethType="IPV6",
811 sw1="",
812 sw2="",
Jon Hall314b74a2017-05-24 16:25:52 -0700813 expectedLink="" )
Jon Hall439c8912016-04-15 02:22:03 -0700814 utilities.assert_equals( expect=main.TRUE,
815 actual=stepResult,
816 onpass=main.assertReturnString,
817 onfail=main.assertReturnString )
818 main.intentFunction.report( main )
819
820 def CASE5000( self, main ):
821 """
822 Tests Host Mobility
823 Modifies the topology location of h1
824 """
825 assert main, "There is no main"
Jon Hall439c8912016-04-15 02:22:03 -0700826 assert main.Mininet1, "Mininet handle should be named Mininet1"
827 assert main.numSwitch, "Placed the total number of switch topology in \
828 main.numSwitch"
829 main.case( "Test host mobility with host intents " )
830 main.step( "Testing host mobility by moving h1 from s5 to s6" )
831 h1PreMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
832
Jon Hall314b74a2017-05-24 16:25:52 -0700833 main.log.info( "Moving h1 from s5 to s6" )
834 main.Mininet1.moveHostv6( "h1", "s5", "s6" )
Jon Hall439c8912016-04-15 02:22:03 -0700835 main.intentFunction.getHostsData( main )
836 h1PostMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
837
838 utilities.assert_equals( expect="of:0000000000000006",
839 actual=h1PostMove,
840 onpass="Mobility: Successfully moved h1 to s6",
841 onfail="Mobility: Failed to move h1 to s6" +
842 " to single point intents" +
843 " with IPV6 type and MAC addresses" +
844 " in the same VLAN" )
845 main.step( "IPV6: Add host intents between h1 and h9" )
846 main.assertReturnString = "Assert result for IPV6 host intent between h1, moved, and h9\n"
847 stepResult = main.TRUE
848 stepResult = main.intentFunction.hostIntent( main,
Jon Hall314b74a2017-05-24 16:25:52 -0700849 name='IPV6 Mobility IPV6',
850 host1='h1',
851 host2='h9',
852 host1Id='00:00:00:00:00:01/-1',
853 host2Id='00:00:00:00:00:09/-1' )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530854
855 utilities.assert_equals( expect=main.TRUE,
856 actual=stepResult,
857 onpass=main.assertReturnString,
858 onfail=main.assertReturnString )
Subhash Kumar Singh5ea4d302015-11-05 14:36:52 +0530859 main.intentFunction.report( main )
sathishmc4362252016-04-20 18:29:48 +0530860
861 def CASE6000( self, main ):
862 """
863 Tests Multi to Single Point Intent and Single to Multi Point Intent End Point Failure
864 """
865 assert main, "There is no main"
sathishmc4362252016-04-20 18:29:48 +0530866 assert main.Mininet1, "Mininet handle should be named Mininet1"
867 assert main.numSwitch, "Placed the total number of switch topology in \
868 main.numSwitch"
869 main.case( "Test Multi to Single End Point Failure" )
870 main.step( "NOOPTION: test end point failure for multi point to single point intents" )
871 main.assertReturnString = "Assertion results for IPV6 multi to single \
872 point intent end point failure with no options set\n"
873 hostNames = [ 'h8', 'h17' ]
874 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
875 testResult = main.TRUE
876 testResult = main.intentFunction.testEndPointFail(
877 main,
878 name="NOOPTION",
879 test="MultipletoSingle",
880 hostNames=hostNames,
881 devices=devices,
882 sw1="s6",
883 sw2="s2",
884 sw3="s4",
885 sw4="s1",
886 sw5="s3",
887 expectedLink1=16,
888 expectedLink2=14 )
889 utilities.assert_equals( expect=main.TRUE,
890 actual=testResult,
891 onpass=main.assertReturnString,
892 onfail=main.assertReturnString )
893
894 main.step( "IPV6: test end point failure for multi point to single point intents" )
895 main.assertReturnString = "Assertion results for IPV6 multi to single \
896 point intent end point failure with IPV6 type and MAC addresses\n"
897 hostNames = [ 'h8', 'h9', 'h17' ]
898 devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700899 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 +0530900 testResult = main.TRUE
901 testResult = main.intentFunction.testEndPointFail(
902 main,
903 test="MultipletoSingle",
904 name="IPV6",
905 hostNames=hostNames,
906 devices=devices,
907 macs=macs,
908 ethType="IPV6",
909 sw1="s6",
910 sw2="s2",
911 sw3="s4",
912 sw4="s1",
913 sw5="s3",
914 expectedLink1=16,
915 expectedLink2=14 )
916 utilities.assert_equals( expect=main.TRUE,
917 actual=testResult,
918 onpass=main.assertReturnString,
919 onfail=main.assertReturnString )
920
921 main.step( "IPV6_2: test end point faliure for multi point to single point intents" )
922 main.assertReturnString = "Assertion results for IPV6 multi to single \
923 point intent end point failure with IPV6 type and no MAC addresses\n"
924 hostNames = [ 'h8', 'h17' ]
925 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
926 testResult = main.TRUE
927 testResult = main.intentFunction.testEndPointFail(
928 main,
929 test="MultipletoSingle",
930 name="IPV6_2",
931 hostNames=hostNames,
932 devices=devices,
933 ethType="IPV6",
934 sw1="s6",
935 sw2="s2",
936 sw3="s4",
937 sw4="s1",
938 sw5="s3",
939 expectedLink1=16,
940 expectedLink2=14 )
941
942 utilities.assert_equals( expect=main.TRUE,
943 actual=testResult,
944 onpass=main.assertReturnString,
945 onfail=main.assertReturnString )
946
947 main.step( "VLAN: test end point failure for multi point to single point intents" )
948 main.assertReturnString = "Assertion results for IPV6 multi to single \
949 point intent end point failure with IPV6 type and no MAC addresses in the same VLAN\n"
950 hostNames = [ 'h5', 'h24' ]
951 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -0700952 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
sathishmc4362252016-04-20 18:29:48 +0530953 testResult = main.TRUE
954 testResult = main.intentFunction.testEndPointFail(
955 main,
956 test="MultipletoSingle",
957 name="VLAN",
958 hostNames=hostNames,
959 devices=devices,
960 ethType="IPV6",
961 sw1="s6",
962 sw2="s2",
963 sw3="s4",
964 sw4="s1",
965 sw5="s3",
966 expectedLink1=16,
967 expectedLink2=14 )
968 utilities.assert_equals( expect=main.TRUE,
969 actual=testResult,
970 onpass=main.assertReturnString,
971 onfail=main.assertReturnString )
972
973 main.case( "Test Single to Multiple End Point Failure" )
974 main.step( "NOOPTION: test end point failure for single point to multi point intents" )
975 main.assertReturnString = "Assertion results for IPV6 single to multi \
976 point intent end point failure with no options set\n"
977 hostNames = [ 'h8', 'h17' ]
978 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
979 testResult = main.TRUE
980 testResult = main.intentFunction.testEndPointFail(
981 main,
982 test="SingletoMultiple",
983 name="NOOPTION",
984 hostNames=hostNames,
985 devices=devices,
986 sw1="s6",
987 sw2="s2",
988 sw3="s4",
989 sw4="s1",
990 sw5="s3",
991 expectedLink1=16,
992 expectedLink2=14 )
993 utilities.assert_equals( expect=main.TRUE,
994 actual=testResult,
995 onpass=main.assertReturnString,
996 onfail=main.assertReturnString )
997 main.step( "IPV6: test end point failure for single point to multi point intents" )
998 main.assertReturnString = "Assertion results for IPV6 single to multi \
999 point intent end point failure with IPV6 type and MAC addresses\n"
1000 hostNames = [ 'h8', 'h9', 'h17' ]
1001 devices = [ 'of:0000000000000005/8', 'of:0000000000000006/1', 'of:0000000000000007/1' ]
Jon Hall314b74a2017-05-24 16:25:52 -07001002 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 +05301003 testResult = main.TRUE
1004 testResult = main.intentFunction.testEndPointFail(
1005 main,
1006 test="SingletoMultiple",
1007 name="IPV6",
1008 hostNames=hostNames,
1009 devices=devices,
1010 ethType="IPV6",
1011 macs=macs,
1012 sw1="s6",
1013 sw2="s2",
1014 sw3="s4",
1015 sw4="s1",
1016 sw5="s3",
1017 expectedLink1=16,
1018 expectedLink2=14 )
1019 utilities.assert_equals( expect=main.TRUE,
1020 actual=testResult,
1021 onpass=main.assertReturnString,
1022 onfail=main.assertReturnString )
1023
1024 main.step( "IPV6_2: test end point failure for single point to multi point intents" )
1025 main.assertReturnString = "Assertion results for IPV6 single to multi\
1026 point intent endpoint failure with IPV6 type and no MAC addresses\n"
1027 hostNames = [ 'h8', 'h17' ]
1028 devices = [ 'of:0000000000000005/8', 'of:0000000000000007/1' ]
1029 testResult = main.TRUE
1030 testResult = main.intentFunction.testEndPointFail(
1031 main,
1032 test="SingletoMultiple",
1033 name="IPV6_2",
1034 hostNames=hostNames,
1035 devices=devices,
1036 ethType="IPV6",
1037 sw1="s6",
1038 sw2="s2",
1039 sw3="s4",
1040 sw4="s1",
1041 sw5="s3",
1042 expectedLink1=16,
1043 expectedLink2=14 )
1044 utilities.assert_equals( expect=main.TRUE,
1045 actual=testResult,
1046 onpass=main.assertReturnString,
1047 onfail=main.assertReturnString )
1048
1049 main.step( "VLAN: test end point failure for single point to multi point intents" )
1050 main.assertReturnString = "Assertion results for IPV6 single to multi point\
1051 intent endpoint failure with IPV6 type and MAC addresses in the same VLAN\n"
1052 hostNames = [ 'h5', 'h24' ]
1053 devices = [ 'of:0000000000000005/5', 'of:0000000000000007/8' ]
Jon Hall314b74a2017-05-24 16:25:52 -07001054 macs = [ '00:00:00:00:00:05', '00:00:00:00:00:18' ]
sathishmc4362252016-04-20 18:29:48 +05301055 testResult = main.TRUE
1056 testResult = main.intentFunction.testEndPointFail(
1057 main,
1058 test="SingletoMultiple",
1059 name="IPV6",
1060 hostNames=hostNames,
1061 devices=devices,
1062 macs=macs,
1063 ethType="IPV6",
1064 sw1="s6",
1065 sw2="s2",
1066 sw3="s4",
1067 sw4="s1",
1068 sw5="s3",
1069 expectedLink1=16,
1070 expectedLink2=14 )
1071 utilities.assert_equals( expect=main.TRUE,
1072 actual=testResult,
1073 onpass=main.assertReturnString,
1074 onfail=main.assertReturnString )
1075
1076 main.intentFunction.report( main )