suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 1 | class COMPflow: |
| 2 | |
| 3 | def __init__( self ): |
| 4 | self.default = '' |
| 5 | |
| 6 | def CASE1( self, main ): |
| 7 | import time |
| 8 | import os |
| 9 | import imp |
| 10 | |
| 11 | """ |
| 12 | - Construct tests variables |
| 13 | - GIT ( optional ) |
| 14 | - Checkout ONOS master branch |
| 15 | - Pull latest ONOS code |
| 16 | - Building ONOS ( optional ) |
| 17 | - Install ONOS package |
| 18 | - Build ONOS package |
| 19 | """ |
| 20 | |
| 21 | main.case( "Constructing test variables and building ONOS package" ) |
| 22 | main.step( "Constructing test variables" ) |
| 23 | stepResult = main.FALSE |
| 24 | |
| 25 | # Test variables |
| 26 | main.testOnDirectory = os.path.dirname( os.getcwd ( ) ) |
| 27 | main.cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 28 | main.apps = main.params[ 'ENV' ][ 'cellApps' ] |
| 29 | gitBranch = main.params[ 'GIT' ][ 'branch' ] |
| 30 | gitPull = main.params[ 'GIT' ][ 'pull' ] |
| 31 | main.ONOSport = main.params[ 'CTRL' ][ 'port' ] |
| 32 | main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] ) |
| 33 | main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] ) |
| 34 | main.startMNSleep = int( main.params[ 'SLEEP' ][ 'startMN' ] ) |
| 35 | main.addFlowSleep = int( main.params[ 'SLEEP' ][ 'addFlow' ] ) |
| 36 | main.delFlowSleep = int( main.params[ 'SLEEP' ][ 'delFlow' ] ) |
| 37 | main.debug = main.params['DEBUG'] |
| 38 | #main.swDPID = main.params[ 'TEST' ][ 'swDPID' ] |
| 39 | main.cellData = {} # for creating cell file |
| 40 | main.CLIs = [] |
| 41 | main.ONOSip = [] |
| 42 | |
| 43 | main.debug = True if "on" in main.debug else False |
| 44 | |
| 45 | main.ONOSip = main.ONOSbench.getOnosIps() |
| 46 | |
| 47 | # Assigning ONOS cli handles to a list |
| 48 | for i in range( 1, main.maxNodes + 1 ): |
| 49 | main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) ) |
| 50 | |
| 51 | |
| 52 | if main.CLIs: |
| 53 | stepResult = main.TRUE |
| 54 | else: |
| 55 | main.log.error( "Did not properly created list of ONOS CLI handle" ) |
| 56 | stepResult = main.FALSE |
| 57 | |
| 58 | utilities.assert_equals( expect=main.TRUE, |
| 59 | actual=stepResult, |
| 60 | onpass="Successfully construct " + |
| 61 | "test variables ", |
| 62 | onfail="Failed to construct test variables" ) |
| 63 | |
| 64 | if gitPull == 'True': |
| 65 | main.step( "Building ONOS in " + gitBranch + " branch" ) |
| 66 | onosBuildResult = main.startUp.onosBuild( main, gitBranch ) |
| 67 | stepResult = onosBuildResult |
| 68 | utilities.assert_equals( expect=main.TRUE, |
| 69 | actual=stepResult, |
| 70 | onpass="Successfully compiled " + |
| 71 | "latest ONOS", |
| 72 | onfail="Failed to compile " + |
| 73 | "latest ONOS" ) |
| 74 | else: |
| 75 | main.log.warn( "Did not pull new code so skipping mvn " + |
| 76 | "clean install" ) |
| 77 | |
| 78 | def CASE2( self, main ): |
| 79 | """ |
| 80 | - Set up cell |
| 81 | - Create cell file |
| 82 | - Set cell file |
| 83 | - Verify cell file |
| 84 | - Kill ONOS process |
| 85 | - Uninstall ONOS cluster |
| 86 | - Verify ONOS start up |
| 87 | - Install ONOS cluster |
| 88 | - Connect to cli |
| 89 | """ |
| 90 | |
| 91 | main.numCtrls = int( main.maxNodes ) |
| 92 | |
| 93 | main.case( "Starting up " + str( main.numCtrls ) + |
| 94 | " node(s) ONOS cluster" ) |
| 95 | |
| 96 | #kill off all onos processes |
| 97 | main.log.info( "Safety check, killing all ONOS processes" + |
| 98 | " before initiating environment setup" ) |
| 99 | |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 100 | |
| 101 | print "NODE COUNT = ", main.numCtrls |
| 102 | |
| 103 | tempOnosIp = [] |
| 104 | for i in range( main.numCtrls ): |
| 105 | tempOnosIp.append( main.ONOSip[i] ) |
| 106 | |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 107 | main.log.info("Apps in cell file: " + main.apps) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 108 | main.ONOSbench.createCellFile( main.ONOSbench.ip_address, "temp", main.Mininet1.ip_address, main.apps, tempOnosIp ) |
| 109 | |
| 110 | main.step( "Apply cell to environment" ) |
| 111 | cellResult = main.ONOSbench.setCell( "temp" ) |
| 112 | verifyResult = main.ONOSbench.verifyCell() |
| 113 | stepResult = cellResult and verifyResult |
| 114 | utilities.assert_equals( expect=main.TRUE, |
| 115 | actual=stepResult, |
| 116 | onpass="Successfully applied cell to " + \ |
| 117 | "environment", |
| 118 | onfail="Failed to apply cell to environment " ) |
| 119 | |
| 120 | main.step( "Creating ONOS package" ) |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 121 | packageResult = main.ONOSbench.onosPackage(opTimeout=240) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 122 | stepResult = packageResult |
| 123 | utilities.assert_equals( expect=main.TRUE, |
| 124 | actual=stepResult, |
| 125 | onpass="Successfully created ONOS package", |
| 126 | onfail="Failed to create ONOS package" ) |
| 127 | |
| 128 | time.sleep( main.startUpSleep ) |
| 129 | main.step( "Uninstalling ONOS package" ) |
| 130 | onosUninstallResult = main.TRUE |
| 131 | for i in range( main.numCtrls ): |
| 132 | onosUninstallResult = onosUninstallResult and \ |
| 133 | main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] ) |
| 134 | stepResult = onosUninstallResult |
| 135 | utilities.assert_equals( expect=main.TRUE, |
| 136 | actual=stepResult, |
| 137 | onpass="Successfully uninstalled ONOS package", |
| 138 | onfail="Failed to uninstall ONOS package" ) |
| 139 | |
| 140 | time.sleep( main.startUpSleep ) |
| 141 | main.step( "Installing ONOS package" ) |
| 142 | onosInstallResult = main.TRUE |
| 143 | for i in range( main.numCtrls ): |
| 144 | onosInstallResult = onosInstallResult and \ |
| 145 | main.ONOSbench.onosInstall( node=main.ONOSip[ i ] ) |
| 146 | stepResult = onosInstallResult |
| 147 | utilities.assert_equals( expect=main.TRUE, |
| 148 | actual=stepResult, |
| 149 | onpass="Successfully installed ONOS package", |
| 150 | onfail="Failed to install ONOS package" ) |
| 151 | |
| 152 | time.sleep( main.startUpSleep ) |
| 153 | main.step( "Starting ONOS service" ) |
| 154 | stopResult = main.TRUE |
| 155 | startResult = main.TRUE |
| 156 | onosIsUp = main.TRUE |
| 157 | |
| 158 | for i in range( main.numCtrls ): |
| 159 | onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] ) |
| 160 | if onosIsUp == main.TRUE: |
| 161 | main.log.report( "ONOS instance is up and ready" ) |
| 162 | else: |
| 163 | main.log.report( "ONOS instance may not be up, stop and " + |
| 164 | "start ONOS again " ) |
| 165 | for i in range( main.numCtrls ): |
| 166 | stopResult = stopResult and \ |
| 167 | main.ONOSbench.onosStop( main.ONOSip[ i ] ) |
| 168 | for i in range( main.numCtrls ): |
| 169 | startResult = startResult and \ |
| 170 | main.ONOSbench.onosStart( main.ONOSip[ i ] ) |
| 171 | stepResult = onosIsUp and stopResult and startResult |
| 172 | utilities.assert_equals( expect=main.TRUE, |
| 173 | actual=stepResult, |
| 174 | onpass="ONOS service is ready", |
| 175 | onfail="ONOS service did not start properly" ) |
| 176 | |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 177 | |
| 178 | def CASE10( self, main ): |
| 179 | ''' |
| 180 | Start Mininet |
| 181 | ''' |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 182 | import time |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 183 | |
| 184 | main.numSw = int(main.params['CASE10']['numSw']) |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 185 | main.case( "Enable openflow-base on onos and start Mininet." ) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 186 | main.caseExplanation = "Start mininet with custom topology and compare topology " +\ |
| 187 | "elements between Mininet and ONOS" |
| 188 | |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 189 | main.step("Activate openflow-base App") |
| 190 | stepResult = main.ONOSbench.onosCli( ONOSIp = main.ONOSip[0], cmdstr = "app activate org.onosproject.openflow-base" ) |
| 191 | time.sleep(10) |
| 192 | print stepResult |
| 193 | time.sleep(5) |
| 194 | |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 195 | main.step( "Setup Mininet Linear Topology with " + str(main.numSw) + " switches" ) |
| 196 | stepResult = main.Mininet1.startNet( args = main.params['CASE10']['mnArgs'] ) |
| 197 | |
| 198 | utilities.assert_equals( expect=main.TRUE, |
| 199 | actual=stepResult, |
| 200 | onpass="Successfully loaded topology", |
| 201 | onfail="Failed to load topology" ) |
| 202 | |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 203 | time.sleep(int(main.params['SLEEP']['startMN'])) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 204 | main.step( "Assign switches to controller" ) |
| 205 | for i in range(1, main.numSw + 1): |
| 206 | main.Mininet1.assignSwController( "s" + str(i), main.ONOSip[0] ) |
| 207 | |
| 208 | utilities.assert_equals( expect=main.TRUE, |
| 209 | actual=stepResult, |
| 210 | onpass="Successfully assigned switch to controller", |
| 211 | onfail="Failed to assign switch to controller" ) |
| 212 | |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 213 | main.deviceIdPrefix = "of:" |
| 214 | |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 215 | time.sleep( main.startMNSleep ) |
| 216 | |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 217 | def CASE11( self, main ): |
| 218 | ''' |
| 219 | Start Null Provider |
| 220 | ''' |
| 221 | import time |
| 222 | |
| 223 | main.numSw = int(main.params['CASE11']['numSw']) |
| 224 | |
| 225 | main.case("Activate Null Provider App") |
| 226 | stepResult = main.ONOSbench.onosCli( ONOSIp = main.ONOSip[0], cmdstr = "app activate org.onosproject.null" ) |
| 227 | time.sleep(10) |
| 228 | print stepResult |
| 229 | time.sleep(5) |
| 230 | |
| 231 | main.case( "Setup Null Provider for linear Topology" ) |
| 232 | main.step( "Setup Null Provider Linear Topology with " + str(main.numSw) + " devices." ) |
| 233 | main.ONOSbench.onosCfgSet( main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "deviceCount " + str(main.numSw)) |
| 234 | main.ONOSbench.onosCfgSet( main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "topoShape " + main.params['CASE11']['nullTopo'] ) |
| 235 | main.ONOSbench.onosCfgSet( main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "enabled " + main.params['CASE11']['nullStart']) |
| 236 | time.sleep(5) |
| 237 | |
| 238 | main.log.info("Check to make sure null providers are configured correctly.") |
| 239 | main.ONOSbench.handle.sendline("onos $OC1 summary") |
| 240 | stepResult = main.ONOSbench.handle.expect(":~") |
| 241 | main.log.info("ONOS Summary: " + main.ONOSbench.handle.before) |
| 242 | |
| 243 | main.deviceIdPrefix = "null:" |
| 244 | |
| 245 | time.sleep( main.startMNSleep ) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 246 | |
| 247 | |
| 248 | |
| 249 | def CASE1000( self, main ): |
| 250 | ''' |
| 251 | create JSON object with batched flows |
| 252 | ''' |
| 253 | import numpy |
| 254 | import time |
suibin zhang | 570cb45 | 2016-03-29 19:03:15 -0700 | [diff] [blame] | 255 | from pprint import pprint |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 256 | |
| 257 | main.case( "Create a json object for the batched flows" ) |
| 258 | |
| 259 | main.step( "Parse batch information" ) |
suibin zhang | a82fe3f | 2016-03-29 11:26:21 -0700 | [diff] [blame] | 260 | main.batchSize = int(main.params['CASE1000']['batchSize']) |
| 261 | main.log.info("Number of flows in a batch is:" + str(main.batchSize)) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 262 | |
| 263 | main.flowJsonBatchList = [] |
suibin zhang | 570cb45 | 2016-03-29 19:03:15 -0700 | [diff] [blame] | 264 | main.addedBatchList = [] |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 265 | postTimes = [] |
suibin zhang | a82fe3f | 2016-03-29 11:26:21 -0700 | [diff] [blame] | 266 | startSw = 1 |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 267 | |
| 268 | main.step("Creating a full list of batches") |
| 269 | for index in range(1, int(main.params['CASE1000']['batches']) + 1): |
suibin zhang | a82fe3f | 2016-03-29 11:26:21 -0700 | [diff] [blame] | 270 | if startSw <= main.numSw: |
suibin zhang | ff4abfe | 2016-03-29 11:52:08 -0700 | [diff] [blame] | 271 | ind = startSw |
| 272 | else: |
| 273 | startSw = 1 |
| 274 | ind = startSw |
| 275 | |
| 276 | main.log.info("Creating batch: " + str(index)) |
| 277 | flowJsonBatch = main.ONOSrest.createFlowBatch( numSw = main.numSw, |
| 278 | swIndex = ind, |
suibin zhang | a82fe3f | 2016-03-29 11:26:21 -0700 | [diff] [blame] | 279 | batchSize = main.batchSize, |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 280 | batchIndex = index, |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 281 | deviceIdpreFix=main.deviceIdPrefix, |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 282 | ingressPort = 2, |
| 283 | egressPort = 3) |
suibin zhang | ff4abfe | 2016-03-29 11:52:08 -0700 | [diff] [blame] | 284 | main.flowJsonBatchList.append(flowJsonBatch) |
suibin zhang | a82fe3f | 2016-03-29 11:26:21 -0700 | [diff] [blame] | 285 | |
suibin zhang | ff4abfe | 2016-03-29 11:52:08 -0700 | [diff] [blame] | 286 | startSw += 1 |
| 287 | |
suibin zhang | a82fe3f | 2016-03-29 11:26:21 -0700 | [diff] [blame] | 288 | |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 289 | |
| 290 | main.step("Using REST API /flows/{} to post flow batch") |
| 291 | tStartPost = time.time() |
| 292 | for item in main.flowJsonBatchList: |
| 293 | ts = time.time() |
suibin zhang | 570cb45 | 2016-03-29 19:03:15 -0700 | [diff] [blame] | 294 | status, response = main.ONOSrest.sendFlowBatch(batch = item ) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 295 | teBatch = time.time() - ts |
| 296 | postTimes.append(teBatch) |
| 297 | main.log.info("Batch Rest Post Elapse time is: " + str(teBatch)) |
suibin zhang | 570cb45 | 2016-03-29 19:03:15 -0700 | [diff] [blame] | 298 | main.addedBatchList.append(response[1]) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 299 | |
| 300 | tLastPostEnd = time.time() |
| 301 | |
| 302 | main.step("Check to ensure all flows are in added state.") |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 303 | #pprint(main.addedBatchList) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 304 | resp = main.FALSE |
| 305 | while resp != main.TRUE: |
| 306 | resp = main.ONOSrest.checkFlowsState() |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 307 | time.sleep( float(main.params['SLEEP']['chkFlow']) ) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 308 | tAllAdded = time.time() |
| 309 | |
suibin zhang | dec01c5 | 2016-03-29 19:23:33 -0700 | [diff] [blame] | 310 | main.numFlows = int(main.params['CASE1000']['batches']) *\ |
suibin zhang | a82fe3f | 2016-03-29 11:26:21 -0700 | [diff] [blame] | 311 | int(main.params['CASE1000']['batchSize']) |
suibin zhang | dec01c5 | 2016-03-29 19:23:33 -0700 | [diff] [blame] | 312 | main.log.info("Total number of flows: " + str (main.numFlows) ) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 313 | main.log.info("Sum of each POST elapse time: " + str(numpy.sum(postTimes)) ) |
| 314 | main.log.info("Total POST elapse time: " + str(tLastPostEnd-tStartPost)) |
suibin zhang | dec01c5 | 2016-03-29 19:23:33 -0700 | [diff] [blame] | 315 | main.log.info("Rate of ADD Controller response: " + str(main.numFlows / (tLastPostEnd - tStartPost))) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 316 | |
| 317 | duration = tAllAdded - tLastPostEnd |
| 318 | main.log.info("Elapse time from end of last REST POST to Flows in ADDED state: " +\ |
| 319 | str(duration)) |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 320 | main.log.info("Rate of Confirmed Batch Flow ADD is (flows/sec): " + str( main.numFlows / duration)) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 321 | |
| 322 | def CASE2000(self, main): |
| 323 | import time |
| 324 | import numpy |
suibin zhang | 570cb45 | 2016-03-29 19:03:15 -0700 | [diff] [blame] | 325 | import json |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 326 | |
| 327 | rmTimes = [] |
| 328 | |
| 329 | main.case("Remove flow timing") |
| 330 | |
| 331 | tStartRemove = time.time() |
suibin zhang | 570cb45 | 2016-03-29 19:03:15 -0700 | [diff] [blame] | 332 | for item in main.addedBatchList: |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 333 | ts = time.time() |
suibin zhang | 570cb45 | 2016-03-29 19:03:15 -0700 | [diff] [blame] | 334 | print(item) |
| 335 | resp = main.ONOSrest.removeFlowBatch(batch = json.loads(item) ) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 336 | teBatch = time.time() - ts |
| 337 | rmTimes.append(teBatch) |
| 338 | main.log.info("Batch Rest Remove Elapse time is: " + str(teBatch)) |
| 339 | |
| 340 | tLastRemoveEnd = time.time() |
| 341 | |
suibin zhang | f59d368 | 2016-03-29 19:27:13 -0700 | [diff] [blame] | 342 | main.step("Check to ensure all flows are not in PENDING state.") |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 343 | resp = main.FALSE |
| 344 | while resp != main.TRUE: |
| 345 | resp = main.ONOSrest.checkFlowsState() |
| 346 | time.sleep(0.5) |
| 347 | tAllRemoved = time.time() |
| 348 | |
| 349 | main.log.info("Total number of flows: " + str (int(main.params['CASE1000']['batches']) *\ |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 350 | int(main.params['CASE1000']['batchSize']) )) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 351 | main.log.info("Sum of each DELETE elapse time: " + str(numpy.sum(rmTimes)) ) |
suibin zhang | 570cb45 | 2016-03-29 19:03:15 -0700 | [diff] [blame] | 352 | main.log.info("Total DELETE elapse time: " + str(tLastRemoveEnd-tStartRemove)) |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 353 | main.log.info("Rate of DELETE Controller response (flows/sec): " + str(main.numFlows / (tLastRemoveEnd - tStartRemove))) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 354 | |
suibin zhang | dec01c5 | 2016-03-29 19:23:33 -0700 | [diff] [blame] | 355 | duration = tAllRemoved - tLastRemoveEnd |
suibin zhang | f59d368 | 2016-03-29 19:27:13 -0700 | [diff] [blame] | 356 | main.log.info("Elapse time from end of last REST DELETE to Flows in REMOVED state: " +\ |
suibin zhang | dec01c5 | 2016-03-29 19:23:33 -0700 | [diff] [blame] | 357 | str(duration)) |
suibin zhang | 5c735ca | 2016-03-30 16:01:06 -0700 | [diff] [blame^] | 358 | main.log.info("Rate of Confirmed Batch Flow DELETE is (flows/sec): " + str( main.numFlows / duration)) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 359 | |
| 360 | def CASE100(self,main): |
| 361 | from pprint import pprint |
| 362 | |
| 363 | main.case( "Check to ensure onos flows." ) |
| 364 | |
| 365 | resp = main.ONOSrest.checkFlowsState() |
suibin zhang | dec01c5 | 2016-03-29 19:23:33 -0700 | [diff] [blame] | 366 | #pprint(resp) |
suibin zhang | d0f09b3 | 2016-03-29 00:57:57 -0700 | [diff] [blame] | 367 | |
| 368 | |
| 369 | def CASE110( self, main ): |
| 370 | ''' |
| 371 | Report errors/warnings/exceptions |
| 372 | ''' |
| 373 | main.log.info("Error report: \n" ) |
| 374 | main.ONOSbench.logReport( main.ONOSip[ 0 ], |
| 375 | [ "INFO", |
| 376 | "FOLLOWER", |
| 377 | "WARN", |
| 378 | "flow", |
| 379 | "ERROR", |
| 380 | "Except" ], |
| 381 | "s" ) |
| 382 | main.stop() |
| 383 | |