blob: 31b427c8a1c8662b450d2b39852e45cfd7b2cb24 [file] [log] [blame]
GlennRC5147a422015-10-06 17:26:17 -07001class FUNCflow:
2
3 def __init__( self ):
4 self.default = ''
5
6 def CASE1( self, main ):
GlennRC5147a422015-10-06 17:26:17 -07007 import os
8 import imp
9
10 """
11 - Construct tests variables
12 - GIT ( optional )
13 - Checkout ONOS master branch
14 - Pull latest ONOS code
15 - Building ONOS ( optional )
16 - Install ONOS package
17 - Build ONOS package
18 """
GlennRC5147a422015-10-06 17:26:17 -070019 main.case( "Constructing test variables and building ONOS package" )
20 main.step( "Constructing test variables" )
GlennRC5147a422015-10-06 17:26:17 -070021
22 # Test variables
Jon Hallfc951072017-05-24 15:55:34 -070023 main.testOnDirectory = os.path.dirname( os.getcwd() )
GlennRC5147a422015-10-06 17:26:17 -070024 main.cellName = main.params[ 'ENV' ][ 'cellName' ]
25 main.apps = main.params[ 'ENV' ][ 'cellApps' ]
26 gitBranch = main.params[ 'GIT' ][ 'branch' ]
GlennRC073e8bc2015-10-27 17:11:28 -070027 gitPull = main.params[ 'GIT' ][ 'pull' ]
28 main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
GlennRC5147a422015-10-06 17:26:17 -070029 main.dependencyPath = main.testOnDirectory + \
30 main.params[ 'DEPENDENCY' ][ 'path' ]
GlennRC5147a422015-10-06 17:26:17 -070031 wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
GlennRC1704d072015-10-07 18:40:45 -070032 wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
GlennRC073e8bc2015-10-27 17:11:28 -070033 main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
34 main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
GlennRC5147a422015-10-06 17:26:17 -070035 main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
GlennRC073e8bc2015-10-27 17:11:28 -070036 main.startMNSleep = int( main.params[ 'SLEEP' ][ 'startMN' ] )
37 main.addFlowSleep = int( main.params[ 'SLEEP' ][ 'addFlow' ] )
38 main.delFlowSleep = int( main.params[ 'SLEEP' ][ 'delFlow' ] )
alisone14d7b02016-07-06 10:31:51 -070039 main.debug = main.params[ 'DEBUG' ]
GlennRC073e8bc2015-10-27 17:11:28 -070040 main.swDPID = main.params[ 'TEST' ][ 'swDPID' ]
Jon Hallfc951072017-05-24 15:55:34 -070041 main.cellData = {} # for creating cell file
42 main.CLIs = []
43 main.ONOSip = []
GlennRC5147a422015-10-06 17:26:17 -070044
GlennRC956ea742015-11-05 16:14:15 -080045 main.debug = True if "on" in main.debug else False
46
Jon Hallfc951072017-05-24 15:55:34 -070047 main.ONOSip = main.ONOSbench.getOnosIps()
GlennRC5147a422015-10-06 17:26:17 -070048
49 # Assigning ONOS cli handles to a list
Jon Hallfc951072017-05-24 15:55:34 -070050 for i in range( 1, main.maxNodes + 1 ):
GlennRC5147a422015-10-06 17:26:17 -070051 main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
52
53 # -- INIT SECTION, ONLY RUNS ONCE -- #
54 main.startUp = imp.load_source( wrapperFile1,
55 main.dependencyPath +
56 wrapperFile1 +
57 ".py" )
58
GlennRC1704d072015-10-07 18:40:45 -070059 main.topo = imp.load_source( wrapperFile2,
60 main.dependencyPath +
61 wrapperFile2 +
62 ".py" )
63
GlennRC94ed2232015-10-07 15:08:57 -070064 copyResult = main.ONOSbench.scp( main.Mininet1,
alisone14d7b02016-07-06 10:31:51 -070065 main.dependencyPath + main.topology,
66 main.Mininet1.home + '/custom/',
GlennRC94ed2232015-10-07 15:08:57 -070067 direction="to" )
68
alisone14d7b02016-07-06 10:31:51 -070069 utilities.assert_equals( expect=main.TRUE,
Jeremy Songstere7f3b342016-08-17 14:56:49 -070070 actual=copyResult,
71 onpass="Successfully copy " + "test variables ",
72 onfail="Failed to copy test variables" )
alisone14d7b02016-07-06 10:31:51 -070073
GlennRC5147a422015-10-06 17:26:17 -070074 if main.CLIs:
75 stepResult = main.TRUE
76 else:
77 main.log.error( "Did not properly created list of ONOS CLI handle" )
78 stepResult = main.FALSE
79
80 utilities.assert_equals( expect=main.TRUE,
81 actual=stepResult,
alisone14d7b02016-07-06 10:31:51 -070082 onpass="Successfully construct " + "test variables ",
GlennRC5147a422015-10-06 17:26:17 -070083 onfail="Failed to construct test variables" )
84
Devin Lim8d7c7782017-06-07 16:21:20 -070085
GlennRC5147a422015-10-06 17:26:17 -070086
87 def CASE2( self, main ):
88 """
89 - Set up cell
90 - Create cell file
91 - Set cell file
92 - Verify cell file
93 - Kill ONOS process
94 - Uninstall ONOS cluster
95 - Verify ONOS start up
96 - Install ONOS cluster
97 - Connect to cli
98 """
alisone14d7b02016-07-06 10:31:51 -070099 import time
GlennRC5147a422015-10-06 17:26:17 -0700100
101 main.numCtrls = int( main.maxNodes )
102
103 main.case( "Starting up " + str( main.numCtrls ) +
104 " node(s) ONOS cluster" )
105
106 #kill off all onos processes
107 main.log.info( "Safety check, killing all ONOS processes" +
Jon Hall70b2ff42015-11-17 15:49:44 -0800108 " before initiating environment setup" )
GlennRC5147a422015-10-06 17:26:17 -0700109
110 for i in range( main.maxNodes ):
111 main.ONOSbench.onosDie( main.ONOSip[ i ] )
112
Jon Hall53c5e662016-04-13 16:06:56 -0700113 main.log.info( "NODE COUNT = " + str( main.numCtrls ) )
GlennRC5147a422015-10-06 17:26:17 -0700114
Jon Hallfc951072017-05-24 15:55:34 -0700115 tempOnosIp = []
GlennRC5147a422015-10-06 17:26:17 -0700116 for i in range( main.numCtrls ):
alisone14d7b02016-07-06 10:31:51 -0700117 tempOnosIp.append( main.ONOSip[ i ] )
GlennRC5147a422015-10-06 17:26:17 -0700118
Jon Hall53c5e662016-04-13 16:06:56 -0700119 main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
120 "temp",
121 main.Mininet1.ip_address,
122 main.apps,
Devin Lim461f0872017-06-05 16:49:33 -0700123 tempOnosIp, main.ONOScli1.user_name )
GlennRC5147a422015-10-06 17:26:17 -0700124
125 main.step( "Apply cell to environment" )
126 cellResult = main.ONOSbench.setCell( "temp" )
Jon Hallfc951072017-05-24 15:55:34 -0700127 verifyResult = main.ONOSbench.verifyCell()
GlennRC5147a422015-10-06 17:26:17 -0700128 stepResult = cellResult and verifyResult
129 utilities.assert_equals( expect=main.TRUE,
130 actual=stepResult,
alisone14d7b02016-07-06 10:31:51 -0700131 onpass="Successfully applied cell to " + "environment",
GlennRC5147a422015-10-06 17:26:17 -0700132 onfail="Failed to apply cell to environment " )
133
134 main.step( "Creating ONOS package" )
Jon Hallbd60ea02016-08-23 10:03:59 -0700135 packageResult = main.ONOSbench.buckBuild()
GlennRC5147a422015-10-06 17:26:17 -0700136 stepResult = packageResult
137 utilities.assert_equals( expect=main.TRUE,
138 actual=stepResult,
139 onpass="Successfully created ONOS package",
140 onfail="Failed to create ONOS package" )
141
142 time.sleep( main.startUpSleep )
143 main.step( "Uninstalling ONOS package" )
144 onosUninstallResult = main.TRUE
Jeremy86160992016-04-11 10:05:53 -0700145 for ip in main.ONOSip:
GlennRC5147a422015-10-06 17:26:17 -0700146 onosUninstallResult = onosUninstallResult and \
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700147 main.ONOSbench.onosUninstall( nodeIp=ip )
GlennRC5147a422015-10-06 17:26:17 -0700148 stepResult = onosUninstallResult
149 utilities.assert_equals( expect=main.TRUE,
150 actual=stepResult,
151 onpass="Successfully uninstalled ONOS package",
152 onfail="Failed to uninstall ONOS package" )
GlennRC5147a422015-10-06 17:26:17 -0700153 time.sleep( main.startUpSleep )
154 main.step( "Installing ONOS package" )
155 onosInstallResult = main.TRUE
156 for i in range( main.numCtrls ):
157 onosInstallResult = onosInstallResult and \
Jeremy Songstere7f3b342016-08-17 14:56:49 -0700158 main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
GlennRC5147a422015-10-06 17:26:17 -0700159 stepResult = onosInstallResult
160 utilities.assert_equals( expect=main.TRUE,
161 actual=stepResult,
162 onpass="Successfully installed ONOS package",
163 onfail="Failed to install ONOS package" )
164
You Wangf5de25b2017-01-06 15:13:01 -0800165 main.step( "Set up ONOS secure SSH" )
166 secureSshResult = main.TRUE
167 for i in range( int( main.numCtrls ) ):
Jon Hallfc951072017-05-24 15:55:34 -0700168 secureSshResult = secureSshResult and main.ONOSbench.onosSecureSSH( node=main.ONOSip[ i ] )
You Wangf5de25b2017-01-06 15:13:01 -0800169 utilities.assert_equals( expect=main.TRUE, actual=secureSshResult,
170 onpass="Test step PASS",
171 onfail="Test step FAIL" )
172
GlennRC5147a422015-10-06 17:26:17 -0700173 time.sleep( main.startUpSleep )
174 main.step( "Starting ONOS service" )
175 stopResult = main.TRUE
176 startResult = main.TRUE
177 onosIsUp = main.TRUE
178
179 for i in range( main.numCtrls ):
180 onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
181 if onosIsUp == main.TRUE:
182 main.log.report( "ONOS instance is up and ready" )
183 else:
184 main.log.report( "ONOS instance may not be up, stop and " +
185 "start ONOS again " )
186 for i in range( main.numCtrls ):
187 stopResult = stopResult and \
188 main.ONOSbench.onosStop( main.ONOSip[ i ] )
189 for i in range( main.numCtrls ):
190 startResult = startResult and \
191 main.ONOSbench.onosStart( main.ONOSip[ i ] )
192 stepResult = onosIsUp and stopResult and startResult
193 utilities.assert_equals( expect=main.TRUE,
194 actual=stepResult,
195 onpass="ONOS service is ready",
196 onfail="ONOS service did not start properly" )
197
198 main.step( "Start ONOS cli" )
199 cliResult = main.TRUE
200 for i in range( main.numCtrls ):
201 cliResult = cliResult and \
202 main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
203 stepResult = cliResult
204 utilities.assert_equals( expect=main.TRUE,
205 actual=stepResult,
206 onpass="Successfully start ONOS cli",
207 onfail="Failed to start ONOS cli" )
208
GlennRC68449942015-10-16 16:03:12 -0700209 def CASE10( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -0700210 """
GlennRC68449942015-10-16 16:03:12 -0700211 Start Mininet
Jon Hallfc951072017-05-24 15:55:34 -0700212 """
GlennRC073e8bc2015-10-27 17:11:28 -0700213 import json
214
215 main.case( "Setup mininet and compare ONOS topology view to Mininet topology" )
216 main.caseExplanation = "Start mininet with custom topology and compare topology " +\
217 "elements between Mininet and ONOS"
218
GlennRC68449942015-10-16 16:03:12 -0700219 main.step( "Setup Mininet Topology" )
220 topology = main.Mininet1.home + '/custom/' + main.topology
Jon Hallfc951072017-05-24 15:55:34 -0700221 stepResult = main.Mininet1.startNet( topoFile=topology )
GlennRC68449942015-10-16 16:03:12 -0700222
223 utilities.assert_equals( expect=main.TRUE,
GlennRC073e8bc2015-10-27 17:11:28 -0700224 actual=stepResult,
GlennRC68449942015-10-16 16:03:12 -0700225 onpass="Successfully loaded topology",
226 onfail="Failed to load topology" )
227
GlennRC073e8bc2015-10-27 17:11:28 -0700228 main.step( "Assign switch to controller" )
Jon Hallfc951072017-05-24 15:55:34 -0700229 stepResult = main.Mininet1.assignSwController( "s1", main.ONOSip[ 0 ] )
GlennRC68449942015-10-16 16:03:12 -0700230
231 utilities.assert_equals( expect=main.TRUE,
GlennRC073e8bc2015-10-27 17:11:28 -0700232 actual=stepResult,
233 onpass="Successfully assigned switch to controller",
234 onfail="Failed to assign switch to controller" )
GlennRC68449942015-10-16 16:03:12 -0700235
GlennRC073e8bc2015-10-27 17:11:28 -0700236 time.sleep( main.startMNSleep )
GlennRC68449942015-10-16 16:03:12 -0700237
Jon Hall70b2ff42015-11-17 15:49:44 -0800238 main.step( "Comparing MN topology to ONOS topology" )
GlennRC073e8bc2015-10-27 17:11:28 -0700239 main.log.info( "Gathering topology information" )
GlennRC1704d072015-10-07 18:40:45 -0700240 devices = main.topo.getAllDevices( main )
241 hosts = main.topo.getAllHosts( main )
242 ports = main.topo.getAllPorts( main )
243 links = main.topo.getAllLinks( main )
GlennRC1704d072015-10-07 18:40:45 -0700244
Jon Hallfc951072017-05-24 15:55:34 -0700245 mnSwitches = main.Mininet1.getSwitches()
246 mnLinks = main.Mininet1.getLinks()
247 mnHosts = main.Mininet1.getHosts()
GlennRC1704d072015-10-07 18:40:45 -0700248
GlennRC1704d072015-10-07 18:40:45 -0700249 for controller in range( main.numCtrls ):
250 controllerStr = str( controller + 1 )
251 if devices[ controller ] and ports[ controller ] and\
Jon Hallfc951072017-05-24 15:55:34 -0700252 "Error" not in devices[ controller ] and\
253 "Error" not in ports[ controller ]:
GlennRC1704d072015-10-07 18:40:45 -0700254
255 currentDevicesResult = main.Mininet1.compareSwitches(
256 mnSwitches,
257 json.loads( devices[ controller ] ),
258 json.loads( ports[ controller ] ) )
259 else:
260 currentDevicesResult = main.FALSE
261 utilities.assert_equals( expect=main.TRUE,
262 actual=currentDevicesResult,
263 onpass="ONOS" + controllerStr +
GlennRC68449942015-10-16 16:03:12 -0700264 " Switches view is correct",
GlennRC1704d072015-10-07 18:40:45 -0700265 onfail="ONOS" + controllerStr +
GlennRC68449942015-10-16 16:03:12 -0700266 " Switches view is incorrect" )
GlennRC1704d072015-10-07 18:40:45 -0700267 if links[ controller ] and "Error" not in links[ controller ]:
268 currentLinksResult = main.Mininet1.compareLinks(
269 mnSwitches, mnLinks,
270 json.loads( links[ controller ] ) )
271 else:
272 currentLinksResult = main.FALSE
273 utilities.assert_equals( expect=main.TRUE,
274 actual=currentLinksResult,
275 onpass="ONOS" + controllerStr +
GlennRC68449942015-10-16 16:03:12 -0700276 " links view is correct",
GlennRC1704d072015-10-07 18:40:45 -0700277 onfail="ONOS" + controllerStr +
GlennRC68449942015-10-16 16:03:12 -0700278 " links view is incorrect" )
GlennRC1704d072015-10-07 18:40:45 -0700279
280 if hosts[ controller ] or "Error" not in hosts[ controller ]:
281 currentHostsResult = main.Mininet1.compareHosts(
282 mnHosts,
283 json.loads( hosts[ controller ] ) )
284 else:
285 currentHostsResult = main.FALSE
286 utilities.assert_equals( expect=main.TRUE,
287 actual=currentHostsResult,
288 onpass="ONOS" + controllerStr +
GlennRC68449942015-10-16 16:03:12 -0700289 " hosts exist in Mininet",
GlennRC1704d072015-10-07 18:40:45 -0700290 onfail="ONOS" + controllerStr +
Jon Hallfc951072017-05-24 15:55:34 -0700291 " hosts don't match Mininet" )
GlennRC68449942015-10-16 16:03:12 -0700292
Jon Hall892818c2015-10-20 17:58:34 -0700293 def CASE66( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -0700294 """
Jon Hall892818c2015-10-20 17:58:34 -0700295 Testing scapy
Jon Hallfc951072017-05-24 15:55:34 -0700296 """
Jon Hall892818c2015-10-20 17:58:34 -0700297 main.case( "Testing scapy" )
298 main.step( "Creating Host1 component" )
Jon Halla510a8a2016-05-04 15:09:28 -0700299 main.Scapy.createHostComponent( "h1" )
300 main.Scapy.createHostComponent( "h2" )
alisone14d7b02016-07-06 10:31:51 -0700301 hosts = [ main.h1, main.h2 ]
Jon Hall892818c2015-10-20 17:58:34 -0700302 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700303 host.startHostCli()
304 host.startScapy()
305 host.updateSelf()
Jon Hall892818c2015-10-20 17:58:34 -0700306 main.log.debug( host.name )
307 main.log.debug( host.hostIp )
308 main.log.debug( host.hostMac )
309
310 main.step( "Sending/Receiving Test packet - Filter doesn't match" )
Jon Halla510a8a2016-05-04 15:09:28 -0700311 main.log.info( "Starting Filter..." )
Jon Hallfc951072017-05-24 15:55:34 -0700312 main.h2.startFilter()
Jon Halla510a8a2016-05-04 15:09:28 -0700313 main.log.info( "Building Ether frame..." )
Jon Hall892818c2015-10-20 17:58:34 -0700314 main.h1.buildEther( dst=main.h2.hostMac )
Jon Halla510a8a2016-05-04 15:09:28 -0700315 main.log.info( "Sending Packet..." )
Jon Hallfc951072017-05-24 15:55:34 -0700316 main.h1.sendPacket()
Jon Halla510a8a2016-05-04 15:09:28 -0700317 main.log.info( "Checking Filter..." )
Jon Hallfc951072017-05-24 15:55:34 -0700318 finished = main.h2.checkFilter()
Jon Halla510a8a2016-05-04 15:09:28 -0700319 main.log.debug( finished )
Jon Hall892818c2015-10-20 17:58:34 -0700320 i = ""
321 if finished:
Jon Hallfc951072017-05-24 15:55:34 -0700322 a = main.h2.readPackets()
323 for i in a.splitlines():
Jon Hall892818c2015-10-20 17:58:34 -0700324 main.log.info( i )
325 else:
Jon Hallfc951072017-05-24 15:55:34 -0700326 kill = main.h2.killFilter()
Jon Hall892818c2015-10-20 17:58:34 -0700327 main.log.debug( kill )
328 main.h2.handle.sendline( "" )
329 main.h2.handle.expect( main.h2.scapyPrompt )
330 main.log.debug( main.h2.handle.before )
331 utilities.assert_equals( expect=True,
332 actual="dst=00:00:00:00:00:02 src=00:00:00:00:00:01" in i,
333 onpass="Pass",
334 onfail="Fail" )
335
336 main.step( "Sending/Receiving Test packet - Filter matches" )
Jon Hallfc951072017-05-24 15:55:34 -0700337 main.h2.startFilter()
Jon Hall892818c2015-10-20 17:58:34 -0700338 main.h1.buildEther( dst=main.h2.hostMac )
339 main.h1.buildIP( dst=main.h2.hostIp )
Jon Hallfc951072017-05-24 15:55:34 -0700340 main.h1.sendPacket()
341 finished = main.h2.checkFilter()
Jon Hall892818c2015-10-20 17:58:34 -0700342 i = ""
343 if finished:
Jon Hallfc951072017-05-24 15:55:34 -0700344 a = main.h2.readPackets()
345 for i in a.splitlines():
Jon Hall892818c2015-10-20 17:58:34 -0700346 main.log.info( i )
347 else:
Jon Hallfc951072017-05-24 15:55:34 -0700348 kill = main.h2.killFilter()
Jon Hall892818c2015-10-20 17:58:34 -0700349 main.log.debug( kill )
350 main.h2.handle.sendline( "" )
351 main.h2.handle.expect( main.h2.scapyPrompt )
352 main.log.debug( main.h2.handle.before )
353 utilities.assert_equals( expect=True,
354 actual="dst=00:00:00:00:00:02 src=00:00:00:00:00:01" in i,
355 onpass="Pass",
356 onfail="Fail" )
357
Jon Hall892818c2015-10-20 17:58:34 -0700358 main.step( "Clean up host components" )
359 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700360 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -0700361 main.Mininet1.removeHostComponent( "h1" )
362 main.Mininet1.removeHostComponent( "h2" )
Jon Hall892818c2015-10-20 17:58:34 -0700363
GlennRC68449942015-10-16 16:03:12 -0700364 def CASE1000( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -0700365 """
GlennRC073e8bc2015-10-27 17:11:28 -0700366 Add flows with MAC selectors and verify the flows
Jon Hallfc951072017-05-24 15:55:34 -0700367 """
GlennRC073e8bc2015-10-27 17:11:28 -0700368 import json
369 import time
GlennRC68449942015-10-16 16:03:12 -0700370
GlennRC073e8bc2015-10-27 17:11:28 -0700371 main.case( "Verify flow MAC selectors are correctly compiled" )
372 main.caseExplanation = "Install two flows with only MAC selectors " +\
Jon Hallfc951072017-05-24 15:55:34 -0700373 "specified, then verify flows are added in ONOS, finally " +\
GlennRC073e8bc2015-10-27 17:11:28 -0700374 "send a packet that only specifies the MAC src and dst."
GlennRC68449942015-10-16 16:03:12 -0700375
GlennRC073e8bc2015-10-27 17:11:28 -0700376 main.step( "Add flows with MAC addresses as the only selectors" )
GlennRC68449942015-10-16 16:03:12 -0700377
GlennRC073e8bc2015-10-27 17:11:28 -0700378 main.log.info( "Creating host components" )
Jon Halla510a8a2016-05-04 15:09:28 -0700379 main.Scapy.createHostComponent( "h1" )
380 main.Scapy.createHostComponent( "h2" )
alisone14d7b02016-07-06 10:31:51 -0700381 hosts = [ main.h1, main.h2 ]
GlennRC073e8bc2015-10-27 17:11:28 -0700382 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700383 host.startHostCli()
384 host.startScapy()
385 host.updateSelf()
GlennRC68449942015-10-16 16:03:12 -0700386
GlennRC073e8bc2015-10-27 17:11:28 -0700387 # Add a flow that connects host1 on port1 to host2 on port2
388 # send output on port2
389 # recieve input on port1
390 egress = 2
391 ingress = 1
392
393 # Add flows that sends packets from port1 to port2 with correct
394 # MAC src and dst addresses
395 main.log.info( "Adding flow with MAC selectors" )
396 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
397 egressPort=egress,
398 ingressPort=ingress,
399 ethSrc=main.h1.hostMac,
400 ethDst=main.h2.hostMac,
GlennRC956ea742015-11-05 16:14:15 -0800401 debug=main.debug )
GlennRC68449942015-10-16 16:03:12 -0700402
GlennRCa5391372015-10-14 17:28:15 -0700403 utilities.assert_equals( expect=main.TRUE,
404 actual=stepResult,
GlennRC68449942015-10-16 16:03:12 -0700405 onpass="Successfully added flows",
406 onfail="Failed add flows" )
GlennRCa5391372015-10-14 17:28:15 -0700407
GlennRC073e8bc2015-10-27 17:11:28 -0700408 # Giving ONOS time to add the flows
409 time.sleep( main.addFlowSleep )
GlennRC5147a422015-10-06 17:26:17 -0700410
GlennRC073e8bc2015-10-27 17:11:28 -0700411 main.step( "Check flows are in the ADDED state" )
412
GlennRC073e8bc2015-10-27 17:11:28 -0700413 main.log.info( "Get the flows from ONOS" )
Jeremy86160992016-04-11 10:05:53 -0700414 try:
Jon Hallfc951072017-05-24 15:55:34 -0700415 flows = json.loads( main.ONOSrest.flows() )
GlennRC68449942015-10-16 16:03:12 -0700416
Jeremy86160992016-04-11 10:05:53 -0700417 stepResult = main.TRUE
418 for f in flows:
alisone14d7b02016-07-06 10:31:51 -0700419 if "rest" in f.get( "appId" ):
420 if "ADDED" not in f.get( "state" ):
Jeremy86160992016-04-11 10:05:53 -0700421 stepResult = main.FALSE
alisone14d7b02016-07-06 10:31:51 -0700422 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
Jeremy86160992016-04-11 10:05:53 -0700423 except TypeError:
424 main.log.error( "No Flows found by the REST API" )
425 stepResult = main.FALSE
426 except ValueError:
427 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -0700428 main.cleanup()
429 main.exit()
GlennRC68449942015-10-16 16:03:12 -0700430
431 utilities.assert_equals( expect=main.TRUE,
432 actual=stepResult,
433 onpass="All flows are in the ADDED state",
GlennRC073e8bc2015-10-27 17:11:28 -0700434 onfail="All flows are NOT in the ADDED state" )
GlennRC68449942015-10-16 16:03:12 -0700435
GlennRC956ea742015-11-05 16:14:15 -0800436 main.step( "Check flows are in Mininet's flow table" )
437
438 # get the flow IDs that were added through rest
439 main.log.info( "Getting the flow IDs from ONOS" )
alisone14d7b02016-07-06 10:31:51 -0700440 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
GlennRC956ea742015-11-05 16:14:15 -0800441 # convert the flowIDs to ints then hex and finally back to strings
alisone14d7b02016-07-06 10:31:51 -0700442 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
443 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
GlennRC956ea742015-11-05 16:14:15 -0800444
445 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
446
447 utilities.assert_equals( expect=main.TRUE,
448 actual=stepResult,
449 onpass="All flows are in mininet",
450 onfail="All flows are NOT in mininet" )
451
GlennRC073e8bc2015-10-27 17:11:28 -0700452 main.step( "Send a packet to verify the flows are correct" )
453
454 # Specify the src and dst MAC addr
455 main.log.info( "Constructing packet" )
456 main.h1.buildEther( src=main.h1.hostMac, dst=main.h2.hostMac )
457
458 # Filter for packets with the correct host name. Otherwise,
459 # the filter we catch any packet that is sent to host2
460 # NOTE: I believe it doesn't matter which host name it is,
GlennRC956ea742015-11-05 16:14:15 -0800461 # as long as the src and dst are both specified
GlennRC073e8bc2015-10-27 17:11:28 -0700462 main.log.info( "Starting filter on host2" )
alisone14d7b02016-07-06 10:31:51 -0700463 main.h2.startFilter( pktFilter="ether host %s" % main.h1.hostMac )
GlennRC073e8bc2015-10-27 17:11:28 -0700464
465 main.log.info( "Sending packet to host2" )
466 main.h1.sendPacket()
467
468 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -0700469 stepResult = main.h2.checkFilter()
GlennRC073e8bc2015-10-27 17:11:28 -0700470 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -0700471 main.log.info( "Packet: %s" % main.h2.readPackets() )
alisone14d7b02016-07-06 10:31:51 -0700472 else:
Jon Hallfc951072017-05-24 15:55:34 -0700473 main.h2.killFilter()
GlennRC073e8bc2015-10-27 17:11:28 -0700474
475 main.log.info( "Clean up host components" )
476 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700477 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -0700478 main.Mininet1.removeHostComponent( "h1" )
479 main.Mininet1.removeHostComponent( "h2" )
GlennRC073e8bc2015-10-27 17:11:28 -0700480
481 utilities.assert_equals( expect=main.TRUE,
482 actual=stepResult,
483 onpass="Successfully sent a packet",
484 onfail="Failed to send a packet" )
485
alisone14d7b02016-07-06 10:31:51 -0700486 def CASE1400( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -0700487 """
GlennRC073e8bc2015-10-27 17:11:28 -0700488 Add flows with IPv4 selectors and verify the flows
Jon Hallfc951072017-05-24 15:55:34 -0700489 """
GlennRC68449942015-10-16 16:03:12 -0700490 import json
GlennRC073e8bc2015-10-27 17:11:28 -0700491 import time
GlennRC68449942015-10-16 16:03:12 -0700492
GlennRC073e8bc2015-10-27 17:11:28 -0700493 main.case( "Verify flow IP selectors are correctly compiled" )
494 main.caseExplanation = "Install two flows with only IP selectors " +\
alisone14d7b02016-07-06 10:31:51 -0700495 "specified, then verify flows are added in ONOS, finally " +\
GlennRC073e8bc2015-10-27 17:11:28 -0700496 "send a packet that only specifies the IP src and dst."
497
498 main.step( "Add flows with IPv4 addresses as the only selectors" )
499
500 main.log.info( "Creating host components" )
Jon Halla510a8a2016-05-04 15:09:28 -0700501 main.Scapy.createHostComponent( "h1" )
502 main.Scapy.createHostComponent( "h2" )
alisone14d7b02016-07-06 10:31:51 -0700503 hosts = [ main.h1, main.h2 ]
GlennRC073e8bc2015-10-27 17:11:28 -0700504 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700505 host.startHostCli()
506 host.startScapy()
507 host.updateSelf()
GlennRC073e8bc2015-10-27 17:11:28 -0700508
509 # Add a flow that connects host1 on port1 to host2 on port2
510 # send output on port2
511 # recieve input on port1
512 egress = 2
513 ingress = 1
514 # IPv4 etherType = 0x800
alisone14d7b02016-07-06 10:31:51 -0700515 ethType = main.params[ 'TEST' ][ 'ip4Type' ]
GlennRC073e8bc2015-10-27 17:11:28 -0700516
517 # Add flows that connects host1 to host2
518 main.log.info( "Add flow with port ingress 1 to port egress 2" )
519 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
520 egressPort=egress,
521 ingressPort=ingress,
alisone14d7b02016-07-06 10:31:51 -0700522 ethType=ethType,
Jon Hallfc951072017-05-24 15:55:34 -0700523 ipSrc=( "IPV4_SRC", main.h1.hostIp + "/32" ),
524 ipDst=( "IPV4_DST", main.h2.hostIp + "/32" ),
GlennRC956ea742015-11-05 16:14:15 -0800525 debug=main.debug )
GlennRC073e8bc2015-10-27 17:11:28 -0700526
527 utilities.assert_equals( expect=main.TRUE,
528 actual=stepResult,
529 onpass="Successfully added flows",
530 onfail="Failed add flows" )
531
532 # Giving ONOS time to add the flow
533 time.sleep( main.addFlowSleep )
534
535 main.step( "Check flow is in the ADDED state" )
536
537 main.log.info( "Get the flows from ONOS" )
Jeremy86160992016-04-11 10:05:53 -0700538 try:
Jon Hallfc951072017-05-24 15:55:34 -0700539 flows = json.loads( main.ONOSrest.flows() )
GlennRC68449942015-10-16 16:03:12 -0700540
Jeremy86160992016-04-11 10:05:53 -0700541 stepResult = main.TRUE
542 for f in flows:
alisone14d7b02016-07-06 10:31:51 -0700543 if "rest" in f.get( "appId" ):
544 if "ADDED" not in f.get( "state" ):
Jeremy86160992016-04-11 10:05:53 -0700545 stepResult = main.FALSE
alisone14d7b02016-07-06 10:31:51 -0700546 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
Jeremy86160992016-04-11 10:05:53 -0700547 except TypeError:
548 main.log.error( "No Flows found by the REST API" )
549 stepResult = main.FALSE
550 except ValueError:
551 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -0700552 main.cleanup()
553 main.exit()
GlennRC68449942015-10-16 16:03:12 -0700554
555 utilities.assert_equals( expect=main.TRUE,
556 actual=stepResult,
GlennRC073e8bc2015-10-27 17:11:28 -0700557 onpass="All flows are in the ADDED state",
558 onfail="All flows are NOT in the ADDED state" )
559
GlennRC956ea742015-11-05 16:14:15 -0800560 main.step( "Check flows are in Mininet's flow table" )
561
562 # get the flow IDs that were added through rest
563 main.log.info( "Getting the flow IDs from ONOS" )
alisone14d7b02016-07-06 10:31:51 -0700564 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
GlennRC956ea742015-11-05 16:14:15 -0800565 # convert the flowIDs to ints then hex and finally back to strings
alisone14d7b02016-07-06 10:31:51 -0700566 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
567 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
GlennRC956ea742015-11-05 16:14:15 -0800568
569 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
570
571 utilities.assert_equals( expect=main.TRUE,
572 actual=stepResult,
573 onpass="All flows are in mininet",
574 onfail="All flows are NOT in mininet" )
575
GlennRC073e8bc2015-10-27 17:11:28 -0700576 main.step( "Send a packet to verify the flow is correct" )
577
578 main.log.info( "Constructing packet" )
579 # No need for the MAC src dst
580 main.h1.buildEther( dst=main.h2.hostMac )
581 main.h1.buildIP( src=main.h1.hostIp, dst=main.h2.hostIp )
582
583 main.log.info( "Starting filter on host2" )
584 # Defaults to ip
Jon Hallfc951072017-05-24 15:55:34 -0700585 main.h2.startFilter()
GlennRC073e8bc2015-10-27 17:11:28 -0700586
587 main.log.info( "Sending packet to host2" )
Jon Hallfc951072017-05-24 15:55:34 -0700588 main.h1.sendPacket()
GlennRC073e8bc2015-10-27 17:11:28 -0700589
590 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -0700591 stepResult = main.h2.checkFilter()
GlennRC073e8bc2015-10-27 17:11:28 -0700592 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -0700593 main.log.info( "Packet: %s" % main.h2.readPackets() )
594 else:
595 main.h2.killFilter()
GlennRC073e8bc2015-10-27 17:11:28 -0700596
597 main.log.info( "Clean up host components" )
598 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700599 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -0700600 main.Mininet1.removeHostComponent( "h1" )
601 main.Mininet1.removeHostComponent( "h2" )
GlennRC073e8bc2015-10-27 17:11:28 -0700602
603 utilities.assert_equals( expect=main.TRUE,
604 actual=stepResult,
605 onpass="Successfully sent a packet",
606 onfail="Failed to send a packet" )
607
Jon Hallfc951072017-05-24 15:55:34 -0700608 def CASE1500( self, main ):
alisone14d7b02016-07-06 10:31:51 -0700609 """
610 Add flow with IPv6 selector and verify the flow
611 """
612 import json
613 import time
614 main.case( "Verify IPv6 selector is correctly compiled" )
615 main.caseExplanation = "Install two flows with only IP selectors " + \
616 "specified, then verify flows are added in ONOS, finally " + \
617 "send a packet that only specifies the IP src and dst."
618
619 main.step( "Add flows with IPv6 addresses as the only selectors" )
620
621 main.log.info( "Creating host components" )
622 main.Scapy.createHostComponent( "h5" )
623 main.Scapy.createHostComponent( "h6" )
624 hosts = [ main.h5, main.h6 ]
625
626 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700627 host.startHostCli()
628 host.startScapy()
alisone14d7b02016-07-06 10:31:51 -0700629 host.updateSelf( IPv6=True )
630
631 # Add a flow that connects host1 on port1 to host2 on port2
632 # send output on port2
633 # recieve input on port1
634 egress = 6
635 ingress = 5
636 # IPv6 etherType = 0x86DD
637 ethType = main.params[ 'TEST' ][ 'ip6Type' ]
638
639 # Add flows that connects host1 to host2
640 main.log.info( "Add flow with port ingress 5 to port egress 6" )
641 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
642 egressPort=egress,
643 ingressPort=ingress,
644 ethType=ethType,
645 ipSrc=( "IPV6_SRC", main.h5.hostIp + "/128" ),
646 ipDst=( "IPV6_DST", main.h6.hostIp + "/128" ),
647 debug=main.debug )
648
649 utilities.assert_equals( expect=main.TRUE,
650 actual=stepResult,
651 onpass="Successfully added flows",
652 onfail="Failed add flows" )
653
654 # Giving ONOS time to add the flow
655 time.sleep( main.addFlowSleep )
656
657 main.step( "Check flow is in the ADDED state" )
658
659 main.log.info( "Get the flows from ONOS" )
660 try:
Jon Hallfc951072017-05-24 15:55:34 -0700661 flows = json.loads( main.ONOSrest.flows() )
alisone14d7b02016-07-06 10:31:51 -0700662
663 stepResult = main.TRUE
664 for f in flows:
665 if "rest" in f.get( "appId" ):
666 if "ADDED" not in f.get( "state" ):
667 stepResult = main.FALSE
668 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
669 except TypeError:
670 main.log.error( "No Flows found by the REST API" )
671 stepResult = main.FALSE
672 except ValueError:
673 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -0700674 main.cleanup()
675 main.exit()
alisone14d7b02016-07-06 10:31:51 -0700676
677 utilities.assert_equals( expect=main.TRUE,
678 actual=stepResult,
679 onpass="All flows are in the ADDED state",
680 onfail="All flows are NOT in the ADDED state" )
681
682 main.step( "Check flows are in Mininet's flow table" )
683
684 # get the flow IDs that were added through rest
685 main.log.info( "Getting the flow IDs from ONOS" )
686 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
687 # convert the flowIDs to ints then hex and finally back to strings
688 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
689 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
690
691 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
692
693 utilities.assert_equals( expect=main.TRUE,
694 actual=stepResult,
695 onpass="All flows are in mininet",
696 onfail="All flows are NOT in mininet" )
697
698 main.step( "Send a packet to verify the flow is correct" )
699
700 main.log.info( "Constructing packet" )
701 # No need for the MAC src dst
702 main.h5.buildEther( dst=main.h6.hostMac )
703 main.h5.buildIPv6( src=main.h5.hostIp, dst=main.h6.hostIp )
704
705 main.log.info( "Starting filter on host6" )
706 # Defaults to ip
707 main.h6.startFilter( pktFilter="ip6" )
708 main.log.info( "Sending packet to host6" )
Jon Hallfc951072017-05-24 15:55:34 -0700709 main.h5.sendPacket()
alisone14d7b02016-07-06 10:31:51 -0700710
711 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -0700712 stepResult = main.h6.checkFilter()
alisone14d7b02016-07-06 10:31:51 -0700713 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -0700714 main.log.info( "Packet: %s" % main.h6.readPackets() )
alisone14d7b02016-07-06 10:31:51 -0700715 else:
Jon Hallfc951072017-05-24 15:55:34 -0700716 main.h6.killFilter()
alisone14d7b02016-07-06 10:31:51 -0700717
718 main.log.info( "Clean up host components" )
719 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700720 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -0700721 main.Mininet1.removeHostComponent( "h5" )
722 main.Mininet1.removeHostComponent( "h6" )
723
724 utilities.assert_equals( expect=main.TRUE,
725 actual=stepResult,
726 onpass="Successfully sent a packet",
727 onfail="Failed to send a packet" )
728
alisone14d7b02016-07-06 10:31:51 -0700729 def CASE1100( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -0700730 """
GlennRC073e8bc2015-10-27 17:11:28 -0700731 Add flow with VLAN selector and verify the flow
Jon Hallfc951072017-05-24 15:55:34 -0700732 """
GlennRC073e8bc2015-10-27 17:11:28 -0700733 import json
734 import time
735
736 main.case( "Verify VLAN selector is correctly compiled" )
737 main.caseExplanation = "Install one flow with only the VLAN selector " +\
Jon Hallfc951072017-05-24 15:55:34 -0700738 "specified, then verify the flow is added in ONOS, and finally " +\
GlennRC073e8bc2015-10-27 17:11:28 -0700739 "broadcast a packet with the correct VLAN tag."
740
741 # We do this here to utilize the hosts information
742 main.log.info( "Creating host components" )
Jon Halla510a8a2016-05-04 15:09:28 -0700743 main.Scapy.createHostComponent( "h3" )
744 main.Scapy.createHostComponent( "h4" )
alisone14d7b02016-07-06 10:31:51 -0700745 hosts = [ main.h3, main.h4 ]
GlennRC073e8bc2015-10-27 17:11:28 -0700746 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700747 host.startHostCli()
748 host.startScapy()
749 host.updateSelf()
GlennRC073e8bc2015-10-27 17:11:28 -0700750
751 main.step( "Add a flow with the VLAN tag as the only selector" )
752
753 # Add flows that connects the two vlan hosts h3 and h4
754 # Host 3 is on port 3 and host 4 is on port 4
755 vlan = main.params[ 'TEST' ][ 'vlan' ]
756 egress = 4
757 ingress = 3
758 # VLAN ethType = 0x8100
alisone14d7b02016-07-06 10:31:51 -0700759 ethType = main.params[ 'TEST' ][ 'vlanType' ]
GlennRC073e8bc2015-10-27 17:11:28 -0700760
761 # Add only one flow because we don't need a response
762 main.log.info( "Add flow with port ingress 1 to port egress 2" )
763 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
764 egressPort=egress,
765 ingressPort=ingress,
766 ethType=ethType,
767 vlan=vlan,
GlennRC956ea742015-11-05 16:14:15 -0800768 debug=main.debug )
GlennRC073e8bc2015-10-27 17:11:28 -0700769
GlennRC073e8bc2015-10-27 17:11:28 -0700770 utilities.assert_equals( expect=main.TRUE,
771 actual=stepResult,
772 onpass="Successfully added flow",
773 onfail="Failed add flows" )
774
775 # Giving ONOS time to add the flows
776 time.sleep( main.addFlowSleep )
777
778 main.step( "Check flows are in the ADDED state" )
779
780 main.log.info( "Get the flows from ONOS" )
Jeremy86160992016-04-11 10:05:53 -0700781 try:
Jon Hallfc951072017-05-24 15:55:34 -0700782 flows = json.loads( main.ONOSrest.flows() )
GlennRC073e8bc2015-10-27 17:11:28 -0700783
Jeremy86160992016-04-11 10:05:53 -0700784 stepResult = main.TRUE
785 for f in flows:
alisone14d7b02016-07-06 10:31:51 -0700786 if "rest" in f.get( "appId" ):
787 if "ADDED" not in f.get( "state" ):
Jeremy86160992016-04-11 10:05:53 -0700788 stepResult = main.FALSE
alisone14d7b02016-07-06 10:31:51 -0700789 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
Jeremy86160992016-04-11 10:05:53 -0700790 except TypeError:
791 main.log.error( "No Flows found by the REST API" )
792 stepResult = main.FALSE
793 except ValueError:
794 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -0700795 main.cleanup()
796 main.exit()
GlennRC073e8bc2015-10-27 17:11:28 -0700797
798 utilities.assert_equals( expect=main.TRUE,
799 actual=stepResult,
800 onpass="All flows are in the ADDED state",
801 onfail="All flows are NOT in the ADDED state" )
802
GlennRC956ea742015-11-05 16:14:15 -0800803 main.step( "Check flows are in Mininet's flow table" )
804
805 # get the flow IDs that were added through rest
806 main.log.info( "Getting the flow IDs from ONOS" )
alisone14d7b02016-07-06 10:31:51 -0700807 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
GlennRC956ea742015-11-05 16:14:15 -0800808 # convert the flowIDs to ints then hex and finally back to strings
alisone14d7b02016-07-06 10:31:51 -0700809 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
810 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
GlennRC956ea742015-11-05 16:14:15 -0800811
812 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
813
814 utilities.assert_equals( expect=main.TRUE,
815 actual=stepResult,
816 onpass="All flows are in mininet",
817 onfail="All flows are NOT in mininet" )
818
GlennRC073e8bc2015-10-27 17:11:28 -0700819 main.step( "Send a packet to verify the flow are correct" )
820
821 # The receiving interface
alisone14d7b02016-07-06 10:31:51 -0700822 recIface = "{}-eth0.{}".format( main.h4.name, vlan )
GlennRC073e8bc2015-10-27 17:11:28 -0700823 main.log.info( "Starting filter on host2" )
824 # Filter is setup to catch any packet on the vlan interface with the correct vlan tag
Jon Hallfc951072017-05-24 15:55:34 -0700825 main.h4.startFilter( ifaceName=recIface, pktFilter="" )
GlennRC073e8bc2015-10-27 17:11:28 -0700826
827 # Broadcast the packet on the vlan interface. We only care if the flow forwards
828 # the packet with the correct vlan tag, not if the mac addr is correct
alisone14d7b02016-07-06 10:31:51 -0700829 sendIface = "{}-eth0.{}".format( main.h3.name, vlan )
GlennRC073e8bc2015-10-27 17:11:28 -0700830 main.log.info( "Broadcasting the packet with a vlan tag" )
GlennRC956ea742015-11-05 16:14:15 -0800831 main.h3.sendPacket( iface=sendIface,
alisone14d7b02016-07-06 10:31:51 -0700832 packet="Ether()/Dot1Q(vlan={})".format( vlan ) )
GlennRC073e8bc2015-10-27 17:11:28 -0700833
834 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -0700835 stepResult = main.h4.checkFilter()
GlennRC073e8bc2015-10-27 17:11:28 -0700836 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -0700837 main.log.info( "Packet: %s" % main.h4.readPackets() )
838 else:
839 main.h4.killFilter()
GlennRC073e8bc2015-10-27 17:11:28 -0700840
841 main.log.info( "Clean up host components" )
842 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700843 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -0700844 main.Mininet1.removeHostComponent( "h3" )
845 main.Mininet1.removeHostComponent( "h4" )
GlennRC073e8bc2015-10-27 17:11:28 -0700846
847 utilities.assert_equals( expect=main.TRUE,
848 actual=stepResult,
849 onpass="Successfully sent a packet",
850 onfail="Failed to send a packet" )
GlennRC68449942015-10-16 16:03:12 -0700851
GlennRC956ea742015-11-05 16:14:15 -0800852 def CASE1300( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -0700853 """
GlennRC956ea742015-11-05 16:14:15 -0800854 Add flows with MPLS selector and verify the flows
Jon Hallfc951072017-05-24 15:55:34 -0700855 """
GlennRC956ea742015-11-05 16:14:15 -0800856 import json
857 import time
858
859 main.case( "Verify the MPLS selector is correctly compiled on the flow." )
860 main.caseExplanation = "Install one flow with an MPLS selector, " +\
alisone14d7b02016-07-06 10:31:51 -0700861 "verify the flow is added in ONOS, and finally " +\
GlennRC956ea742015-11-05 16:14:15 -0800862 "send a packet via scapy that has a MPLS label."
863
864 main.step( "Add a flow with a MPLS selector" )
865
866 main.log.info( "Creating host components" )
Jon Halla510a8a2016-05-04 15:09:28 -0700867 main.Scapy.createHostComponent( "h1" )
868 main.Scapy.createHostComponent( "h2" )
alisone14d7b02016-07-06 10:31:51 -0700869 hosts = [ main.h1, main.h2 ]
GlennRC956ea742015-11-05 16:14:15 -0800870 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700871 host.startHostCli()
GlennRC956ea742015-11-05 16:14:15 -0800872 host.startScapy( main.dependencyPath )
Jon Hallfc951072017-05-24 15:55:34 -0700873 host.updateSelf()
GlennRC956ea742015-11-05 16:14:15 -0800874
875 # ports
876 egress = 2
877 ingress = 1
878 # MPLS etherType
879 ethType = main.params[ 'TEST' ][ 'mplsType' ]
880 # MPLS label
881 mplsLabel = main.params[ 'TEST' ][ 'mpls' ]
882
883 # Add a flow that connects host1 on port1 to host2 on port2
884 main.log.info( "Adding flow with MPLS selector" )
885 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
886 egressPort=egress,
887 ingressPort=ingress,
888 ethType=ethType,
889 mpls=mplsLabel,
890 debug=main.debug )
891
892 utilities.assert_equals( expect=main.TRUE,
893 actual=stepResult,
894 onpass="Successfully added flow",
895 onfail="Failed add flow" )
896
897 # Giving ONOS time to add the flow
898 time.sleep( main.addFlowSleep )
899
900 main.step( "Check flow is in the ADDED state" )
901
902 main.log.info( "Get the flows from ONOS" )
Jeremy86160992016-04-11 10:05:53 -0700903 try:
Jon Hallfc951072017-05-24 15:55:34 -0700904 flows = json.loads( main.ONOSrest.flows() )
GlennRC956ea742015-11-05 16:14:15 -0800905
Jeremy86160992016-04-11 10:05:53 -0700906 stepResult = main.TRUE
907 for f in flows:
alisone14d7b02016-07-06 10:31:51 -0700908 if "rest" in f.get( "appId" ):
909 if "ADDED" not in f.get( "state" ):
Jeremy86160992016-04-11 10:05:53 -0700910 stepResult = main.FALSE
alisone14d7b02016-07-06 10:31:51 -0700911 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
Jeremy86160992016-04-11 10:05:53 -0700912 except TypeError:
913 main.log.error( "No Flows found by the REST API" )
914 stepResult = main.FALSE
915 except ValueError:
916 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -0700917 main.cleanup()
918 main.exit()
GlennRC956ea742015-11-05 16:14:15 -0800919
920 utilities.assert_equals( expect=main.TRUE,
921 actual=stepResult,
922 onpass="All flows are in the ADDED state",
923 onfail="All flows are NOT in the ADDED state" )
924
925 main.step( "Check flows are in Mininet's flow table" )
926
927 # get the flow IDs that were added through rest
928 main.log.info( "Getting the flow IDs from ONOS" )
alisone14d7b02016-07-06 10:31:51 -0700929 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
GlennRC956ea742015-11-05 16:14:15 -0800930 # convert the flowIDs to ints then hex and finally back to strings
alisone14d7b02016-07-06 10:31:51 -0700931 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
932 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
GlennRC956ea742015-11-05 16:14:15 -0800933
934 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=True )
935
936 utilities.assert_equals( expect=main.TRUE,
937 actual=stepResult,
938 onpass="All flows are in mininet",
939 onfail="All flows are NOT in mininet" )
940
941 main.step( "Send a packet to verify the flow is correct" )
942
943 main.log.info( "Starting filter on host2" )
944 main.h2.startFilter( pktFilter="mpls" )
945
946 main.log.info( "Constructing packet" )
947 main.log.info( "Sending packet to host2" )
alisone14d7b02016-07-06 10:31:51 -0700948 main.h1.sendPacket( packet='Ether()/MPLS(label={})'.format( mplsLabel ) )
GlennRC956ea742015-11-05 16:14:15 -0800949
950 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -0700951 stepResult = main.h2.checkFilter()
GlennRC956ea742015-11-05 16:14:15 -0800952 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -0700953 main.log.info( "Packet: %s" % main.h2.readPackets() )
954 else:
955 main.h2.killFilter()
GlennRC956ea742015-11-05 16:14:15 -0800956
957 main.log.info( "Clean up host components" )
958 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700959 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -0700960 main.Mininet1.removeHostComponent( "h1" )
961 main.Mininet1.removeHostComponent( "h2" )
GlennRC956ea742015-11-05 16:14:15 -0800962
963 utilities.assert_equals( expect=main.TRUE,
964 actual=stepResult,
965 onpass="Successfully sent a packet",
966 onfail="Failed to send a packet" )
967
alisone14d7b02016-07-06 10:31:51 -0700968 def CASE1700( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -0700969 """
GlennRC956ea742015-11-05 16:14:15 -0800970 Add flows with a TCP selector and verify the flow
Jon Hallfc951072017-05-24 15:55:34 -0700971 """
GlennRC956ea742015-11-05 16:14:15 -0800972 import json
973 import time
974
975 main.case( "Verify the TCP selector is correctly compiled on the flow" )
976 main.caseExplanation = "Install a flow with only the TCP selector " +\
alisone14d7b02016-07-06 10:31:51 -0700977 "specified, verify the flow is added in ONOS, and finally " +\
GlennRC956ea742015-11-05 16:14:15 -0800978 "send a TCP packet to verify the TCP selector is compiled correctly."
979
980 main.step( "Add a flow with a TCP selector" )
981
982 main.log.info( "Creating host components" )
Jon Halla510a8a2016-05-04 15:09:28 -0700983 main.Scapy.createHostComponent( "h1" )
984 main.Scapy.createHostComponent( "h2" )
alisone14d7b02016-07-06 10:31:51 -0700985 hosts = [ main.h1, main.h2 ]
GlennRC956ea742015-11-05 16:14:15 -0800986 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -0700987 host.startHostCli()
988 host.startScapy()
989 host.updateSelf()
GlennRC956ea742015-11-05 16:14:15 -0800990
991 # Add a flow that connects host1 on port1 to host2 on port2
992 egress = 2
993 ingress = 1
994 # IPv4 etherType
995 ethType = main.params[ 'TEST' ][ 'ip4Type' ]
996 # IP protocol
997 ipProto = main.params[ 'TEST' ][ 'tcpProto' ]
998 # TCP port destination
999 tcpDst = main.params[ 'TEST' ][ 'tcpDst' ]
1000
1001 main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
1002 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
1003 egressPort=egress,
1004 ingressPort=ingress,
1005 ethType=ethType,
1006 ipProto=ipProto,
1007 tcpDst=tcpDst,
1008 debug=main.debug )
1009
1010 utilities.assert_equals( expect=main.TRUE,
1011 actual=stepResult,
1012 onpass="Successfully added flows",
1013 onfail="Failed add flows" )
1014
1015 # Giving ONOS time to add the flow
1016 time.sleep( main.addFlowSleep )
1017
1018 main.step( "Check flow is in the ADDED state" )
1019
1020 main.log.info( "Get the flows from ONOS" )
Jeremy86160992016-04-11 10:05:53 -07001021 try:
Jon Hallfc951072017-05-24 15:55:34 -07001022 flows = json.loads( main.ONOSrest.flows() )
GlennRC956ea742015-11-05 16:14:15 -08001023
Jeremy86160992016-04-11 10:05:53 -07001024 stepResult = main.TRUE
1025 for f in flows:
alisone14d7b02016-07-06 10:31:51 -07001026 if "rest" in f.get( "appId" ):
1027 if "ADDED" not in f.get( "state" ):
Jeremy86160992016-04-11 10:05:53 -07001028 stepResult = main.FALSE
alisone14d7b02016-07-06 10:31:51 -07001029 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
Jeremy86160992016-04-11 10:05:53 -07001030 except TypeError:
1031 main.log.error( "No Flows found by the REST API" )
1032 stepResult = main.FALSE
1033 except ValueError:
1034 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -07001035 main.cleanup()
1036 main.exit()
GlennRC956ea742015-11-05 16:14:15 -08001037
1038 utilities.assert_equals( expect=main.TRUE,
1039 actual=stepResult,
1040 onpass="All flows are in the ADDED state",
1041 onfail="All flows are NOT in the ADDED state" )
1042
1043 main.step( "Check flows are in Mininet's flow table" )
1044
1045 # get the flow IDs that were added through rest
1046 main.log.info( "Getting the flow IDs from ONOS" )
alisone14d7b02016-07-06 10:31:51 -07001047 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
GlennRC956ea742015-11-05 16:14:15 -08001048 # convert the flowIDs to ints then hex and finally back to strings
alisone14d7b02016-07-06 10:31:51 -07001049 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
1050 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
GlennRC956ea742015-11-05 16:14:15 -08001051
1052 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
1053
1054 utilities.assert_equals( expect=main.TRUE,
1055 actual=stepResult,
1056 onpass="All flows are in mininet",
1057 onfail="All flows are NOT in mininet" )
1058
1059 main.step( "Send a packet to verify the flow is correct" )
1060
1061 main.log.info( "Constructing packet" )
1062 # No need for the MAC src dst
1063 main.h1.buildEther( dst=main.h2.hostMac )
1064 main.h1.buildIP( dst=main.h2.hostIp )
1065 main.h1.buildTCP( dport=tcpDst )
1066
1067 main.log.info( "Starting filter on host2" )
1068 # Defaults to ip
1069 main.h2.startFilter( pktFilter="tcp" )
1070
1071 main.log.info( "Sending packet to host2" )
Jon Hallfc951072017-05-24 15:55:34 -07001072 main.h1.sendPacket()
GlennRC956ea742015-11-05 16:14:15 -08001073
1074 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -07001075 stepResult = main.h2.checkFilter()
GlennRC956ea742015-11-05 16:14:15 -08001076 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -07001077 main.log.info( "Packet: %s" % main.h2.readPackets() )
1078 else:
1079 main.h2.killFilter()
GlennRC956ea742015-11-05 16:14:15 -08001080
1081 main.log.info( "Clean up host components" )
1082 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001083 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -07001084 main.Mininet1.removeHostComponent( "h1" )
1085 main.Mininet1.removeHostComponent( "h2" )
GlennRC956ea742015-11-05 16:14:15 -08001086
1087 utilities.assert_equals( expect=main.TRUE,
1088 actual=stepResult,
1089 onpass="Successfully sent a packet",
1090 onfail="Failed to send a packet" )
1091
alisone14d7b02016-07-06 10:31:51 -07001092 def CASE1600( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -07001093 """
GlennRC956ea742015-11-05 16:14:15 -08001094 Add flows with a UDP selector and verify the flow
Jon Hallfc951072017-05-24 15:55:34 -07001095 """
GlennRC956ea742015-11-05 16:14:15 -08001096 import json
1097 import time
1098
1099 main.case( "Verify the UDP selector is correctly compiled on the flow" )
1100 main.caseExplanation = "Install a flow with only the UDP selector " +\
alisone14d7b02016-07-06 10:31:51 -07001101 "specified, verify the flow is added in ONOS, and finally " +\
GlennRC956ea742015-11-05 16:14:15 -08001102 "send a UDP packet to verify the UDP selector is compiled correctly."
1103
1104 main.step( "Add a flow with a UDP selector" )
1105
1106 main.log.info( "Creating host components" )
Jon Halla510a8a2016-05-04 15:09:28 -07001107 main.Scapy.createHostComponent( "h1" )
1108 main.Scapy.createHostComponent( "h2" )
alisone14d7b02016-07-06 10:31:51 -07001109 hosts = [ main.h1, main.h2 ]
GlennRC956ea742015-11-05 16:14:15 -08001110 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001111 host.startHostCli()
1112 host.startScapy()
1113 host.updateSelf()
GlennRC956ea742015-11-05 16:14:15 -08001114
1115 # Add a flow that connects host1 on port1 to host2 on port2
1116 egress = 2
1117 ingress = 1
1118 # IPv4 etherType
1119 ethType = main.params[ 'TEST' ][ 'ip4Type' ]
1120 # IP protocol
1121 ipProto = main.params[ 'TEST' ][ 'udpProto' ]
1122 # UDP port destination
1123 udpDst = main.params[ 'TEST' ][ 'udpDst' ]
1124
1125 main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
1126 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
1127 egressPort=egress,
1128 ingressPort=ingress,
1129 ethType=ethType,
1130 ipProto=ipProto,
1131 udpDst=udpDst,
1132 debug=main.debug )
1133
1134 utilities.assert_equals( expect=main.TRUE,
1135 actual=stepResult,
1136 onpass="Successfully added flows",
1137 onfail="Failed add flows" )
1138
1139 # Giving ONOS time to add the flow
1140 time.sleep( main.addFlowSleep )
1141
1142 main.step( "Check flow is in the ADDED state" )
1143
1144 main.log.info( "Get the flows from ONOS" )
Jeremy86160992016-04-11 10:05:53 -07001145 try:
Jon Hallfc951072017-05-24 15:55:34 -07001146 flows = json.loads( main.ONOSrest.flows() )
GlennRC956ea742015-11-05 16:14:15 -08001147
Jeremy86160992016-04-11 10:05:53 -07001148 stepResult = main.TRUE
1149 for f in flows:
alisone14d7b02016-07-06 10:31:51 -07001150 if "rest" in f.get( "appId" ):
1151 if "ADDED" not in f.get( "state" ):
Jeremy86160992016-04-11 10:05:53 -07001152 stepResult = main.FALSE
alisone14d7b02016-07-06 10:31:51 -07001153 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
Jeremy86160992016-04-11 10:05:53 -07001154 except TypeError:
1155 main.log.error( "No Flows found by the REST API" )
1156 stepResult = main.FALSE
1157 except ValueError:
1158 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -07001159 main.cleanup()
1160 main.exit()
GlennRC956ea742015-11-05 16:14:15 -08001161
1162 utilities.assert_equals( expect=main.TRUE,
1163 actual=stepResult,
1164 onpass="All flows are in the ADDED state",
1165 onfail="All flows are NOT in the ADDED state" )
1166
1167 main.step( "Check flows are in Mininet's flow table" )
1168
1169 # get the flow IDs that were added through rest
1170 main.log.info( "Getting the flow IDs from ONOS" )
alisone14d7b02016-07-06 10:31:51 -07001171 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
GlennRC956ea742015-11-05 16:14:15 -08001172 # convert the flowIDs to ints then hex and finally back to strings
alisone14d7b02016-07-06 10:31:51 -07001173 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
1174 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
GlennRC956ea742015-11-05 16:14:15 -08001175
1176 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
1177
1178 utilities.assert_equals( expect=main.TRUE,
1179 actual=stepResult,
1180 onpass="All flows are in mininet",
1181 onfail="All flows are NOT in mininet" )
1182
1183 main.step( "Send a packet to verify the flow is correct" )
1184
1185 main.log.info( "Constructing packet" )
1186 # No need for the MAC src dst
1187 main.h1.buildEther( dst=main.h2.hostMac )
1188 main.h1.buildIP( dst=main.h2.hostIp )
1189 main.h1.buildUDP( dport=udpDst )
1190
1191 main.log.info( "Starting filter on host2" )
1192 # Defaults to ip
1193 main.h2.startFilter( pktFilter="udp" )
1194
1195 main.log.info( "Sending packet to host2" )
Jon Hallfc951072017-05-24 15:55:34 -07001196 main.h1.sendPacket()
GlennRC956ea742015-11-05 16:14:15 -08001197
1198 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -07001199 stepResult = main.h2.checkFilter()
GlennRC956ea742015-11-05 16:14:15 -08001200 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -07001201 main.log.info( "Packet: %s" % main.h2.readPackets() )
1202 else:
1203 main.h2.killFilter()
GlennRC956ea742015-11-05 16:14:15 -08001204
1205 main.log.info( "Clean up host components" )
1206 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001207 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -07001208 main.Mininet1.removeHostComponent( "h1" )
1209 main.Mininet1.removeHostComponent( "h2" )
GlennRC956ea742015-11-05 16:14:15 -08001210
1211 utilities.assert_equals( expect=main.TRUE,
1212 actual=stepResult,
1213 onpass="Successfully sent a packet",
1214 onfail="Failed to send a packet" )
1215
alisone14d7b02016-07-06 10:31:51 -07001216 def CASE1900( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -07001217 """
alisone14d7b02016-07-06 10:31:51 -07001218 Add flows with a ICMPv4 selector and verify the flow
Jon Hallfc951072017-05-24 15:55:34 -07001219 """
GlennRC956ea742015-11-05 16:14:15 -08001220 import json
alisone14d7b02016-07-06 10:31:51 -07001221 import time
GlennRC956ea742015-11-05 16:14:15 -08001222
alisone14d7b02016-07-06 10:31:51 -07001223 main.case( "Verify the ICMPv4 selector is correctly compiled on the flow" )
1224 main.caseExplanation = "Install a flow with only the ICMPv4 selector " +\
1225 "specified, verify the flow is added in ONOS, and finally " +\
1226 "send a IMCPv4 packet to verify the ICMPv4 selector is compiled correctly."
GlennRC956ea742015-11-05 16:14:15 -08001227
alisone14d7b02016-07-06 10:31:51 -07001228 main.step( "Add a flow with a ICMPv4 selector" )
1229
1230 main.log.info( "Creating host components" )
1231 main.Scapy.createHostComponent( "h1" )
1232 main.Scapy.createHostComponent( "h2" )
1233 hosts = [ main.h1, main.h2 ]
1234 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001235 host.startHostCli()
1236 host.startScapy()
1237 host.updateSelf()
alisone14d7b02016-07-06 10:31:51 -07001238
1239 # Add a flow that connects host1 on port1 to host2 on port2
1240 egress = 2
1241 ingress = 1
1242 # IPv4 etherType
1243 ethType = main.params[ 'TEST' ][ 'ip4Type' ]
1244 # IP protocol
1245 ipProto = main.params[ 'TEST' ][ 'icmpProto' ]
1246
1247 main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
1248 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
1249 egressPort=egress,
1250 ingressPort=ingress,
1251 ethType=ethType,
1252 ipProto=ipProto,
1253 debug=main.debug )
1254
1255 utilities.assert_equals( expect=main.TRUE,
1256 actual=stepResult,
1257 onpass="Successfully added flows",
1258 onfail="Failed add flows" )
1259
1260 # Giving ONOS time to add the flow
1261 time.sleep( main.addFlowSleep )
1262
1263 main.step( "Check flow is in the ADDED state" )
1264
1265 main.log.info( "Get the flows from ONOS" )
Jeremy86160992016-04-11 10:05:53 -07001266 try:
Jon Hallfc951072017-05-24 15:55:34 -07001267 flows = json.loads( main.ONOSrest.flows() )
GlennRC956ea742015-11-05 16:14:15 -08001268
Jeremy86160992016-04-11 10:05:53 -07001269 stepResult = main.TRUE
1270 for f in flows:
alisone14d7b02016-07-06 10:31:51 -07001271 if "rest" in f.get( "appId" ):
1272 if "ADDED" not in f.get( "state" ):
1273 stepResult = main.FALSE
1274 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
Jeremy86160992016-04-11 10:05:53 -07001275 except TypeError:
1276 main.log.error( "No Flows found by the REST API" )
1277 stepResult = main.FALSE
1278 except ValueError:
1279 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -07001280 main.cleanup()
1281 main.exit()
alisone14d7b02016-07-06 10:31:51 -07001282
1283 utilities.assert_equals( expect=main.TRUE,
1284 actual=stepResult,
1285 onpass="All flows are in the ADDED state",
1286 onfail="All flows are NOT in the ADDED state" )
1287
1288 main.step( "Check flows are in Mininet's flow table" )
1289
1290 # get the flow IDs that were added through rest
1291 main.log.info( "Getting the flow IDs from ONOS" )
1292 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
1293 # convert the flowIDs to ints then hex and finally back to strings
1294 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
1295 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
1296
1297 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
1298
1299 utilities.assert_equals( expect=main.TRUE,
1300 actual=stepResult,
1301 onpass="All flows are in mininet",
1302 onfail="All flows are NOT in mininet" )
1303
1304 main.step( "Send a packet to verify the flow is correct" )
1305
1306 main.log.info( "Constructing packet" )
1307 # No need for the MAC src dst
1308 main.h1.buildEther( dst=main.h2.hostMac )
1309 main.h1.buildIP( dst=main.h2.hostIp )
Jon Hallfc951072017-05-24 15:55:34 -07001310 main.h1.buildICMP()
alisone14d7b02016-07-06 10:31:51 -07001311
1312 main.log.info( "Starting filter on host2" )
1313 # Defaults to ip
1314 main.h2.startFilter( pktFilter="icmp" )
1315
1316 main.log.info( "Sending packet to host2" )
Jon Hallfc951072017-05-24 15:55:34 -07001317 main.h1.sendPacket()
alisone14d7b02016-07-06 10:31:51 -07001318
1319 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -07001320 stepResult = main.h2.checkFilter()
alisone14d7b02016-07-06 10:31:51 -07001321 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -07001322 main.log.info( "Packet: %s" % main.h2.readPackets() )
1323 else:
1324 main.h2.killFilter()
alisone14d7b02016-07-06 10:31:51 -07001325
1326 main.log.info( "Clean up host components" )
1327 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001328 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -07001329 main.Mininet1.removeHostComponent( "h1" )
1330 main.Mininet1.removeHostComponent( "h2" )
1331
1332 utilities.assert_equals( expect=main.TRUE,
1333 actual=stepResult,
1334 onpass="Successfully sent a packet",
1335 onfail="Failed to send a packet" )
1336
1337 def CASE2000( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -07001338 """
alisone14d7b02016-07-06 10:31:51 -07001339 Add flows with a ICMPv6 selector and verify the flow
Jon Hallfc951072017-05-24 15:55:34 -07001340 """
alisone14d7b02016-07-06 10:31:51 -07001341 import json
1342 import time
1343
1344 main.case( "Verify the ICMPv6 selector is correctly compiled on the flow" )
1345 main.caseExplanation = "Install a flow with only the ICMPv6 selector " +\
1346 "specified, verify the flow is added in ONOS, and finally " +\
1347 "send a IMCPv6 packet to verify the ICMPv6 selector is compiled correctly."
1348
1349 main.step( "Add a flow with a ICMPv6 selector" )
1350
1351 main.log.info( "Creating host components" )
1352 main.Scapy.createHostComponent( "h5" )
1353 main.Scapy.createHostComponent( "h6" )
Jon Hallfc951072017-05-24 15:55:34 -07001354 hosts = [ main.h5, main.h6 ]
alisone14d7b02016-07-06 10:31:51 -07001355 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001356 host.startHostCli()
1357 host.startScapy()
alisone14d7b02016-07-06 10:31:51 -07001358 host.updateSelf( IPv6=True )
1359
1360 # Add a flow that connects host1 on port1 to host2 on port2
Jon Hallfc951072017-05-24 15:55:34 -07001361 egress = 6
1362 ingress = 5
alisone14d7b02016-07-06 10:31:51 -07001363 # IPv6 etherType
1364 ethType = main.params[ 'TEST' ][ 'ip6Type' ]
1365 # IP protocol
1366 ipProto = main.params[ 'TEST' ][ 'icmp6Proto' ]
1367
1368 main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
1369 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
1370 egressPort=egress,
1371 ingressPort=ingress,
1372 ethType=ethType,
1373 ipProto=ipProto,
1374 debug=main.debug )
1375
1376 utilities.assert_equals( expect=main.TRUE,
1377 actual=stepResult,
1378 onpass="Successfully added flows",
1379 onfail="Failed add flows" )
1380
1381 # Giving ONOS time to add the flow
1382 time.sleep( main.addFlowSleep )
1383
1384 main.step( "Check flow is in the ADDED state" )
1385
1386 main.log.info( "Get the flows from ONOS" )
1387 try:
Jon Hallfc951072017-05-24 15:55:34 -07001388 flows = json.loads( main.ONOSrest.flows() )
alisone14d7b02016-07-06 10:31:51 -07001389
1390 stepResult = main.TRUE
1391 for f in flows:
1392 if "rest" in f.get( "appId" ):
1393 if "ADDED" not in f.get( "state" ):
1394 stepResult = main.FALSE
1395 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
1396 except TypeError:
1397 main.log.error( "No Flows found by the REST API" )
1398 stepResult = main.FALSE
1399 except ValueError:
1400 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -07001401 main.cleanup()
1402 main.exit()
alisone14d7b02016-07-06 10:31:51 -07001403
1404 utilities.assert_equals( expect=main.TRUE,
1405 actual=stepResult,
1406 onpass="All flows are in the ADDED state",
1407 onfail="All flows are NOT in the ADDED state" )
1408
1409 main.step( "Check flows are in Mininet's flow table" )
1410
1411 # get the flow IDs that were added through rest
1412 main.log.info( "Getting the flow IDs from ONOS" )
1413 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
1414 # convert the flowIDs to ints then hex and finally back to strings
1415 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
1416 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
1417
1418 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
1419
1420 utilities.assert_equals( expect=main.TRUE,
1421 actual=stepResult,
1422 onpass="All flows are in mininet",
1423 onfail="All flows are NOT in mininet" )
1424
1425 main.step( "Send a packet to verify the flow is correct" )
1426
1427 main.log.info( "Constructing packet" )
1428 # No need for the MAC src dst
1429 main.h5.buildEther( dst=main.h6.hostMac )
1430 main.h5.buildIPv6( dst=main.h6.hostIp )
1431 main.h5.buildICMP( ipVersion=6 )
1432
1433 main.log.info( "Starting filter on host2" )
1434 # Defaults to ip
1435 main.h6.startFilter( pktFilter="icmp6" )
1436
1437 main.log.info( "Sending packet to host2" )
Jon Hallfc951072017-05-24 15:55:34 -07001438 main.h5.sendPacket()
alisone14d7b02016-07-06 10:31:51 -07001439
1440 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -07001441 stepResult = main.h6.checkFilter()
alisone14d7b02016-07-06 10:31:51 -07001442 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -07001443 main.log.info( "Packet: %s" % main.h6.readPackets() )
1444 else:
1445 main.h6.killFilter()
alisone14d7b02016-07-06 10:31:51 -07001446
1447 main.log.info( "Clean up host components" )
1448 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001449 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -07001450 main.Mininet1.removeHostComponent( "h5" )
1451 main.Mininet1.removeHostComponent( "h6" )
1452
1453 utilities.assert_equals( expect=main.TRUE,
1454 actual=stepResult,
1455 onpass="Successfully sent a packet",
1456 onfail="Failed to send a packet" )
1457
1458 def CASE3000( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -07001459 """
alisone14d7b02016-07-06 10:31:51 -07001460 Delete flow
Jon Hallfc951072017-05-24 15:55:34 -07001461 """
alisone14d7b02016-07-06 10:31:51 -07001462 import json
1463
1464 main.case( "Delete flows that were added through rest" )
1465 main.step( "Deleting flows" )
1466
1467 main.log.info( "Getting flows" )
1468 try:
Jon Hallfc951072017-05-24 15:55:34 -07001469 flows = json.loads( main.ONOSrest.flows() )
alisone14d7b02016-07-06 10:31:51 -07001470
1471 stepResult = main.TRUE
1472 for f in flows:
1473 if "rest" in f.get( "appId" ):
Jon Hallfc951072017-05-24 15:55:34 -07001474 if main.debug:
1475 main.log.debug( "Flow to be deleted:\n{}".format( main.ONOSrest.pprint( f ) ) )
alisone14d7b02016-07-06 10:31:51 -07001476 stepResult = stepResult and main.ONOSrest.removeFlow( f.get( "deviceId" ), f.get( "id" ) )
1477 except TypeError:
1478 main.log.error( "No Flows found by the REST API" )
1479 stepResult = main.FALSE
1480 except ValueError:
1481 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -07001482 main.cleanup()
1483 main.exit()
GlennRC956ea742015-11-05 16:14:15 -08001484
1485 utilities.assert_equals( expect=main.TRUE,
1486 actual=stepResult,
1487 onpass="Successfully deleting flows",
1488 onfail="Failed to delete flows" )
1489
1490 time.sleep( main.delFlowSleep )
1491
Jon Hallfc951072017-05-24 15:55:34 -07001492 def CASE1200( self, main ):
1493 """
alisone14d7b02016-07-06 10:31:51 -07001494 Add flows with a ARP selector and verify the flow
Jon Hallfc951072017-05-24 15:55:34 -07001495 """
alisone14d7b02016-07-06 10:31:51 -07001496 import json
1497 import time
1498
1499 main.case( "Verify flow IP selectors are correctly compiled" )
1500 main.caseExplanation = "Install two flows with only IP selectors " + \
1501 "specified, then verify flows are added in ONOS, finally " + \
1502 "send a packet that only specifies the IP src and dst."
1503
1504 main.step( "Add flows with ARP addresses as the only selectors" )
1505
1506 main.log.info( "Creating host components" )
1507 main.Scapy.createHostComponent( "h1" )
1508 main.Scapy.createHostComponent( "h2" )
1509 hosts = [ main.h1, main.h2 ]
1510 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001511 host.startHostCli()
1512 host.startScapy()
1513 host.updateSelf()
alisone14d7b02016-07-06 10:31:51 -07001514
1515 # Add a flow that connects host1 on port1 to host2 on port2
1516 # send output on port2
1517 # recieve input on port1
1518 egress = 2
1519 ingress = 1
1520 # ARP etherType = 0x0806
1521 ethType = main.params[ 'TEST' ][ 'arpType' ]
1522
1523 # Add flows that connects host1 to host2
1524 main.log.info( "Add flow with port ingress 1 to port egress 2" )
Jon Hallfc951072017-05-24 15:55:34 -07001525 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
1526 egressPort=egress,
1527 ingressPort=ingress,
1528 ethType=ethType,
1529 priority=40001,
1530 debug=main.debug )
alisone14d7b02016-07-06 10:31:51 -07001531
1532 utilities.assert_equals( expect=main.TRUE,
1533 actual=stepResult,
1534 onpass="Successfully added flows",
1535 onfail="Failed add flows" )
1536
1537 # Giving ONOS time to add the flow
1538 time.sleep( main.addFlowSleep )
1539
1540 main.step( "Check flow is in the ADDED state" )
1541
1542 main.log.info( "Get the flows from ONOS" )
1543 try:
Jon Hallfc951072017-05-24 15:55:34 -07001544 flows = json.loads( main.ONOSrest.flows() )
alisone14d7b02016-07-06 10:31:51 -07001545
1546 stepResult = main.TRUE
1547 for f in flows:
1548 if "rest" in f.get( "appId" ):
1549 if "ADDED" not in f.get( "state" ):
1550 stepResult = main.FALSE
Jon Hallfc951072017-05-24 15:55:34 -07001551 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
alisone14d7b02016-07-06 10:31:51 -07001552 except TypeError:
1553 main.log.error( "No Flows found by the REST API" )
1554 stepResult = main.FALSE
1555 except ValueError:
1556 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -07001557 main.cleanup()
1558 main.exit()
alisone14d7b02016-07-06 10:31:51 -07001559
1560 utilities.assert_equals( expect=main.TRUE,
1561 actual=stepResult,
1562 onpass="All flows are in the ADDED state",
1563 onfail="All flows are NOT in the ADDED state" )
1564
1565 main.step( "Check flows are in Mininet's flow table" )
1566
1567 # get the flow IDs that were added through rest
1568 main.log.info( "Getting the flow IDs from ONOS" )
Jon Hallfc951072017-05-24 15:55:34 -07001569 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
alisone14d7b02016-07-06 10:31:51 -07001570 # convert the flowIDs to ints then hex and finally back to strings
1571 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
Jon Hallfc951072017-05-24 15:55:34 -07001572 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
alisone14d7b02016-07-06 10:31:51 -07001573
1574 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
1575
1576 utilities.assert_equals( expect=main.TRUE,
1577 actual=stepResult,
1578 onpass="All flows are in mininet",
1579 onfail="All flows are NOT in mininet" )
1580
1581 main.step( "Send a packet to verify the flow is correct" )
1582
1583 main.log.info( "Constructing packet" )
1584 # No need for the MAC src dst
1585 main.h1.buildEther( src=main.h1.hostMac, dst=main.h2.hostMac )
1586 main.h1.buildARP( pdst=main.h2.hostIp )
1587
1588 main.log.info( "Starting filter on host2" )
1589 # Defaults to ip
1590 main.h2.startFilter( pktFilter="arp" )
1591
1592 main.log.info( "Sending packet to host2" )
Jon Hallfc951072017-05-24 15:55:34 -07001593 main.h1.sendPacket()
alisone14d7b02016-07-06 10:31:51 -07001594
1595 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -07001596 stepResult = main.h2.checkFilter()
alisone14d7b02016-07-06 10:31:51 -07001597 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -07001598 main.log.info( "Packet: %s" % main.h2.readPackets() )
alisone14d7b02016-07-06 10:31:51 -07001599 else:
Jon Hallfc951072017-05-24 15:55:34 -07001600 main.h2.killFilter()
alisone14d7b02016-07-06 10:31:51 -07001601
1602 main.log.info( "Clean up host components" )
1603 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001604 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -07001605 main.Mininet1.removeHostComponent( "h1" )
1606 main.Mininet1.removeHostComponent( "h2" )
1607
1608 utilities.assert_equals( expect=main.TRUE,
1609 actual=stepResult,
1610 onpass="Successfully sent a packet",
1611 onfail="Failed to send a packet" )
1612
1613 def CASE1800( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -07001614 """
alisone14d7b02016-07-06 10:31:51 -07001615 Add flows with a SCTP selector and verify the flow
Jon Hallfc951072017-05-24 15:55:34 -07001616 """
alisone14d7b02016-07-06 10:31:51 -07001617 import json
1618 import time
1619
1620 main.case( "Verify the UDP selector is correctly compiled on the flow" )
1621 main.caseExplanation = "Install a flow with only the UDP selector " + \
1622 "specified, verify the flow is added in ONOS, and finally " + \
1623 "send a UDP packet to verify the UDP selector is compiled correctly."
1624
1625 main.step( "Add a flow with a SCTP selector" )
1626
1627 main.log.info( "Creating host components" )
1628 main.Scapy.createHostComponent( "h1" )
1629 main.Scapy.createHostComponent( "h2" )
1630 hosts = [ main.h1, main.h2 ]
1631 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001632 host.startHostCli()
1633 host.startScapy()
1634 host.updateSelf()
alisone14d7b02016-07-06 10:31:51 -07001635
1636 # Add a flow that connects host1 on port1 to host2 on port2
1637 egress = 2
1638 ingress = 1
1639 # IPv4 etherType
1640 ethType = main.params[ 'TEST' ][ 'ip4Type' ]
1641 # IP protocol
1642 ipProto = main.params[ 'TEST' ][ 'sctpProto' ]
1643
Jon Hallfc951072017-05-24 15:55:34 -07001644 main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
alisone14d7b02016-07-06 10:31:51 -07001645 stepResult = main.ONOSrest.addFlow( deviceId=main.swDPID,
1646 egressPort=egress,
1647 ingressPort=ingress,
1648 ethType=ethType,
1649 ipProto=ipProto,
1650 debug=main.debug )
1651
1652 utilities.assert_equals( expect=main.TRUE,
1653 actual=stepResult,
1654 onpass="Successfully added flows",
1655 onfail="Failed add flows" )
1656
1657 # Giving ONOS time to add the flow
1658 time.sleep( main.addFlowSleep )
1659
1660 main.step( "Check flow is in the ADDED state" )
1661
1662 main.log.info( "Get the flows from ONOS" )
1663 try:
Jon Hallfc951072017-05-24 15:55:34 -07001664 flows = json.loads( main.ONOSrest.flows() )
alisone14d7b02016-07-06 10:31:51 -07001665
1666 stepResult = main.TRUE
1667 for f in flows:
1668 if "rest" in f.get( "appId" ):
1669 if "ADDED" not in f.get( "state" ):
1670 stepResult = main.FALSE
Jon Hallfc951072017-05-24 15:55:34 -07001671 main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) )
alisone14d7b02016-07-06 10:31:51 -07001672 except TypeError:
1673 main.log.error( "No Flows found by the REST API" )
1674 stepResult = main.FALSE
1675 except ValueError:
1676 main.log.error( "Problem getting Flows state from REST API. Exiting test" )
Jon Hallfc951072017-05-24 15:55:34 -07001677 main.cleanup()
1678 main.exit()
alisone14d7b02016-07-06 10:31:51 -07001679
1680 utilities.assert_equals( expect=main.TRUE,
1681 actual=stepResult,
1682 onpass="All flows are in the ADDED state",
1683 onfail="All flows are NOT in the ADDED state" )
1684
1685 main.step( "Check flows are in Mininet's flow table" )
1686
1687 # get the flow IDs that were added through rest
1688 main.log.info( "Getting the flow IDs from ONOS" )
1689 flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ]
1690 # convert the flowIDs to ints then hex and finally back to strings
1691 flowIds = [ str( hex( int( x ) ) ) for x in flowIds ]
1692 main.log.info( "ONOS flow IDs: {}".format( flowIds ) )
1693
1694 stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=False )
1695
1696 utilities.assert_equals( expect=main.TRUE,
1697 actual=stepResult,
1698 onpass="All flows are in mininet",
1699 onfail="All flows are NOT in mininet" )
1700
1701 main.step( "Send a packet to verify the flow is correct" )
1702
1703 main.log.info( "Constructing packet" )
1704 # No need for the MAC src dst
1705 main.h1.buildEther( dst=main.h2.hostMac )
1706 main.h1.buildIP( dst=main.h2.hostIp )
Jon Hallfc951072017-05-24 15:55:34 -07001707 main.h1.buildSCTP()
alisone14d7b02016-07-06 10:31:51 -07001708
1709 main.log.info( "Starting filter on host2" )
1710 # Defaults to ip
1711 main.h2.startFilter( pktFilter="sctp" )
1712
1713 main.log.info( "Sending packet to host2" )
Jon Hallfc951072017-05-24 15:55:34 -07001714 main.h1.sendPacket()
alisone14d7b02016-07-06 10:31:51 -07001715
1716 main.log.info( "Checking filter for our packet" )
Jon Hallfc951072017-05-24 15:55:34 -07001717 stepResult = main.h2.checkFilter()
alisone14d7b02016-07-06 10:31:51 -07001718 if stepResult:
Jon Hallfc951072017-05-24 15:55:34 -07001719 main.log.info( "Packet: %s" % main.h2.readPackets() )
alisone14d7b02016-07-06 10:31:51 -07001720 else:
Jon Hallfc951072017-05-24 15:55:34 -07001721 main.h2.killFilter()
alisone14d7b02016-07-06 10:31:51 -07001722
1723 main.log.info( "Clean up host components" )
1724 for host in hosts:
Jon Hallfc951072017-05-24 15:55:34 -07001725 host.stopScapy()
alisone14d7b02016-07-06 10:31:51 -07001726 main.Mininet1.removeHostComponent( "h1" )
1727 main.Mininet1.removeHostComponent( "h2" )
1728
1729 utilities.assert_equals( expect=main.TRUE,
1730 actual=stepResult,
1731 onpass="Successfully sent a packet",
1732 onfail="Failed to send a packet" )
1733
GlennRC68449942015-10-16 16:03:12 -07001734 def CASE100( self, main ):
Jon Hallfc951072017-05-24 15:55:34 -07001735 """
GlennRC5147a422015-10-06 17:26:17 -07001736 Report errors/warnings/exceptions
Jon Hallfc951072017-05-24 15:55:34 -07001737 """
alisone14d7b02016-07-06 10:31:51 -07001738 main.log.info( "Error report: \n" )
GlennRC5147a422015-10-06 17:26:17 -07001739 main.ONOSbench.logReport( main.ONOSip[ 0 ],
1740 [ "INFO",
1741 "FOLLOWER",
1742 "WARN",
1743 "flow",
1744 "ERROR",
1745 "Except" ],
GlennRC68449942015-10-16 16:03:12 -07001746 "s" )