blob: d3583e6f37aff9454fa30d82d7bca032a053ac3e [file] [log] [blame]
kelvin-onlab4ff9cc12015-05-05 11:14:42 -07001
2# Testing the basic functionality of ONOS Next
3# For sanity and driver functionality excercises only.
4
5import time
6import json
7
8time.sleep( 1 )
9
kelvin-onlab05cf7732015-05-08 14:25:46 -070010class FuncIntent:
kelvin-onlab4ff9cc12015-05-05 11:14:42 -070011
12 def __init__( self ):
13 self.default = ''
14
15 def CASE10( self, main ):
16 import time
17 import os
kelvin-onlabe5239e52015-05-13 14:46:45 -070018 import imp
kelvin-onlab4ff9cc12015-05-05 11:14:42 -070019 """
20 Startup sequence:
21 cell <name>
22 onos-verify-cell
23 onos-remove-raft-log
24 git pull
25 mvn clean install
26 onos-package
27 onos-install -f
28 onos-wait-for-start
29 """
kelvin-onlabf70fd542015-05-07 18:41:40 -070030 global init
cameron@onlab.us59d29d92015-05-11 14:31:54 -070031 global globalONOSip
kelvin-onlabf70fd542015-05-07 18:41:40 -070032 try:
33 if type(init) is not bool:
34 init = False
35 except NameError:
36 init = False
kelvin-onlab132bd5b2015-05-18 18:15:26 -070037
38 main.wrapper = imp.load_source( 'FuncIntentFunction',
39 '/home/admin/ONLabTest/TestON/tests/' +
40 'FuncIntent/Dependency/' +
41 'FuncIntentFunction.py' )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -070042 #Local variables
43 cellName = main.params[ 'ENV' ][ 'cellName' ]
kelvin-onlabf70fd542015-05-07 18:41:40 -070044 apps = main.params[ 'ENV' ][ 'cellApps' ]
kelvin-onlabf70fd542015-05-07 18:41:40 -070045 gitBranch = main.params[ 'GIT' ][ 'branch' ]
cameron@onlab.us59d29d92015-05-11 14:31:54 -070046 benchIp = os.environ[ 'OCN' ]
kelvin-onlabf70fd542015-05-07 18:41:40 -070047 benchUser = main.params[ 'BENCH' ][ 'user' ]
kelvin-onlab05cf7732015-05-08 14:25:46 -070048 topology = main.params[ 'MININET' ][ 'topo' ]
kelvin-onlab4ff9cc12015-05-05 11:14:42 -070049 main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
kelvin-onlab65782a82015-05-07 14:12:13 -070050 main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
kelvin-onlabf70fd542015-05-07 18:41:40 -070051 main.numCtrls = main.params[ 'CTRL' ][ 'num' ]
kelvin-onlab132bd5b2015-05-18 18:15:26 -070052 main.ONOSport = []
53 main.hostsData = {}
kelvin-onlab4ff9cc12015-05-05 11:14:42 -070054 PULLCODE = False
55 if main.params[ 'GIT' ][ 'pull' ] == 'True':
56 PULLCODE = True
57 main.case( "Setting up test environment" )
kelvin-onlabf70fd542015-05-07 18:41:40 -070058 main.CLIs = []
59 for i in range( 1, int( main.numCtrls ) + 1 ):
60 main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
kelvin-onlab132bd5b2015-05-18 18:15:26 -070061 main.ONOSport.append( main.params[ 'CTRL' ][ 'port' + str( i ) ] )
cameron@onlab.us7fd2a522015-05-14 11:20:33 -070062
kelvin-onlabf70fd542015-05-07 18:41:40 -070063 # -- INIT SECTION, ONLY RUNS ONCE -- #
64 if init == False:
65 init = True
kelvin-onlabf70fd542015-05-07 18:41:40 -070066
kelvin-onlab05cf7732015-05-08 14:25:46 -070067 main.scale = ( main.params[ 'SCALE' ] ).split( "," )
68 main.numCtrls = int( main.scale[ 0 ] )
kelvin-onlabf70fd542015-05-07 18:41:40 -070069
70 if PULLCODE:
71 main.step( "Git checkout and pull " + gitBranch )
72 main.ONOSbench.gitCheckout( gitBranch )
73 gitPullResult = main.ONOSbench.gitPull()
74 if gitPullResult == main.ERROR:
75 main.log.error( "Error pulling git branch" )
76 main.step( "Using mvn clean & install" )
77 cleanInstallResult = main.ONOSbench.cleanInstall()
78 stepResult = cleanInstallResult
79 utilities.assert_equals( expect=main.TRUE,
80 actual=stepResult,
81 onpass="Successfully compiled " +
82 "latest ONOS",
83 onfail="Failed to compile " +
84 "latest ONOS" )
85 else:
86 main.log.warn( "Did not pull new code so skipping mvn " +
87 "clean install" )
kelvin-onlab132bd5b2015-05-18 18:15:26 -070088
cameron@onlab.us033cc0f2015-05-15 15:27:43 -070089 globalONOSip = main.ONOSbench.getOnosIps()
kelvin-onlab0a28a742015-05-18 16:03:13 -070090
cameron@onlab.us033cc0f2015-05-15 15:27:43 -070091 maxNodes = ( len(globalONOSip) - 2 )
kelvin-onlabf70fd542015-05-07 18:41:40 -070092
kelvin-onlab05cf7732015-05-08 14:25:46 -070093 main.numCtrls = int( main.scale[ 0 ] )
94 main.scale.remove( main.scale[ 0 ] )
cameron@onlab.us59d29d92015-05-11 14:31:54 -070095
cameron@onlab.us033cc0f2015-05-15 15:27:43 -070096 main.ONOSip = []
kelvin-onlab0a28a742015-05-18 16:03:13 -070097 for i in range( maxNodes ):
cameron@onlab.us59d29d92015-05-11 14:31:54 -070098 main.ONOSip.append( globalONOSip[i] )
99
kelvin-onlabf70fd542015-05-07 18:41:40 -0700100 #kill off all onos processes
101 main.log.info( "Safety check, killing all ONOS processes" +
102 " before initiating enviornment setup" )
kelvin-onlab132bd5b2015-05-18 18:15:26 -0700103 for i in range(maxNodes):
104 main.ONOSbench.onosDie( globalONOSip[ i ] )
105
kelvin-onlab05cf7732015-05-08 14:25:46 -0700106 print "NODE COUNT = ", main.numCtrls
kelvin-onlabf70fd542015-05-07 18:41:40 -0700107 main.log.info( "Creating cell file" )
108 cellIp = []
kelvin-onlab05cf7732015-05-08 14:25:46 -0700109 for i in range( main.numCtrls ):
110 cellIp.append( str( main.ONOSip[ i ] ) )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700111 print cellIp
112 main.ONOSbench.createCellFile( benchIp, cellName, "",
113 str( apps ), *cellIp )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700114
115 main.step( "Apply cell to environment" )
116 cellResult = main.ONOSbench.setCell( cellName )
117 verifyResult = main.ONOSbench.verifyCell()
118 stepResult = cellResult and verifyResult
119 utilities.assert_equals( expect=main.TRUE,
120 actual=stepResult,
121 onpass="Successfully applied cell to " + \
122 "environment",
123 onfail="Failed to apply cell to environment " )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700124
125 main.step( "Creating ONOS package" )
126 packageResult = main.ONOSbench.onosPackage()
127 stepResult = packageResult
128 utilities.assert_equals( expect=main.TRUE,
129 actual=stepResult,
130 onpass="Successfully created ONOS package",
131 onfail="Failed to create ONOS package" )
132
133 main.step( "Uninstalling ONOS package" )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700134 onosUninstallResult = main.TRUE
cameron@onlab.us033cc0f2015-05-15 15:27:43 -0700135 for i in range( main.numCtrls ):
kelvin-onlabf70fd542015-05-07 18:41:40 -0700136 onosUninstallResult = onosUninstallResult and \
kelvin-onlab05cf7732015-05-08 14:25:46 -0700137 main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700138 stepResult = onosUninstallResult
139 utilities.assert_equals( expect=main.TRUE,
140 actual=stepResult,
141 onpass="Successfully uninstalled ONOS package",
142 onfail="Failed to uninstall ONOS package" )
143 time.sleep( 5 )
144 main.step( "Installing ONOS package" )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700145 onosInstallResult = main.TRUE
cameron@onlab.us033cc0f2015-05-15 15:27:43 -0700146 for i in range( main.numCtrls ):
kelvin-onlabf70fd542015-05-07 18:41:40 -0700147 onosInstallResult = onosInstallResult and \
kelvin-onlab05cf7732015-05-08 14:25:46 -0700148 main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700149 stepResult = onosInstallResult
150 utilities.assert_equals( expect=main.TRUE,
151 actual=stepResult,
152 onpass="Successfully installed ONOS package",
153 onfail="Failed to install ONOS package" )
154
cameron@onlab.us59d29d92015-05-11 14:31:54 -0700155 time.sleep( 20 )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700156 main.step( "Starting ONOS service" )
157 stopResult = main.TRUE
158 startResult = main.TRUE
kelvin-onlabf70fd542015-05-07 18:41:40 -0700159 onosIsUp = main.TRUE
kelvin-onlab05cf7732015-05-08 14:25:46 -0700160 for i in range( main.numCtrls ):
161 onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700162 if onosIsUp == main.TRUE:
163 main.log.report( "ONOS instance is up and ready" )
164 else:
165 main.log.report( "ONOS instance may not be up, stop and " +
166 "start ONOS again " )
kelvin-onlab05cf7732015-05-08 14:25:46 -0700167 for i in range( main.numCtrls ):
kelvin-onlabf70fd542015-05-07 18:41:40 -0700168 stopResult = stopResult and \
kelvin-onlab05cf7732015-05-08 14:25:46 -0700169 main.ONOSbench.onosStop( main.ONOSip[ i ] )
170 for i in range( main.numCtrls ):
kelvin-onlabf70fd542015-05-07 18:41:40 -0700171 startResult = startResult and \
kelvin-onlab05cf7732015-05-08 14:25:46 -0700172 main.ONOSbench.onosStart( main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700173 stepResult = onosIsUp and stopResult and startResult
174 utilities.assert_equals( expect=main.TRUE,
175 actual=stepResult,
176 onpass="ONOS service is ready",
177 onfail="ONOS service did not start properly" )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700178
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700179 main.step( "Start ONOS cli" )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700180 cliResult = main.TRUE
kelvin-onlab05cf7732015-05-08 14:25:46 -0700181 for i in range( main.numCtrls ):
182 cliResult = cliResult and \
183 main.CLIs[i].startOnosCli( main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700184 stepResult = cliResult
185 utilities.assert_equals( expect=main.TRUE,
186 actual=stepResult,
187 onpass="Successfully start ONOS cli",
188 onfail="Failed to start ONOS cli" )
189
kelvin-onlab0a28a742015-05-18 16:03:13 -0700190 def CASE9( self, main ):
kelvin-onlab132bd5b2015-05-18 18:15:26 -0700191 '''
192 Report errors/warnings/exceptions
193 '''
194 main.log.info( "Error report: \n" )
195 main.ONOSbench.logReport( globalONOSip[0],
196 [ "INFO", "FOLLOWER", "WARN", "flow", "ERROR" , "Except" ],
197 "s" )
198 #main.ONOSbench.logReport( globalONOSip[1], [ "INFO" ], "d" )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700199
200 def CASE11( self, main ):
201 """
kelvin-onlab05cf7732015-05-08 14:25:46 -0700202 Start mininet
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700203 """
kelvin-onlab05cf7732015-05-08 14:25:46 -0700204 main.log.report( "Start Mininet topology" )
kelvin-onlab132bd5b2015-05-18 18:15:26 -0700205 main.log.case( "Start Mininet topology" )
206
kelvin-onlabf70fd542015-05-07 18:41:40 -0700207 main.step( "Starting Mininet Topology" )
208 topoResult = main.Mininet1.startNet( topoFile=topology )
209 stepResult = topoResult
210 utilities.assert_equals( expect=main.TRUE,
211 actual=stepResult,
212 onpass="Successfully loaded topology",
213 onfail="Failed to load topology" )
214 # Exit if topology did not load properly
215 if not topoResult:
216 main.cleanup()
217 main.exit()
218
kelvin-onlab05cf7732015-05-08 14:25:46 -0700219 def CASE12( self, main ):
220 """
221 Assign mastership to controllers
222 """
223 import re
224
kelvin-onlabe5239e52015-05-13 14:46:45 -0700225 main.case( "Assign switches to controllers" )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700226 main.step( "Assigning switches to controllers" )
227 assignResult = main.TRUE
kelvin-onlab5cbf9992015-05-05 14:34:07 -0700228 for i in range( 1, ( main.numSwitch + 1 ) ):
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700229 main.Mininet1.assignSwController( sw=str( i ),
230 count=1,
kelvin-onlab05cf7732015-05-08 14:25:46 -0700231 ip1=main.ONOSip[ 0 ],
232 port1=main.ONOSport[ 0 ] )
kelvin-onlab5cbf9992015-05-05 14:34:07 -0700233 for i in range( 1, ( main.numSwitch + 1 ) ):
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700234 response = main.Mininet1.getSwController( "s" + str( i ) )
235 print( "Response is " + str( response ) )
kelvin-onlab05cf7732015-05-08 14:25:46 -0700236 if re.search( "tcp:" + main.ONOSip[ 0 ], response ):
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700237 assignResult = assignResult and main.TRUE
238 else:
239 assignResult = main.FALSE
240 stepResult = assignResult
241 utilities.assert_equals( expect=main.TRUE,
242 actual=stepResult,
243 onpass="Successfully assigned switches" +
244 "to controller",
245 onfail="Failed to assign switches to " +
246 "controller" )
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700247 def CASE13( self, main ):
248 """
249 Discover all hosts and store its data to a dictionary
250 """
251 main.case( "Discover all hosts" )
252
253 stepResult = main.TRUE
kelvin-onlab132bd5b2015-05-18 18:15:26 -0700254 main.step( "Discover all hosts using pingall " )
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700255 stepResult = main.wrapper.getHostsData( main )
256 utilities.assert_equals( expect=main.FALSE,
257 actual=stepResult,
258 onpass="Successfully discovered hosts",
259 onfail="Failed to discover hosts" )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700260
kelvin-onlabf70fd542015-05-07 18:41:40 -0700261 def CASE1001( self, main ):
kelvin-onlab7c577e82015-05-07 10:45:16 -0700262 """
kelvin-onlab65782a82015-05-07 14:12:13 -0700263 Add host intents between 2 host:
264 - Discover hosts
265 - Add host intents
266 - Check intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700267 - Verify flows
kelvin-onlab65782a82015-05-07 14:12:13 -0700268 - Ping hosts
269 - Reroute
270 - Link down
kelvin-onlabe5239e52015-05-13 14:46:45 -0700271 - Verify flows
272 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700273 - Ping hosts
274 - Link up
kelvin-onlabe5239e52015-05-13 14:46:45 -0700275 - Verify flows
276 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700277 - Ping hosts
278 - Remove intents
kelvin-onlab7c577e82015-05-07 10:45:16 -0700279 """
280 import time
281 import json
kelvin-onlab65782a82015-05-07 14:12:13 -0700282 import re
283 """
284 Create your item(s) here
285 item = { 'name': '', 'host1':
286 { 'name': '', 'MAC': '00:00:00:00:00:0X',
287 'id':'00:00:00:00:00:0X/-X' } , 'host2':
288 { 'name': '', 'MAC': '00:00:00:00:00:0X',
289 'id':'00:00:00:00:00:0X/-X'}, 'link': { 'switch1': '',
kelvin-onlabe5239e52015-05-13 14:46:45 -0700290 'switch2': '', 'expect':'' } }
kelvin-onlab65782a82015-05-07 14:12:13 -0700291 """
kelvin-onlabe5239e52015-05-13 14:46:45 -0700292
293 # Assert variables - These variable's name|format must be followed
294 # if you want to use the wrapper function
295 assert main, "There is no main"
296 assert main.CLIs, "There is no main.CLIs"
297 assert main.Mininet1, "Mininet handle should be named Mininet1"
298 assert main.numSwitch, "Placed the total number of switch topology in \
299 main.numSwitch"
300
kelvin-onlabe5239e52015-05-13 14:46:45 -0700301 main.case( "Add host intents between 2 host" )
kelvin-onlab05cf7732015-05-08 14:25:46 -0700302
kelvin-onlabe5239e52015-05-13 14:46:45 -0700303 stepResult = main.TRUE
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700304 main.step( "IPV4: Add host intents between h1 and h9" )
305 stepResult = main.wrapper.hostIntent( main,
306 name='IPV4',
307 host1='h1',
308 host2='h9',
309 host1Id='00:00:00:00:00:01/-1',
310 host2Id='00:00:00:00:00:09/-1',
311 sw1='s5',
312 sw2='s2',
313 expectedLink=18 )
kelvin-onlab7c577e82015-05-07 10:45:16 -0700314
kelvin-onlabe5239e52015-05-13 14:46:45 -0700315 utilities.assert_equals( expect=main.TRUE,
316 actual=stepResult,
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700317 onpass="IPV4: Add host intent successful",
318 onfail="IPV4: Add host intent failed" )
319 stepResult = main.TRUE
320
321 main.step( "DUALSTACK: Add host intents between h3 and h11" )
322 stepResult = main.wrapper.hostIntent( main,
323 name='DUALSTACK',
324 host1='h3',
325 host2='h11',
326 host1Id='00:00:00:00:00:03/-1',
kelvin-onlab132bd5b2015-05-18 18:15:26 -0700327 host2Id='00:00:00:00:00:0B/-1',
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700328 sw1='s5',
329 sw2='s2',
330 expectedLink=18 )
331
332 utilities.assert_equals( expect=main.TRUE,
333 actual=stepResult,
334 onpass="DUALSTACK: Add host intent successful",
335 onfail="DUALSTACK: Add host intent failed" )
kelvin-onlab7c577e82015-05-07 10:45:16 -0700336
kelvin-onlabf70fd542015-05-07 18:41:40 -0700337 def CASE1002( self, main ):
kelvin-onlab65782a82015-05-07 14:12:13 -0700338 """
339 Add point intents between 2 hosts:
kelvin-onlabe5239e52015-05-13 14:46:45 -0700340 - Get device ids | ports
kelvin-onlab65782a82015-05-07 14:12:13 -0700341 - Add point intents
342 - Check intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700343 - Verify flows
kelvin-onlab65782a82015-05-07 14:12:13 -0700344 - Ping hosts
345 - Reroute
346 - Link down
kelvin-onlabe5239e52015-05-13 14:46:45 -0700347 - Verify flows
348 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700349 - Ping hosts
350 - Link up
kelvin-onlabe5239e52015-05-13 14:46:45 -0700351 - Verify flows
352 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700353 - Ping hosts
354 - Remove intents
355 """
kelvin-onlabe5239e52015-05-13 14:46:45 -0700356 import time
357 import json
358 import re
359 """
360 Create your item(s) here
kelvin-onlabb2235602015-05-13 17:51:06 -0700361 item = { 'name':'', 'host1': { 'name': '' },
362 'host2': { 'name': '' },
363 'ingressDevice':'' , 'egressDevice':'',
364 'ingressPort':'', 'egressPort':'',
kelvin-onlabe5239e52015-05-13 14:46:45 -0700365 'option':{ 'ethType':'', 'ethSrc':'', 'ethDst':'' } ,
366 'link': { 'switch1': '', 'switch2':'', 'expect':'' } }
367
368 """
369
370 # Assert variables - These variable's name|format must be followed
371 # if you want to use the wrapper function
372 assert main, "There is no main"
373 assert main.CLIs, "There is no main.CLIs"
374 assert main.Mininet1, "Mininet handle should be named Mininet1"
375 assert main.numSwitch, "Placed the total number of switch topology in \
376 main.numSwitch"
377
kelvin-onlabb2235602015-05-13 17:51:06 -0700378 ipv4 = { 'name':'IPV4', 'ingressDevice':'of:0000000000000005/1' ,
379 'host1': { 'name': 'h1' }, 'host2': { 'name': 'h9' },
380 'egressDevice':'of:0000000000000006/1', 'option':
kelvin-onlabe5239e52015-05-13 14:46:45 -0700381 { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:01',
382 'ethDst':'00:00:00:00:00:09' }, 'link': { 'switch1':'s5',
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700383 'switch2':'s2', 'expect':'18' } }
kelvin-onlabe5239e52015-05-13 14:46:45 -0700384
kelvin-onlabb2235602015-05-13 17:51:06 -0700385 """
386 ipv4 = { 'name':'IPV4', 'ingressDevice':'of:0000000000000005/1' ,
387 'host1': { 'name': 'h1' }, 'host2': { 'name': 'h9' },
388 'egressDevice':'of:0000000000000006/1', 'option':
389 { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:01' },
390 'link': { 'switch1':'s5', 'switch2':'s2', 'expect':'18' } }
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700391 """
kelvin-onlabb2235602015-05-13 17:51:06 -0700392 dualStack1 = { 'name':'IPV4', 'ingressDevice':'0000000000000005/3' ,
393 'host1': { 'name': 'h3' }, 'host2': { 'name': 'h11' },
394 'egressDevice':'0000000000000006/3', 'option':
395 { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:03',
396 'ethDst':'00:00:00:00:00:0B' }, 'link': { 'switch1':'s5',
397 'switch2':'s2', 'expect':'18' } }
kelvin-onlabe5239e52015-05-13 14:46:45 -0700398
kelvin-onlabb2235602015-05-13 17:51:06 -0700399 main.case( "Add point intents between 2 devices" )
400
401 stepResult = main.TRUE
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700402 main.step( "IPV4: Add point intents between h1 and h9" )
403 stepResult = main.wrapper.pointIntent(
404 main,
405 name="IPV4",
406 host1="h1",
407 host2="h9",
408 deviceId1="of:0000000000000005/1",
409 deviceId2="of:0000000000000006/1",
410 port1="",
411 port2="",
412 ethType="IPV4",
413 mac1="00:00:00:00:00:01",
414 mac2="00:00:00:00:00:09",
415 bandwidth="",
416 lambdaAlloc=False,
417 ipProto="",
418 ip1="",
419 ip2="",
420 tcp1="",
421 tcp2="",
422 sw1="s5",
423 sw2="s2",
424 expectedLink=18 )
425
kelvin-onlabb2235602015-05-13 17:51:06 -0700426 utilities.assert_equals( expect=main.TRUE,
427 actual=stepResult,
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700428 onpass="IPV4: Add point intent successful",
429 onfail="IPV4: Add point intent failed" )
kelvin-onlab65782a82015-05-07 14:12:13 -0700430
kelvin-onlabf70fd542015-05-07 18:41:40 -0700431 def CASE1003( self, main ):
kelvin-onlab65782a82015-05-07 14:12:13 -0700432 """
433 Add single point to multi point intents
434 - Get device ids
435 - Add single point to multi point intents
436 - Check intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700437 - Verify flows
kelvin-onlab65782a82015-05-07 14:12:13 -0700438 - Ping hosts
439 - Reroute
440 - Link down
kelvin-onlabe5239e52015-05-13 14:46:45 -0700441 - Verify flows
442 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700443 - Ping hosts
444 - Link up
kelvin-onlabe5239e52015-05-13 14:46:45 -0700445 - Verify flows
446 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700447 - Ping hosts
448 - Remove intents
449 """
450
kelvin-onlabf70fd542015-05-07 18:41:40 -0700451 def CASE1004( self, main ):
kelvin-onlab65782a82015-05-07 14:12:13 -0700452 """
453 Add multi point to single point intents
454 - Get device ids
455 - Add multi point to single point intents
456 - Check intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700457 - Verify flows
kelvin-onlab65782a82015-05-07 14:12:13 -0700458 - Ping hosts
459 - Reroute
460 - Link down
kelvin-onlabe5239e52015-05-13 14:46:45 -0700461 - Verify flows
462 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700463 - Ping hosts
464 - Link up
kelvin-onlabe5239e52015-05-13 14:46:45 -0700465 - Verify flows
466 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700467 - Ping hosts
468 - Remove intents
469 """