blob: 6d604a107f40909725638496a77439b8eba07770 [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-onlab4ff9cc12015-05-05 11:14:42 -070037 #Local variables
38 cellName = main.params[ 'ENV' ][ 'cellName' ]
kelvin-onlabf70fd542015-05-07 18:41:40 -070039 apps = main.params[ 'ENV' ][ 'cellApps' ]
kelvin-onlabf70fd542015-05-07 18:41:40 -070040 gitBranch = main.params[ 'GIT' ][ 'branch' ]
cameron@onlab.us59d29d92015-05-11 14:31:54 -070041 benchIp = os.environ[ 'OCN' ]
kelvin-onlabf70fd542015-05-07 18:41:40 -070042 benchUser = main.params[ 'BENCH' ][ 'user' ]
kelvin-onlab05cf7732015-05-08 14:25:46 -070043 topology = main.params[ 'MININET' ][ 'topo' ]
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -070044 #benchIp = main.params[ 'BENCH' ][ 'ip1' ]
45 benchUser = main.params[ 'BENCH' ][ 'user' ]
46 topology = main.params[ 'MININET' ][ 'topo' ]
47 #maxNodes = int( main.params[ 'availableNodes' ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -070048 main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
kelvin-onlab65782a82015-05-07 14:12:13 -070049 main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
kelvin-onlabf70fd542015-05-07 18:41:40 -070050 main.numCtrls = main.params[ 'CTRL' ][ 'num' ]
kelvin-onlabe5239e52015-05-13 14:46:45 -070051 main.wrapper = imp.load_source( 'FuncIntentFunction',
52 '/home/admin/ONLabTest/TestON/tests/' +
53 'FuncIntent/Dependency/' +
54 'FuncIntentFunction.py' )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -070055 PULLCODE = False
56 if main.params[ 'GIT' ][ 'pull' ] == 'True':
57 PULLCODE = True
58 main.case( "Setting up test environment" )
kelvin-onlab2ccad6e2015-05-18 10:36:54 -070059 main.hostsData = {}
kelvin-onlabf70fd542015-05-07 18:41:40 -070060 main.CLIs = []
61 for i in range( 1, int( main.numCtrls ) + 1 ):
62 main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
63
cameron@onlab.us7fd2a522015-05-14 11:20:33 -070064 main.errors = [0]*11
65 main.warnings = [0]*11
66 main.exceptions = [0]*11
67
kelvin-onlabf70fd542015-05-07 18:41:40 -070068 # -- INIT SECTION, ONLY RUNS ONCE -- #
69 if init == False:
70 init = True
kelvin-onlabe5239e52015-05-13 14:46:45 -070071 main.MNisUp = main.FALSE
kelvin-onlabf70fd542015-05-07 18:41:40 -070072
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -070073 #main.ONOSip = []
kelvin-onlab05cf7732015-05-08 14:25:46 -070074 main.ONOSport = []
75 main.scale = ( main.params[ 'SCALE' ] ).split( "," )
76 main.numCtrls = int( main.scale[ 0 ] )
kelvin-onlabf70fd542015-05-07 18:41:40 -070077
78 if PULLCODE:
79 main.step( "Git checkout and pull " + gitBranch )
80 main.ONOSbench.gitCheckout( gitBranch )
81 gitPullResult = main.ONOSbench.gitPull()
82 if gitPullResult == main.ERROR:
83 main.log.error( "Error pulling git branch" )
84 main.step( "Using mvn clean & install" )
85 cleanInstallResult = main.ONOSbench.cleanInstall()
86 stepResult = cleanInstallResult
87 utilities.assert_equals( expect=main.TRUE,
88 actual=stepResult,
89 onpass="Successfully compiled " +
90 "latest ONOS",
91 onfail="Failed to compile " +
92 "latest ONOS" )
93 else:
94 main.log.warn( "Did not pull new code so skipping mvn " +
95 "clean install" )
cameron@onlab.us033cc0f2015-05-15 15:27:43 -070096 globalONOSip = main.ONOSbench.getOnosIps()
kelvin-onlab0a28a742015-05-18 16:03:13 -070097
cameron@onlab.us033cc0f2015-05-15 15:27:43 -070098 maxNodes = ( len(globalONOSip) - 2 )
kelvin-onlabf70fd542015-05-07 18:41:40 -070099
kelvin-onlab05cf7732015-05-08 14:25:46 -0700100 main.numCtrls = int( main.scale[ 0 ] )
101 main.scale.remove( main.scale[ 0 ] )
cameron@onlab.us59d29d92015-05-11 14:31:54 -0700102
cameron@onlab.us033cc0f2015-05-15 15:27:43 -0700103 main.ONOSip = []
kelvin-onlab0a28a742015-05-18 16:03:13 -0700104 for i in range( maxNodes ):
cameron@onlab.us59d29d92015-05-11 14:31:54 -0700105 main.ONOSip.append( globalONOSip[i] )
106
kelvin-onlabf70fd542015-05-07 18:41:40 -0700107 # Populate main.ONOSip with ips from params
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700108 #for i in range( 1, maxNodes + 1):
109 # main.ONOSip.append( main.params[ 'CTRL' ][ 'ip' + str( i ) ] )
110 # main.ONOSport.append( main.params[ 'CTRL' ][ 'port' +
111 # str( i ) ])
cameron@onlab.uscd4e8a22015-05-11 10:58:43 -0700112 ONOSip = main.ONOSbench.getOnosIpFromEnv()
kelvin-onlab0a28a742015-05-18 16:03:13 -0700113 main.log.info("\t\t CLUSTER IPs: \n\n" + str(ONOSip) + "\n\n")
kelvin-onlabf70fd542015-05-07 18:41:40 -0700114
115 main.numCtrls = int( main.scale[ 0 ] )
116 main.scale.remove( main.scale[ 0 ] )
117 #kill off all onos processes
118 main.log.info( "Safety check, killing all ONOS processes" +
119 " before initiating enviornment setup" )
120 for i in range( maxNodes ):
kelvin-onlab05cf7732015-05-08 14:25:46 -0700121 main.ONOSbench.onosDie( main.ONOSip[ i ] )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700122 """main.step( "Removing raft logs" )
123 removeRaftResult = main.ONOSbench.onosRemoveRaftLogs()
124 stepResult = removeRaftResult
125 utilities.assert_equals( expect=main.TRUE,
126 actual=stepResult,
127 onpass="Successfully removed raft logs",
128 onfail="Failed to remove raft logs" )
129 """
kelvin-onlab05cf7732015-05-08 14:25:46 -0700130 print "NODE COUNT = ", main.numCtrls
kelvin-onlabf70fd542015-05-07 18:41:40 -0700131 main.log.info( "Creating cell file" )
132 cellIp = []
kelvin-onlab05cf7732015-05-08 14:25:46 -0700133 for i in range( main.numCtrls ):
134 cellIp.append( str( main.ONOSip[ i ] ) )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700135 print cellIp
136 main.ONOSbench.createCellFile( benchIp, cellName, "",
137 str( apps ), *cellIp )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700138
139 main.step( "Apply cell to environment" )
140 cellResult = main.ONOSbench.setCell( cellName )
141 verifyResult = main.ONOSbench.verifyCell()
142 stepResult = cellResult and verifyResult
143 utilities.assert_equals( expect=main.TRUE,
144 actual=stepResult,
145 onpass="Successfully applied cell to " + \
146 "environment",
147 onfail="Failed to apply cell to environment " )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700148
149 main.step( "Creating ONOS package" )
150 packageResult = main.ONOSbench.onosPackage()
151 stepResult = packageResult
152 utilities.assert_equals( expect=main.TRUE,
153 actual=stepResult,
154 onpass="Successfully created ONOS package",
155 onfail="Failed to create ONOS package" )
156
157 main.step( "Uninstalling ONOS package" )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700158 onosUninstallResult = main.TRUE
cameron@onlab.us033cc0f2015-05-15 15:27:43 -0700159 for i in range( main.numCtrls ):
kelvin-onlabf70fd542015-05-07 18:41:40 -0700160 onosUninstallResult = onosUninstallResult and \
kelvin-onlab05cf7732015-05-08 14:25:46 -0700161 main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700162 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" )
167 time.sleep( 5 )
168 main.step( "Installing ONOS package" )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700169 onosInstallResult = main.TRUE
cameron@onlab.us033cc0f2015-05-15 15:27:43 -0700170 for i in range( main.numCtrls ):
kelvin-onlabf70fd542015-05-07 18:41:40 -0700171 onosInstallResult = onosInstallResult and \
kelvin-onlab05cf7732015-05-08 14:25:46 -0700172 main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700173 stepResult = onosInstallResult
174 utilities.assert_equals( expect=main.TRUE,
175 actual=stepResult,
176 onpass="Successfully installed ONOS package",
177 onfail="Failed to install ONOS package" )
178
cameron@onlab.us59d29d92015-05-11 14:31:54 -0700179 time.sleep( 20 )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700180 main.step( "Starting ONOS service" )
181 stopResult = main.TRUE
182 startResult = main.TRUE
kelvin-onlabf70fd542015-05-07 18:41:40 -0700183 onosIsUp = main.TRUE
kelvin-onlab05cf7732015-05-08 14:25:46 -0700184 for i in range( main.numCtrls ):
185 onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700186 if onosIsUp == main.TRUE:
187 main.log.report( "ONOS instance is up and ready" )
188 else:
189 main.log.report( "ONOS instance may not be up, stop and " +
190 "start ONOS again " )
kelvin-onlab05cf7732015-05-08 14:25:46 -0700191 for i in range( main.numCtrls ):
kelvin-onlabf70fd542015-05-07 18:41:40 -0700192 stopResult = stopResult and \
kelvin-onlab05cf7732015-05-08 14:25:46 -0700193 main.ONOSbench.onosStop( main.ONOSip[ i ] )
194 for i in range( main.numCtrls ):
kelvin-onlabf70fd542015-05-07 18:41:40 -0700195 startResult = startResult and \
kelvin-onlab05cf7732015-05-08 14:25:46 -0700196 main.ONOSbench.onosStart( main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700197 stepResult = onosIsUp and stopResult and startResult
198 utilities.assert_equals( expect=main.TRUE,
199 actual=stepResult,
200 onpass="ONOS service is ready",
201 onfail="ONOS service did not start properly" )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700202
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700203 main.step( "Start ONOS cli" )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700204 cliResult = main.TRUE
kelvin-onlab05cf7732015-05-08 14:25:46 -0700205 for i in range( main.numCtrls ):
206 cliResult = cliResult and \
207 main.CLIs[i].startOnosCli( main.ONOSip[ i ] )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700208 stepResult = cliResult
209 utilities.assert_equals( expect=main.TRUE,
210 actual=stepResult,
211 onpass="Successfully start ONOS cli",
212 onfail="Failed to start ONOS cli" )
213
kelvin-onlab0a28a742015-05-18 16:03:13 -0700214 def CASE9( self, main ):
215 main.log.info("Error report: \n")
216 main.ONOSbench.logReport(globalONOSip[0],["WARN","ERROR","stuff"],"d")
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700217
218 def CASE11( self, main ):
219 """
kelvin-onlab05cf7732015-05-08 14:25:46 -0700220 Start mininet
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700221 """
kelvin-onlabe5239e52015-05-13 14:46:45 -0700222 import time
kelvin-onlab05cf7732015-05-08 14:25:46 -0700223 main.log.report( "Start Mininet topology" )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700224 main.case( "Start Mininet topology" )
225 if not main.MNisUp:
226 main.MNisUp = main.TRUE
227 else:
228 main.Mininet1.stopNet()
229 time.sleep( 30 )
kelvin-onlabf70fd542015-05-07 18:41:40 -0700230 main.step( "Starting Mininet Topology" )
231 topoResult = main.Mininet1.startNet( topoFile=topology )
232 stepResult = topoResult
233 utilities.assert_equals( expect=main.TRUE,
234 actual=stepResult,
235 onpass="Successfully loaded topology",
236 onfail="Failed to load topology" )
237 # Exit if topology did not load properly
238 if not topoResult:
239 main.cleanup()
240 main.exit()
241
kelvin-onlab05cf7732015-05-08 14:25:46 -0700242 def CASE12( self, main ):
243 """
244 Assign mastership to controllers
245 """
246 import re
247
kelvin-onlabe5239e52015-05-13 14:46:45 -0700248 main.case( "Assign switches to controllers" )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700249 main.step( "Assigning switches to controllers" )
250 assignResult = main.TRUE
kelvin-onlab5cbf9992015-05-05 14:34:07 -0700251 for i in range( 1, ( main.numSwitch + 1 ) ):
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700252 main.Mininet1.assignSwController( sw=str( i ),
253 count=1,
kelvin-onlab05cf7732015-05-08 14:25:46 -0700254 ip1=main.ONOSip[ 0 ],
255 port1=main.ONOSport[ 0 ] )
kelvin-onlab5cbf9992015-05-05 14:34:07 -0700256 for i in range( 1, ( main.numSwitch + 1 ) ):
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700257 response = main.Mininet1.getSwController( "s" + str( i ) )
258 print( "Response is " + str( response ) )
kelvin-onlab05cf7732015-05-08 14:25:46 -0700259 if re.search( "tcp:" + main.ONOSip[ 0 ], response ):
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700260 assignResult = assignResult and main.TRUE
261 else:
262 assignResult = main.FALSE
263 stepResult = assignResult
264 utilities.assert_equals( expect=main.TRUE,
265 actual=stepResult,
266 onpass="Successfully assigned switches" +
267 "to controller",
268 onfail="Failed to assign switches to " +
269 "controller" )
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700270 def CASE13( self, main ):
271 """
272 Discover all hosts and store its data to a dictionary
273 """
274 main.case( "Discover all hosts" )
275
276 stepResult = main.TRUE
277 main.step( "IPV4: Add host intents between h1 and h9" )
278 stepResult = main.wrapper.getHostsData( main )
279 utilities.assert_equals( expect=main.FALSE,
280 actual=stepResult,
281 onpass="Successfully discovered hosts",
282 onfail="Failed to discover hosts" )
kelvin-onlab4ff9cc12015-05-05 11:14:42 -0700283
kelvin-onlabf70fd542015-05-07 18:41:40 -0700284 def CASE1001( self, main ):
kelvin-onlab7c577e82015-05-07 10:45:16 -0700285 """
kelvin-onlab65782a82015-05-07 14:12:13 -0700286 Add host intents between 2 host:
287 - Discover hosts
288 - Add host intents
289 - Check intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700290 - Verify flows
kelvin-onlab65782a82015-05-07 14:12:13 -0700291 - Ping hosts
292 - Reroute
293 - Link down
kelvin-onlabe5239e52015-05-13 14:46:45 -0700294 - Verify flows
295 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700296 - Ping hosts
297 - Link up
kelvin-onlabe5239e52015-05-13 14:46:45 -0700298 - Verify flows
299 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700300 - Ping hosts
301 - Remove intents
kelvin-onlab7c577e82015-05-07 10:45:16 -0700302 """
303 import time
304 import json
kelvin-onlab65782a82015-05-07 14:12:13 -0700305 import re
306 """
307 Create your item(s) here
308 item = { 'name': '', 'host1':
309 { 'name': '', 'MAC': '00:00:00:00:00:0X',
310 'id':'00:00:00:00:00:0X/-X' } , 'host2':
311 { 'name': '', 'MAC': '00:00:00:00:00:0X',
312 'id':'00:00:00:00:00:0X/-X'}, 'link': { 'switch1': '',
kelvin-onlabe5239e52015-05-13 14:46:45 -0700313 'switch2': '', 'expect':'' } }
kelvin-onlab65782a82015-05-07 14:12:13 -0700314 """
kelvin-onlabe5239e52015-05-13 14:46:45 -0700315
316 # Assert variables - These variable's name|format must be followed
317 # if you want to use the wrapper function
318 assert main, "There is no main"
319 assert main.CLIs, "There is no main.CLIs"
320 assert main.Mininet1, "Mininet handle should be named Mininet1"
321 assert main.numSwitch, "Placed the total number of switch topology in \
322 main.numSwitch"
323
kelvin-onlabe5239e52015-05-13 14:46:45 -0700324 main.case( "Add host intents between 2 host" )
kelvin-onlab05cf7732015-05-08 14:25:46 -0700325
kelvin-onlabe5239e52015-05-13 14:46:45 -0700326 stepResult = main.TRUE
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700327 main.step( "IPV4: Add host intents between h1 and h9" )
328 stepResult = main.wrapper.hostIntent( main,
329 name='IPV4',
330 host1='h1',
331 host2='h9',
332 host1Id='00:00:00:00:00:01/-1',
333 host2Id='00:00:00:00:00:09/-1',
334 sw1='s5',
335 sw2='s2',
336 expectedLink=18 )
kelvin-onlab7c577e82015-05-07 10:45:16 -0700337
kelvin-onlabe5239e52015-05-13 14:46:45 -0700338 utilities.assert_equals( expect=main.TRUE,
339 actual=stepResult,
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700340 onpass="IPV4: Add host intent successful",
341 onfail="IPV4: Add host intent failed" )
342 stepResult = main.TRUE
343
344 main.step( "DUALSTACK: Add host intents between h3 and h11" )
345 stepResult = main.wrapper.hostIntent( main,
346 name='DUALSTACK',
347 host1='h3',
348 host2='h11',
349 host1Id='00:00:00:00:00:03/-1',
350 host2Id='00:00:00:00:00:011/-1',
351 sw1='s5',
352 sw2='s2',
353 expectedLink=18 )
354
355 utilities.assert_equals( expect=main.TRUE,
356 actual=stepResult,
357 onpass="DUALSTACK: Add host intent successful",
358 onfail="DUALSTACK: Add host intent failed" )
kelvin-onlab7c577e82015-05-07 10:45:16 -0700359
kelvin-onlabf70fd542015-05-07 18:41:40 -0700360 def CASE1002( self, main ):
kelvin-onlab65782a82015-05-07 14:12:13 -0700361 """
362 Add point intents between 2 hosts:
kelvin-onlabe5239e52015-05-13 14:46:45 -0700363 - Get device ids | ports
kelvin-onlab65782a82015-05-07 14:12:13 -0700364 - Add point intents
365 - Check intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700366 - Verify flows
kelvin-onlab65782a82015-05-07 14:12:13 -0700367 - Ping hosts
368 - Reroute
369 - Link down
kelvin-onlabe5239e52015-05-13 14:46:45 -0700370 - Verify flows
371 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700372 - Ping hosts
373 - Link up
kelvin-onlabe5239e52015-05-13 14:46:45 -0700374 - Verify flows
375 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700376 - Ping hosts
377 - Remove intents
378 """
kelvin-onlabe5239e52015-05-13 14:46:45 -0700379 import time
380 import json
381 import re
382 """
383 Create your item(s) here
kelvin-onlabb2235602015-05-13 17:51:06 -0700384 item = { 'name':'', 'host1': { 'name': '' },
385 'host2': { 'name': '' },
386 'ingressDevice':'' , 'egressDevice':'',
387 'ingressPort':'', 'egressPort':'',
kelvin-onlabe5239e52015-05-13 14:46:45 -0700388 'option':{ 'ethType':'', 'ethSrc':'', 'ethDst':'' } ,
389 'link': { 'switch1': '', 'switch2':'', 'expect':'' } }
390
391 """
392
393 # Assert variables - These variable's name|format must be followed
394 # if you want to use the wrapper function
395 assert main, "There is no main"
396 assert main.CLIs, "There is no main.CLIs"
397 assert main.Mininet1, "Mininet handle should be named Mininet1"
398 assert main.numSwitch, "Placed the total number of switch topology in \
399 main.numSwitch"
400
kelvin-onlabb2235602015-05-13 17:51:06 -0700401 ipv4 = { 'name':'IPV4', 'ingressDevice':'of:0000000000000005/1' ,
402 'host1': { 'name': 'h1' }, 'host2': { 'name': 'h9' },
403 'egressDevice':'of:0000000000000006/1', 'option':
kelvin-onlabe5239e52015-05-13 14:46:45 -0700404 { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:01',
405 'ethDst':'00:00:00:00:00:09' }, 'link': { 'switch1':'s5',
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700406 'switch2':'s2', 'expect':'18' } }
kelvin-onlabe5239e52015-05-13 14:46:45 -0700407
kelvin-onlabb2235602015-05-13 17:51:06 -0700408 """
409 ipv4 = { 'name':'IPV4', 'ingressDevice':'of:0000000000000005/1' ,
410 'host1': { 'name': 'h1' }, 'host2': { 'name': 'h9' },
411 'egressDevice':'of:0000000000000006/1', 'option':
412 { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:01' },
413 'link': { 'switch1':'s5', 'switch2':'s2', 'expect':'18' } }
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700414 """
kelvin-onlabb2235602015-05-13 17:51:06 -0700415 dualStack1 = { 'name':'IPV4', 'ingressDevice':'0000000000000005/3' ,
416 'host1': { 'name': 'h3' }, 'host2': { 'name': 'h11' },
417 'egressDevice':'0000000000000006/3', 'option':
418 { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:03',
419 'ethDst':'00:00:00:00:00:0B' }, 'link': { 'switch1':'s5',
420 'switch2':'s2', 'expect':'18' } }
kelvin-onlabe5239e52015-05-13 14:46:45 -0700421
kelvin-onlabb2235602015-05-13 17:51:06 -0700422 main.case( "Add point intents between 2 devices" )
423
424 stepResult = main.TRUE
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700425 main.step( "IPV4: Add point intents between h1 and h9" )
426 stepResult = main.wrapper.pointIntent(
427 main,
428 name="IPV4",
429 host1="h1",
430 host2="h9",
431 deviceId1="of:0000000000000005/1",
432 deviceId2="of:0000000000000006/1",
433 port1="",
434 port2="",
435 ethType="IPV4",
436 mac1="00:00:00:00:00:01",
437 mac2="00:00:00:00:00:09",
438 bandwidth="",
439 lambdaAlloc=False,
440 ipProto="",
441 ip1="",
442 ip2="",
443 tcp1="",
444 tcp2="",
445 sw1="s5",
446 sw2="s2",
447 expectedLink=18 )
448
kelvin-onlabb2235602015-05-13 17:51:06 -0700449 utilities.assert_equals( expect=main.TRUE,
450 actual=stepResult,
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700451 onpass="IPV4: Add point intent successful",
452 onfail="IPV4: Add point intent failed" )
kelvin-onlab65782a82015-05-07 14:12:13 -0700453
kelvin-onlabf70fd542015-05-07 18:41:40 -0700454 def CASE1003( self, main ):
kelvin-onlab65782a82015-05-07 14:12:13 -0700455 """
456 Add single point to multi point intents
457 - Get device ids
458 - Add single point to multi point intents
459 - Check intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700460 - Verify flows
kelvin-onlab65782a82015-05-07 14:12:13 -0700461 - Ping hosts
462 - Reroute
463 - Link down
kelvin-onlabe5239e52015-05-13 14:46:45 -0700464 - Verify flows
465 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700466 - Ping hosts
467 - Link up
kelvin-onlabe5239e52015-05-13 14:46:45 -0700468 - Verify flows
469 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700470 - Ping hosts
471 - Remove intents
472 """
473
kelvin-onlabf70fd542015-05-07 18:41:40 -0700474 def CASE1004( self, main ):
kelvin-onlab65782a82015-05-07 14:12:13 -0700475 """
476 Add multi point to single point intents
477 - Get device ids
478 - Add multi point to single point intents
479 - Check intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700480 - Verify flows
kelvin-onlab65782a82015-05-07 14:12:13 -0700481 - Ping hosts
482 - Reroute
483 - Link down
kelvin-onlabe5239e52015-05-13 14:46:45 -0700484 - Verify flows
485 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700486 - Ping hosts
487 - Link up
kelvin-onlabe5239e52015-05-13 14:46:45 -0700488 - Verify flows
489 - Check topology
kelvin-onlab65782a82015-05-07 14:12:13 -0700490 - Ping hosts
491 - Remove intents
492 """