Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 1 | """ |
| 2 | Copyright 2015 Open Networking Foundation (ONF) |
| 3 | |
| 4 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 5 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 6 | or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 7 | |
| 8 | TestON is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 2 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | TestON is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 20 | """ |
| 21 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 22 | # ScaleOutTemplate -> flowTP |
| 23 | # |
| 24 | # CASE1 starts number of nodes specified in param file |
| 25 | # |
| 26 | # cameron@onlab.us |
| 27 | |
| 28 | import sys |
| 29 | import os.path |
| 30 | |
| 31 | |
| 32 | class SCPFflowTp1g: |
| 33 | |
| 34 | def __init__( self ): |
| 35 | self.default = '' |
| 36 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 37 | def CASE1( self, main ): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 38 | |
| 39 | import time |
| 40 | global init |
| 41 | try: |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 42 | if type( init ) is not bool: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 43 | init = False |
| 44 | except NameError: |
| 45 | init = False |
| 46 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 47 | main.log.info( "==========DEBUG VERSION 3===========" ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 48 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 49 | # -- INIT SECTION, ONLY RUNS ONCE -- # |
| 50 | if init == False: |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 51 | try: |
| 52 | init = True |
| 53 | try: |
| 54 | from tests.dependencies.ONOSSetup import ONOSSetup |
| 55 | main.testSetUp = ONOSSetup() |
| 56 | except ImportError: |
| 57 | main.log.error( "ONOSSetup not found. exiting the test" ) |
| 58 | main.exit() |
| 59 | main.testSetUp.envSetupDescription() |
| 60 | #Load values from params file |
| 61 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 62 | main.apps = main.params[ 'ENV' ][ 'cellApps' ] |
| 63 | BENCHUser = main.params[ 'BENCH' ][ 'user' ] |
| 64 | BENCHIp = main.params[ 'BENCH' ][ 'ip1' ] |
| 65 | main.scale = ( main.params[ 'SCALE' ] ).split( "," ) |
| 66 | stepResult = main.testSetUp.envSetup() |
| 67 | resultsDB = open( "/tmp/flowTP1gDB", "w+" ) |
| 68 | resultsDB.close() |
| 69 | except Exception as e: |
| 70 | main.testSetUp.envSetupException( e ) |
| 71 | main.testSetUp.evnSetupConclusion( stepResult ) |
| 72 | main.commit = (main.commit.split(" "))[1] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 73 | # -- END OF INIT SECTION --# |
| 74 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 75 | main.testSetUp.ONOSSetUp( "localhost", True, cellName=cellName ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 76 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 77 | main.log.info("Startup sequence complete") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 78 | main.ONOSbench.logReport(main.ONOSip[0], ["ERROR", "WARNING", "EXCEPT"], outputMode="d") |
Chiyu Cheng | ef10950 | 2016-11-21 15:51:38 -0800 | [diff] [blame] | 79 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 80 | def CASE2( self, main ): |
| 81 | # |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 82 | # This is the flow TP test |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 83 | # |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 84 | import os.path |
| 85 | import numpy |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 86 | import math |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 87 | import time |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 88 | import datetime |
| 89 | import traceback |
| 90 | |
| 91 | global currentNeighbors |
| 92 | try: |
| 93 | currentNeighbors |
| 94 | except: |
| 95 | currentNeighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")[0] |
| 96 | else: |
| 97 | if currentNeighbors == "r": #reset |
| 98 | currentNeighbors = "0" |
| 99 | else: |
| 100 | currentNeighbors = "a" |
| 101 | |
| 102 | testCMD = [ 0,0,0,0 ] |
| 103 | warmUp = int(main.params[ 'TEST' ][ 'warmUp' ]) |
| 104 | sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ]) |
| 105 | switches = int(main.params[ 'TEST' ][ 'switches' ]) |
| 106 | neighborList = (main.params[ 'TEST' ][ 'neighbors' ]).split(",") |
| 107 | testCMD[0] = main.params[ 'TEST' ][ 'testCMD0' ] |
| 108 | testCMD[1] = main.params[ 'TEST' ][ 'testCMD1' ] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 109 | cooldown = main.params[ 'TEST' ][ 'cooldown' ] |
| 110 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 111 | BENCHIp = main.params[ 'BENCH' ][ 'ip1' ] |
| 112 | BENCHUser = main.params[ 'BENCH' ][ 'user' ] |
| 113 | MN1Ip = main.params[ 'MN' ][ 'ip1' ] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 114 | homeDir = os.path.expanduser('~') |
| 115 | flowRuleBackup = str(main.params[ 'TEST' ][ 'enableFlowRuleStoreBackup' ]) |
| 116 | main.log.info("Flow Rule Backup is set to:" + flowRuleBackup) |
| 117 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 118 | servers = str( main.numCtrls ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 119 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 120 | if main.numCtrls == 1: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 121 | neighborList = ['0'] |
| 122 | currentNeighbors = "r" |
| 123 | else: |
| 124 | if currentNeighbors == "a": |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 125 | neighborList = [ str( main.numCtrls - 1 ) ] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 126 | currentNeighbors = "r" |
| 127 | else: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 128 | neighborList = ['0'] |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 129 | |
| 130 | main.log.info("neightborlist: " + str(neighborList)) |
| 131 | |
| 132 | ts = time.time() |
| 133 | st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S') |
| 134 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 135 | for n in neighborList: |
Jon Hall | 6509dbf | 2016-06-21 17:01:17 -0700 | [diff] [blame] | 136 | main.step("\tSTARTING TEST") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 137 | main.step("\tLOADING FROM SERVERS: \t" + str( main.numCtrls ) ) |
Jon Hall | 6509dbf | 2016-06-21 17:01:17 -0700 | [diff] [blame] | 138 | main.step("\tNEIGHBORS:\t" + n ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 139 | main.log.info("=============================================================") |
| 140 | main.log.info("=============================================================") |
| 141 | #write file to configure nil link |
| 142 | ipCSV = "" |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 143 | for i in range ( main.maxNodes ): |
| 144 | tempstr = "ip" + str( i + 1 ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 145 | ipCSV += main.params[ 'CTRL' ][ tempstr ] |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 146 | if i + 1 < main.maxNodes: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 147 | ipCSV +="," |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 148 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 149 | main.ONOSbench.onosCfgSet(main.ONOSip[0], "org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupCount 1") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 150 | for i in range(3): |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 151 | main.ONOSbench.onosCfgSet(main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "deviceCount 35") |
| 152 | main.ONOSbench.onosCfgSet(main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "topoShape linear") |
| 153 | main.ONOSbench.onosCfgSet(main.ONOSip[0], "org.onosproject.provider.nil.NullProviders", "enabled true") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 154 | |
| 155 | time.sleep(5) |
| 156 | main.ONOSbench.handle.sendline("onos $OC1 summary") |
| 157 | main.ONOSbench.handle.expect(":~") |
| 158 | check = main.ONOSbench.handle.before |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 159 | main.log.info("\nStart up check: \n" + check + "\n") |
| 160 | if "SCC(s)=1," in check: |
suibin zhang | a3746bf | 2015-09-05 09:36:39 -0700 | [diff] [blame] | 161 | main.ONOSbench.handle.sendline( "onos $OC1 balance-masters" ) |
suibin zhang | 45efc1b | 2015-09-04 16:48:10 -0700 | [diff] [blame] | 162 | main.ONOSbench.handle.expect( ":~" ) |
| 163 | time.sleep(5) |
| 164 | main.ONOSbench.handle.sendline( "onos $OC1 roles ") |
| 165 | main.ONOSbench.handle.expect ( ":~" ) |
| 166 | main.log.info( "switch masterships:" + str( main.ONOSbench.handle.before ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 167 | break |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 168 | time.sleep(5) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 169 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 170 | #devide flows |
| 171 | flows = int(main.params[ 'TEST' ][ 'flows' ]) |
| 172 | main.log.info("Flow Target = " + str(flows)) |
| 173 | |
| 174 | flows = (flows *max(int(n)+1,int(servers)))/((int(n) + 1)*int(servers)*(switches)) |
| 175 | |
| 176 | main.log.info("Flows per switch = " + str(flows)) |
| 177 | |
| 178 | #build list of servers in "$OC1, $OC2...." format |
| 179 | serverEnvVars = "" |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 180 | for i in range( int( servers ) ): |
| 181 | serverEnvVars += ( "-s " + main.ONOSip[ i ] + " " ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 182 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 183 | data = [[""]*int(servers)]*int(sampleSize) |
| 184 | maxes = [""]*int(sampleSize) |
| 185 | |
| 186 | flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/" |
| 187 | flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1] |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 188 | flowCMD += " " + str(n) + " " + str(serverEnvVars) + "-j" |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 189 | |
| 190 | main.log.info(flowCMD) |
| 191 | #time.sleep(60) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 192 | |
| 193 | for test in range(0, warmUp + sampleSize): |
| 194 | if test < warmUp: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 195 | main.log.info("Warm up " + str(test + 1) + " of " + str(warmUp)) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 196 | else: |
| 197 | main.log.info("====== Test run: " + str(test-warmUp+1) + " ======") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 198 | |
| 199 | main.ONOSbench.handle.sendline(flowCMD) |
| 200 | main.ONOSbench.handle.expect(":~") |
| 201 | rawResult = main.ONOSbench.handle.before |
| 202 | main.log.info("Raw results: \n" + rawResult + "\n") |
| 203 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 204 | if "failed" in rawResult: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 205 | main.log.report("FLOW_TESTER.PY FAILURE") |
| 206 | main.log.report( " \n" + rawResult + " \n") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 207 | for i in range( main.numCtrls ): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 208 | main.log.report("=======================================================") |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 209 | main.log.report(" ONOS " + str( i + 1 ) + "LOG REPORT") |
| 210 | main.ONOSbench.logReport( main.ONOSip[ i ], ["ERROR", "WARNING", "EXCEPT"], outputMode="d" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 211 | main.ONOSbench.handle.sendline("onos $OC1 flows") |
| 212 | main.ONOSbench.handle.expect(":~") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 213 | main.log.info(main.ONOSbench.handle.before) |
| 214 | |
| 215 | break |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 216 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 217 | ######################################################################################## |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 218 | result = [""]*( main.numCtrls ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 219 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 220 | #print("rawResult: " + rawResult) |
| 221 | |
| 222 | rawResult = rawResult.splitlines() |
| 223 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 224 | for node in range( main.numCtrls ): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 225 | for line in rawResult: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 226 | #print("line: " + line) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 227 | if main.ONOSip[ node ] in line and "server" in line: |
| 228 | temp = line.split( " " ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 229 | for word in temp: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 230 | #print ("word: " + word) |
| 231 | if "elapsed" in repr(word): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 232 | index = temp.index(word) + 1 |
| 233 | myParsed = (temp[index]).replace(",","") |
| 234 | myParsed = myParsed.replace("}","") |
| 235 | myParsed = int(myParsed) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 236 | result[ node ] = myParsed |
| 237 | main.log.info( main.ONOSip[ node ] + " : " + str( myParsed ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 238 | break |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 239 | |
| 240 | if test >= warmUp: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 241 | for i in result: |
| 242 | if i == "": |
cameron@onlab.us | b3aa498 | 2015-07-13 15:20:41 -0700 | [diff] [blame] | 243 | main.log.error("Missing data point, critical failure incoming") |
| 244 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 245 | print result |
| 246 | maxes[test-warmUp] = max(result) |
| 247 | main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize)) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 248 | main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 249 | |
| 250 | data[test-warmUp] = result |
| 251 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 252 | # wait for flows = 0 |
| 253 | for checkCount in range(0,5): |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 254 | time.sleep(10) |
| 255 | main.ONOSbench.handle.sendline("onos $OC1 summary") |
| 256 | main.ONOSbench.handle.expect(":~") |
| 257 | flowCheck = main.ONOSbench.handle.before |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 258 | if "flows=0," in flowCheck: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 259 | main.log.info("Flows removed") |
| 260 | break |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 261 | else: |
| 262 | for line in flowCheck.splitlines(): |
| 263 | if "flows=" in line: |
| 264 | main.log.info("Current Summary: " + line) |
| 265 | if checkCount == 2: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 266 | main.log.info("Flows are stuck, moving on ") |
| 267 | |
| 268 | |
| 269 | time.sleep(5) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 270 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 271 | main.log.info("raw data: " + str(data)) |
| 272 | main.log.info("maxes:" + str(maxes)) |
| 273 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 274 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 275 | # report data |
| 276 | print("") |
| 277 | main.log.info("\t Results (measurments are in milliseconds)") |
| 278 | print("") |
| 279 | |
| 280 | nodeString = "" |
| 281 | for i in range(1, int(servers) + 1): |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 282 | nodeString += ("\tNode " + str(i)) |
| 283 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 284 | for test in range(0, sampleSize ): |
| 285 | main.log.info("\t Test iteration " + str(test + 1) ) |
| 286 | main.log.info("\t------------------") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 287 | main.log.info(nodeString) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 288 | resultString = "" |
| 289 | |
| 290 | for i in range(0, int(servers) ): |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 291 | resultString += ("\t" + str(data[test][i]) ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 292 | main.log.info(resultString) |
| 293 | |
| 294 | print("\n") |
| 295 | |
| 296 | avgOfMaxes = numpy.mean(maxes) |
| 297 | main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes)) |
| 298 | |
| 299 | stdOfMaxes = numpy.std(maxes) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 300 | main.log.info("Standard Deviation of max values: " + str(stdOfMaxes)) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 301 | print("\n\n") |
| 302 | |
| 303 | avgTP = int(main.params[ 'TEST' ][ 'flows' ]) / avgOfMaxes #result in kflows/second |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 304 | |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 305 | tp = [] |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 306 | for i in maxes: |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 307 | tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i )) |
| 308 | |
| 309 | stdTP = numpy.std(tp) |
| 310 | |
| 311 | main.log.info("Average thoughput: " + str(avgTP) + " Kflows/second" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 312 | main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second") |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 313 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 314 | resultsLog = open( "/tmp/flowTP1gDB", "a" ) |
| 315 | resultString = ( "'" + main.commit + "'," ) |
| 316 | resultString += ( "'1gig'," ) |
| 317 | resultString += ( (main.params[ 'TEST' ][ 'flows' ] ) + "," ) |
| 318 | resultString += ( str( main.numCtrls ) + "," ) |
| 319 | resultString += ( str( n ) + "," ) |
| 320 | resultString += ( str( avgTP ) + "," + str( stdTP ) + "\n" ) |
| 321 | resultsLog.write( resultString ) |
cameron@onlab.us | 946d99c | 2015-07-08 15:34:37 -0700 | [diff] [blame] | 322 | resultsLog.close() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 323 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 324 | main.log.report( "Result line to file: " + resultString ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 325 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 326 | main.ONOSbench.logReport( main.ONOSip[ 0 ], [ "ERROR", "WARNING", "EXCEPT" ], outputMode="d" ) |