blob: 074b472d8e67d802d1c075809810283b07f9d7f0 [file] [log] [blame]
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001# Testing the basic intent functionality of ONOS
2
kelvin-onlabd48a68c2015-07-13 16:01:36 -07003class FUNCintent:
4
5 def __init__( self ):
6 self.default = ''
7
8 def CASE1( self, main ):
kelvin-onlabd48a68c2015-07-13 16:01:36 -07009 import imp
Jon Hallf632d202015-07-30 15:45:11 -070010 import re
kelvin-onlabd48a68c2015-07-13 16:01:36 -070011
12 """
13 - Construct tests variables
14 - GIT ( optional )
15 - Checkout ONOS master branch
16 - Pull latest ONOS code
17 - Building ONOS ( optional )
18 - Install ONOS package
19 - Build ONOS package
20 """
21
22 main.case( "Constructing test variables and building ONOS package" )
23 main.step( "Constructing test variables" )
Jon Hall783bbf92015-07-23 14:33:19 -070024 main.caseExplanation = "This test case is mainly for loading " +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -070025 "from params file, and pull and build the " +\
26 " latest ONOS package"
kelvin-onlabd48a68c2015-07-13 16:01:36 -070027 stepResult = main.FALSE
28
29 # Test variables
Jon Halla3e02432015-07-24 15:55:42 -070030 try:
Jon Hallf632d202015-07-30 15:45:11 -070031 main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
Jon Halla3e02432015-07-24 15:55:42 -070032 main.apps = main.params[ 'ENV' ][ 'cellApps' ]
33 gitBranch = main.params[ 'GIT' ][ 'branch' ]
34 main.dependencyPath = main.testOnDirectory + \
35 main.params[ 'DEPENDENCY' ][ 'path' ]
36 main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
37 main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
38 if main.ONOSbench.maxNodes:
39 main.maxNodes = int( main.ONOSbench.maxNodes )
40 else:
41 main.maxNodes = 0
42 wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
43 wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
44 wrapperFile3 = main.params[ 'DEPENDENCY' ][ 'wrapper3' ]
45 main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
46 main.checkIntentSleep = int( main.params[ 'SLEEP' ][ 'checkintent' ] )
acsmarscfa52272015-08-06 15:21:45 -070047 main.removeIntentSleep = int( main.params[ 'SLEEP' ][ 'removeintent' ] )
Jon Halla3e02432015-07-24 15:55:42 -070048 main.rerouteSleep = int( main.params[ 'SLEEP' ][ 'reroute' ] )
49 main.fwdSleep = int( main.params[ 'SLEEP' ][ 'fwd' ] )
Shreyaca8990f2017-03-16 11:43:11 -070050 main.checkConnectionSleep = int( main.params[ 'SLEEP' ][ 'checkConnection' ] )
51 main.checkFlowCountSleep = int( main.params[ 'SLEEP' ][ 'checkFlowCount' ] )
52 main.checkIntentHostSleep = int( main.params[ 'SLEEP' ][ 'checkIntentHost' ] )
53 main.checkIntentPointSleep = int( main.params[ 'SLEEP' ][ 'checkIntentPoint' ] )
acsmars59a4c552015-09-10 18:11:19 -070054 main.checkTopoAttempts = int( main.params[ 'SLEEP' ][ 'topoAttempts' ] )
Jeremy Songster306ed7a2016-07-19 10:59:07 -070055 main.flowDurationSleep = int( main.params[ 'SLEEP' ][ 'flowDuration' ] )
Jon Halla3e02432015-07-24 15:55:42 -070056 gitPull = main.params[ 'GIT' ][ 'pull' ]
57 main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
58 main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
59 main.cellData = {} # for creating cell file
60 main.hostsData = {}
61 main.CLIs = []
62 main.ONOSip = []
Jeremy Songster1f39bf02016-01-20 17:17:25 -080063 main.scapyHostNames = main.params[ 'SCAPY' ][ 'HOSTNAMES' ].split( ',' )
64 main.scapyHosts = [] # List of scapy hosts for iterating
acsmars5d8cc862015-09-25 09:44:50 -070065 main.assertReturnString = '' # Assembled assert return string
Jeremy Songster17147f22016-05-31 18:30:52 -070066 main.cycle = 0 # How many times FUNCintent has run through its tests
kelvin-onlabd48a68c2015-07-13 16:01:36 -070067
Jon Halla3e02432015-07-24 15:55:42 -070068 main.ONOSip = main.ONOSbench.getOnosIps()
69 print main.ONOSip
kelvin-onlabd48a68c2015-07-13 16:01:36 -070070
Jon Halla3e02432015-07-24 15:55:42 -070071 # Assigning ONOS cli handles to a list
72 for i in range( 1, main.maxNodes + 1 ):
73 main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
kelvin-onlabd48a68c2015-07-13 16:01:36 -070074
Jon Halla3e02432015-07-24 15:55:42 -070075 # -- INIT SECTION, ONLY RUNS ONCE -- #
76 main.startUp = imp.load_source( wrapperFile1,
77 main.dependencyPath +
78 wrapperFile1 +
79 ".py" )
kelvin-onlabd48a68c2015-07-13 16:01:36 -070080
Jon Halla3e02432015-07-24 15:55:42 -070081 main.intentFunction = imp.load_source( wrapperFile2,
82 main.dependencyPath +
83 wrapperFile2 +
84 ".py" )
kelvin-onlabd48a68c2015-07-13 16:01:36 -070085
Jon Halla3e02432015-07-24 15:55:42 -070086 main.topo = imp.load_source( wrapperFile3,
87 main.dependencyPath +
88 wrapperFile3 +
89 ".py" )
90
kelvin-onlabd9e23de2015-08-06 10:34:44 -070091 copyResult1 = main.ONOSbench.scp( main.Mininet1,
92 main.dependencyPath +
93 main.topology,
Jeremy Songster1f39bf02016-01-20 17:17:25 -080094 main.Mininet1.home + "custom/",
kelvin-onlabd9e23de2015-08-06 10:34:44 -070095 direction="to" )
Jon Halla3e02432015-07-24 15:55:42 -070096 if main.CLIs:
97 stepResult = main.TRUE
98 else:
99 main.log.error( "Did not properly created list of ONOS CLI handle" )
100 stepResult = main.FALSE
101 except Exception as e:
102 main.log.exception(e)
103 main.cleanup()
104 main.exit()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700105
106 utilities.assert_equals( expect=main.TRUE,
107 actual=stepResult,
108 onpass="Successfully construct " +
109 "test variables ",
110 onfail="Failed to construct test variables" )
111
112 if gitPull == 'True':
113 main.step( "Building ONOS in " + gitBranch + " branch" )
114 onosBuildResult = main.startUp.onosBuild( main, gitBranch )
115 stepResult = onosBuildResult
116 utilities.assert_equals( expect=main.TRUE,
117 actual=stepResult,
118 onpass="Successfully compiled " +
119 "latest ONOS",
120 onfail="Failed to compile " +
121 "latest ONOS" )
122 else:
123 main.log.warn( "Did not pull new code so skipping mvn " +
124 "clean install" )
Jon Hall106be082015-07-22 09:53:00 -0700125 main.ONOSbench.getVersion( report=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700126
127 def CASE2( self, main ):
128 """
129 - Set up cell
130 - Create cell file
131 - Set cell file
132 - Verify cell file
133 - Kill ONOS process
134 - Uninstall ONOS cluster
135 - Verify ONOS start up
136 - Install ONOS cluster
137 - Connect to cli
138 """
alison52b25892016-09-19 10:53:48 -0700139 import time
Jeremy Songster17147f22016-05-31 18:30:52 -0700140 main.cycle += 1
141
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700142 # main.scale[ 0 ] determines the current number of ONOS controller
143 main.numCtrls = int( main.scale[ 0 ] )
Jeremycd872222016-03-29 10:08:34 -0700144 main.flowCompiler = "Flow Rules"
Jeremyd9e4eb12016-04-13 12:09:06 -0700145 main.initialized = main.TRUE
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700146
147 main.case( "Starting up " + str( main.numCtrls ) +
148 " node(s) ONOS cluster" )
Jon Hall783bbf92015-07-23 14:33:19 -0700149 main.caseExplanation = "Set up ONOS with " + str( main.numCtrls ) +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700150 " node(s) ONOS cluster"
151
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700152 #kill off all onos processes
153 main.log.info( "Safety check, killing all ONOS processes" +
Jon Hall70b2ff42015-11-17 15:49:44 -0800154 " before initiating environment setup" )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700155
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800156 time.sleep( main.startUpSleep )
157 main.step( "Uninstalling ONOS package" )
158 onosUninstallResult = main.TRUE
159 for ip in main.ONOSip:
160 onosUninstallResult = onosUninstallResult and \
161 main.ONOSbench.onosUninstall( nodeIp=ip )
162 stepResult = onosUninstallResult
163 utilities.assert_equals( expect=main.TRUE,
164 actual=stepResult,
165 onpass="Successfully uninstalled ONOS package",
166 onfail="Failed to uninstall ONOS package" )
Jeremy42df2e72016-02-23 16:37:46 -0800167 time.sleep( main.startUpSleep )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800168
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700169 for i in range( main.maxNodes ):
170 main.ONOSbench.onosDie( main.ONOSip[ i ] )
171
172 print "NODE COUNT = ", main.numCtrls
173
174 tempOnosIp = []
175 for i in range( main.numCtrls ):
176 tempOnosIp.append( main.ONOSip[i] )
177
kelvin-onlabf34a58a2015-07-23 16:41:52 -0700178 main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
179 "temp", main.Mininet1.ip_address,
180 main.apps, tempOnosIp )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700181
182 main.step( "Apply cell to environment" )
183 cellResult = main.ONOSbench.setCell( "temp" )
184 verifyResult = main.ONOSbench.verifyCell()
185 stepResult = cellResult and verifyResult
186 utilities.assert_equals( expect=main.TRUE,
187 actual=stepResult,
188 onpass="Successfully applied cell to " + \
189 "environment",
190 onfail="Failed to apply cell to environment " )
191
192 main.step( "Creating ONOS package" )
Jon Hallbd60ea02016-08-23 10:03:59 -0700193 packageResult = main.ONOSbench.buckBuild()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700194 stepResult = packageResult
195 utilities.assert_equals( expect=main.TRUE,
196 actual=stepResult,
197 onpass="Successfully created ONOS package",
198 onfail="Failed to create ONOS package" )
199
200 time.sleep( main.startUpSleep )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700201 main.step( "Installing ONOS package" )
202 onosInstallResult = main.TRUE
203 for i in range( main.numCtrls ):
204 onosInstallResult = onosInstallResult and \
205 main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
206 stepResult = onosInstallResult
207 utilities.assert_equals( expect=main.TRUE,
208 actual=stepResult,
209 onpass="Successfully installed ONOS package",
210 onfail="Failed to install ONOS package" )
211
You Wangf5de25b2017-01-06 15:13:01 -0800212 main.step( "Set up ONOS secure SSH" )
213 secureSshResult = main.TRUE
214 for i in range( int( main.numCtrls ) ):
215 secureSshResult = secureSshResult and main.ONOSbench.onosSecureSSH( node=main.ONOSip[i] )
216 utilities.assert_equals( expect=main.TRUE, actual=secureSshResult,
217 onpass="Test step PASS",
218 onfail="Test step FAIL" )
219
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700220 time.sleep( main.startUpSleep )
221 main.step( "Starting ONOS service" )
222 stopResult = main.TRUE
223 startResult = main.TRUE
224 onosIsUp = main.TRUE
225
226 for i in range( main.numCtrls ):
Jeremy Songster7edb6632016-04-28 15:44:28 -0700227 isUp = main.ONOSbench.isup( main.ONOSip[ i ] )
228 onosIsUp = onosIsUp and isUp
229 if isUp == main.TRUE:
Jeremyd9e4eb12016-04-13 12:09:06 -0700230 main.log.report( "ONOS instance {0} is up and ready".format( i + 1 ) )
231 else:
232 main.log.report( "ONOS instance {0} may not be up, stop and ".format( i + 1 ) +
233 "start ONOS again " )
234 stopResult = stopResult and main.ONOSbench.onosStop( main.ONOSip[ i ] )
235 startResult = startResult and main.ONOSbench.onosStart( main.ONOSip[ i ] )
236 if not startResult or stopResult:
237 main.log.report( "ONOS instance {0} did not start correctly.".format( i + 1) )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700238 stepResult = onosIsUp and stopResult and startResult
239 utilities.assert_equals( expect=main.TRUE,
240 actual=stepResult,
Jeremyd9e4eb12016-04-13 12:09:06 -0700241 onpass="ONOS service is ready on all nodes",
242 onfail="ONOS service did not start properly on all nodes" )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700243
244 main.step( "Start ONOS cli" )
245 cliResult = main.TRUE
246 for i in range( main.numCtrls ):
247 cliResult = cliResult and \
248 main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
249 stepResult = cliResult
250 utilities.assert_equals( expect=main.TRUE,
251 actual=stepResult,
252 onpass="Successfully start ONOS cli",
253 onfail="Failed to start ONOS cli" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700254 if not stepResult:
255 main.initialized = main.FALSE
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700256
257 # Remove the first element in main.scale list
258 main.scale.remove( main.scale[ 0 ] )
259
kelvin-onlab016dce22015-08-10 09:54:11 -0700260 main.intentFunction.report( main )
261
Jon Halla3e02432015-07-24 15:55:42 -0700262 def CASE8( self, main ):
263 """
acsmars59a4c552015-09-10 18:11:19 -0700264 Compare ONOS Topology to Mininet Topology
Jon Halla3e02432015-07-24 15:55:42 -0700265 """
266 import json
267
268 main.case( "Compare ONOS Topology view to Mininet topology" )
269 main.caseExplanation = "Compare topology elements between Mininet" +\
270 " and ONOS"
271
acsmars59a4c552015-09-10 18:11:19 -0700272 main.log.info( "Gathering topology information from Mininet" )
273 devicesResults = main.FALSE # Overall Boolean for device correctness
274 linksResults = main.FALSE # Overall Boolean for link correctness
275 hostsResults = main.FALSE # Overall Boolean for host correctness
276 deviceFails = [] # Nodes where devices are incorrect
277 linkFails = [] # Nodes where links are incorrect
278 hostFails = [] # Nodes where hosts are incorrect
279 attempts = main.checkTopoAttempts # Remaining Attempts
Jon Halla3e02432015-07-24 15:55:42 -0700280
281 mnSwitches = main.Mininet1.getSwitches()
282 mnLinks = main.Mininet1.getLinks()
283 mnHosts = main.Mininet1.getHosts()
284
Jon Hall70b2ff42015-11-17 15:49:44 -0800285 main.step( "Comparing Mininet topology to ONOS topology" )
Jon Halla3e02432015-07-24 15:55:42 -0700286
acsmars59a4c552015-09-10 18:11:19 -0700287 while ( attempts >= 0 ) and\
288 ( not devicesResults or not linksResults or not hostsResults ):
289 time.sleep( 2 )
290 if not devicesResults:
291 devices = main.topo.getAllDevices( main )
292 ports = main.topo.getAllPorts( main )
293 devicesResults = main.TRUE
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800294 deviceFails = [] # Reset for each failed attempt
acsmars59a4c552015-09-10 18:11:19 -0700295 if not linksResults:
296 links = main.topo.getAllLinks( main )
297 linksResults = main.TRUE
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800298 linkFails = [] # Reset for each failed attempt
acsmars59a4c552015-09-10 18:11:19 -0700299 if not hostsResults:
300 hosts = main.topo.getAllHosts( main )
301 hostsResults = main.TRUE
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800302 hostFails = [] # Reset for each failed attempt
Jon Halla3e02432015-07-24 15:55:42 -0700303
acsmars59a4c552015-09-10 18:11:19 -0700304 # Check for matching topology on each node
305 for controller in range( main.numCtrls ):
306 controllerStr = str( controller + 1 ) # ONOS node number
307 # Compare Devices
308 if devices[ controller ] and ports[ controller ] and\
309 "Error" not in devices[ controller ] and\
310 "Error" not in ports[ controller ]:
Jon Halla3e02432015-07-24 15:55:42 -0700311
acsmars2ec91d62015-09-16 11:15:48 -0700312 try:
313 deviceData = json.loads( devices[ controller ] )
314 portData = json.loads( ports[ controller ] )
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700315 except( TypeError, ValueError ):
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800316 main.log.error( "Could not load json: {0} or {1}".format( str( devices[ controller ] ), str( ports[ controller ] ) ) )
acsmars2ec91d62015-09-16 11:15:48 -0700317 currentDevicesResult = main.FALSE
318 else:
319 currentDevicesResult = main.Mininet1.compareSwitches(
320 mnSwitches,deviceData,portData )
acsmars59a4c552015-09-10 18:11:19 -0700321 else:
322 currentDevicesResult = main.FALSE
323 if not currentDevicesResult:
324 deviceFails.append( controllerStr )
325 devicesResults = devicesResults and currentDevicesResult
326 # Compare Links
327 if links[ controller ] and "Error" not in links[ controller ]:
acsmars2ec91d62015-09-16 11:15:48 -0700328 try:
329 linkData = json.loads( links[ controller ] )
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700330 except( TypeError, ValueError ):
331 main.log.error( "Could not load json:" + str( links[ controller ] ) )
acsmars2ec91d62015-09-16 11:15:48 -0700332 currentLinksResult = main.FALSE
333 else:
334 currentLinksResult = main.Mininet1.compareLinks(
335 mnSwitches, mnLinks,linkData )
acsmars59a4c552015-09-10 18:11:19 -0700336 else:
337 currentLinksResult = main.FALSE
338 if not currentLinksResult:
339 linkFails.append( controllerStr )
340 linksResults = linksResults and currentLinksResult
341 # Compare Hosts
acsmars2ec91d62015-09-16 11:15:48 -0700342 if hosts[ controller ] and "Error" not in hosts[ controller ]:
343 try:
344 hostData = json.loads( hosts[ controller ] )
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700345 except( TypeError, ValueError ):
346 main.log.error( "Could not load json:" + str( hosts[ controller ] ) )
acsmars2ec91d62015-09-16 11:15:48 -0700347 currentHostsResult = main.FALSE
348 else:
349 currentHostsResult = main.Mininet1.compareHosts(
350 mnHosts,hostData )
acsmars59a4c552015-09-10 18:11:19 -0700351 else:
352 currentHostsResult = main.FALSE
353 if not currentHostsResult:
354 hostFails.append( controllerStr )
355 hostsResults = hostsResults and currentHostsResult
356 # Decrement Attempts Remaining
357 attempts -= 1
358
359
360 utilities.assert_equals( expect=[],
361 actual=deviceFails,
362 onpass="ONOS correctly discovered all devices",
363 onfail="ONOS incorrectly discovered devices on nodes: " +
364 str( deviceFails ) )
365 utilities.assert_equals( expect=[],
366 actual=linkFails,
367 onpass="ONOS correctly discovered all links",
368 onfail="ONOS incorrectly discovered links on nodes: " +
369 str( linkFails ) )
370 utilities.assert_equals( expect=[],
371 actual=hostFails,
372 onpass="ONOS correctly discovered all hosts",
373 onfail="ONOS incorrectly discovered hosts on nodes: " +
374 str( hostFails ) )
Jon Hall46d48252015-08-03 11:41:16 -0700375 topoResults = hostsResults and linksResults and devicesResults
376 utilities.assert_equals( expect=main.TRUE,
377 actual=topoResults,
378 onpass="ONOS correctly discovered the topology",
379 onfail="ONOS incorrectly discovered the topology" )
Jon Halla3e02432015-07-24 15:55:42 -0700380
kelvin-onlabb5cfab32015-07-22 16:38:22 -0700381 def CASE10( self, main ):
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700382 """
kelvin-onlabb0b0dcb2015-07-22 16:51:33 -0700383 Start Mininet topology with OF 1.0 switches
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700384 """
Jeremyd9e4eb12016-04-13 12:09:06 -0700385 if main.initialized == main.FALSE:
386 main.log.error( "Test components did not start correctly, skipping further tests" )
387 main.skipCase()
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700388 main.OFProtocol = "1.0"
kelvin-onlabb0b0dcb2015-07-22 16:51:33 -0700389 main.log.report( "Start Mininet topology with OF 1.0 switches" )
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700390 main.case( "Start Mininet topology with OF 1.0 switches" )
Jon Hall783bbf92015-07-23 14:33:19 -0700391 main.caseExplanation = "Start mininet topology with OF 1.0 " +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700392 "switches to test intents, exits out if " +\
393 "topology did not start correctly"
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700394
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700395 main.step( "Starting Mininet topology with OF 1.0 switches" )
kelvin-onlabb0b0dcb2015-07-22 16:51:33 -0700396 args = "--switch ovs,protocols=OpenFlow10"
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700397 topoResult = main.Mininet1.startNet( topoFile=main.dependencyPath +
kelvin-onlabb0b0dcb2015-07-22 16:51:33 -0700398 main.topology,
399 args=args )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700400 stepResult = topoResult
401 utilities.assert_equals( expect=main.TRUE,
402 actual=stepResult,
403 onpass="Successfully loaded topology",
404 onfail="Failed to load topology" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700405
406 # Set flag to test cases if topology did not load properly
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700407 if not topoResult:
Jeremyd9e4eb12016-04-13 12:09:06 -0700408 main.initialized = main.FALSE
409 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700410
kelvin-onlabb5cfab32015-07-22 16:38:22 -0700411 def CASE11( self, main ):
412 """
kelvin-onlabb0b0dcb2015-07-22 16:51:33 -0700413 Start Mininet topology with OF 1.3 switches
kelvin-onlabb5cfab32015-07-22 16:38:22 -0700414 """
Jeremyd9e4eb12016-04-13 12:09:06 -0700415 if main.initialized == main.FALSE:
416 main.log.error( "Test components did not start correctly, skipping further tests" )
417 main.skipCase()
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700418 main.OFProtocol = "1.3"
kelvin-onlabb5cfab32015-07-22 16:38:22 -0700419 main.log.report( "Start Mininet topology with OF 1.3 switches" )
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700420 main.case( "Start Mininet topology with OF 1.3 switches" )
Jon Hall783bbf92015-07-23 14:33:19 -0700421 main.caseExplanation = "Start mininet topology with OF 1.3 " +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700422 "switches to test intents, exits out if " +\
423 "topology did not start correctly"
kelvin-onlabb5cfab32015-07-22 16:38:22 -0700424
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700425 main.step( "Starting Mininet topology with OF 1.3 switches" )
kelvin-onlabb5cfab32015-07-22 16:38:22 -0700426 args = "--switch ovs,protocols=OpenFlow13"
427 topoResult = main.Mininet1.startNet( topoFile=main.dependencyPath +
428 main.topology,
429 args=args )
430 stepResult = topoResult
431 utilities.assert_equals( expect=main.TRUE,
432 actual=stepResult,
433 onpass="Successfully loaded topology",
434 onfail="Failed to load topology" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700435 # Set flag to skip test cases if topology did not load properly
kelvin-onlabb5cfab32015-07-22 16:38:22 -0700436 if not topoResult:
Jeremyd9e4eb12016-04-13 12:09:06 -0700437 main.initialized = main.FALSE
kelvin-onlabb5cfab32015-07-22 16:38:22 -0700438
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700439 def CASE12( self, main ):
440 """
441 Assign mastership to controllers
442 """
443 import re
444
Jeremyd9e4eb12016-04-13 12:09:06 -0700445 if main.initialized == main.FALSE:
446 main.log.error( "Test components did not start correctly, skipping further tests" )
447 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700448 main.case( "Assign switches to controllers" )
449 main.step( "Assigning switches to controllers" )
Jon Hall783bbf92015-07-23 14:33:19 -0700450 main.caseExplanation = "Assign OF " + main.OFProtocol +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700451 " switches to ONOS nodes"
452
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700453 switchList = []
454
455 # Creates a list switch name, use getSwitch() function later...
456 for i in range( 1, ( main.numSwitch + 1 ) ):
457 switchList.append( 's' + str( i ) )
458
459 tempONOSip = []
460 for i in range( main.numCtrls ):
461 tempONOSip.append( main.ONOSip[ i ] )
462
463 assignResult = main.Mininet1.assignSwController( sw=switchList,
464 ip=tempONOSip,
alison52b25892016-09-19 10:53:48 -0700465 port="6653" )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700466 if not assignResult:
Jeremyd9e4eb12016-04-13 12:09:06 -0700467 main.log.error( "Problem assigning mastership of switches" )
468 main.initialized = main.FALSE
469 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700470
471 for i in range( 1, ( main.numSwitch + 1 ) ):
472 response = main.Mininet1.getSwController( "s" + str( i ) )
473 print( "Response is " + str( response ) )
474 if re.search( "tcp:" + main.ONOSip[ 0 ], response ):
475 assignResult = assignResult and main.TRUE
476 else:
477 assignResult = main.FALSE
478 stepResult = assignResult
479 utilities.assert_equals( expect=main.TRUE,
480 actual=stepResult,
481 onpass="Successfully assigned switches" +
482 "to controller",
483 onfail="Failed to assign switches to " +
484 "controller" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700485 if not stepResult:
486 main.initialized = main.FALSE
acsmars5d8cc862015-09-25 09:44:50 -0700487
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800488 def CASE13( self,main ):
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700489 """
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800490 Create Scapy components
491 """
Jeremyd9e4eb12016-04-13 12:09:06 -0700492 if main.initialized == main.FALSE:
493 main.log.error( "Test components did not start correctly, skipping further tests" )
494 main.skipCase()
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800495 main.case( "Create scapy components" )
496 main.step( "Create scapy components" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800497 scapyResult = main.TRUE
498 for hostName in main.scapyHostNames:
499 main.Scapy1.createHostComponent( hostName )
500 main.scapyHosts.append( getattr( main, hostName ) )
501
502 main.step( "Start scapy components" )
503 for host in main.scapyHosts:
504 host.startHostCli()
505 host.startScapy()
506 host.updateSelf()
507 main.log.debug( host.name )
508 main.log.debug( host.hostIp )
509 main.log.debug( host.hostMac )
510
511
512 utilities.assert_equals( expect=main.TRUE,
513 actual=scapyResult,
514 onpass="Successfully created Scapy Components",
515 onfail="Failed to discover Scapy Components" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700516 if not scapyResult:
517 main.initialized = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800518
519 def CASE14( self, main ):
520 """
521 Discover all hosts with fwd and pingall and store its data in a dictionary
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700522 """
Jeremyd9e4eb12016-04-13 12:09:06 -0700523 if main.initialized == main.FALSE:
524 main.log.error( "Test components did not start correctly, skipping further tests" )
525 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700526 main.case( "Discover all hosts" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800527 main.step( "Pingall hosts and confirm ONOS discovery" )
528 utilities.retry( f=main.intentFunction.fwdPingall, retValue=main.FALSE, args=[ main ] )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700529
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800530 utilities.retry( f=main.intentFunction.confirmHostDiscovery, retValue=main.FALSE,
531 args=[ main ], attempts=main.checkTopoAttempts, sleep=2 )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700532 utilities.assert_equals( expect=main.TRUE,
533 actual=stepResult,
534 onpass="Successfully discovered hosts",
535 onfail="Failed to discover hosts" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700536 if not stepResult:
537 main.initialized = main.FALSE
538 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700539
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800540 main.step( "Populate hostsData" )
541 stepResult = main.intentFunction.populateHostData( main )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700542 utilities.assert_equals( expect=main.TRUE,
543 actual=stepResult,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800544 onpass="Successfully populated hostsData",
545 onfail="Failed to populate hostsData" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700546 if not stepResult:
547 main.initialized = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800548
549 def CASE15( self, main ):
550 """
551 Discover all hosts with scapy arp packets and store its data to a dictionary
552 """
Jeremyd9e4eb12016-04-13 12:09:06 -0700553 if main.initialized == main.FALSE:
554 main.log.error( "Test components did not start correctly, skipping further tests" )
555 main.skipCase()
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800556 main.case( "Discover all hosts using scapy" )
557 main.step( "Send packets from each host to the first host and confirm onos discovery" )
558
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800559 if len( main.scapyHosts ) < 1:
560 main.log.error( "No scapy hosts have been created" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700561 main.initialized = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800562 main.skipCase()
563
564 # Send ARP packets from each scapy host component
565 main.intentFunction.sendDiscoveryArp( main, main.scapyHosts )
566
567 stepResult = utilities.retry( f=main.intentFunction.confirmHostDiscovery,
568 retValue=main.FALSE, args=[ main ],
569 attempts=main.checkTopoAttempts, sleep=2 )
570
571 utilities.assert_equals( expect=main.TRUE,
572 actual=stepResult,
573 onpass="ONOS correctly discovered all hosts",
574 onfail="ONOS incorrectly discovered hosts" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700575 if not stepResult:
576 main.initialized = main.FALSE
577 main.skipCase()
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800578
579 main.step( "Populate hostsData" )
580 stepResult = main.intentFunction.populateHostData( main )
581 utilities.assert_equals( expect=main.TRUE,
582 actual=stepResult,
583 onpass="Successfully populated hostsData",
584 onfail="Failed to populate hostsData" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700585 if not stepResult:
586 main.initialized = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800587
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800588 def CASE16( self, main ):
589 """
Jeremy42df2e72016-02-23 16:37:46 -0800590 Balance Masters
591 """
Jeremyd9e4eb12016-04-13 12:09:06 -0700592 if main.initialized == main.FALSE:
593 main.log.error( "Test components did not start correctly, skipping further tests" )
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700594 main.stop()
Jeremyd9e4eb12016-04-13 12:09:06 -0700595 main.skipCase()
Jeremy42df2e72016-02-23 16:37:46 -0800596 main.case( "Balance mastership of switches" )
597 main.step( "Balancing mastership of switches" )
598
Jeremy42df2e72016-02-23 16:37:46 -0800599 balanceResult = utilities.retry( f=main.CLIs[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
600
601 utilities.assert_equals( expect=main.TRUE,
Jeremy6e9748f2016-03-25 15:03:39 -0700602 actual=balanceResult,
Jeremy42df2e72016-02-23 16:37:46 -0800603 onpass="Successfully balanced mastership of switches",
604 onfail="Failed to balance mastership of switches" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700605 if not balanceResult:
606 main.initialized = main.FALSE
Jeremy42df2e72016-02-23 16:37:46 -0800607
608 def CASE17( self, main ):
609 """
Jeremy6e9748f2016-03-25 15:03:39 -0700610 Use Flow Objectives
611 """
Jeremyd9e4eb12016-04-13 12:09:06 -0700612 if main.initialized == main.FALSE:
613 main.log.error( "Test components did not start correctly, skipping further tests" )
614 main.skipCase()
Jeremy6e9748f2016-03-25 15:03:39 -0700615 main.case( "Enable intent compilation using Flow Objectives" )
616 main.step( "Enabling Flow Objectives" )
617
618 main.flowCompiler = "Flow Objectives"
619
620 cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
621
622 stepResult = main.CLIs[ 0 ].setCfg( component=cmd,
623 propName="useFlowObjectives", value="true" )
You Wang106d0fa2017-05-15 17:22:15 -0700624 stepResult &= main.CLIs[ 0 ].setCfg( component=cmd,
625 propName="defaultFlowObjectiveCompiler",
626 value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler')
Jeremy6e9748f2016-03-25 15:03:39 -0700627
628 utilities.assert_equals( expect=main.TRUE,
629 actual=stepResult,
630 onpass="Successfully activated Flow Objectives",
631 onfail="Failed to activate Flow Objectives" )
Jeremyd9e4eb12016-04-13 12:09:06 -0700632 if not balanceResult:
633 main.initialized = main.FALSE
Jeremy6e9748f2016-03-25 15:03:39 -0700634
635 def CASE18( self, main ):
636 """
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800637 Stop mininet and remove scapy host
638 """
639 main.log.report( "Stop Mininet and Scapy" )
640 main.case( "Stop Mininet and Scapy" )
641 main.caseExplanation = "Stopping the current mininet topology " +\
642 "to start up fresh"
643 main.step( "Stopping and Removing Scapy Host Components" )
644 scapyResult = main.TRUE
645 for host in main.scapyHosts:
646 scapyResult = scapyResult and host.stopScapy()
647 main.log.info( "Stopped Scapy Host: {0}".format( host.name ) )
648
649 for host in main.scapyHosts:
650 scapyResult = scapyResult and main.Scapy1.removeHostComponent( host.name )
651 main.log.info( "Removed Scapy Host Component: {0}".format( host.name ) )
652
653 main.scapyHosts = []
654 main.scapyHostIPs = []
655
656 utilities.assert_equals( expect=main.TRUE,
657 actual=scapyResult,
658 onpass="Successfully stopped scapy and removed host components",
659 onfail="Failed to stop mininet and scapy" )
660
661 main.step( "Stopping Mininet Topology" )
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700662 mininetResult = main.Mininet1.stopNet()
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800663
664 utilities.assert_equals( expect=main.TRUE,
665 actual=mininetResult,
666 onpass="Successfully stopped mininet and scapy",
667 onfail="Failed to stop mininet and scapy" )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700668 # Exit if topology did not load properly
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800669 if not ( mininetResult and scapyResult ):
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700670 main.cleanup()
671 main.exit()
672
Jeremy Songster17147f22016-05-31 18:30:52 -0700673 def CASE19( self, main ):
674 """
675 Copy the karaf.log files after each testcase cycle
676 """
677 main.log.report( "Copy karaf logs" )
678 main.case( "Copy karaf logs" )
679 main.caseExplanation = "Copying the karaf logs to preserve them through" +\
680 "reinstalling ONOS"
681 main.step( "Copying karaf logs" )
Jeremy Songster31aad312016-06-13 16:32:11 -0700682 stepResult = main.TRUE
683 scpResult = main.TRUE
684 copyResult = main.TRUE
Jeremy Songstercc5414b2016-07-11 10:59:53 -0700685 for i in range( main.numCtrls ):
686 main.node = main.CLIs[ i ]
Jeremy Songster17147f22016-05-31 18:30:52 -0700687 ip = main.ONOSip[ i ]
688 main.node.ip_address = ip
Jeremy Songster31aad312016-06-13 16:32:11 -0700689 scpResult = scpResult and main.ONOSbench.scp( main.node ,
690 "/opt/onos/log/karaf.log",
691 "/tmp/karaf.log",
692 direction="from" )
693 copyResult = copyResult and main.ONOSbench.cpLogsToDir( "/tmp/karaf.log", main.logdir,
694 copyFileName=( "karaf.log.node{0}.cycle{1}".format( str( i + 1 ), str( main.cycle ) ) ) )
695 if scpResult and copyResult:
696 stepResult = main.TRUE and stepResult
697 else:
698 stepResult = main.FALSE and stepResult
Jeremy Songster31aad312016-06-13 16:32:11 -0700699 utilities.assert_equals( expect=main.TRUE,
700 actual=stepResult,
701 onpass="Successfully copied remote ONOS logs",
702 onfail="Failed to copy remote ONOS logs" )
Jeremy Songster17147f22016-05-31 18:30:52 -0700703
kelvin-onlabb769f562015-07-15 17:05:10 -0700704 def CASE1000( self, main ):
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700705 """
706 Add host intents between 2 host:
707 - Discover hosts
708 - Add host intents
709 - Check intents
710 - Verify flows
711 - Ping hosts
712 - Reroute
713 - Link down
714 - Verify flows
715 - Check topology
716 - Ping hosts
717 - Link up
718 - Verify flows
719 - Check topology
720 - Ping hosts
721 - Remove intents
722 """
Jeremyd9e4eb12016-04-13 12:09:06 -0700723 if main.initialized == main.FALSE:
724 main.log.error( "Test components did not start correctly, skipping further tests" )
725 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700726 # Assert variables - These variable's name|format must be followed
727 # if you want to use the wrapper function
728 assert main, "There is no main"
Jeremyd9e4eb12016-04-13 12:09:06 -0700729 try:
730 assert main.CLIs
731 except AssertionError:
732 main.log.error( "There is no main.CLIs, skipping test cases" )
733 main.initialized = main.FALSE
734 main.skipCase()
735 try:
736 assert main.Mininet1
737 except AssertionError:
738 main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
739 main.initialized = main.FALSE
740 main.skipCase()
741 try:
742 assert main.numSwitch
743 except AssertionError:
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700744 main.log.error( "Place the total number of switch topology in " +\
745 main.numSwitch )
Jeremyd9e4eb12016-04-13 12:09:06 -0700746 main.initialized = main.FALSE
747 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700748
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800749 # Save leader candidates
acsmarse6b410f2015-07-17 14:39:34 -0700750 intentLeadersOld = main.CLIs[ 0 ].leaderCandidates()
751
kelvin-onlab7bb2d972015-08-05 10:56:16 -0700752 main.testName = "Host Intents"
753 main.case( main.testName + " Test - " + str( main.numCtrls ) +
Jeremy6e9748f2016-03-25 15:03:39 -0700754 " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
Jon Hall783bbf92015-07-23 14:33:19 -0700755 main.caseExplanation = "This test case tests Host intents using " +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -0700756 str( main.numCtrls ) + " node(s) cluster;\n" +\
757 "Different type of hosts will be tested in " +\
758 "each step such as IPV4, Dual stack, VLAN " +\
Jeremyeb51cb12016-03-28 17:53:35 -0700759 "etc;\nThe test will use OF " + main.OFProtocol +\
760 " OVS running in Mininet and compile intents" +\
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700761 " using " + main.flowCompiler
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700762
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700763 main.step( "IPV4: Add host intents between h1 and h9" )
acsmars5d8cc862015-09-25 09:44:50 -0700764 main.assertReturnString = "Assertion Result for IPV4 host intent with mac addresses\n"
Jon Hall9c888672017-05-15 18:03:54 -0700765 host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" }
766 host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800767 testResult = main.FALSE
768 installResult = main.intentFunction.installHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700769 name="IPV4",
770 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800771 host1=host1,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700772 host2=host2 )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800773 if installResult:
774 testResult = main.intentFunction.testHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700775 name="IPV4",
Jon Hall9c888672017-05-15 18:03:54 -0700776 intentId=installResult,
alison52b25892016-09-19 10:53:48 -0700777 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800778 host1=host1,
779 host2=host2,
alison52b25892016-09-19 10:53:48 -0700780 sw1="s5",
781 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700782 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -0800783 else:
784 main.CLIs[ 0 ].removeAllIntents( purge=True )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800785
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700786 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800787 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -0700788 onpass=main.assertReturnString,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700789 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700790
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700791 main.step( "DUALSTACK1: Add host intents between h3 and h11" )
acsmars5d8cc862015-09-25 09:44:50 -0700792 main.assertReturnString = "Assertion Result for dualstack IPV4 with MAC addresses\n"
Jon Hall9c888672017-05-15 18:03:54 -0700793 host1 = { "name": "h3", "id": "00:00:00:00:00:03/-1" }
794 host2 = { "name": "h11", "id": "00:00:00:00:00:0B/-1 "}
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800795 testResult = main.FALSE
796 installResult = main.intentFunction.installHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700797 name="DUALSTACK",
798 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800799 host1=host1,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700800 host2=host2 )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800801
802 if installResult:
803 testResult = main.intentFunction.testHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700804 name="DUALSTACK",
Jon Hall9c888672017-05-15 18:03:54 -0700805 intentId=installResult,
alison52b25892016-09-19 10:53:48 -0700806 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800807 host1=host1,
808 host2=host2,
alison52b25892016-09-19 10:53:48 -0700809 sw1="s5",
810 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700811 expectedLink=18 )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700812
813 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800814 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -0700815 onpass=main.assertReturnString,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700816 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700817
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700818 main.step( "DUALSTACK2: Add host intents between h1 and h11" )
acsmars5d8cc862015-09-25 09:44:50 -0700819 main.assertReturnString = "Assertion Result for dualstack2 host intent\n"
Jon Hall9c888672017-05-15 18:03:54 -0700820 host1 = { "name": "h1" }
821 host2 = { "name": "h11" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800822 testResult = main.FALSE
823 installResult = main.intentFunction.installHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700824 name="DUALSTACK2",
825 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800826 host1=host1,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700827 host2=host2 )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800828
829 if installResult:
830 testResult = main.intentFunction.testHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700831 name="DUALSTACK2",
Jon Hall9c888672017-05-15 18:03:54 -0700832 intentId=installResult,
alison52b25892016-09-19 10:53:48 -0700833 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800834 host1=host1,
835 host2=host2,
alison52b25892016-09-19 10:53:48 -0700836 sw1="s5",
837 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700838 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -0800839 else:
840 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700841
842 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800843 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -0700844 onpass=main.assertReturnString,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700845 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700846
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700847 main.step( "1HOP: Add host intents between h1 and h3" )
acsmars5d8cc862015-09-25 09:44:50 -0700848 main.assertReturnString = "Assertion Result for 1HOP for IPV4 same switch\n"
Jon Hall9c888672017-05-15 18:03:54 -0700849 host1 = { "name": "h1" }
850 host2 = { "name": "h3" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800851 testResult = main.FALSE
852 installResult = main.intentFunction.installHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700853 name="1HOP",
854 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800855 host1=host1,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700856 host2=host2 )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800857
858 if installResult:
859 testResult = main.intentFunction.testHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700860 name="1HOP",
Jon Hall9c888672017-05-15 18:03:54 -0700861 intentId=installResult,
alison52b25892016-09-19 10:53:48 -0700862 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800863 host1=host1,
864 host2=host2,
alison52b25892016-09-19 10:53:48 -0700865 sw1="s5",
866 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700867 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -0800868 else:
869 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700870
871 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800872 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -0700873 onpass=main.assertReturnString,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700874 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700875
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700876 main.step( "VLAN1: Add vlan host intents between h4 and h12" )
acsmars5d8cc862015-09-25 09:44:50 -0700877 main.assertReturnString = "Assertion Result vlan IPV4\n"
Jon Hall9c888672017-05-15 18:03:54 -0700878 host1 = { "name": "h4", "id": "00:00:00:00:00:04/100", "vlan": "100" }
879 host2 = { "name": "h12", "id": "00:00:00:00:00:0C/100", "vlan": "100" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800880 testResult = main.FALSE
881 installResult = main.intentFunction.installHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700882 name="VLAN1",
883 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800884 host1=host1,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700885 host2=host2 )
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800886
887 if installResult:
888 testResult = main.intentFunction.testHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700889 name="VLAN1",
Jon Hall9c888672017-05-15 18:03:54 -0700890 intentId=installResult,
alison52b25892016-09-19 10:53:48 -0700891 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800892 host1=host1,
893 host2=host2,
alison52b25892016-09-19 10:53:48 -0700894 sw1="s5",
895 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700896 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -0800897 else:
898 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700899
900 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800901 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -0700902 onpass=main.assertReturnString,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700903 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -0700904
Jeremy Songsterff553672016-05-12 17:06:23 -0700905 main.step( "VLAN2: Add vlan host intents between h4 and h13" )
906 main.assertReturnString = "Assertion Result vlan IPV4\n"
Jon Hall9c888672017-05-15 18:03:54 -0700907 host1 = { "name": "h5", "vlan": "200" }
908 host2 = { "name": "h12", "vlan": "100" }
Jeremy Songsterff553672016-05-12 17:06:23 -0700909 testResult = main.FALSE
Jeremy Songsterff553672016-05-12 17:06:23 -0700910 installResult = main.intentFunction.installHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700911 name="VLAN2",
912 onosNode=0,
Jeremy Songsterff553672016-05-12 17:06:23 -0700913 host1=host1,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700914 host2=host2 )
Jeremy Songsterff553672016-05-12 17:06:23 -0700915
916 if installResult:
917 testResult = main.intentFunction.testHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700918 name="VLAN2",
Jon Hall9c888672017-05-15 18:03:54 -0700919 intentId=installResult,
alison52b25892016-09-19 10:53:48 -0700920 onosNode=0,
Jeremy Songsterff553672016-05-12 17:06:23 -0700921 host1=host1,
922 host2=host2,
alison52b25892016-09-19 10:53:48 -0700923 sw1="s5",
924 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700925 expectedLink=18 )
Jeremy Songsterff553672016-05-12 17:06:23 -0700926 else:
927 main.CLIs[ 0 ].removeAllIntents( purge=True )
928
929 utilities.assert_equals( expect=main.TRUE,
930 actual=testResult,
931 onpass=main.assertReturnString,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700932 onfail=main.assertReturnString )
Jeremy Songsterff553672016-05-12 17:06:23 -0700933
Jeremy Songsterc032f162016-08-04 17:14:49 -0700934 main.step( "Encapsulation: Add host intents between h1 and h9" )
935 main.assertReturnString = "Assertion Result for VLAN Encapsulated host intent\n"
Jon Hall9c888672017-05-15 18:03:54 -0700936 host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" }
937 host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" }
Jeremy Songsterc032f162016-08-04 17:14:49 -0700938 testResult = main.FALSE
Jeremy Songsterc032f162016-08-04 17:14:49 -0700939 installResult = main.intentFunction.installHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700940 name="ENCAPSULATION",
941 onosNode=0,
Jeremy Songsterc032f162016-08-04 17:14:49 -0700942 host1=host1,
943 host2=host2,
944 encap="VLAN" )
945 if installResult:
946 testResult = main.intentFunction.testHostIntent( main,
alison52b25892016-09-19 10:53:48 -0700947 name="ENCAPSULATION",
Jon Hall9c888672017-05-15 18:03:54 -0700948 intentId=installResult,
alison52b25892016-09-19 10:53:48 -0700949 onosNode=0,
Jeremy Songsterc032f162016-08-04 17:14:49 -0700950 host1=host1,
951 host2=host2,
alison52b25892016-09-19 10:53:48 -0700952 sw1="s5",
953 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700954 expectedLink=18 )
Jeremy Songsterc032f162016-08-04 17:14:49 -0700955 else:
956 main.CLIs[ 0 ].removeAllIntents( purge=True )
957
958 utilities.assert_equals( expect=main.TRUE,
959 actual=testResult,
960 onpass=main.assertReturnString,
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700961 onfail=main.assertReturnString )
Jeremy Songsterc032f162016-08-04 17:14:49 -0700962
Shreyaca8990f2017-03-16 11:43:11 -0700963 # Testing MPLS would require kernel version of 4.1 or higher (Current version is 3.13)
alison52b25892016-09-19 10:53:48 -0700964 # main.step( "Encapsulation: Add host intents between h1 and h9" )
965 # main.assertReturnString = "Assertion Result for MPLS Encapsulated host intent\n"
966 # host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" }
967 # host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" }
968 # testResult = main.FALSE
969 # installResult = main.intentFunction.installHostIntent( main,
970 # name="ENCAPSULATION",
971 # onosNode=0,
972 # host1=host1,
973 # host2=host2,
974 # encap="MPLS" )
975 # if installResult:
976 # testResult = main.intentFunction.testHostIntent( main,
977 # name="ENCAPSULATION",
978 # intentId=installResult,
979 # onosNode=0,
980 # host1=host1,
981 # host2=host2,
982 # sw1="s5",
983 # sw2="s2",
984 # expectedLink=18 )
985 # else:
986 # main.CLIs[ 0 ].removeAllIntents( purge=True )
987 #
988 # utilities.assert_equals( expect=main.TRUE,
989 # actual=testResult,
990 # onpass=main.assertReturnString,
991 # onfail=main.assertReturnString )
992
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700993 main.step( "Confirm that ONOS leadership is unchanged" )
acsmarse6b410f2015-07-17 14:39:34 -0700994 intentLeadersNew = main.CLIs[ 0 ].leaderCandidates()
alison52b25892016-09-19 10:53:48 -0700995 testResult = main.intentFunction.checkLeaderChange( intentLeadersOld,
acsmarse6b410f2015-07-17 14:39:34 -0700996 intentLeadersNew )
997
Jeremy Songster1f39bf02016-01-20 17:17:25 -0800998 utilities.assert_equals( expect=main.TRUE,
999 actual=testResult,
1000 onpass="ONOS Leaders Unchanged",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001001 onfail="ONOS Leader Mismatch" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001002
kelvin-onlab016dce22015-08-10 09:54:11 -07001003 main.intentFunction.report( main )
1004
kelvin-onlabb769f562015-07-15 17:05:10 -07001005 def CASE2000( self, main ):
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001006 """
1007 Add point intents between 2 hosts:
1008 - Get device ids | ports
1009 - Add point intents
1010 - Check intents
1011 - Verify flows
1012 - Ping hosts
1013 - Reroute
1014 - Link down
1015 - Verify flows
1016 - Check topology
1017 - Ping hosts
1018 - Link up
1019 - Verify flows
1020 - Check topology
1021 - Ping hosts
1022 - Remove intents
1023 """
Jeremyd9e4eb12016-04-13 12:09:06 -07001024 if main.initialized == main.FALSE:
1025 main.log.error( "Test components did not start correctly, skipping further tests" )
1026 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001027 # Assert variables - These variable's name|format must be followed
1028 # if you want to use the wrapper function
1029 assert main, "There is no main"
Jeremyd9e4eb12016-04-13 12:09:06 -07001030 try:
1031 assert main.CLIs
1032 except AssertionError:
1033 main.log.error( "There is no main.CLIs, skipping test cases" )
1034 main.initialized = main.FALSE
1035 main.skipCase()
1036 try:
1037 assert main.Mininet1
1038 except AssertionError:
1039 main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
1040 main.initialized = main.FALSE
1041 main.skipCase()
1042 try:
1043 assert main.numSwitch
1044 except AssertionError:
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001045 main.log.error( "Place the total number of switch topology in " +\
1046 main.numSwitch )
Jeremyd9e4eb12016-04-13 12:09:06 -07001047 main.initialized = main.FALSE
1048 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001049
kelvin-onlab7bb2d972015-08-05 10:56:16 -07001050 main.testName = "Point Intents"
1051 main.case( main.testName + " Test - " + str( main.numCtrls ) +
Jeremy6e9748f2016-03-25 15:03:39 -07001052 " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
Jon Hall783bbf92015-07-23 14:33:19 -07001053 main.caseExplanation = "This test case will test point to point" +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -07001054 " intents using " + str( main.numCtrls ) +\
1055 " node(s) cluster;\n" +\
1056 "Different type of hosts will be tested in " +\
1057 "each step such as IPV4, Dual stack, VLAN etc" +\
1058 ";\nThe test will use OF " + main.OFProtocol +\
Jeremy6e9748f2016-03-25 15:03:39 -07001059 " OVS running in Mininet and compile intents" +\
1060 " using " + main.flowCompiler
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001061
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001062 # No option point intents
1063 main.step( "NOOPTION: Add point intents between h1 and h9" )
acsmars5d8cc862015-09-25 09:44:50 -07001064 main.assertReturnString = "Assertion Result for NOOPTION point intent\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001065 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001066 { "name": "h1", "device": "of:0000000000000005/1" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001067 ]
1068 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001069 { "name": "h9", "device": "of:0000000000000006/1" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001070 ]
Jeremy42df2e72016-02-23 16:37:46 -08001071 testResult = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001072 installResult = main.intentFunction.installPointIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001073 main,
1074 name="NOOPTION",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001075 senders=senders,
1076 recipients=recipients )
1077
1078 if installResult:
1079 testResult = main.intentFunction.testPointIntent(
1080 main,
1081 intentId=installResult,
1082 name="NOOPTION",
1083 senders=senders,
1084 recipients=recipients,
1085 sw1="s5",
1086 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001087 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001088 else:
1089 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001090
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001091 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001092 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001093 onpass=main.assertReturnString,
1094 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001095
kelvin-onlabb769f562015-07-15 17:05:10 -07001096 main.step( "IPV4: Add point intents between h1 and h9" )
acsmars5d8cc862015-09-25 09:44:50 -07001097 main.assertReturnString = "Assertion Result for IPV4 point intent\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001098 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001099 { "name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001100 ]
1101 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001102 { "name": "h9", "device": "of:0000000000000006/1", "mac": "00:00:00:00:00:09" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001103 ]
Jeremy42df2e72016-02-23 16:37:46 -08001104 testResult = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001105 installResult = main.intentFunction.installPointIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001106 main,
1107 name="IPV4",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001108 senders=senders,
1109 recipients=recipients,
1110 ethType="IPV4" )
1111
1112 if installResult:
1113 testResult = main.intentFunction.testPointIntent(
1114 main,
1115 intentId=installResult,
1116 name="IPV4",
1117 senders=senders,
1118 recipients=recipients,
1119 sw1="s5",
1120 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001121 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001122 else:
1123 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001124
1125 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001126 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001127 onpass=main.assertReturnString,
1128 onfail=main.assertReturnString )
alisonda157272016-12-22 01:13:21 -08001129
1130 main.step("Protected: Add point intents between h1 and h9")
1131 main.assertReturnString = "Assertion Result for protected point intent\n"
1132 senders = [
1133 {"name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01"}
1134 ]
1135 recipients = [
1136 {"name": "h9", "device": "of:0000000000000006/1", "mac": "00:00:00:00:00:09"}
1137 ]
1138 testResult = main.FALSE
1139 installResult = main.intentFunction.installPointIntent(
1140 main,
1141 name="Protected",
1142 senders=senders,
1143 recipients=recipients,
1144 protected=True )
1145
1146 if installResult:
1147 testResult = main.intentFunction.testPointIntent(
1148 main,
1149 name="Protected",
1150 intentId=installResult,
1151 senders=senders,
1152 recipients=recipients,
1153 sw1="s5",
1154 sw2="s2",
1155 protected=True,
1156 expectedLink=18 )
1157 else:
1158 main.CLIs[ 0 ].removeAllIntents( purge=True )
1159
1160 utilities.assert_equals( expect=main.TRUE,
1161 actual=testResult,
1162 onpass=main.assertReturnString,
1163 onfail=main.assertReturnString )
1164
kelvin-onlabb769f562015-07-15 17:05:10 -07001165 main.step( "IPV4_2: Add point intents between h1 and h9" )
acsmars5d8cc862015-09-25 09:44:50 -07001166 main.assertReturnString = "Assertion Result for IPV4 no mac address point intents\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001167 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001168 { "name": "h1", "device": "of:0000000000000005/1" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001169 ]
1170 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001171 { "name": "h9", "device": "of:0000000000000006/1" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001172 ]
Jeremy42df2e72016-02-23 16:37:46 -08001173 testResult = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001174 installResult = main.intentFunction.installPointIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001175 main,
1176 name="IPV4_2",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001177 senders=senders,
1178 recipients=recipients,
1179 ethType="IPV4" )
1180
1181 if installResult:
1182 testResult = main.intentFunction.testPointIntent(
1183 main,
1184 intentId=installResult,
1185 name="IPV4_2",
1186 senders=senders,
1187 recipients=recipients,
1188 sw1="s5",
1189 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001190 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001191 else:
1192 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001193
1194 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001195 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001196 onpass=main.assertReturnString,
1197 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001198
kelvin-onlabb55e58e2015-08-04 00:13:48 -07001199 main.step( "SDNIP-ICMP: Add point intents between h1 and h9" )
acsmars5d8cc862015-09-25 09:44:50 -07001200 main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV4 using TCP point intents\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001201 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001202 { "name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01",
Jeremy6f000c62016-02-25 17:02:28 -08001203 "ip":( main.h1.hostIp + "/24" ) }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001204 ]
1205 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001206 { "name": "h9", "device": "of:0000000000000006/1", "mac": "00:00:00:00:00:09",
Jeremy6f000c62016-02-25 17:02:28 -08001207 "ip":( main.h9.hostIp + "/24" ) }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001208 ]
Jeremy6f000c62016-02-25 17:02:28 -08001209 ipProto = main.params[ 'SDNIP' ][ 'ipPrototype' ]
kelvin-onlab79ce0492015-07-27 16:14:39 -07001210 # Uneccessary, not including this in the selectors
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001211 tcpSrc = main.params[ 'SDNIP' ][ 'srcPort' ]
1212 tcpDst = main.params[ 'SDNIP' ][ 'dstPort' ]
Jeremy42df2e72016-02-23 16:37:46 -08001213 testResult = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001214 installResult = main.intentFunction.installPointIntent(
1215 main,
1216 name="SDNIP-ICMP",
1217 senders=senders,
1218 recipients=recipients,
1219 ethType="IPV4",
1220 ipProto=ipProto,
1221 tcpSrc=tcpSrc,
1222 tcpDst=tcpDst )
1223
1224 if installResult:
1225 testResult = main.intentFunction.testPointIntent(
1226 main,
1227 intentId=installResult,
1228 name="SDNIP_ICMP",
1229 senders=senders,
1230 recipients=recipients,
1231 sw1="s5",
1232 sw2="s2",
Jeremy Songstere405d3d2016-05-17 11:18:57 -07001233 expectedLink=18,
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001234 useTCP=True )
Jeremy42df2e72016-02-23 16:37:46 -08001235 else:
1236 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabb769f562015-07-15 17:05:10 -07001237
1238 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001239 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001240 onpass=main.assertReturnString,
1241 onfail=main.assertReturnString )
kelvin-onlabb769f562015-07-15 17:05:10 -07001242
kelvin-onlabb55e58e2015-08-04 00:13:48 -07001243 main.step( "SDNIP-TCP: Add point intents between h1 and h9" )
acsmars5d8cc862015-09-25 09:44:50 -07001244 main.assertReturnString = "Assertion Result for SDNIP-TCP IPV4 using ICMP point intents\n"
kelvin-onlabb769f562015-07-15 17:05:10 -07001245 mac1 = main.hostsData[ 'h1' ][ 'mac' ]
1246 mac2 = main.hostsData[ 'h9' ][ 'mac' ]
kelvin-onlab58dc39e2015-08-06 08:11:09 -07001247 ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/32"
1248 ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/32"
kelvin-onlabb769f562015-07-15 17:05:10 -07001249 ipProto = main.params[ 'SDNIP' ][ 'tcpProto' ]
1250 tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ]
1251 tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ]
1252
kelvin-onlab58dc39e2015-08-06 08:11:09 -07001253 stepResult = main.intentFunction.pointIntentTcp(
kelvin-onlabb769f562015-07-15 17:05:10 -07001254 main,
kelvin-onlabb55e58e2015-08-04 00:13:48 -07001255 name="SDNIP-TCP",
kelvin-onlabb769f562015-07-15 17:05:10 -07001256 host1="h1",
1257 host2="h9",
1258 deviceId1="of:0000000000000005/1",
1259 deviceId2="of:0000000000000006/1",
1260 mac1=mac1,
1261 mac2=mac2,
1262 ethType="IPV4",
kelvin-onlabb55e58e2015-08-04 00:13:48 -07001263 ipProto=ipProto,
1264 ip1=ip1,
1265 ip2=ip2,
1266 tcp1=tcp1,
1267 tcp2=tcp2 )
kelvin-onlabb769f562015-07-15 17:05:10 -07001268
1269 utilities.assert_equals( expect=main.TRUE,
Jeremy6f000c62016-02-25 17:02:28 -08001270 actual=stepResult,
acsmars5d8cc862015-09-25 09:44:50 -07001271 onpass=main.assertReturnString,
1272 onfail=main.assertReturnString )
kelvin-onlabb769f562015-07-15 17:05:10 -07001273
acsmars5d8cc862015-09-25 09:44:50 -07001274 main.step( "DUALSTACK1: Add point intents between h3 and h11" )
1275 main.assertReturnString = "Assertion Result for Dualstack1 IPV4 with mac address point intents\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001276 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001277 { "name": "h3", "device": "of:0000000000000005/3", "mac": "00:00:00:00:00:03" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001278 ]
1279 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001280 { "name": "h11", "device": "of:0000000000000006/3", "mac": "00:00:00:00:00:0B" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001281 ]
Jeremy42df2e72016-02-23 16:37:46 -08001282 testResult = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001283 installResult = main.intentFunction.installPointIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001284 main,
1285 name="DUALSTACK1",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001286 senders=senders,
1287 recipients=recipients,
1288 ethType="IPV4" )
1289
1290 if installResult:
1291 testResult = main.intentFunction.testPointIntent(
1292 main,
1293 intentId=installResult,
1294 name="DUALSTACK1",
1295 senders=senders,
1296 recipients=recipients,
1297 sw1="s5",
1298 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001299 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001300 else:
1301 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001302
1303 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001304 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001305 onpass=main.assertReturnString,
1306 onfail=main.assertReturnString )
kelvin-onlabb769f562015-07-15 17:05:10 -07001307
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001308 main.step( "VLAN: Add point intents between h5 and h21" )
acsmars5d8cc862015-09-25 09:44:50 -07001309 main.assertReturnString = "Assertion Result for VLAN IPV4 with mac address point intents\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001310 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001311 { "name": "h5", "device": "of:0000000000000005/5", "mac": "00:00:00:00:00:05", "vlan": "200" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001312 ]
1313 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001314 { "name": "h21", "device": "of:0000000000000007/5", "mac": "00:00:00:00:00:15", "vlan": "200" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001315 ]
Jeremy42df2e72016-02-23 16:37:46 -08001316 testResult = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001317 installResult = main.intentFunction.installPointIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001318 main,
Jeremy Songster832f9e92016-05-05 14:30:49 -07001319 name="VLAN",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001320 senders=senders,
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001321 recipients=recipients )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001322
1323 if installResult:
1324 testResult = main.intentFunction.testPointIntent(
1325 main,
1326 intentId=installResult,
Jeremy Songster832f9e92016-05-05 14:30:49 -07001327 name="VLAN",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001328 senders=senders,
1329 recipients=recipients,
1330 sw1="s5",
1331 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001332 expectedLink=18 )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001333
1334 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001335 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001336 onpass=main.assertReturnString,
1337 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001338
Jeremy Songsterff553672016-05-12 17:06:23 -07001339 main.step( "VLAN: Add point intents between h5 and h21" )
1340 main.assertReturnString = "Assertion Result for VLAN IPV4 point intents with VLAN treatment\n"
1341 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001342 { "name": "h4", "vlan": "100" }
Jeremy Songsterff553672016-05-12 17:06:23 -07001343 ]
1344 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001345 { "name": "h21", "vlan": "200" }
Jeremy Songsterff553672016-05-12 17:06:23 -07001346 ]
1347 testResult = main.FALSE
Jeremy Songsterff553672016-05-12 17:06:23 -07001348 installResult = main.intentFunction.installPointIntent(
1349 main,
1350 name="VLAN2",
1351 senders=senders,
1352 recipients=recipients,
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001353 setVlan=200 )
Jeremy Songsterff553672016-05-12 17:06:23 -07001354
1355 if installResult:
1356 testResult = main.intentFunction.testPointIntent(
1357 main,
1358 intentId=installResult,
1359 name="VLAN2",
1360 senders=senders,
1361 recipients=recipients,
1362 sw1="s5",
1363 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001364 expectedLink=18 )
Jeremy Songsterff553672016-05-12 17:06:23 -07001365
1366 utilities.assert_equals( expect=main.TRUE,
1367 actual=testResult,
1368 onpass=main.assertReturnString,
1369 onfail=main.assertReturnString )
1370
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001371 main.step( "1HOP: Add point intents between h1 and h3" )
acsmars5d8cc862015-09-25 09:44:50 -07001372 main.assertReturnString = "Assertion Result for 1HOP IPV4 with no mac address point intents\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001373 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001374 { "name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001375 ]
1376 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001377 { "name": "h3", "device": "of:0000000000000005/3", "mac": "00:00:00:00:00:03" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001378 ]
Jeremy42df2e72016-02-23 16:37:46 -08001379 testResult = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001380 installResult = main.intentFunction.installPointIntent(
1381 main,
1382 name="1HOP IPV4",
1383 senders=senders,
1384 recipients=recipients,
1385 ethType="IPV4" )
1386
1387 if installResult:
1388 testResult = main.intentFunction.testPointIntent(
1389 main,
1390 intentId=installResult,
1391 name="1HOP IPV4",
1392 senders=senders,
1393 recipients=recipients,
1394 sw1="s5",
1395 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001396 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001397 else:
1398 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001399
1400 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001401 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001402 onpass=main.assertReturnString,
1403 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001404
Jeremy Songsterc032f162016-08-04 17:14:49 -07001405 main.step( "Add point to point intents using VLAN Encapsulation" )
1406 main.assertReturnString = "Assertion Result for VLAN Encapsulation Point Intent"
1407 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001408 { "name": "h1", "device": "of:0000000000000005/1" }
Jeremy Songsterc032f162016-08-04 17:14:49 -07001409 ]
1410 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001411 { "name": "h9", "device": "of:0000000000000006/1" }
Jeremy Songsterc032f162016-08-04 17:14:49 -07001412 ]
1413 testResult = main.FALSE
Jeremy Songsterc032f162016-08-04 17:14:49 -07001414 installResult = main.intentFunction.installPointIntent(
1415 main,
1416 name="ENCAPSULATION",
1417 senders=senders,
1418 recipients=recipients,
1419 encap="VLAN" )
1420
1421 if installResult:
1422 testResult = main.intentFunction.testPointIntent(
1423 main,
1424 intentId=installResult,
1425 name="ENCAPSULATION",
1426 senders=senders,
1427 recipients=recipients,
1428 sw1="s5",
1429 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001430 expectedLink=18 )
Jeremy Songsterc032f162016-08-04 17:14:49 -07001431 else:
1432 main.CLIs[ 0 ].removeAllIntents( purge=True )
1433
1434 utilities.assert_equals( expect=main.TRUE,
1435 actual=testResult,
1436 onpass=main.assertReturnString,
1437 onfail=main.assertReturnString )
1438
Shreya Chowdhary6fbb96c2017-05-02 16:20:19 -07001439 main.step( "BANDWIDTH ALLOCATION: Checking bandwidth allocation for point intents between h1 and h9" )
1440 main.assertReturnString = "Assertion Result for BANDWIDTH ALLOCATION for point intent\n"
1441 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001442 { "name": "h1", "device": "of:0000000000000005/1" }
Shreya Chowdhary6fbb96c2017-05-02 16:20:19 -07001443 ]
1444 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001445 { "name": "h9", "device": "of:0000000000000006/1" }
Shreya Chowdhary6fbb96c2017-05-02 16:20:19 -07001446 ]
1447 testResult = main.FALSE
1448 installResult = main.intentFunction.installPointIntent(
1449 main,
1450 name="NOOPTION",
1451 senders=senders,
1452 recipients=recipients,
1453 bandwidth=100,
1454 bandwidthFlag=True )
1455
1456 if installResult:
1457 testResult = main.intentFunction.testPointIntent(
1458 main,
1459 intentId=installResult,
1460 name="NOOPTION",
1461 senders=senders,
1462 recipients=recipients,
1463 sw1="s5",
1464 sw2="s2",
1465 expectedLink=18 )
1466 else:
1467 main.CLIs[ 0 ].removeAllIntents( purge=True )
1468
1469 utilities.assert_equals( expect=main.TRUE,
1470 actual=testResult,
1471 onpass=main.assertReturnString,
1472 onfail=main.assertReturnString )
1473
Shreyaca8990f2017-03-16 11:43:11 -07001474 # Testing MPLS would require kernel version of 4.1 or higher (Current version is 3.13)
alison52b25892016-09-19 10:53:48 -07001475 # main.step( "Add point to point intents using MPLS Encapsulation" )
1476 # main.assertReturnString = "Assertion Result for MPLS Encapsulation Point Intent"
1477 # senders = [
1478 # { "name": "h1", "device": "of:0000000000000005/1" }
1479 # ]
1480 # recipients = [
1481 # { "name": "h9", "device": "of:0000000000000006/1" }
1482 # ]
1483 # testResult = main.FALSE
1484 # installResult = main.intentFunction.installPointIntent(
1485 # main,
1486 # name="ENCAPSULATION",
1487 # senders=senders,
1488 # recipients=recipients,
1489 # encap="MPLS" )
1490 #
1491 # if installResult:
1492 # testResult = main.intentFunction.testPointIntent(
1493 # main,
1494 # intentId=installResult,
1495 # name="ENCAPSULATION",
1496 # senders=senders,
1497 # recipients=recipients,
1498 # sw1="s5",
1499 # sw2="s2",
1500 # expectedLink=18 )
1501 # else:
1502 # main.CLIs[ 0 ].removeAllIntents( purge=True )
1503 #
1504 # utilities.assert_equals( expect=main.TRUE,
1505 # actual=testResult,
1506 # onpass=main.assertReturnString,
1507 # onfail=main.assertReturnString )
1508
kelvin-onlab016dce22015-08-10 09:54:11 -07001509 main.intentFunction.report( main )
1510
kelvin-onlabb769f562015-07-15 17:05:10 -07001511 def CASE3000( self, main ):
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001512 """
1513 Add single point to multi point intents
1514 - Get device ids
1515 - Add single point to multi point intents
1516 - Check intents
1517 - Verify flows
1518 - Ping hosts
1519 - Reroute
1520 - Link down
1521 - Verify flows
1522 - Check topology
1523 - Ping hosts
1524 - Link up
1525 - Verify flows
1526 - Check topology
1527 - Ping hosts
1528 - Remove intents
1529 """
Jeremyd9e4eb12016-04-13 12:09:06 -07001530 if main.initialized == main.FALSE:
1531 main.log.error( "Test components did not start correctly, skipping further tests" )
1532 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001533 assert main, "There is no main"
Jeremyd9e4eb12016-04-13 12:09:06 -07001534 try:
1535 assert main.CLIs
1536 except AssertionError:
1537 main.log.error( "There is no main.CLIs, skipping test cases" )
1538 main.initialized = main.FALSE
1539 main.skipCase()
1540 try:
1541 assert main.Mininet1
1542 except AssertionError:
1543 main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
1544 main.initialized = main.FALSE
1545 main.skipCase()
1546 try:
1547 assert main.numSwitch
1548 except AssertionError:
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001549 main.log.error( "Place the total number of switch topology in "+ \
1550 main.numSwitch )
Jeremyd9e4eb12016-04-13 12:09:06 -07001551 main.initialized = main.FALSE
1552 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001553
kelvin-onlab7bb2d972015-08-05 10:56:16 -07001554 main.testName = "Single to Multi Point Intents"
1555 main.case( main.testName + " Test - " + str( main.numCtrls ) +
Jeremy6e9748f2016-03-25 15:03:39 -07001556 " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
Jon Hall783bbf92015-07-23 14:33:19 -07001557 main.caseExplanation = "This test case will test single point to" +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -07001558 " multi point intents using " +\
1559 str( main.numCtrls ) + " node(s) cluster;\n" +\
1560 "Different type of hosts will be tested in " +\
1561 "each step such as IPV4, Dual stack, VLAN etc" +\
1562 ";\nThe test will use OF " + main.OFProtocol +\
Jeremy6e9748f2016-03-25 15:03:39 -07001563 " OVS running in Mininet and compile intents" +\
1564 " using " + main.flowCompiler
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001565
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001566 main.step( "NOOPTION: Install and test single point to multi point intents" )
1567 main.assertReturnString = "Assertion results for IPV4 single to multi point intent with no options set\n"
1568 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001569 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001570 ]
1571 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001572 { "name": "h16", "device": "of:0000000000000006/8" },
1573 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001574 ]
Jon Hall9c888672017-05-15 18:03:54 -07001575 badSenders = [ { "name": "h9" } ] # Senders that are not in the intent
1576 badRecipients = [ { "name": "h17" } ] # Recipients that are not in the intent
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001577 testResult = main.FALSE
1578 installResult = main.intentFunction.installSingleToMultiIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001579 main,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001580 name="NOOPTION",
1581 senders=senders,
1582 recipients=recipients,
1583 sw1="s5",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001584 sw2="s2" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001585
1586 if installResult:
1587 testResult = main.intentFunction.testPointIntent(
1588 main,
1589 intentId=installResult,
1590 name="NOOPTION",
1591 senders=senders,
1592 recipients=recipients,
1593 badSenders=badSenders,
1594 badRecipients=badRecipients,
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001595 sw1="s5",
1596 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001597 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001598 else:
1599 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001600
1601 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001602 actual=testResult,
1603 onpass=main.assertReturnString,
1604 onfail=main.assertReturnString )
1605
1606 main.step( "IPV4: Install and test single point to multi point intents" )
1607 main.assertReturnString = "Assertion results for IPV4 single to multi point intent with IPV4 type and MAC addresses\n"
1608 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001609 { "name": "h8", "device": "of:0000000000000005/8", "mac": "00:00:00:00:00:08" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001610 ]
1611 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001612 { "name": "h16", "device": "of:0000000000000006/8", "mac": "00:00:00:00:00:10" },
1613 { "name": "h24", "device": "of:0000000000000007/8", "mac": "00:00:00:00:00:18" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001614 ]
Jon Hall9c888672017-05-15 18:03:54 -07001615 badSenders = [ { "name": "h9" } ] # Senders that are not in the intent
1616 badRecipients = [ { "name": "h17" } ] # Recipients that are not in the intent
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001617 testResult = main.FALSE
1618 installResult = main.intentFunction.installSingleToMultiIntent(
1619 main,
1620 name="IPV4",
1621 senders=senders,
1622 recipients=recipients,
1623 ethType="IPV4",
1624 sw1="s5",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001625 sw2="s2" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001626
1627 if installResult:
1628 testResult = main.intentFunction.testPointIntent(
1629 main,
1630 intentId=installResult,
1631 name="IPV4",
1632 senders=senders,
1633 recipients=recipients,
1634 badSenders=badSenders,
1635 badRecipients=badRecipients,
1636 sw1="s5",
1637 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001638 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001639 else:
1640 main.CLIs[ 0 ].removeAllIntents( purge=True )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001641
1642 utilities.assert_equals( expect=main.TRUE,
1643 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001644 onpass=main.assertReturnString,
1645 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001646
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001647 main.step( "IPV4_2: Add single point to multi point intents" )
acsmars5d8cc862015-09-25 09:44:50 -07001648 main.assertReturnString = "Assertion results for IPV4 single to multi point intent with IPV4 type and no MAC addresses\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001649 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001650 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001651 ]
1652 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001653 { "name": "h16", "device": "of:0000000000000006/8" },
1654 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001655 ]
Jon Hall9c888672017-05-15 18:03:54 -07001656 badSenders = [ { "name": "h9" } ] # Senders that are not in the intent
1657 badRecipients = [ { "name": "h17" } ] # Recipients that are not in the intent
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001658 testResult = main.FALSE
1659 installResult = main.intentFunction.installSingleToMultiIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001660 main,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001661 name="IPV4_2",
1662 senders=senders,
1663 recipients=recipients,
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001664 ethType="IPV4",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001665 sw1="s5",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001666 sw2="s2" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001667
1668 if installResult:
1669 testResult = main.intentFunction.testPointIntent(
1670 main,
1671 intentId=installResult,
1672 name="IPV4_2",
1673 senders=senders,
1674 recipients=recipients,
1675 badSenders=badSenders,
1676 badRecipients=badRecipients,
1677 sw1="s5",
1678 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001679 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001680 else:
1681 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001682
1683 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001684 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001685 onpass=main.assertReturnString,
1686 onfail=main.assertReturnString )
kelvin-onlabb769f562015-07-15 17:05:10 -07001687
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001688 main.step( "VLAN: Add single point to multi point intents" )
acsmars5d8cc862015-09-25 09:44:50 -07001689 main.assertReturnString = "Assertion results for IPV4 single to multi point intent with IPV4 type and MAC addresses in the same VLAN\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001690 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001691 { "name": "h4", "device": "of:0000000000000005/4", "mac": "00:00:00:00:00:04", "vlan": "100" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001692 ]
1693 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001694 { "name": "h12", "device": "of:0000000000000006/4", "mac": "00:00:00:00:00:0C", "vlan": "100" },
1695 { "name": "h20", "device": "of:0000000000000007/4", "mac": "00:00:00:00:00:14", "vlan": "100" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001696 ]
Jon Hall9c888672017-05-15 18:03:54 -07001697 badSenders = [ { "name": "h13" } ] # Senders that are not in the intent
1698 badRecipients = [ { "name": "h21" } ] # Recipients that are not in the intent
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001699 testResult = main.FALSE
1700 installResult = main.intentFunction.installSingleToMultiIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001701 main,
alison52b25892016-09-19 10:53:48 -07001702 name="VLAN",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001703 senders=senders,
1704 recipients=recipients,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001705 sw1="s5",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001706 sw2="s2" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001707
1708 if installResult:
1709 testResult = main.intentFunction.testPointIntent(
1710 main,
1711 intentId=installResult,
Jeremy Songster832f9e92016-05-05 14:30:49 -07001712 name="VLAN",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001713 senders=senders,
1714 recipients=recipients,
1715 badSenders=badSenders,
1716 badRecipients=badRecipients,
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001717 sw1="s5",
1718 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001719 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001720 else:
1721 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001722
1723 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001724 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001725 onpass=main.assertReturnString,
1726 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001727
Jeremy Songsterff553672016-05-12 17:06:23 -07001728 main.step( "VLAN: Add single point to multi point intents" )
1729 main.assertReturnString = "Assertion results for single to multi point intent with VLAN treatment\n"
1730 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001731 { "name": "h5", "vlan": "200" }
Jeremy Songsterff553672016-05-12 17:06:23 -07001732 ]
1733 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001734 { "name": "h12", "device": "of:0000000000000006/4", "mac": "00:00:00:00:00:0C", "vlan": "100" },
1735 { "name": "h20", "device": "of:0000000000000007/4", "mac": "00:00:00:00:00:14", "vlan": "100" }
Jeremy Songsterff553672016-05-12 17:06:23 -07001736 ]
Jon Hall9c888672017-05-15 18:03:54 -07001737 badSenders = [ { "name": "h13" } ] # Senders that are not in the intent
1738 badRecipients = [ { "name": "h21" } ] # Recipients that are not in the intent
Jeremy Songsterff553672016-05-12 17:06:23 -07001739 testResult = main.FALSE
Jeremy Songsterff553672016-05-12 17:06:23 -07001740 installResult = main.intentFunction.installSingleToMultiIntent(
1741 main,
1742 name="VLAN2",
1743 senders=senders,
1744 recipients=recipients,
1745 sw1="s5",
1746 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001747 setVlan=100 )
Jeremy Songsterff553672016-05-12 17:06:23 -07001748
1749 if installResult:
1750 testResult = main.intentFunction.testPointIntent(
1751 main,
1752 intentId=installResult,
1753 name="VLAN2",
1754 senders=senders,
1755 recipients=recipients,
1756 badSenders=badSenders,
1757 badRecipients=badRecipients,
1758 sw1="s5",
1759 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001760 expectedLink=18 )
Jeremy Songsterff553672016-05-12 17:06:23 -07001761 else:
1762 main.CLIs[ 0 ].removeAllIntents( purge=True )
1763
1764 utilities.assert_equals( expect=main.TRUE,
1765 actual=testResult,
1766 onpass=main.assertReturnString,
1767 onfail=main.assertReturnString )
1768
alison52b25892016-09-19 10:53:48 -07001769 # Does not support Single point to multi point encapsulation
1770 # main.step( "ENCAPSULATION: Install and test single point to multi point intents" )
1771 # main.assertReturnString = "Assertion results for VLAN Encapsulation single to multi point intent\n"
1772 # senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001773 # { "name": "h8", "device": "of:0000000000000005/8" }
alison52b25892016-09-19 10:53:48 -07001774 # ]
1775 # recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001776 # { "name": "h16", "device": "of:0000000000000006/8" },
1777 # { "name": "h24", "device": "of:0000000000000007/8" }
alison52b25892016-09-19 10:53:48 -07001778 # ]
Jon Hall9c888672017-05-15 18:03:54 -07001779 # badSenders = [ { "name": "h9" } ] # Senders that are not in the intent
1780 # badRecipients = [ { "name": "h17" } ] # Recipients that are not in the intent
alison52b25892016-09-19 10:53:48 -07001781 # testResult = main.FALSE
1782 # installResult = main.intentFunction.installSingleToMultiIntent(
1783 # main,
1784 # name="ENCAPSULATION",
1785 # senders=senders,
1786 # recipients=recipients,
1787 # sw1="s5",
1788 # sw2="s2",
1789 # encap="VLAN" )
1790 #
1791 # if installResult:
1792 # testResult = main.intentFunction.testPointIntent(
1793 # main,
1794 # intentId=installResult,
1795 # name="ENCAPSULATION",
1796 # senders=senders,
1797 # recipients=recipients,
1798 # badSenders=badSenders,
1799 # badRecipients=badRecipients,
1800 # sw1="s5",
1801 # sw2="s2",
1802 # expectedLink=18 )
1803 # else:
1804 # main.CLIs[ 0 ].removeAllIntents( purge=True )
1805 #
1806 # utilities.assert_equals( expect=main.TRUE,
1807 # actual=testResult,
1808 # onpass=main.assertReturnString,
1809 # onfail=main.assertReturnString )
Jeremy Songsterc032f162016-08-04 17:14:49 -07001810
kelvin-onlab016dce22015-08-10 09:54:11 -07001811 main.intentFunction.report( main )
1812
kelvin-onlabb769f562015-07-15 17:05:10 -07001813 def CASE4000( self, main ):
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001814 """
1815 Add multi point to single point intents
1816 - Get device ids
1817 - Add multi point to single point intents
1818 - Check intents
1819 - Verify flows
1820 - Ping hosts
1821 - Reroute
1822 - Link down
1823 - Verify flows
1824 - Check topology
1825 - Ping hosts
1826 - Link up
1827 - Verify flows
1828 - Check topology
1829 - Ping hosts
1830 - Remove intents
1831 """
Jeremyd9e4eb12016-04-13 12:09:06 -07001832 if main.initialized == main.FALSE:
1833 main.log.error( "Test components did not start correctly, skipping further tests" )
1834 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001835 assert main, "There is no main"
Jeremyd9e4eb12016-04-13 12:09:06 -07001836 try:
1837 assert main.CLIs
1838 except AssertionError:
1839 main.log.error( "There is no main.CLIs, skipping test cases" )
1840 main.initialized = main.FALSE
1841 main.skipCase()
1842 try:
1843 assert main.Mininet1
1844 except AssertionError:
1845 main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
1846 main.initialized = main.FALSE
1847 main.skipCase()
1848 try:
1849 assert main.numSwitch
1850 except AssertionError:
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001851 main.log.error( "Place the total number of switch topology in "+\
1852 main.numSwitch )
Jeremyd9e4eb12016-04-13 12:09:06 -07001853 main.initialized = main.FALSE
1854 main.skipCase()
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001855
kelvin-onlab7bb2d972015-08-05 10:56:16 -07001856 main.testName = "Multi To Single Point Intents"
1857 main.case( main.testName + " Test - " + str( main.numCtrls ) +
Jeremy6e9748f2016-03-25 15:03:39 -07001858 " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
Jon Hall783bbf92015-07-23 14:33:19 -07001859 main.caseExplanation = "This test case will test single point to" +\
kelvin-onlab6dea6e62015-07-23 13:07:26 -07001860 " multi point intents using " +\
1861 str( main.numCtrls ) + " node(s) cluster;\n" +\
1862 "Different type of hosts will be tested in " +\
1863 "each step such as IPV4, Dual stack, VLAN etc" +\
1864 ";\nThe test will use OF " + main.OFProtocol +\
Jeremy6e9748f2016-03-25 15:03:39 -07001865 " OVS running in Mininet and compile intents" +\
1866 " using " + main.flowCompiler
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001867
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001868 main.step( "NOOPTION: Add multi point to single point intents" )
1869 main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
1870 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001871 { "name": "h16", "device": "of:0000000000000006/8" },
1872 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001873 ]
1874 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001875 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001876 ]
Jon Hall9c888672017-05-15 18:03:54 -07001877 badSenders = [ { "name": "h17" } ] # Senders that are not in the intent
1878 badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001879 testResult = main.FALSE
1880 installResult = main.intentFunction.installMultiToSingleIntent(
1881 main,
1882 name="NOOPTION",
1883 senders=senders,
1884 recipients=recipients,
1885 sw1="s5",
Jeremye0cb5eb2016-01-27 17:39:09 -08001886 sw2="s2" )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001887
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001888 if installResult:
1889 testResult = main.intentFunction.testPointIntent(
1890 main,
1891 intentId=installResult,
1892 name="NOOPTION",
1893 senders=senders,
1894 recipients=recipients,
1895 badSenders=badSenders,
1896 badRecipients=badRecipients,
1897 sw1="s5",
1898 sw2="s2",
Jeremye0cb5eb2016-01-27 17:39:09 -08001899 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001900 else:
1901 main.CLIs[ 0 ].removeAllIntents( purge=True )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001902
1903 utilities.assert_equals( expect=main.TRUE,
1904 actual=testResult,
1905 onpass=main.assertReturnString,
1906 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001907
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001908 main.step( "IPV4: Add multi point to single point intents" )
acsmars5d8cc862015-09-25 09:44:50 -07001909 main.assertReturnString = "Assertion results for IPV4 multi to single point intent with IPV4 type and MAC addresses\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001910 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001911 { "name": "h16", "device": "of:0000000000000006/8", "mac": "00:00:00:00:00:10" },
1912 { "name": "h24", "device": "of:0000000000000007/8", "mac": "00:00:00:00:00:18" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001913 ]
1914 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001915 { "name": "h8", "device": "of:0000000000000005/8", "mac": "00:00:00:00:00:08" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001916 ]
Jon Hall9c888672017-05-15 18:03:54 -07001917 badSenders = [ { "name": "h17" } ] # Senders that are not in the intent
1918 badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001919 testResult = main.FALSE
1920 installResult = main.intentFunction.installMultiToSingleIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001921 main,
1922 name="IPV4",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001923 senders=senders,
1924 recipients=recipients,
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001925 ethType="IPV4",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001926 sw1="s5",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001927 sw2="s2" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001928
1929 if installResult:
1930 testResult = main.intentFunction.testPointIntent(
1931 main,
1932 intentId=installResult,
1933 name="IPV4",
1934 senders=senders,
1935 recipients=recipients,
1936 badSenders=badSenders,
1937 badRecipients=badRecipients,
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001938 sw1="s5",
1939 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001940 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001941 else:
1942 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001943
1944 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001945 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001946 onpass=main.assertReturnString,
1947 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001948
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001949 main.step( "IPV4_2: Add multi point to single point intents" )
acsmars5d8cc862015-09-25 09:44:50 -07001950 main.assertReturnString = "Assertion results for IPV4 multi to single point intent with IPV4 type and no MAC addresses\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001951 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001952 { "name": "h16", "device": "of:0000000000000006/8" },
1953 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001954 ]
1955 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001956 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001957 ]
Jon Hall9c888672017-05-15 18:03:54 -07001958 badSenders = [ { "name": "h17" } ] # Senders that are not in the intent
1959 badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001960 testResult = main.FALSE
1961 installResult = main.intentFunction.installMultiToSingleIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001962 main,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001963 name="IPV4_2",
1964 senders=senders,
1965 recipients=recipients,
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001966 ethType="IPV4",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001967 sw1="s5",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001968 sw2="s2" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001969
1970 if installResult:
1971 testResult = main.intentFunction.testPointIntent(
1972 main,
1973 intentId=installResult,
1974 name="IPV4_2",
1975 senders=senders,
1976 recipients=recipients,
1977 badSenders=badSenders,
1978 badRecipients=badRecipients,
1979 sw1="s5",
1980 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07001981 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08001982 else:
1983 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001984
1985 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001986 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07001987 onpass=main.assertReturnString,
1988 onfail=main.assertReturnString )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001989
kelvin-onlabd48a68c2015-07-13 16:01:36 -07001990 main.step( "VLAN: Add multi point to single point intents" )
acsmars5d8cc862015-09-25 09:44:50 -07001991 main.assertReturnString = "Assertion results for IPV4 multi to single point intent with IPV4 type and no MAC addresses in the same VLAN\n"
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001992 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07001993 { "name": "h13", "device": "of:0000000000000006/5", "vlan": "200" },
1994 { "name": "h21", "device": "of:0000000000000007/5", "vlan": "200" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001995 ]
1996 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07001997 { "name": "h5", "device": "of:0000000000000005/5", "vlan": "200" }
Jeremy Songster1f39bf02016-01-20 17:17:25 -08001998 ]
Jon Hall9c888672017-05-15 18:03:54 -07001999 badSenders = [ { "name": "h12" } ] # Senders that are not in the intent
2000 badRecipients = [ { "name": "h20" } ] # Recipients that are not in the intent
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002001 testResult = main.FALSE
2002 installResult = main.intentFunction.installMultiToSingleIntent(
kelvin-onlabd48a68c2015-07-13 16:01:36 -07002003 main,
2004 name="VLAN",
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002005 senders=senders,
2006 recipients=recipients,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002007 sw1="s5",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07002008 sw2="s2" )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002009
2010 if installResult:
2011 testResult = main.intentFunction.testPointIntent(
2012 main,
2013 intentId=installResult,
2014 name="VLAN",
2015 senders=senders,
2016 recipients=recipients,
2017 badSenders=badSenders,
2018 badRecipients=badRecipients,
kelvin-onlabd48a68c2015-07-13 16:01:36 -07002019 sw1="s5",
2020 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07002021 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08002022 else:
2023 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabd48a68c2015-07-13 16:01:36 -07002024
2025 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002026 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07002027 onpass=main.assertReturnString,
2028 onfail=main.assertReturnString )
kelvin-onlabf34a58a2015-07-23 16:41:52 -07002029
Jeremy Songsterff553672016-05-12 17:06:23 -07002030 # Right now this fails because of this bug: https://jira.onosproject.org/browse/ONOS-4383
2031 main.step( "VLAN: Add multi point to single point intents" )
2032 main.assertReturnString = "Assertion results for multi to single point intent with VLAN ID treatment\n"
2033 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07002034 { "name": "h13", "device": "of:0000000000000006/5", "vlan": "200" },
2035 { "name": "h21", "device": "of:0000000000000007/5", "vlan": "200" }
Jeremy Songsterff553672016-05-12 17:06:23 -07002036 ]
2037 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07002038 { "name": "h4", "vlan": "100" }
Jeremy Songsterff553672016-05-12 17:06:23 -07002039 ]
Jon Hall9c888672017-05-15 18:03:54 -07002040 badSenders = [ { "name": "h12" } ] # Senders that are not in the intent
2041 badRecipients = [ { "name": "h20" } ] # Recipients that are not in the intent
Jeremy Songsterff553672016-05-12 17:06:23 -07002042 testResult = main.FALSE
Jeremy Songsterff553672016-05-12 17:06:23 -07002043 installResult = main.intentFunction.installMultiToSingleIntent(
2044 main,
2045 name="VLAN2",
2046 senders=senders,
2047 recipients=recipients,
2048 sw1="s5",
2049 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07002050 setVlan=100 )
Jeremy Songsterff553672016-05-12 17:06:23 -07002051
2052 if installResult:
2053 testResult = main.intentFunction.testPointIntent(
2054 main,
2055 intentId=installResult,
2056 name="VLAN2",
2057 senders=senders,
2058 recipients=recipients,
2059 badSenders=badSenders,
2060 badRecipients=badRecipients,
2061 sw1="s5",
2062 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07002063 expectedLink=18 )
Jeremy Songsterff553672016-05-12 17:06:23 -07002064 else:
2065 main.CLIs[ 0 ].removeAllIntents( purge=True )
2066
2067 utilities.assert_equals( expect=main.TRUE,
2068 actual=testResult,
2069 onpass=main.assertReturnString,
2070 onfail=main.assertReturnString )
2071
Jeremy Songsterc032f162016-08-04 17:14:49 -07002072 main.step( "ENCAPSULATION: Add multi point to single point intents" )
2073 main.assertReturnString = "Assertion results for VLAN Encapsulation multi to single point intent\n"
2074 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07002075 { "name": "h16", "device": "of:0000000000000006/8" },
2076 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremy Songsterc032f162016-08-04 17:14:49 -07002077 ]
2078 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07002079 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremy Songsterc032f162016-08-04 17:14:49 -07002080 ]
Jon Hall9c888672017-05-15 18:03:54 -07002081 badSenders = [ { "name": "h17" } ] # Senders that are not in the intent
2082 badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent
Jeremy Songsterc032f162016-08-04 17:14:49 -07002083 testResult = main.FALSE
Jeremy Songsterc032f162016-08-04 17:14:49 -07002084 installResult = main.intentFunction.installMultiToSingleIntent(
2085 main,
2086 name="ENCAPSULATION",
2087 senders=senders,
2088 recipients=recipients,
2089 sw1="s5",
2090 sw2="s2",
2091 encap="VLAN" )
2092
2093 if installResult:
2094 testResult = main.intentFunction.testPointIntent(
2095 main,
2096 intentId=installResult,
2097 name="ENCAPSULATION",
2098 senders=senders,
2099 recipients=recipients,
2100 badSenders=badSenders,
2101 badRecipients=badRecipients,
2102 sw1="s5",
2103 sw2="s2",
2104 expectedLink=18 )
2105 else:
2106 main.CLIs[ 0 ].removeAllIntents( purge=True )
2107
2108 utilities.assert_equals( expect=main.TRUE,
2109 actual=testResult,
2110 onpass=main.assertReturnString,
2111 onfail=main.assertReturnString )
2112
Shreyaca8990f2017-03-16 11:43:11 -07002113 #Testing MPLS would require kernel version of 4.1 or higher (Current version is 3.13)
2114 #main.step( "ENCAPSULATION: Add multi point to single point intents" )
2115 #main.assertReturnString = "Assertion results for MPLS Encapsulation multi to single point intent\n"
2116 #senders = [
2117 # { "name": "h16", "device": "of:0000000000000006/8" },
2118 # { "name": "h24", "device": "of:0000000000000007/8" }
2119 #]
2120 #recipients = [
2121 # { "name": "h8", "device": "of:0000000000000005/8" }
2122 #]
2123 #badSenders = [ { "name": "h17" } ] # Senders that are not in the intent
2124 #badRecipients = [ {"name": "h9" } ] # Recipients that are not in the intent
2125 #testResult = main.FALSE
2126 #installResult = main.intentFunction.installMultiToSingleIntent(
2127 # main,
2128 # name="ENCAPSULATION",
2129 # senders=senders,
2130 # recipients=recipients,
2131 # sw1="s5",
2132 # sw2="s2",
2133 # encap="MPLS" )
alison52b25892016-09-19 10:53:48 -07002134 #
Shreyaca8990f2017-03-16 11:43:11 -07002135 #if installResult:
2136 # testResult = main.intentFunction.testPointIntent(
2137 # main,
2138 # intentId=installResult,
2139 # name="ENCAPSULATION",
2140 # senders=senders,
2141 # recipients=recipients,
2142 # badSenders=badSenders,
2143 # badRecipients=badRecipients,
2144 # sw1="s5",
2145 # sw2="s2",
2146 # expectedLink=18 )
2147 #else:
2148 # main.CLIs[ 0 ].removeAllIntents( purge=True )
alison52b25892016-09-19 10:53:48 -07002149 #
Shreyaca8990f2017-03-16 11:43:11 -07002150 #utilities.assert_equals( expect=main.TRUE,
2151 # actual=testResult,
2152 # onpass=main.assertReturnString,
2153 # onfail=main.assertReturnString )
alison52b25892016-09-19 10:53:48 -07002154
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002155 main.intentFunction.report( main )
2156
acsmars1ff5e052015-07-23 11:27:48 -07002157 def CASE5000( self, main ):
2158 """
acsmars5d8cc862015-09-25 09:44:50 -07002159 Tests Host Mobility
2160 Modifies the topology location of h1
acsmars1ff5e052015-07-23 11:27:48 -07002161 """
Jeremyd9e4eb12016-04-13 12:09:06 -07002162 if main.initialized == main.FALSE:
2163 main.log.error( "Test components did not start correctly, skipping further tests" )
2164 main.skipCase()
acsmars1ff5e052015-07-23 11:27:48 -07002165 assert main, "There is no main"
Jeremyd9e4eb12016-04-13 12:09:06 -07002166 try:
2167 assert main.CLIs
2168 except AssertionError:
2169 main.log.error( "There is no main.CLIs, skipping test cases" )
2170 main.initialized = main.FALSE
2171 main.skipCase()
2172 try:
2173 assert main.Mininet1
2174 except AssertionError:
2175 main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
2176 main.initialized = main.FALSE
2177 main.skipCase()
2178 try:
2179 assert main.numSwitch
2180 except AssertionError:
Jeremy Songstere7f3b342016-08-17 14:56:49 -07002181 main.log.error( "Place the total number of switch topology in "+\
2182 main.numSwitch )
Jeremyd9e4eb12016-04-13 12:09:06 -07002183 main.initialized = main.FALSE
2184 main.skipCase()
alison52b25892016-09-19 10:53:48 -07002185 main.case( "Test host mobility with host intents " + " - " + str( main.numCtrls ) +
2186 " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002187 main.step( "Testing host mobility by moving h1 from s5 to s6" )
acsmars1ff5e052015-07-23 11:27:48 -07002188
Jeremy Songstere7f3b342016-08-17 14:56:49 -07002189 main.log.info( "Moving h1 from s5 to s6" )
Jon Hall9c888672017-05-15 18:03:54 -07002190 main.Mininet1.moveHost( "h1", "s5", "s6" )
acsmars1ff5e052015-07-23 11:27:48 -07002191
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002192 # Send discovery ping from moved host
2193 # Moving the host brings down the default interfaces and creates a new one.
2194 # Scapy is restarted on this host to detect the new interface
2195 main.h1.stopScapy()
2196 main.h1.startScapy()
2197
2198 # Discover new host location in ONOS and populate host data.
2199 # Host 1 IP and MAC should be unchanged
2200 main.intentFunction.sendDiscoveryArp( main, [ main.h1 ] )
2201 main.intentFunction.populateHostData( main )
2202
acsmars1ff5e052015-07-23 11:27:48 -07002203 h1PostMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
2204
2205 utilities.assert_equals( expect="of:0000000000000006",
2206 actual=h1PostMove,
2207 onpass="Mobility: Successfully moved h1 to s6",
acsmars5d8cc862015-09-25 09:44:50 -07002208 onfail="Mobility: Failed to move h1 to s6" +
kelvin-onlabf34a58a2015-07-23 16:41:52 -07002209 " to single point intents" +
2210 " with IPV4 type and MAC addresses" +
2211 " in the same VLAN" )
2212
2213 main.step( "IPV4: Add host intents between h1 and h9" )
acsmars5d8cc862015-09-25 09:44:50 -07002214 main.assertReturnString = "Assert result for IPV4 host intent between h1, moved, and h9\n"
Jon Hall9c888672017-05-15 18:03:54 -07002215 host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" }
2216 host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" }
Jeremy42df2e72016-02-23 16:37:46 -08002217 testResult = main.FALSE
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002218 installResult = main.intentFunction.installHostIntent( main,
alison52b25892016-09-19 10:53:48 -07002219 name="IPV4 Mobility IPV4",
2220 onosNode=0,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002221 host1=host1,
Jeremye0cb5eb2016-01-27 17:39:09 -08002222 host2=host2 )
Jeremy2f190ca2016-01-29 15:23:57 -08002223 if installResult:
2224 testResult = main.intentFunction.testHostIntent( main,
alison52b25892016-09-19 10:53:48 -07002225 name="Host Mobility IPV4",
Jon Hall9c888672017-05-15 18:03:54 -07002226 intentId=installResult,
alison52b25892016-09-19 10:53:48 -07002227 onosNode=0,
Jeremy2f190ca2016-01-29 15:23:57 -08002228 host1=host1,
2229 host2=host2,
2230 sw1="s6",
2231 sw2="s2",
2232 expectedLink=18 )
Jeremy42df2e72016-02-23 16:37:46 -08002233 else:
2234 main.CLIs[ 0 ].removeAllIntents( purge=True )
kelvin-onlabf34a58a2015-07-23 16:41:52 -07002235
2236 utilities.assert_equals( expect=main.TRUE,
Jeremy Songster1f39bf02016-01-20 17:17:25 -08002237 actual=testResult,
acsmars5d8cc862015-09-25 09:44:50 -07002238 onpass=main.assertReturnString,
2239 onfail=main.assertReturnString )
kelvin-onlab016dce22015-08-10 09:54:11 -07002240
2241 main.intentFunction.report( main )
Jeremye0cb5eb2016-01-27 17:39:09 -08002242
2243 def CASE6000( self, main ):
2244 """
2245 Tests Multi to Single Point Intent and Single to Multi Point Intent End Point Failure
2246 """
Jeremy Songster9385d412016-06-02 17:57:36 -07002247 # At some later point discussion on this behavior in MPSP and SPMP intents
2248 # will be reoppened and this test case may need to be updated to reflect
2249 # the outcomes of that discussion
Jeremyd9e4eb12016-04-13 12:09:06 -07002250 if main.initialized == main.FALSE:
2251 main.log.error( "Test components did not start correctly, skipping further tests" )
2252 main.skipCase()
Jeremye0cb5eb2016-01-27 17:39:09 -08002253 assert main, "There is no main"
Jeremyd9e4eb12016-04-13 12:09:06 -07002254 try:
2255 assert main.CLIs
2256 except AssertionError:
2257 main.log.error( "There is no main.CLIs, skipping test cases" )
2258 main.initialized = main.FALSE
2259 main.skipCase()
2260 try:
2261 assert main.Mininet1
2262 except AssertionError:
2263 main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
2264 main.initialized = main.FALSE
2265 main.skipCase()
2266 try:
2267 assert main.numSwitch
2268 except AssertionError:
alison52b25892016-09-19 10:53:48 -07002269 main.log.error( "Place the total number of switch topology in " + main.numSwitch )
Jeremyd9e4eb12016-04-13 12:09:06 -07002270 main.initialized = main.FALSE
2271 main.skipCase()
alison52b25892016-09-19 10:53:48 -07002272 main.case( "Test Multi to Single End Point Failure" + " - " + str( main.numCtrls ) +
2273 " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
Jeremy Songster9385d412016-06-02 17:57:36 -07002274 main.step( "Installing Multi to Single Point intents with no options set" )
2275 main.assertReturnString = "Assertion results for IPV4 multi to single " +\
2276 "point intent end point failure with no options set\n"
Jeremye0cb5eb2016-01-27 17:39:09 -08002277 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07002278 { "name": "h16", "device": "of:0000000000000006/8" },
2279 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremye0cb5eb2016-01-27 17:39:09 -08002280 ]
2281 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07002282 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremye0cb5eb2016-01-27 17:39:09 -08002283 ]
2284 isolatedSenders = [
Jon Hall9c888672017-05-15 18:03:54 -07002285 { "name": "h24" }
Jeremye0cb5eb2016-01-27 17:39:09 -08002286 ]
2287 isolatedRecipients = []
2288 testResult = main.FALSE
2289 installResult = main.intentFunction.installMultiToSingleIntent(
2290 main,
2291 name="NOOPTION",
2292 senders=senders,
2293 recipients=recipients,
2294 sw1="s5",
2295 sw2="s2" )
2296
2297 if installResult:
2298 testResult = main.intentFunction.testEndPointFail(
2299 main,
2300 intentId=installResult,
2301 name="NOOPTION",
2302 senders=senders,
2303 recipients=recipients,
2304 isolatedSenders=isolatedSenders,
2305 isolatedRecipients=isolatedRecipients,
2306 sw1="s6",
2307 sw2="s2",
2308 sw3="s4",
2309 sw4="s1",
2310 sw5="s3",
2311 expectedLink1=16,
2312 expectedLink2=14 )
Jeremy42df2e72016-02-23 16:37:46 -08002313 else:
2314 main.CLIs[ 0 ].removeAllIntents( purge=True )
Jeremye0cb5eb2016-01-27 17:39:09 -08002315
2316 utilities.assert_equals( expect=main.TRUE,
2317 actual=testResult,
2318 onpass=main.assertReturnString,
2319 onfail=main.assertReturnString )
2320
Jeremy Songster9385d412016-06-02 17:57:36 -07002321 main.step( "Installing Multi to Single Point intents with partial failure allowed" )
2322
2323 main.assertReturnString = "Assertion results for IPV4 multi to single " +\
2324 "with partial failures allowed\n"
2325 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07002326 { "name": "h16", "device": "of:0000000000000006/8" },
2327 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremy Songster9385d412016-06-02 17:57:36 -07002328 ]
2329 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07002330 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremy Songster9385d412016-06-02 17:57:36 -07002331 ]
2332 isolatedSenders = [
Jon Hall9c888672017-05-15 18:03:54 -07002333 { "name": "h24" }
Jeremy Songster9385d412016-06-02 17:57:36 -07002334 ]
2335 isolatedRecipients = []
2336 testResult = main.FALSE
Jeremy Songster9385d412016-06-02 17:57:36 -07002337 installResult = main.intentFunction.installMultiToSingleIntent(
2338 main,
2339 name="NOOPTION",
2340 senders=senders,
2341 recipients=recipients,
2342 sw1="s5",
2343 sw2="s2",
2344 partial=True )
2345
2346 if installResult:
2347 testResult = main.intentFunction.testEndPointFail(
2348 main,
2349 intentId=installResult,
2350 name="NOOPTION",
2351 senders=senders,
2352 recipients=recipients,
2353 isolatedSenders=isolatedSenders,
2354 isolatedRecipients=isolatedRecipients,
2355 sw1="s6",
2356 sw2="s2",
2357 sw3="s4",
2358 sw4="s1",
2359 sw5="s3",
2360 expectedLink1=16,
2361 expectedLink2=14,
2362 partial=True )
2363 else:
2364 main.CLIs[ 0 ].removeAllIntents( purge=True )
2365
2366 utilities.assert_equals( expect=main.TRUE,
2367 actual=testResult,
2368 onpass=main.assertReturnString,
2369 onfail=main.assertReturnString )
2370
Jeremye0cb5eb2016-01-27 17:39:09 -08002371 main.step( "NOOPTION: Install and test single point to multi point intents" )
Jeremy Songster9385d412016-06-02 17:57:36 -07002372 main.assertReturnString = "Assertion results for IPV4 single to multi " +\
2373 "point intent with no options set\n"
Jeremye0cb5eb2016-01-27 17:39:09 -08002374 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07002375 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremye0cb5eb2016-01-27 17:39:09 -08002376 ]
2377 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07002378 { "name": "h16", "device": "of:0000000000000006/8" },
2379 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremye0cb5eb2016-01-27 17:39:09 -08002380 ]
Jeremy Songster9385d412016-06-02 17:57:36 -07002381 isolatedSenders = []
2382 isolatedRecipients = [
Jon Hall9c888672017-05-15 18:03:54 -07002383 { "name": "h24" }
Jeremye0cb5eb2016-01-27 17:39:09 -08002384 ]
2385 testResult = main.FALSE
2386 installResult = main.intentFunction.installSingleToMultiIntent(
2387 main,
2388 name="NOOPTION",
2389 senders=senders,
2390 recipients=recipients,
2391 sw1="s5",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07002392 sw2="s2" )
Jeremye0cb5eb2016-01-27 17:39:09 -08002393
2394 if installResult:
2395 testResult = main.intentFunction.testEndPointFail(
2396 main,
2397 intentId=installResult,
2398 name="NOOPTION",
2399 senders=senders,
2400 recipients=recipients,
2401 isolatedSenders=isolatedSenders,
2402 isolatedRecipients=isolatedRecipients,
2403 sw1="s6",
2404 sw2="s2",
2405 sw3="s4",
2406 sw4="s1",
2407 sw5="s3",
2408 expectedLink1=16,
2409 expectedLink2=14 )
Jeremy42df2e72016-02-23 16:37:46 -08002410 else:
2411 main.CLIs[ 0 ].removeAllIntents( purge=True )
Jeremye0cb5eb2016-01-27 17:39:09 -08002412
2413 utilities.assert_equals( expect=main.TRUE,
2414 actual=testResult,
2415 onpass=main.assertReturnString,
2416 onfail=main.assertReturnString )
Jeremy Songster9385d412016-06-02 17:57:36 -07002417 # Right now this functionality doesn't work properly in SPMP intents
2418 main.step( "NOOPTION: Install and test single point to multi point " +\
2419 "intents with partial failures allowed" )
2420 main.assertReturnString = "Assertion results for IPV4 single to multi " +\
2421 "point intent with partial failures allowed\n"
2422 senders = [
Jon Hall9c888672017-05-15 18:03:54 -07002423 { "name": "h8", "device": "of:0000000000000005/8" }
Jeremy Songster9385d412016-06-02 17:57:36 -07002424 ]
2425 recipients = [
Jon Hall9c888672017-05-15 18:03:54 -07002426 { "name": "h16", "device": "of:0000000000000006/8" },
2427 { "name": "h24", "device": "of:0000000000000007/8" }
Jeremy Songster9385d412016-06-02 17:57:36 -07002428 ]
2429 isolatedSenders = []
2430 isolatedRecipients = [
Jon Hall9c888672017-05-15 18:03:54 -07002431 { "name": "h24" }
Jeremy Songster9385d412016-06-02 17:57:36 -07002432 ]
2433 testResult = main.FALSE
Jeremy Songster9385d412016-06-02 17:57:36 -07002434 installResult = main.intentFunction.installSingleToMultiIntent(
2435 main,
2436 name="NOOPTION",
2437 senders=senders,
2438 recipients=recipients,
2439 sw1="s5",
2440 sw2="s2",
Jeremy Songstere7f3b342016-08-17 14:56:49 -07002441 partial=True )
Jeremy Songster9385d412016-06-02 17:57:36 -07002442
2443 if installResult:
2444 testResult = main.intentFunction.testEndPointFail(
2445 main,
2446 intentId=installResult,
2447 name="NOOPTION",
2448 senders=senders,
2449 recipients=recipients,
2450 isolatedSenders=isolatedSenders,
2451 isolatedRecipients=isolatedRecipients,
2452 sw1="s6",
2453 sw2="s2",
2454 sw3="s4",
2455 sw4="s1",
2456 sw5="s3",
2457 expectedLink1=16,
2458 expectedLink2=14,
2459 partial=True )
2460 else:
2461 main.CLIs[ 0 ].removeAllIntents( purge=True )
2462
2463 utilities.assert_equals( expect=main.TRUE,
2464 actual=testResult,
2465 onpass=main.assertReturnString,
2466 onfail=main.assertReturnString )
Jeremye0cb5eb2016-01-27 17:39:09 -08002467
Chiyu Chengef109502016-11-21 15:51:38 -08002468 main.intentFunction.report( main )