andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1 | # Intent Performance Test for ONOS-next |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 2 | # |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 3 | # andrew@onlab.us |
andrewonlab | 8790abb | 2014-11-06 13:51:54 -0500 | [diff] [blame] | 4 | # |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 5 | # November 5, 2014 |
| 6 | |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 7 | |
| 8 | class IntentPerfNext: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 9 | |
| 10 | def __init__( self ): |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 11 | self.default = "" |
| 12 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 13 | def CASE1( self, main ): |
| 14 | """ |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 15 | ONOS startup sequence |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 16 | """ |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 17 | import time |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 18 | global clusterCount |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 19 | global timeToPost |
| 20 | global runNum |
| 21 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 22 | clusterCount = 1 |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 23 | timeToPost = time.strftime("%Y-%m-%d %H:%M:%S") |
| 24 | runNum = time.strftime("%d%H%M%S") |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 25 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 26 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 27 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 28 | gitPull = main.params[ 'GIT' ][ 'autoPull' ] |
| 29 | checkoutBranch = main.params[ 'GIT' ][ 'checkout' ] |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 30 | intentFilePath = main.params[ 'DB' ][ 'intentFilePath' ] |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 31 | |
andrewonlab | 082dfc3 | 2015-02-06 13:59:51 -0500 | [diff] [blame] | 32 | ONOSIp = [] |
| 33 | for i in range(1, 8): |
| 34 | ONOSIp.append(main.params[ 'CTRL' ][ 'ip'+str(i) ]) |
| 35 | main.ONOSbench.onosUninstall( nodeIp = ONOSIp[i-1] ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 36 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 37 | MN1Ip = main.params[ 'MN' ][ 'ip1' ] |
| 38 | BENCHIp = main.params[ 'BENCH' ][ 'ip' ] |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 39 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 40 | main.case( "Setting up test environment" ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 41 | |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 42 | main.step( "Clearing previous DB log file" ) |
| 43 | fIntentLog = open(intentFilePath, 'w') |
| 44 | # Overwrite with empty line and close |
| 45 | fIntentLog.write('') |
| 46 | fIntentLog.close() |
| 47 | |
andrewonlab | 5b954b0 | 2015-02-05 13:03:46 -0500 | [diff] [blame] | 48 | main.step( "Starting mininet topology" ) |
| 49 | main.Mininet1.startNet() |
| 50 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 51 | main.step( "Creating cell file" ) |
| 52 | cellFileResult = main.ONOSbench.createCellFile( |
| 53 | BENCHIp, cellName, MN1Ip, |
andrewonlab | e07f856 | 2015-02-20 12:23:07 -0500 | [diff] [blame] | 54 | ("onos-core,webconsole,onos-api,onos-app-metrics,onos-gui," |
| 55 | "onos-cli,onos-openflow"), |
andrewonlab | 082dfc3 | 2015-02-06 13:59:51 -0500 | [diff] [blame] | 56 | ONOSIp[0] ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 57 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 58 | main.step( "Applying cell file to environment" ) |
| 59 | cellApplyResult = main.ONOSbench.setCell( cellName ) |
| 60 | verifyCellResult = main.ONOSbench.verifyCell() |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 61 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 62 | main.step( "Removing raft logs" ) |
| 63 | main.ONOSbench.onosRemoveRaftLogs() |
| 64 | |
| 65 | main.step( "Git checkout and pull " + checkoutBranch ) |
| 66 | if gitPull == 'on': |
| 67 | checkoutResult = \ |
| 68 | main.ONOSbench.gitCheckout( checkoutBranch ) |
| 69 | pullResult = main.ONOSbench.gitPull() |
| 70 | |
| 71 | # If you used git pull, auto compile |
| 72 | main.step( "Using onos-build to compile ONOS" ) |
| 73 | buildResult = main.ONOSbench.onosBuild() |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 74 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 75 | checkoutResult = main.TRUE |
| 76 | pullResult = main.TRUE |
| 77 | buildResult = main.TRUE |
| 78 | main.log.info( "Git pull skipped by configuration" ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 79 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 80 | main.log.report( "Commit information - " ) |
| 81 | main.ONOSbench.getVersion( report=True ) |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 82 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 83 | main.step( "Creating ONOS package" ) |
| 84 | packageResult = main.ONOSbench.onosPackage() |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 85 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 86 | main.step( "Installing ONOS package" ) |
andrewonlab | 082dfc3 | 2015-02-06 13:59:51 -0500 | [diff] [blame] | 87 | install1Result = main.ONOSbench.onosInstall( node=ONOSIp[0] ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 88 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 89 | main.step( "Set cell for ONOScli env" ) |
| 90 | main.ONOS1cli.setCell( cellName ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 91 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 92 | time.sleep( 5 ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 93 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 94 | main.step( "Start onos cli" ) |
andrewonlab | 082dfc3 | 2015-02-06 13:59:51 -0500 | [diff] [blame] | 95 | cli1 = main.ONOS1cli.startOnosCli( ONOSIp[0] ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 96 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 97 | utilities.assert_equals( expect=main.TRUE, |
| 98 | actual=cellFileResult and cellApplyResult and |
| 99 | verifyCellResult and checkoutResult and |
| 100 | pullResult and buildResult and |
| 101 | install1Result, # and install2Result and |
| 102 | # install3Result, |
| 103 | onpass="ONOS started successfully", |
| 104 | onfail="Failed to start ONOS" ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 105 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 106 | def CASE2( self, main ): |
| 107 | """ |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 108 | Single intent add latency |
| 109 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 110 | """ |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 111 | import time |
| 112 | import json |
| 113 | import requests |
| 114 | import os |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 115 | import numpy |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 116 | global clusterCount |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 117 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 118 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 119 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 120 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
| 121 | ONOSIpList = [] |
| 122 | for i in range( 1, 8 ): |
| 123 | ONOSIpList.append( main.params[ 'CTRL' ][ 'ip' + str( i ) ] ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 124 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 125 | ONOSUser = main.params[ 'CTRL' ][ 'user' ] |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 126 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 127 | defaultSwPort = main.params[ 'CTRL' ][ 'port1' ] |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 128 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 129 | # number of iterations of case |
| 130 | numIter = main.params[ 'TEST' ][ 'numIter' ] |
| 131 | numIgnore = int( main.params[ 'TEST' ][ 'numIgnore' ] ) |
| 132 | |
| 133 | # Timestamp keys for json metrics output |
| 134 | submitTime = main.params[ 'JSON' ][ 'submittedTime' ] |
| 135 | installTime = main.params[ 'JSON' ][ 'installedTime' ] |
| 136 | wdRequestTime = main.params[ 'JSON' ][ 'wdRequestTime' ] |
| 137 | withdrawnTime = main.params[ 'JSON' ][ 'withdrawnTime' ] |
| 138 | |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 139 | assertion = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 140 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 141 | intentAddLatList = [] |
| 142 | |
| 143 | # Distribute switches according to cluster count |
| 144 | for i in range( 1, 9 ): |
| 145 | if clusterCount == 1: |
| 146 | main.Mininet1.assignSwController( |
| 147 | sw=str( i ), ip1=ONOSIpList[ 0 ], |
| 148 | port1=defaultSwPort |
| 149 | ) |
| 150 | elif clusterCount == 3: |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 151 | if i < 3: |
| 152 | index = 0 |
| 153 | elif i < 6 and i >= 3: |
| 154 | index = 1 |
| 155 | else: |
| 156 | index = 2 |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 157 | main.Mininet1.assignSwController( |
| 158 | sw=str( i ), ip1=ONOSIpList[ index ], |
| 159 | port1=defaultSwPort |
| 160 | ) |
| 161 | elif clusterCount == 5: |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 162 | if i < 3: |
| 163 | index = 0 |
| 164 | elif i < 5 and i >= 3: |
| 165 | index = 1 |
| 166 | elif i < 7 and i >= 5: |
| 167 | index = 2 |
| 168 | elif i == 7: |
| 169 | index = 3 |
| 170 | else: |
| 171 | index = 4 |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 172 | main.Mininet1.assignSwController( |
| 173 | sw=str( i ), ip1=ONOSIpList[ index ], |
| 174 | port1=defaultSwPort |
| 175 | ) |
| 176 | elif clusterCount == 7: |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 177 | if i < 6: |
| 178 | index = i |
| 179 | else: |
| 180 | index = 6 |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 181 | main.Mininet1.assignSwController( |
| 182 | sw=str( i ), ip1=ONOSIpList[ index ], |
| 183 | port1=defaultSwPort |
| 184 | ) |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 185 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 186 | time.sleep( 10 ) |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 187 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 188 | main.log.report( "Single intent add latency test" ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 189 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 190 | devicesJsonStr = main.ONOS1cli.devices() |
| 191 | devicesJsonObj = json.loads( devicesJsonStr ) |
| 192 | |
| 193 | if not devicesJsonObj: |
| 194 | main.log.report( "Devices not discovered" ) |
| 195 | main.log.report( "Aborting test" ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 196 | main.exit() |
| 197 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 198 | main.log.info( "Devices discovered successfully" ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 199 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 200 | deviceIdList = [] |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 201 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 202 | # Obtain device id list in ONOS format. |
| 203 | # They should already be in order ( 1,2,3,10,11,12,13, etc ) |
| 204 | for device in devicesJsonObj: |
| 205 | deviceIdList.append( device[ 'id' ] ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 206 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 207 | for i in range( 0, int( numIter ) ): |
| 208 | # addPointIntent( ingrDevice, egrDevice, |
| 209 | # ingrPort, egrPort ) |
| 210 | main.ONOS1cli.addPointIntent( |
| 211 | deviceIdList[ 0 ] + "/2", deviceIdList[ 7 ] + "/2" ) |
| 212 | |
| 213 | # Allow some time for intents to propagate |
| 214 | time.sleep( 5 ) |
| 215 | |
| 216 | intentsStr = main.ONOS1cli.intents( jsonFormat=True ) |
| 217 | intentsObj = json.loads( intentsStr ) |
| 218 | for intent in intentsObj: |
| 219 | if intent[ 'state' ] == "INSTALLED": |
| 220 | main.log.info( "Intent installed successfully" ) |
| 221 | intentId = intent[ 'id' ] |
| 222 | main.log.info( "Intent id: " + str( intentId ) ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 223 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 224 | # TODO: Add error handling |
| 225 | main.log.info( "Intent installation failed" ) |
| 226 | intentId = "" |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 227 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 228 | # Obtain metrics from ONOS 1, 2, 3 |
| 229 | intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics() |
| 230 | intentsJsonObj1 = json.loads( intentsJsonStr1 ) |
| 231 | # Parse values from the json object |
| 232 | intentSubmit1 = \ |
| 233 | intentsJsonObj1[ submitTime ][ 'value' ] |
| 234 | intentInstall1 = \ |
| 235 | intentsJsonObj1[ installTime ][ 'value' ] |
| 236 | intentInstallLat1 = \ |
| 237 | int( intentInstall1 ) - int( intentSubmit1 ) |
| 238 | |
| 239 | if clusterCount == 3: |
| 240 | intentsJsonStr2 = main.ONOS2cli.intentsEventsMetrics() |
| 241 | intentsJsonStr3 = main.ONOS3cli.intentsEventsMetrics() |
| 242 | intentsJsonObj2 = json.loads( intentsJsonStr2 ) |
| 243 | intentsJsonObj3 = json.loads( intentsJsonStr3 ) |
| 244 | intentSubmit2 = \ |
| 245 | intentsJsonObj2[ submitTime ][ 'value' ] |
| 246 | intentSubmit3 = \ |
| 247 | intentsJsonObj3[ submitTime ][ 'value' ] |
| 248 | intentInstall2 = \ |
| 249 | intentsJsonObj2[ installTime ][ 'value' ] |
| 250 | intentInstall3 = \ |
| 251 | intentsJsonObj3[ installTime ][ 'value' ] |
| 252 | intentInstallLat2 = \ |
| 253 | int( intentInstall2 ) - int( intentSubmit2 ) |
| 254 | intentInstallLat3 = \ |
| 255 | int( intentInstall3 ) - int( intentSubmit3 ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 256 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 257 | intentInstallLat2 = 0 |
| 258 | intentInstallLat3 = 0 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 259 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 260 | if clusterCount == 5: |
| 261 | intentsJsonStr4 = main.ONOS4cli.intentsEventsMetrics() |
| 262 | intentsJsonStr5 = main.ONOS5cli.intentsEventsMetrics() |
| 263 | intentsJsonObj4 = json.loads( intentsJsonStr4 ) |
| 264 | intentsJsonObj5 = json.loads( intentsJsonStr5 ) |
| 265 | intentSubmit4 = \ |
| 266 | intentsJsonObj4[ submitTime ][ 'value' ] |
| 267 | intentSubmit5 = \ |
| 268 | intentsJsonObj5[ submitTime ][ 'value' ] |
| 269 | intentInstall4 = \ |
| 270 | intentsJsonObj5[ installTime ][ 'value' ] |
| 271 | intentInstall5 = \ |
| 272 | intentsJsonObj5[ installTime ][ 'value' ] |
| 273 | intentInstallLat4 = \ |
| 274 | int( intentInstall4 ) - int( intentSubmit4 ) |
| 275 | intentInstallLat5 = \ |
| 276 | int( intentInstall5 ) - int( intentSubmit5 ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 277 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 278 | intentInstallLat4 = 0 |
| 279 | intentInstallLat5 = 0 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 280 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 281 | if clusterCount == 7: |
| 282 | intentsJsonStr6 = main.ONOS6cli.intentsEventsMetrics() |
| 283 | intentsJsonStr7 = main.ONOS7cli.intentsEventsMetrics() |
| 284 | intentsJsonObj6 = json.loads( intentsJsonStr6 ) |
| 285 | intentsJsonObj7 = json.loads( intentsJsonStr7 ) |
| 286 | intentSubmit6 = \ |
| 287 | intentsJsonObj6[ submitTime ][ 'value' ] |
| 288 | intentSubmit7 = \ |
| 289 | intentsJsonObj6[ submitTime ][ 'value' ] |
| 290 | intentInstall6 = \ |
| 291 | intentsJsonObj6[ installTime ][ 'value' ] |
| 292 | intentInstall7 = \ |
| 293 | intentsJsonObj7[ installTime ][ 'value' ] |
| 294 | intentInstallLat6 = \ |
| 295 | int( intentInstall6 ) - int( intentSubmit6 ) |
| 296 | intentInstallLat7 = \ |
| 297 | int( intentInstall7 ) - int( intentSubmit7 ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 298 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 299 | intentInstallLat6 = 0 |
| 300 | intentInstallLat7 = 0 |
andrewonlab | 8790abb | 2014-11-06 13:51:54 -0500 | [diff] [blame] | 301 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 302 | intentInstallLatAvg = \ |
| 303 | ( intentInstallLat1 + |
| 304 | intentInstallLat2 + |
| 305 | intentInstallLat3 + |
| 306 | intentInstallLat4 + |
| 307 | intentInstallLat5 + |
| 308 | intentInstallLat6 + |
| 309 | intentInstallLat7 ) / clusterCount |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 310 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 311 | main.log.info( "Intent add latency avg for iteration " + str( i ) + |
| 312 | ": " + str( intentInstallLatAvg ) + " ms" ) |
andrewonlab | 8790abb | 2014-11-06 13:51:54 -0500 | [diff] [blame] | 313 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 314 | if intentInstallLatAvg > 0.0 and \ |
| 315 | intentInstallLatAvg < 1000 and i > numIgnore: |
| 316 | intentAddLatList.append( intentInstallLatAvg ) |
andrewonlab | 8790abb | 2014-11-06 13:51:54 -0500 | [diff] [blame] | 317 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 318 | main.log.info( "Intent add latency exceeded " + |
| 319 | "threshold. Skipping iteration " + str( i ) ) |
andrewonlab | 8790abb | 2014-11-06 13:51:54 -0500 | [diff] [blame] | 320 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 321 | time.sleep( 3 ) |
| 322 | |
| 323 | # TODO: Only remove intents that were installed |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 324 | # in this case... Otherwise many other intents |
| 325 | # may show up distorting the results |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 326 | main.log.info( "Removing intents for next iteration" ) |
| 327 | jsonTemp = \ |
| 328 | main.ONOS1cli.intents( jsonFormat=True ) |
| 329 | jsonObjIntents = json.loads( jsonTemp ) |
| 330 | if jsonObjIntents: |
| 331 | for intents in jsonObjIntents: |
| 332 | tempId = intents[ 'id' ] |
| 333 | # main.ONOS1cli.removeIntent( tempId ) |
| 334 | main.log.info( "Removing intent id: " + |
| 335 | str( tempId ) ) |
| 336 | main.ONOS1cli.removeIntent( tempId ) |
andrewonlab | 8790abb | 2014-11-06 13:51:54 -0500 | [diff] [blame] | 337 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 338 | main.log.info( "Intents were not installed correctly" ) |
andrewonlab | 8790abb | 2014-11-06 13:51:54 -0500 | [diff] [blame] | 339 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 340 | time.sleep( 5 ) |
andrewonlab | 8790abb | 2014-11-06 13:51:54 -0500 | [diff] [blame] | 341 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 342 | if intentAddLatList: |
| 343 | intentAddLatAvg = sum( intentAddLatList ) /\ |
| 344 | len( intentAddLatList ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 345 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 346 | main.log.report( "Intent installation latency test failed" ) |
| 347 | intentAddLatAvg = "NA" |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 348 | assertion = main.FALSE |
| 349 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 350 | intentAddLatStd = \ |
| 351 | round( numpy.std( intentAddLatList ), 1 ) |
| 352 | # END ITERATION FOR LOOP |
| 353 | main.log.report( "Single intent add latency - " ) |
| 354 | main.log.report( "Avg: " + str( intentAddLatAvg ) + " ms" ) |
| 355 | main.log.report( "Std Deviation: " + str( intentAddLatStd ) + " ms" ) |
| 356 | |
| 357 | utilities.assert_equals( |
| 358 | expect=main.TRUE, |
| 359 | actual=assertion, |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 360 | onpass="Single intent install latency test successful", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 361 | onfail="Single intent install latency test failed" ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 362 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 363 | def CASE3( self, main ): |
| 364 | """ |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 365 | Intent Reroute latency |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 366 | """ |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 367 | import time |
| 368 | import json |
| 369 | import requests |
| 370 | import os |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 371 | import numpy |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 372 | global clusterCount |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 373 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 374 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 375 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 376 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
| 377 | ONOSUser = main.params[ 'CTRL' ][ 'user' ] |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 378 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 379 | defaultSwPort = main.params[ 'CTRL' ][ 'port1' ] |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 380 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 381 | # number of iterations of case |
| 382 | numIter = main.params[ 'TEST' ][ 'numIter' ] |
| 383 | numIgnore = int( main.params[ 'TEST' ][ 'numIgnore' ] ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 384 | assertion = main.TRUE |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 385 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 386 | # Timestamp keys for json metrics output |
| 387 | submitTime = main.params[ 'JSON' ][ 'submittedTime' ] |
| 388 | installTime = main.params[ 'JSON' ][ 'installedTime' ] |
| 389 | wdRequestTime = main.params[ 'JSON' ][ 'wdRequestTime' ] |
| 390 | withdrawnTime = main.params[ 'JSON' ][ 'withdrawnTime' ] |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 391 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 392 | # NOTE: May need to configure interface depending on topology |
| 393 | intfs = main.params[ 'TEST' ][ 'intfs' ] |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 394 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 395 | devicesJsonStr = main.ONOS1cli.devices() |
| 396 | devicesJsonObj = json.loads( devicesJsonStr ) |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 397 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 398 | deviceIdList = [] |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 399 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 400 | # Obtain device id list in ONOS format. |
| 401 | # They should already be in order ( 1,2,3,10,11,12,13, etc ) |
| 402 | for device in devicesJsonObj: |
| 403 | deviceIdList.append( device[ 'id' ] ) |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 404 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 405 | intentRerouteLatList = [] |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 406 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 407 | for i in range( 0, int( numIter ) ): |
| 408 | # addPointIntent( ingrDevice, ingrPort, |
| 409 | # egrDevice, egrPort ) |
| 410 | if len( deviceIdList ) > 0: |
| 411 | main.ONOS1cli.addPointIntent( |
| 412 | deviceIdList[ 0 ] + "/2", deviceIdList[ 7 ] + "/2" ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 413 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 414 | main.log.info( "Failed to fetch devices from ONOS" ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 415 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 416 | time.sleep( 5 ) |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 417 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 418 | intentsStr = main.ONOS1cli.intents( jsonFormat=True ) |
| 419 | intentsObj = json.loads( intentsStr ) |
| 420 | for intent in intentsObj: |
| 421 | if intent[ 'state' ] == "INSTALLED": |
| 422 | main.log.info( "Intent installed successfully" ) |
| 423 | intentId = intent[ 'id' ] |
| 424 | main.log.info( "Intent id: " + str( intentId ) ) |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 425 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 426 | # TODO: Add error handling |
| 427 | main.log.info( "Intent installation failed" ) |
| 428 | intentId = "" |
| 429 | |
| 430 | main.log.info( "Disabling interface " + intfs ) |
| 431 | t0System = time.time() * 1000 |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 432 | main.Mininet1.handle.sendline( |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 433 | "sh ifconfig " + intfs + " down" ) |
| 434 | main.Mininet1.handle.expect( "mininet>" ) |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 435 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 436 | # TODO: Check for correct intent reroute |
| 437 | time.sleep( 1 ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 438 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 439 | # Obtain metrics from ONOS 1, 2, 3 |
| 440 | intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics() |
| 441 | intentsJsonObj1 = json.loads( intentsJsonStr1 ) |
| 442 | # Parse values from the json object |
| 443 | intentInstall1 = \ |
| 444 | intentsJsonObj1[ installTime ][ 'value' ] |
| 445 | intentRerouteLat1 = \ |
| 446 | int( intentInstall1 ) - int( t0System ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 447 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 448 | if clusterCount == 3: |
| 449 | intentsJsonStr2 = main.ONOS2cli.intentsEventsMetrics() |
| 450 | intentsJsonStr3 = main.ONOS3cli.intentsEventsMetrics() |
| 451 | |
| 452 | intentsJsonObj2 = json.loads( intentsJsonStr2 ) |
| 453 | intentsJsonObj3 = json.loads( intentsJsonStr3 ) |
| 454 | intentInstall2 = \ |
| 455 | intentsJsonObj2[ installTime ][ 'value' ] |
| 456 | intentInstall3 = \ |
| 457 | intentsJsonObj3[ installTime ][ 'value' ] |
| 458 | intentRerouteLat2 = \ |
| 459 | int( intentInstall2 ) - int( t0System ) |
| 460 | intentRerouteLat3 = \ |
| 461 | int( intentInstall3 ) - int( t0System ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 462 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 463 | intentRerouteLat2 = 0 |
| 464 | intentRerouteLat3 = 0 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 465 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 466 | if clusterCount == 5: |
| 467 | intentsJsonStr4 = main.ONOS4cli.intentsEventsMetrics() |
| 468 | intentsJsonStr5 = main.ONOS5cli.intentsEventsMetrics() |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 469 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 470 | intentsJsonObj4 = json.loads( intentsJsonStr4 ) |
| 471 | intentsJsonObj5 = json.loads( intentsJsonStr5 ) |
| 472 | intentInstall4 = \ |
| 473 | intentsJsonObj4[ installTime ][ 'value' ] |
| 474 | intentInstall5 = \ |
| 475 | intentsJsonObj5[ installTime ][ 'value' ] |
| 476 | intentRerouteLat4 = \ |
| 477 | int( intentInstall4 ) - int( t0System ) |
| 478 | intentRerouteLat5 = \ |
| 479 | int( intentInstall5 ) - int( t0System ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 480 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 481 | intentRerouteLat4 = 0 |
| 482 | intentRerouteLat5 = 0 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 483 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 484 | if clusterCount == 7: |
| 485 | intentsJsonStr6 = main.ONOS6cli.intentsEventsMetrics() |
| 486 | intentsJsonStr7 = main.ONOS7cli.intentsEventsMetrics() |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 487 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 488 | intentsJsonObj6 = json.loads( intentsJsonStr6 ) |
| 489 | intentsJsonObj7 = json.loads( intentsJsonStr7 ) |
| 490 | intentInstall6 = \ |
| 491 | intentsJsonObj6[ installTime ][ 'value' ] |
| 492 | intentInstall7 = \ |
| 493 | intentsJsonObj7[ installTime ][ 'value' ] |
| 494 | intentRerouteLat6 = \ |
| 495 | int( intentInstall6 ) - int( t0System ) |
| 496 | intentRerouteLat7 = \ |
| 497 | int( intentInstall7 ) - int( t0System ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 498 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 499 | intentRerouteLat6 = 0 |
| 500 | intentRerouteLat7 = 0 |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 501 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 502 | intentRerouteLatAvg = \ |
| 503 | ( intentRerouteLat1 + |
| 504 | intentRerouteLat2 + |
| 505 | intentRerouteLat3 + |
| 506 | intentRerouteLat4 + |
| 507 | intentRerouteLat5 + |
| 508 | intentRerouteLat6 + |
| 509 | intentRerouteLat7 ) / clusterCount |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 510 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 511 | main.log.info( "Intent reroute latency avg for iteration " + |
| 512 | str( i ) + ": " + str( intentRerouteLatAvg ) ) |
| 513 | |
| 514 | if intentRerouteLatAvg > 0.0 and \ |
| 515 | intentRerouteLatAvg < 1000 and i > numIgnore: |
| 516 | intentRerouteLatList.append( intentRerouteLatAvg ) |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 517 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 518 | main.log.info( "Intent reroute latency exceeded " + |
| 519 | "threshold. Skipping iteration " + str( i ) ) |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 520 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 521 | main.log.info( "Removing intents for next iteration" ) |
| 522 | main.ONOS1cli.removeIntent( intentId ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 523 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 524 | main.log.info( "Bringing Mininet interface up for next " + |
| 525 | "iteration" ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 526 | main.Mininet1.handle.sendline( |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 527 | "sh ifconfig " + intfs + " up" ) |
| 528 | main.Mininet1.handle.expect( "mininet>" ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 529 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 530 | if intentRerouteLatList: |
| 531 | intentRerouteLatAvg = sum( intentRerouteLatList ) /\ |
| 532 | len( intentRerouteLatList ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 533 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 534 | main.log.report( "Intent reroute test failed. Results NA" ) |
| 535 | intentRerouteLatAvg = "NA" |
| 536 | # NOTE: fails test when list is empty |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 537 | assertion = main.FALSE |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 538 | |
| 539 | intentRerouteLatStd = \ |
| 540 | round( numpy.std( intentRerouteLatList ), 1 ) |
| 541 | # END ITERATION FOR LOOP |
| 542 | main.log.report( "Single intent reroute latency - " ) |
| 543 | main.log.report( "Avg: " + str( intentRerouteLatAvg ) + " ms" ) |
| 544 | main.log.report( |
| 545 | "Std Deviation: " + |
| 546 | str( intentRerouteLatStd ) + |
| 547 | " ms" ) |
| 548 | |
| 549 | utilities.assert_equals( |
| 550 | expect=main.TRUE, |
| 551 | actual=assertion, |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 552 | onpass="Single intent reroute latency test successful", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 553 | onfail="Single intent reroute latency test failed" ) |
| 554 | |
| 555 | def CASE4( self, main ): |
| 556 | """ |
andrewonlab | 042b391 | 2014-12-10 16:40:50 -0500 | [diff] [blame] | 557 | Batch intent install |
andrewonlab | 082dfc3 | 2015-02-06 13:59:51 -0500 | [diff] [blame] | 558 | |
| 559 | Supports scale-out scenarios and increasing |
| 560 | number of intents within each iteration |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 561 | """ |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 562 | import time |
| 563 | import json |
| 564 | import requests |
| 565 | import os |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 566 | import numpy |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 567 | global clusterCount |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 568 | global timeToPost |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 569 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 570 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 571 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 572 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
| 573 | ONOS4Ip = main.params[ 'CTRL' ][ 'ip4' ] |
| 574 | ONOS5Ip = main.params[ 'CTRL' ][ 'ip5' ] |
| 575 | ONOS6Ip = main.params[ 'CTRL' ][ 'ip6' ] |
| 576 | ONOS7Ip = main.params[ 'CTRL' ][ 'ip7' ] |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 577 | |
| 578 | assertion = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 579 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 580 | ONOSIpList = [] |
| 581 | for i in range( 1, 8 ): |
| 582 | ONOSIpList.append( main.params[ 'CTRL' ][ 'ip' + str( i ) ] ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 583 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 584 | ONOSUser = main.params[ 'CTRL' ][ 'user' ] |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 585 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 586 | defaultSwPort = main.params[ 'CTRL' ][ 'port1' ] |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 587 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 588 | batchIntentSize = int( main.params[ 'TEST' ][ 'batchIntentSize' ] ) |
| 589 | batchThreshMin = int( main.params[ 'TEST' ][ 'batchThresholdMin' ] ) |
| 590 | batchThreshMax = int( main.params[ 'TEST' ][ 'batchThresholdMax' ] ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 591 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 592 | # number of iterations of case |
| 593 | numIter = main.params[ 'TEST' ][ 'numIter' ] |
| 594 | numIgnore = int( main.params[ 'TEST' ][ 'numIgnore' ] ) |
| 595 | numSwitch = int( main.params[ 'TEST' ][ 'numSwitch' ] ) |
| 596 | nThread = main.params[ 'TEST' ][ 'numMult' ] |
| 597 | #nThread = 105 |
| 598 | |
andrewonlab | e07f856 | 2015-02-20 12:23:07 -0500 | [diff] [blame] | 599 | # DB operation variables |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 600 | intentFilePath = main.params[ 'DB' ][ 'intentFilePath' ] |
andrewonlab | e07f856 | 2015-02-20 12:23:07 -0500 | [diff] [blame] | 601 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 602 | # Switch assignment NOTE: hardcoded |
| 603 | if clusterCount == 1: |
| 604 | for i in range( 1, numSwitch + 1 ): |
| 605 | main.Mininet1.assignSwController( |
| 606 | sw=str( i ), |
| 607 | ip1=ONOS1Ip, |
| 608 | port1=defaultSwPort ) |
| 609 | if clusterCount == 3: |
| 610 | for i in range( 1, 3 ): |
| 611 | main.Mininet1.assignSwController( |
| 612 | sw=str( i ), |
| 613 | ip1=ONOS1Ip, |
| 614 | port1=defaultSwPort ) |
| 615 | for i in range( 3, 6 ): |
| 616 | main.Mininet1.assignSwController( |
| 617 | sw=str( i ), |
| 618 | ip1=ONOS2Ip, |
| 619 | port1=defaultSwPort ) |
| 620 | for i in range( 6, 9 ): |
| 621 | main.Mininet1.assignSwController( |
| 622 | sw=str( i ), |
| 623 | ip1=ONOS3Ip, |
| 624 | port1=defaultSwPort ) |
| 625 | if clusterCount == 5: |
| 626 | main.Mininet1.assignSwController( |
| 627 | sw="1", |
| 628 | ip1=ONOS1Ip, |
| 629 | port1=defaultSwPort ) |
| 630 | main.Mininet1.assignSwController( |
| 631 | sw="2", |
| 632 | ip1=ONOS2Ip, |
| 633 | port1=defaultSwPort ) |
| 634 | for i in range( 3, 6 ): |
| 635 | main.Mininet1.assignSwController( |
| 636 | sw=str( i ), |
| 637 | ip1=ONOS3Ip, |
| 638 | port1=defaultSwPort ) |
| 639 | main.Mininet1.assignSwController( |
| 640 | sw="6", |
| 641 | ip1=ONOS4Ip, |
| 642 | port1=defaultSwPort ) |
| 643 | main.Mininet1.assignSwController( |
| 644 | sw="7", |
| 645 | ip1=ONOS5Ip, |
| 646 | port1=defaultSwPort ) |
| 647 | main.Mininet1.assignSwController( |
| 648 | sw="8", |
| 649 | ip1=ONOS5Ip, |
| 650 | port1=defaultSwPort ) |
| 651 | |
| 652 | if clusterCount == 7: |
| 653 | for i in range( 1, 9 ): |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 654 | if i < 8: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 655 | main.Mininet1.assignSwController( |
| 656 | sw=str( i ), |
| 657 | ip1=ONOSIpList[ i - 1 ], |
| 658 | port1=defaultSwPort ) |
| 659 | elif i >= 8: |
| 660 | main.Mininet1.assignSwController( |
| 661 | sw=str( i ), |
| 662 | ip1=ONOSIpList[ 6 ], |
| 663 | port1=defaultSwPort ) |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 664 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 665 | time.sleep( 20 ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 666 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 667 | main.log.report( "Batch intent installation test of " + |
| 668 | str( batchIntentSize ) + " intent(s)" ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 669 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 670 | batchResultList = [] |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 671 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 672 | main.log.info( "Getting list of available devices" ) |
| 673 | deviceIdList = [] |
| 674 | jsonStr = main.ONOS1cli.devices() |
| 675 | jsonObj = json.loads( jsonStr ) |
| 676 | for device in jsonObj: |
| 677 | deviceIdList.append( device[ 'id' ] ) |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 678 | |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 679 | # List of install / witdhraw latencies for each batch |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 680 | batchInstallLat = [] |
| 681 | batchWithdrawLat = [] |
andrewonlab | 70decc0 | 2014-11-19 18:50:23 -0500 | [diff] [blame] | 682 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 683 | sleepTime = 10 |
| 684 | |
| 685 | baseDir = "/tmp/" |
| 686 | |
andrewonlab | e07f856 | 2015-02-20 12:23:07 -0500 | [diff] [blame] | 687 | # Batch size increase loop |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 688 | for batch in range( 0, 5 ): |
andrewonlab | e07f856 | 2015-02-20 12:23:07 -0500 | [diff] [blame] | 689 | # Max intent install measurement of all nodes |
| 690 | # Resets after each batch calculation |
| 691 | maxInstallLat = [] |
| 692 | maxWithdrawLat = [] |
| 693 | # Statistical gathering loop over number of iterations |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 694 | for i in range( 0, int( numIter ) ): |
| 695 | main.log.info( "Pushing " + |
| 696 | str( int( batchIntentSize ) * int( nThread ) ) + |
| 697 | " intents. Iteration " + str( i ) ) |
| 698 | |
| 699 | for node in range( 1, clusterCount + 1 ): |
| 700 | saveDir = baseDir + "batch_intent_" + str( node ) + ".txt" |
| 701 | main.ONOSbench.pushTestIntentsShell( |
| 702 | deviceIdList[ 0 ] + "/2", |
| 703 | deviceIdList[ 7 ] + "/2", |
| 704 | batchIntentSize, |
| 705 | saveDir, ONOSIpList[ node - 1 ], |
| 706 | numMult=nThread, appId=node ) |
| 707 | |
| 708 | # Wait sufficient time for intents to start |
| 709 | # installing |
| 710 | time.sleep( sleepTime ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 711 | |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 712 | intent = "" |
| 713 | counter = 300 |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 714 | while len( intent ) > 0 and counter > 0: |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 715 | main.ONOS1cli.handle.sendline( |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 716 | "intents | wc -l" ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 717 | main.ONOS1cli.handle.expect( |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 718 | "intents | wc -l" ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 719 | main.ONOS1cli.handle.expect( |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 720 | "onos>" ) |
| 721 | intentTemp = main.ONOS1cli.handle.before() |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 722 | intent = main.ONOS1cli.intents() |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 723 | intent = json.loads( intent ) |
| 724 | counter = counter - 1 |
| 725 | time.sleep( 1 ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 726 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 727 | time.sleep( 5 ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 728 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 729 | for node in range( 1, clusterCount + 1 ): |
| 730 | saveDir = baseDir + "batch_intent_" + str( node ) + ".txt" |
| 731 | with open( saveDir ) as fOnos: |
| 732 | lineCount = 0 |
| 733 | for line in fOnos: |
| 734 | line = line[ 1: ] |
| 735 | line = line.split( ": " ) |
| 736 | main.log.info( "Line read: " + str( line ) ) |
andrewonlab | d019a6b | 2015-02-05 00:05:22 -0500 | [diff] [blame] | 737 | #Prevent split method if line doesn't have |
| 738 | #space |
| 739 | if " " in str(line): |
| 740 | result = line[ 1 ].split( " " )[ 0 ] |
| 741 | else: |
| 742 | main.log.warn( "Empty line read" ) |
| 743 | result = 0 |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 744 | # TODO: add parameters before appending latency |
| 745 | if lineCount == 0: |
| 746 | batchInstallLat.append( int( result ) ) |
| 747 | installResult = result |
| 748 | elif lineCount == 1: |
| 749 | batchWithdrawLat.append( int( result ) ) |
| 750 | withdrawResult = result |
andrewonlab | d019a6b | 2015-02-05 00:05:22 -0500 | [diff] [blame] | 751 | else: |
| 752 | main.log.warn("Invalid results") |
| 753 | installResult = 'NA' |
| 754 | withdrawResult = 'NA' |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 755 | lineCount += 1 |
| 756 | main.log.info( "Batch install latency for ONOS" + |
| 757 | str( node ) + " with " + |
| 758 | str( batchIntentSize ) + "intents: " + |
| 759 | str( installResult ) + " ms" ) |
| 760 | main.log.info( "Batch withdraw latency for ONOS" + |
| 761 | str( node ) + " with " + |
| 762 | str( batchIntentSize ) + "intents: " + |
| 763 | str( withdrawResult ) + " ms" ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 764 | |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 765 | #NOTE: END node loop |
| 766 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 767 | if len( batchInstallLat ) > 0 and int( i ) > numIgnore: |
| 768 | maxInstallLat.append( max( batchInstallLat ) ) |
| 769 | elif len( batchInstallLat ) == 0: |
| 770 | # If I failed to read anything from the file, |
| 771 | # increase the wait time before checking intents |
| 772 | sleepTime += 30 |
| 773 | if len( batchWithdrawLat ) > 0 and int( i ) > numIgnore: |
| 774 | maxWithdrawLat.append( max( batchWithdrawLat ) ) |
| 775 | batchInstallLat = [] |
| 776 | batchWithdrawLat = [] |
| 777 | |
| 778 | # Sleep in between iterations |
| 779 | time.sleep( 5 ) |
| 780 | |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 781 | #NOTE: END iteration loop |
| 782 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 783 | if maxInstallLat: |
andrewonlab | d019a6b | 2015-02-05 00:05:22 -0500 | [diff] [blame] | 784 | avgInstallLat = str( round( |
| 785 | sum( maxInstallLat ) / |
| 786 | len( maxInstallLat ) |
| 787 | , 2 )) |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 788 | stdInstallLat = str( round( |
| 789 | numpy.std(maxInstallLat), 2)) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 790 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 791 | avgInstallLat = "NA" |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 792 | stdInstallLat = "NA" |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 793 | main.log.report( "Batch installation failed" ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 794 | assertion = main.FALSE |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 795 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 796 | if maxWithdrawLat: |
andrewonlab | d019a6b | 2015-02-05 00:05:22 -0500 | [diff] [blame] | 797 | avgWithdrawLat = str( round( |
| 798 | sum( maxWithdrawLat ) / |
| 799 | len( maxWithdrawLat ) |
| 800 | , 2 )) |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 801 | stdWithdrawLat = str( round( |
| 802 | numpy.std(maxWithdrawLat), 2)) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 803 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 804 | avgWithdrawLat = "NA" |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 805 | stdWithdrawLat = "NA" |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 806 | main.log.report( "Batch withdraw failed" ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 807 | assertion = main.FALSE |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 808 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 809 | main.log.report( "Avg of batch installation latency " + |
| 810 | "of size " + str( batchIntentSize ) + ": " + |
| 811 | str( avgInstallLat ) + " ms" ) |
| 812 | main.log.report( "Std Deviation of batch installation latency " + |
andrewonlab | d019a6b | 2015-02-05 00:05:22 -0500 | [diff] [blame] | 813 | ": " + |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 814 | str( stdInstallLat ) + " ms" ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 815 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 816 | main.log.report( "Avg of batch withdraw latency " + |
| 817 | "of size " + str( batchIntentSize ) + ": " + |
| 818 | str( avgWithdrawLat ) + " ms" ) |
| 819 | main.log.report( "Std Deviation of batch withdraw latency " + |
| 820 | ": " + |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 821 | str( stdWithdrawLat ) + " ms" ) |
| 822 | |
| 823 | dbCmd = ( |
| 824 | "INSERT INTO intent_latency_tests VALUES(" |
| 825 | "'"+timeToPost+"','intent_latency_results'," |
| 826 | ""+runNum+","+str(clusterCount)+","+str(batchIntentSize)+"," |
| 827 | ""+str(avgInstallLat)+","+str(stdInstallLat)+"," |
| 828 | ""+str(avgWithdrawLat)+","+str(stdWithdrawLat)+");" |
| 829 | ) |
| 830 | |
| 831 | # Write result to file (which is posted to DB by jenkins) |
| 832 | fResult = open(intentFilePath, 'a') |
| 833 | if dbCmd: |
| 834 | fResult.write(dbCmd+"\n") |
| 835 | fResult.close() |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 836 | |
andrewonlab | d019a6b | 2015-02-05 00:05:22 -0500 | [diff] [blame] | 837 | if batch == 0: |
| 838 | batchIntentSize = 10 |
| 839 | elif batch == 1: |
| 840 | batchIntentSize = 100 |
| 841 | elif batch == 2: |
| 842 | batchIntentSize = 1000 |
| 843 | elif batch == 3: |
| 844 | batchIntentSize = 2000 |
| 845 | if batch < 4: |
| 846 | main.log.report( "Increasing batch intent size to " + |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 847 | str(batchIntentSize) ) |
| 848 | |
andrewonlab | 302cd53 | 2015-02-20 13:59:50 -0500 | [diff] [blame] | 849 | #NOTE: END batch loop |
| 850 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 851 | #main.log.info( "Removing all intents for next test case" ) |
| 852 | #jsonTemp = main.ONOS1cli.intents( jsonFormat=True ) |
| 853 | #jsonObjIntents = json.loads( jsonTemp ) |
| 854 | # if jsonObjIntents: |
| 855 | # for intents in jsonObjIntents: |
| 856 | # tempId = intents[ 'id' ] |
| 857 | # main.ONOS1cli.removeIntent( tempId ) |
| 858 | # main.ONOS1cli.removeIntent( tempId ) |
| 859 | |
| 860 | utilities.assert_equals( |
| 861 | expect=main.TRUE, |
| 862 | actual=assertion, |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 863 | onpass="Batch intent install/withdraw test successful", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 864 | onfail="Batch intent install/withdraw test failed" ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 865 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 866 | def CASE5( self, main ): |
| 867 | """ |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 868 | Increase number of nodes and initiate CLI |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 869 | """ |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 870 | import time |
| 871 | import json |
| 872 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 873 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 874 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 875 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
| 876 | ONOS4Ip = main.params[ 'CTRL' ][ 'ip4' ] |
| 877 | ONOS5Ip = main.params[ 'CTRL' ][ 'ip5' ] |
| 878 | ONOS6Ip = main.params[ 'CTRL' ][ 'ip6' ] |
| 879 | ONOS7Ip = main.params[ 'CTRL' ][ 'ip7' ] |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 880 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 881 | global clusterCount |
| 882 | clusterCount += 2 |
| 883 | main.log.report( "Increasing cluster size to " + |
| 884 | str( clusterCount ) ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 885 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 886 | installResult = main.FALSE |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 887 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 888 | if clusterCount == 3: |
| 889 | installResult1 = \ |
| 890 | main.ONOSbench.onosInstall( node=ONOS2Ip ) |
| 891 | installResult2 = \ |
| 892 | main.ONOSbench.onosInstall( node=ONOS3Ip ) |
| 893 | time.sleep( 5 ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 894 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 895 | main.log.info( "Starting ONOS CLI" ) |
| 896 | main.ONOS2cli.startOnosCli( ONOS2Ip ) |
| 897 | main.ONOS3cli.startOnosCli( ONOS3Ip ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 898 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 899 | installResult = installResult1 and installResult2 |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 900 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 901 | if clusterCount == 5: |
| 902 | main.log.info( "Installing ONOS on node 4 and 5" ) |
| 903 | installResult1 = \ |
| 904 | main.ONOSbench.onosInstall( node=ONOS4Ip ) |
| 905 | installResult2 = \ |
| 906 | main.ONOSbench.onosInstall( node=ONOS5Ip ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 907 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 908 | main.log.info( "Starting ONOS CLI" ) |
| 909 | main.ONOS4cli.startOnosCli( ONOS4Ip ) |
| 910 | main.ONOS5cli.startOnosCli( ONOS5Ip ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 911 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 912 | installResult = installResult1 and installResult2 |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 913 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 914 | if clusterCount == 7: |
| 915 | main.log.info( "Installing ONOS on node 6 and 7" ) |
| 916 | installResult1 = \ |
| 917 | main.ONOSbench.onosInstall( node=ONOS6Ip ) |
| 918 | installResult2 = \ |
| 919 | main.ONOSbench.onosInstall( node=ONOS7Ip ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 920 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 921 | main.log.info( "Starting ONOS CLI" ) |
| 922 | main.ONOS6cli.startOnosCli( ONOS6Ip ) |
| 923 | main.ONOS7cli.startOnosCli( ONOS7Ip ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 924 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 925 | installResult = installResult1 and installResult2 |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 926 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 927 | time.sleep( 5 ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 928 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 929 | if installResult == main.TRUE: |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 930 | assertion = main.TRUE |
| 931 | else: |
| 932 | assertion = main.FALSE |
| 933 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 934 | utilities.assert_equals( expect=main.TRUE, actual=assertion, |
| 935 | onpass="Scale out to " + str( clusterCount ) + |
| 936 | " nodes successful", |
| 937 | onfail="Scale out to " + str( clusterCount ) + |
| 938 | " nodes failed" ) |
andrewonlab | 4293dcb | 2014-12-02 15:48:05 -0500 | [diff] [blame] | 939 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 940 | def CASE7( self, main ): |
| 941 | # TODO: Fix for scale-out scenario |
| 942 | """ |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 943 | Batch intent reroute latency |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 944 | """ |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 945 | import time |
| 946 | import json |
| 947 | import requests |
| 948 | import os |
| 949 | import numpy |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 950 | global clusterCount |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 951 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 952 | ONOSIpList = [] |
| 953 | for i in range( 1, 8 ): |
| 954 | ONOSIpList.append( main.params[ 'CTRL' ][ 'ip' + str( i ) ] ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 955 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 956 | ONOSUser = main.params[ 'CTRL' ][ 'user' ] |
| 957 | defaultSwPort = main.params[ 'CTRL' ][ 'port1' ] |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 958 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 959 | batchIntentSize = main.params[ 'TEST' ][ 'batchIntentSize' ] |
| 960 | batchThreshMin = int( main.params[ 'TEST' ][ 'batchThresholdMin' ] ) |
| 961 | batchThreshMax = int( main.params[ 'TEST' ][ 'batchThresholdMax' ] ) |
| 962 | intfs = main.params[ 'TEST' ][ 'intfs' ] |
| 963 | installTime = main.params[ 'JSON' ][ 'installedTime' ] |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 964 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 965 | # number of iterations of case |
| 966 | numIter = main.params[ 'TEST' ][ 'numIter' ] |
| 967 | numIgnore = int( main.params[ 'TEST' ][ 'numIgnore' ] ) |
| 968 | numSwitch = int( main.params[ 'TEST' ][ 'numSwitch' ] ) |
| 969 | nThread = main.params[ 'TEST' ][ 'numMult' ] |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 970 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 971 | main.log.report( "Batch intent installation test of " + |
| 972 | batchIntentSize + " intents" ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 973 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 974 | batchResultList = [] |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 975 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 976 | time.sleep( 10 ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 977 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 978 | main.log.info( "Getting list of available devices" ) |
| 979 | deviceIdList = [] |
| 980 | jsonStr = main.ONOS1cli.devices() |
| 981 | jsonObj = json.loads( jsonStr ) |
| 982 | for device in jsonObj: |
| 983 | deviceIdList.append( device[ 'id' ] ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 984 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 985 | batchInstallLat = [] |
| 986 | batchWithdrawLat = [] |
| 987 | sleepTime = 10 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 988 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 989 | baseDir = "/tmp/" |
| 990 | maxInstallLat = [] |
| 991 | |
| 992 | for i in range( 0, int( numIter ) ): |
| 993 | main.log.info( "Pushing " + |
| 994 | str( int( batchIntentSize ) * int( nThread ) ) + |
| 995 | " intents. Iteration " + str( i ) ) |
| 996 | |
| 997 | main.ONOSbench.pushTestIntentsShell( |
| 998 | deviceIdList[ 0 ] + "/2", |
| 999 | deviceIdList[ 7 ] + "/2", |
| 1000 | batchIntentSize, "/tmp/batch_install.txt", |
| 1001 | ONOSIpList[ 0 ], numMult="1", appId="1", |
| 1002 | report=False, options="--install" ) |
| 1003 | # main.ONOSbench.pushTestIntentsShell( |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1004 | # "of:0000000000001002/1", |
| 1005 | # "of:0000000000002002/1", |
| 1006 | # 133, "/tmp/temp2.txt", "10.128.174.2", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1007 | # numMult="6", appId="2",report=False ) |
| 1008 | |
| 1009 | # TODO: Check for installation success then proceed |
| 1010 | time.sleep( 30 ) |
| 1011 | |
| 1012 | # NOTE: this interface is specific to |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1013 | # topo-intentFlower.py topology |
| 1014 | # reroute case. |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1015 | main.log.info( "Disabling interface " + intfs ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1016 | main.Mininet1.handle.sendline( |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1017 | "sh ifconfig " + intfs + " down" ) |
| 1018 | t0System = time.time() * 1000 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1019 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1020 | # TODO: Wait sufficient time for intents to install |
| 1021 | time.sleep( 10 ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1022 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1023 | # TODO: get intent installation time |
| 1024 | |
| 1025 | # Obtain metrics from ONOS 1, 2, 3 |
| 1026 | intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics() |
| 1027 | intentsJsonObj1 = json.loads( intentsJsonStr1 ) |
| 1028 | # Parse values from the json object |
| 1029 | intentInstall1 = \ |
| 1030 | intentsJsonObj1[ installTime ][ 'value' ] |
| 1031 | intentRerouteLat1 = \ |
| 1032 | int( intentInstall1 ) - int( t0System ) |
| 1033 | |
| 1034 | if clusterCount == 3: |
| 1035 | intentsJsonStr2 =\ |
| 1036 | main.ONOS2cli.intentsEventsMetrics() |
| 1037 | intentsJsonStr3 =\ |
| 1038 | main.ONOS3cli.intentsEventsMetrics() |
| 1039 | intentsJsonObj2 = json.loads( intentsJsonStr2 ) |
| 1040 | intentsJsonObj3 = json.loads( intentsJsonStr3 ) |
| 1041 | intentInstall2 = \ |
| 1042 | intentsJsonObj2[ installTime ][ 'value' ] |
| 1043 | intentInstall3 = \ |
| 1044 | intentsJsonObj3[ installTime ][ 'value' ] |
| 1045 | intentRerouteLat2 = \ |
| 1046 | int( intentInstall2 ) - int( t0System ) |
| 1047 | intentRerouteLat3 = \ |
| 1048 | int( intentInstall3 ) - int( t0System ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1049 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1050 | intentRerouteLat2 = 0 |
| 1051 | intentRerouteLat3 = 0 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1052 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1053 | if clusterCount == 5: |
| 1054 | intentsJsonStr4 =\ |
| 1055 | main.ONOS4cli.intentsEventsMetrics() |
| 1056 | intentsJsonStr5 =\ |
| 1057 | main.ONOS5cli.intentsEventsMetrics() |
| 1058 | intentsJsonObj4 = json.loads( intentsJsonStr4 ) |
| 1059 | intentsJsonObj5 = json.loads( intentsJsonStr5 ) |
| 1060 | intentInstall4 = \ |
| 1061 | intentsJsonObj4[ installTime ][ 'value' ] |
| 1062 | intentInstall5 = \ |
| 1063 | intentsJsonObj5[ installTime ][ 'value' ] |
| 1064 | intentRerouteLat4 = \ |
| 1065 | int( intentInstall4 ) - int( t0System ) |
| 1066 | intentRerouteLat5 = \ |
| 1067 | int( intentInstall5 ) - int( t0System ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1068 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1069 | intentRerouteLat4 = 0 |
| 1070 | intentRerouteLat5 = 0 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1071 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1072 | if clusterCount == 7: |
| 1073 | intentsJsonStr6 =\ |
| 1074 | main.ONOS6cli.intentsEventsMetrics() |
| 1075 | intentsJsonStr7 =\ |
| 1076 | main.ONOS7cli.intentsEventsMetrics() |
| 1077 | intentsJsonObj6 = json.loads( intentsJsonStr6 ) |
| 1078 | intentsJsonObj7 = json.loads( intentsJsonStr7 ) |
| 1079 | intentInstall6 = \ |
| 1080 | intentsJsonObj6[ installTime ][ 'value' ] |
| 1081 | intentInstall7 = \ |
| 1082 | intentsJsonObj7[ installTime ][ 'value' ] |
| 1083 | intentRerouteLat6 = \ |
| 1084 | int( intentInstall6 ) - int( t0System ) |
| 1085 | intentRerouteLat7 = \ |
| 1086 | int( intentInstall7 ) - int( t0System ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1087 | else: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1088 | intentRerouteLat6 = 0 |
| 1089 | intentRerouteLat7 = 0 |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1090 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1091 | intentRerouteLatAvg = \ |
| 1092 | ( intentRerouteLat1 + |
| 1093 | intentRerouteLat2 + |
| 1094 | intentRerouteLat3 + |
| 1095 | intentRerouteLat4 + |
| 1096 | intentRerouteLat5 + |
| 1097 | intentRerouteLat6 + |
| 1098 | intentRerouteLat7 ) / clusterCount |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1099 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1100 | main.log.info( "Intent reroute latency avg for iteration " + |
| 1101 | str( i ) + ": " + str( intentRerouteLatAvg ) ) |
| 1102 | # TODO: Remove intents for next iteration |
| 1103 | |
| 1104 | time.sleep( 5 ) |
| 1105 | |
| 1106 | intentsStr = main.ONOS1cli.intents() |
| 1107 | intentsJson = json.loads( intentsStr ) |
| 1108 | for intents in intentsJson: |
| 1109 | intentId = intents[ 'id' ] |
| 1110 | # TODO: make sure this removes all intents |
| 1111 | # print intentId |
| 1112 | if intentId: |
| 1113 | main.ONOS1cli.removeIntent( intentId ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1114 | |
| 1115 | main.Mininet1.handle.sendline( |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1116 | "sh ifconfig " + intfs + " up" ) |
andrewonlab | a57a304 | 2015-01-23 13:53:05 -0500 | [diff] [blame] | 1117 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1118 | main.log.info( "Intents removed and port back up" ) |
| 1119 | |
| 1120 | def CASE9( self, main ): |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1121 | count = 0 |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1122 | swNum1 = 1 |
| 1123 | swNum2 = 1 |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1124 | appid = 0 |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1125 | portNum1 = 1 |
| 1126 | portNum2 = 1 |
| 1127 | |
| 1128 | time.sleep( 30 ) |
andrewonlab | 4cf9dd2 | 2014-11-18 21:28:38 -0500 | [diff] [blame] | 1129 | |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1130 | while True: |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1131 | # main.ONOS1cli.pushTestIntents( |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1132 | #"of:0000000000001001/1", |
| 1133 | #"of:0000000000002001/1", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1134 | # 100, numMult="10", appId="1" ) |
| 1135 | # main.ONOS2cli.pushTestIntents( |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1136 | # "of:0000000000001002/1", |
| 1137 | # "of:0000000000002002/1", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1138 | # 100, numMult="10", appId="2" ) |
| 1139 | # main.ONOS2cli.pushTestIntents( |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1140 | # "of:0000000000001003/1", |
| 1141 | # "of:0000000000002003/1", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1142 | # 100, numMult="10", appId="3" ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1143 | count += 1 |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1144 | |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1145 | if count >= 100: |
| 1146 | main.ONOSbench.handle.sendline( |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1147 | "onos 10.128.174.1 intents-events-metrics >>" + |
| 1148 | " /tmp/metrics_intents_temp.txt &" ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1149 | count = 0 |
| 1150 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1151 | arg1 = "of:000000000000100" + str( swNum1 ) + "/" + str( portNum1 ) |
| 1152 | arg2 = "of:000000000000200" + str( swNum2 ) + "/" + str( portNum2 ) |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1153 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1154 | swNum1 += 1 |
| 1155 | |
| 1156 | if swNum1 > 7: |
| 1157 | swNum1 = 1 |
| 1158 | swNum2 += 1 |
| 1159 | if swNum2 > 7: |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1160 | appid += 1 |
| 1161 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1162 | if swNum2 > 7: |
| 1163 | swNum2 = 1 |
| 1164 | |
| 1165 | main.ONOSbench.pushTestIntentsShell( |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1166 | arg1, |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1167 | arg2, |
andrewonlab | 042b391 | 2014-12-10 16:40:50 -0500 | [diff] [blame] | 1168 | 100, "/tmp/temp.txt", "10.128.174.1", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1169 | numMult="10", appId=appid, report=False ) |
| 1170 | # main.ONOSbench.pushTestIntentsShell( |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1171 | # "of:0000000000001002/1", |
| 1172 | # "of:0000000000002002/1", |
| 1173 | # 133, "/tmp/temp2.txt", "10.128.174.2", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1174 | # numMult="6", appId="2",report=False ) |
| 1175 | # main.ONOSbench.pushTestIntentsShell( |
andrewonlab | eb1d054 | 2014-12-03 20:12:01 -0500 | [diff] [blame] | 1176 | # "of:0000000000001003/1", |
| 1177 | # "of:0000000000002003/1", |
| 1178 | # 133, "/tmp/temp3.txt", "10.128.174.3", |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1179 | # numMult="6", appId="3",report=False ) |
andrewonlab | 92ea367 | 2014-11-04 20:22:14 -0500 | [diff] [blame] | 1180 | |
andrewonlab | 79244cc | 2015-01-26 01:11:49 -0500 | [diff] [blame] | 1181 | time.sleep( 0.2 ) |