blob: 722819d6b8b0a3cfc8eda5f82e10b650a3289ed2 [file] [log] [blame]
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07001"""
2Copyright 2015 Open Networking Foundation (ONF)
3
4Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
5the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
6or 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.us946d99c2015-07-08 15:34:37 -070022# ScaleOutTemplate -> flowTP
23#
24# CASE1 starts number of nodes specified in param file
25#
26# cameron@onlab.us
27
28import sys
29import os.path
30
31
32class SCPFflowTp1g:
33
34 def __init__( self ):
35 self.default = ''
36
Devin Limd2f199a2017-08-04 12:02:47 -070037 def CASE0( self, main ):
cameron@onlab.us946d99c2015-07-08 15:34:37 -070038
39 import time
cameron@onlab.us946d99c2015-07-08 15:34:37 -070040 try:
Devin Limd2f199a2017-08-04 12:02:47 -070041 from tests.dependencies.ONOSSetup import ONOSSetup
42 main.testSetUp = ONOSSetup()
43 except ImportError:
44 main.log.error("ONOSSetup not found. exiting the test")
45 main.exit()
46 main.testSetUp.envSetupDescription()
47 try:
48 #Load values from params file
49 cellName = main.params[ 'ENV' ][ 'cellName' ]
50 main.apps = main.params[ 'ENV' ][ 'cellApps' ]
51 BENCHUser = main.params[ 'BENCH' ][ 'user' ]
52 BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
53 main.scale = ( main.params[ 'SCALE' ] ).split( "," )
54 main.flowRuleCfg = main.params[ 'CFG' ][ 'flowRule' ]
55 main.nullProviderCfg = main.params[ 'CFG' ][ 'nullProvider' ]
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +053056 isFlowObj = main.params[ 'TEST' ][ 'flowObj' ]
57 if isFlowObj == 'true':
58 resultFile = main.params[ 'TEST' ][ 'flowObjResultFile' ]
59 else:
60 resultFile = main.params[ 'TEST' ][ 'flowResultFile' ]
Devin Limd2f199a2017-08-04 12:02:47 -070061 stepResult = main.testSetUp.envSetup()
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +053062 resultsDB = open( str( resultFile ), "w+" )
Devin Limd2f199a2017-08-04 12:02:47 -070063 resultsDB.close()
64 except Exception as e:
65 main.testSetUp.envSetupException( e )
66 main.testSetUp.evnSetupConclusion( stepResult )
67 main.commit = ( main.commit.split( " " ) )[ 1 ]
cameron@onlab.us946d99c2015-07-08 15:34:37 -070068
Devin Limd2f199a2017-08-04 12:02:47 -070069 def CASE1( self, main ):
Devin Lim142b5342017-07-20 15:22:39 -070070 main.testSetUp.ONOSSetUp( "localhost", main.Cluster, True, cellName=cellName )
Jon Hall4ba53f02015-07-29 13:07:41 -070071
Devin Lim142b5342017-07-20 15:22:39 -070072 main.log.info( "Startup sequence complete" )
73 main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress, [ "ERROR", "WARNING", "EXCEPT" ], outputMode="d" )
Chiyu Chengef109502016-11-21 15:51:38 -080074
cameron@onlab.us946d99c2015-07-08 15:34:37 -070075 def CASE2( self, main ):
76 #
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +053077 # This is the flow/flowObjective TP test
cameron@onlab.us946d99c2015-07-08 15:34:37 -070078 #
Jon Hall4ba53f02015-07-29 13:07:41 -070079 import os.path
80 import numpy
cameron@onlab.us946d99c2015-07-08 15:34:37 -070081 import math
Jon Hall4ba53f02015-07-29 13:07:41 -070082 import time
cameron@onlab.us946d99c2015-07-08 15:34:37 -070083 import datetime
84 import traceback
85
86 global currentNeighbors
87 try:
88 currentNeighbors
89 except:
Devin Lim142b5342017-07-20 15:22:39 -070090 currentNeighbors = ( main.params[ 'TEST' ][ 'neighbors' ] ).split( "," )[ 0 ]
cameron@onlab.us946d99c2015-07-08 15:34:37 -070091 else:
92 if currentNeighbors == "r": #reset
93 currentNeighbors = "0"
94 else:
95 currentNeighbors = "a"
96
Devin Lim142b5342017-07-20 15:22:39 -070097 testCMD = [ 0, 0, 0, 0 ]
98 warmUp = int( main.params[ 'TEST' ][ 'warmUp' ] )
99 sampleSize = int( main.params[ 'TEST' ][ 'sampleSize' ] )
100 switches = int( main.params[ 'TEST' ][ 'switches' ] )
101 neighborList = ( main.params[ 'TEST' ][ 'neighbors' ] ).split( "," )
102 testCMD[ 0 ] = main.params[ 'TEST' ][ 'testCMD0' ]
103 testCMD[ 1 ] = main.params[ 'TEST' ][ 'testCMD1' ]
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530104 testCMD[ 2 ] = main.params[ 'TEST' ][ 'testCMD2' ]
105 testCMD[ 3 ] = main.params[ 'TEST' ][ 'testCMD3' ]
106 flowObjType = main.params[ 'TEST' ][ 'flowObjType' ]
107 isFlowObj = main.params[ 'TEST' ][ 'flowObj' ]
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700108 cooldown = main.params[ 'TEST' ][ 'cooldown' ]
109 cellName = main.params[ 'ENV' ][ 'cellName' ]
110 BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
111 BENCHUser = main.params[ 'BENCH' ][ 'user' ]
112 MN1Ip = main.params[ 'MN' ][ 'ip1' ]
Devin Lim142b5342017-07-20 15:22:39 -0700113 homeDir = os.path.expanduser( '~' )
114 flowRuleBackup = str( main.params[ 'TEST' ][ 'enableFlowRuleStoreBackup' ] )
115 main.log.info( "Flow Rule Backup is set to:" + flowRuleBackup )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700116
Devin Lim142b5342017-07-20 15:22:39 -0700117 servers = str( main.Cluster.numCtrls )
Jon Hall4ba53f02015-07-29 13:07:41 -0700118
Devin Lim142b5342017-07-20 15:22:39 -0700119 if main.Cluster.numCtrls == 1:
120 neighborList = [ '0' ]
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700121 currentNeighbors = "r"
122 else:
123 if currentNeighbors == "a":
Devin Lim142b5342017-07-20 15:22:39 -0700124 neighborList = [ str( main.Cluster.numCtrls - 1 ) ]
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700125 currentNeighbors = "r"
126 else:
Devin Lim142b5342017-07-20 15:22:39 -0700127 neighborList = [ '0' ]
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700128
Devin Lim142b5342017-07-20 15:22:39 -0700129 main.log.info( "neightborlist: " + str( neighborList ) )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700130
131 ts = time.time()
Devin Lim142b5342017-07-20 15:22:39 -0700132 st = datetime.datetime.fromtimestamp( ts ).strftime( '%Y-%m-%d %H:%M:%S' )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700133
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700134 for n in neighborList:
Devin Lim142b5342017-07-20 15:22:39 -0700135 main.step( "\tSTARTING TEST" )
136 main.step( "\tLOADING FROM SERVERS: \t" + str( main.Cluster.numCtrls ) )
137 main.step( "\tNEIGHBORS:\t" + n )
138 main.log.info( "=============================================================" )
139 main.log.info( "=============================================================" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700140 #write file to configure nil link
141 ipCSV = ""
Devin Lim142b5342017-07-20 15:22:39 -0700142 for i in range ( main.Cluster.maxCtrls ):
Devin Lim58046fa2017-07-05 16:55:00 -0700143 tempstr = "ip" + str( i + 1 )
Jon Hall4ba53f02015-07-29 13:07:41 -0700144 ipCSV += main.params[ 'CTRL' ][ tempstr ]
Devin Lim142b5342017-07-20 15:22:39 -0700145 if i + 1 < main.Cluster.maxCtrls:
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700146 ipCSV +=","
Jon Hall4ba53f02015-07-29 13:07:41 -0700147
Devin Lim142b5342017-07-20 15:22:39 -0700148 main.ONOSbench.onosCfgSet( main.Cluster.active( 0 ).ipAddress,
149 main.flowRuleCfg,
150 "backupCount 1" )
151 for i in range( 3 ):
152 main.ONOSbench.onosCfgSet( main.Cluster.active( 0 ).ipAddress,
153 main.nullProviderCfg,
154 "deviceCount 35" )
155 main.ONOSbench.onosCfgSet( main.Cluster.active( 0 ).ipAddress,
156 main.nullProviderCfg,
157 "topoShape linear" )
158 main.ONOSbench.onosCfgSet( main.Cluster.active( 0 ).ipAddress,
159 main.nullProviderCfg,
160 "enabled true" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700161
Devin Lim142b5342017-07-20 15:22:39 -0700162 time.sleep( 5 )
163 main.ONOSbench.handle.sendline( "onos $OC1 summary" )
164 main.ONOSbench.handle.expect( ":~" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700165 check = main.ONOSbench.handle.before
Devin Lim142b5342017-07-20 15:22:39 -0700166 main.log.info( "\nStart up check: \n" + check + "\n" )
Jon Hall4ba53f02015-07-29 13:07:41 -0700167 if "SCC(s)=1," in check:
suibin zhanga3746bf2015-09-05 09:36:39 -0700168 main.ONOSbench.handle.sendline( "onos $OC1 balance-masters" )
suibin zhang45efc1b2015-09-04 16:48:10 -0700169 main.ONOSbench.handle.expect( ":~" )
Devin Lim142b5342017-07-20 15:22:39 -0700170 time.sleep( 5 )
171 main.ONOSbench.handle.sendline( "onos $OC1 roles " )
suibin zhang45efc1b2015-09-04 16:48:10 -0700172 main.ONOSbench.handle.expect ( ":~" )
173 main.log.info( "switch masterships:" + str( main.ONOSbench.handle.before ) )
Jon Hall4ba53f02015-07-29 13:07:41 -0700174 break
Devin Lim142b5342017-07-20 15:22:39 -0700175 time.sleep( 5 )
Jon Hall4ba53f02015-07-29 13:07:41 -0700176
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530177 #divide flows/flowObjectives
178 if isFlowObj == 'true':
179 toInstall = "FlowObjectives"
180 installCount = int( main.params[ 'TEST' ][ 'flowObjectives' ] )
181 ifFailed = "FLOW_OBJ_TESTER.PY FAILURE"
182 resultFile = main.params[ 'TEST' ][ 'flowObjResultFile' ]
183 else:
184 toInstall = "Flows"
185 installCount = int( main.params[ 'TEST' ][ 'flows' ] )
186 ifFailed = "FLOW_TESTER.PY FAILURE"
187 resultFile = main.params[ 'TEST' ][ 'flowResultFile' ]
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700188
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530189 main.log.info( toInstall + " Target = " + str( installCount ) )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700190
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530191 installCount = ( installCount *max( int( n )+1,int( servers ) ) )/( ( int( n ) + 1 )*int( servers )*( switches ) )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700192
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530193 main.log.info( toInstall + " per switch = " + str( installCount ) )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700194 #build list of servers in "$OC1, $OC2...." format
195 serverEnvVars = ""
Devin Lim58046fa2017-07-05 16:55:00 -0700196 for i in range( int( servers ) ):
Devin Lim142b5342017-07-20 15:22:39 -0700197 serverEnvVars += ( "-s " + main.Cluster.active( i ).ipAddress + " " )
Jon Hall4ba53f02015-07-29 13:07:41 -0700198
Devin Lim142b5342017-07-20 15:22:39 -0700199 data = [ [ "" ]*int( servers ) ]*int( sampleSize )
200 maxes = [ "" ]*int( sampleSize )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700201
202 flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530203 if isFlowObj == 'true':
204 flowCMD += testCMD[ 2 ] + " " + str( installCount ) + " " + testCMD[ 1 ]
205 flowCMD += " " + str( n ) + " " + testCMD[ 3 ] + " " + str( flowObjType ) + " " + str( serverEnvVars ) + "-j"
206 else:
207 flowCMD += testCMD[ 0 ] + " " + str( installCount ) + " " + testCMD[ 1 ]
208 flowCMD += " " + str( n ) + " " + str( serverEnvVars ) + "-j"
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700209
Devin Lim142b5342017-07-20 15:22:39 -0700210 main.log.info( flowCMD )
211 #time.sleep( 60 )
Jon Hall4ba53f02015-07-29 13:07:41 -0700212
Devin Lim142b5342017-07-20 15:22:39 -0700213 for test in range( 0, warmUp + sampleSize ):
Jon Hall4ba53f02015-07-29 13:07:41 -0700214 if test < warmUp:
Devin Lim142b5342017-07-20 15:22:39 -0700215 main.log.info( "Warm up " + str( test + 1 ) + " of " + str( warmUp ) )
Jon Hall4ba53f02015-07-29 13:07:41 -0700216 else:
Devin Lim142b5342017-07-20 15:22:39 -0700217 main.log.info( "====== Test run: " + str( test-warmUp+1 ) + " ======" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700218
Devin Lim142b5342017-07-20 15:22:39 -0700219 main.ONOSbench.handle.sendline( flowCMD )
220 main.ONOSbench.handle.expect( ":~" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700221 rawResult = main.ONOSbench.handle.before
Devin Lim142b5342017-07-20 15:22:39 -0700222 main.log.info( "Raw results: \n" + rawResult + "\n" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700223
Jon Hall4ba53f02015-07-29 13:07:41 -0700224 if "failed" in rawResult:
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530225 main.log.report( ifFailed )
Devin Lim142b5342017-07-20 15:22:39 -0700226 main.log.report( " \n" + rawResult + " \n" )
227 for ctrl in main.Cluster.active():
228 main.log.report( "=======================================================" )
229 main.log.report( ctrl.name + "LOG REPORT" )
230 main.ONOSbench.logReport( ctrl.ipAddress, [ "ERROR", "WARNING", "EXCEPT" ], outputMode="d" )
231 main.ONOSbench.handle.sendline( "onos $OC1 flows" )
232 main.ONOSbench.handle.expect( ":~" )
233 main.log.info( main.ONOSbench.handle.before )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700234
235 break
Jon Hall4ba53f02015-07-29 13:07:41 -0700236
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700237 ########################################################################################
Devin Lim142b5342017-07-20 15:22:39 -0700238 result = [ "" ]*( main.Cluster.numCtrls )
Jon Hall4ba53f02015-07-29 13:07:41 -0700239
Devin Lim142b5342017-07-20 15:22:39 -0700240 #print( "rawResult: " + rawResult )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700241
242 rawResult = rawResult.splitlines()
243
Devin Lim142b5342017-07-20 15:22:39 -0700244 for node in range( main.Cluster.numCtrls ):
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700245 for line in rawResult:
Devin Lim142b5342017-07-20 15:22:39 -0700246 #print( "line: " + line )
247 if main.Cluster.active( node ).ipAddress in line and "server" in line:
Devin Lim58046fa2017-07-05 16:55:00 -0700248 temp = line.split( " " )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700249 for word in temp:
Devin Lim142b5342017-07-20 15:22:39 -0700250 #print ( "word: " + word )
251 if "elapsed" in repr( word ):
252 index = temp.index( word ) + 1
253 myParsed = ( temp[ index ] ).replace( ",", "" )
254 myParsed = myParsed.replace( "}", "" )
255 myParsed = int( myParsed )
Devin Lim58046fa2017-07-05 16:55:00 -0700256 result[ node ] = myParsed
Devin Lim142b5342017-07-20 15:22:39 -0700257 main.log.info( main.Cluster.active( node ).ipAddress + " : " + str( myParsed ) )
Jon Hall4ba53f02015-07-29 13:07:41 -0700258 break
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700259
260 if test >= warmUp:
Jon Hall4ba53f02015-07-29 13:07:41 -0700261 for i in result:
262 if i == "":
Devin Lim142b5342017-07-20 15:22:39 -0700263 main.log.error( "Missing data point, critical failure incoming" )
cameron@onlab.usb3aa4982015-07-13 15:20:41 -0700264
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700265 print result
Devin Lim142b5342017-07-20 15:22:39 -0700266 maxes[ test-warmUp ] = max( result )
267 main.log.info( "Data collection iteration: " + str( test-warmUp ) + " of " + str( sampleSize ) )
268 main.log.info( "Throughput time: " + str( maxes[ test-warmUp ] ) + "(ms)" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700269
Devin Lim142b5342017-07-20 15:22:39 -0700270 data[ test-warmUp ] = result
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700271
Jon Hall4ba53f02015-07-29 13:07:41 -0700272 # wait for flows = 0
Devin Lim142b5342017-07-20 15:22:39 -0700273 for checkCount in range( 0, 5 ):
274 time.sleep( 10 )
275 main.ONOSbench.handle.sendline( "onos $OC1 summary" )
276 main.ONOSbench.handle.expect( ":~" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700277 flowCheck = main.ONOSbench.handle.before
Jon Hall4ba53f02015-07-29 13:07:41 -0700278 if "flows=0," in flowCheck:
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530279 main.log.info( toInstall + " removed" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700280 break
Jon Hall4ba53f02015-07-29 13:07:41 -0700281 else:
282 for line in flowCheck.splitlines():
283 if "flows=" in line:
Devin Lim142b5342017-07-20 15:22:39 -0700284 main.log.info( "Current Summary: " + line )
Jon Hall4ba53f02015-07-29 13:07:41 -0700285 if checkCount == 2:
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530286 main.log.info( toInstall + " are stuck, moving on " )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700287
288
Devin Lim142b5342017-07-20 15:22:39 -0700289 time.sleep( 5 )
Jon Hall4ba53f02015-07-29 13:07:41 -0700290
Devin Lim142b5342017-07-20 15:22:39 -0700291 main.log.info( "raw data: " + str( data ) )
292 main.log.info( "maxes:" + str( maxes ) )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700293
Jon Hall4ba53f02015-07-29 13:07:41 -0700294
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700295 # report data
Devin Lim142b5342017-07-20 15:22:39 -0700296 print( "" )
297 main.log.info( "\t Results (measurments are in milliseconds)" )
298 print( "" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700299
300 nodeString = ""
Devin Lim142b5342017-07-20 15:22:39 -0700301 for i in range( 1, int( servers ) + 1 ):
302 nodeString += ( "\tNode " + str( i ) )
Jon Hall4ba53f02015-07-29 13:07:41 -0700303
Devin Lim142b5342017-07-20 15:22:39 -0700304 for test in range( 0, sampleSize ):
305 main.log.info( "\t Test iteration " + str( test + 1 ) )
306 main.log.info( "\t------------------" )
307 main.log.info( nodeString )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700308 resultString = ""
309
Devin Lim142b5342017-07-20 15:22:39 -0700310 for i in range( 0, int( servers ) ):
311 resultString += ( "\t" + str( data[ test ][ i ] ) )
312 main.log.info( resultString )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700313
Devin Lim142b5342017-07-20 15:22:39 -0700314 print( "\n" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700315
Devin Lim142b5342017-07-20 15:22:39 -0700316 avgOfMaxes = numpy.mean( maxes )
317 main.log.info( "Average of max value from each test iteration: " + str( avgOfMaxes ) )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700318
Devin Lim142b5342017-07-20 15:22:39 -0700319 stdOfMaxes = numpy.std( maxes )
320 main.log.info( "Standard Deviation of max values: " + str( stdOfMaxes ) )
321 print( "\n\n" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700322
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530323 avgTP = int( installCount ) / avgOfMaxes #result in kflows/second
Jon Hall4ba53f02015-07-29 13:07:41 -0700324
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700325 tp = []
Jon Hall4ba53f02015-07-29 13:07:41 -0700326 for i in maxes:
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530327 tp.append( ( int( installCount ) / i ) )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700328
Devin Lim142b5342017-07-20 15:22:39 -0700329 stdTP = numpy.std( tp )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700330
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530331 main.log.info( "Average thoughput: " + str( avgTP ) + " K" + toInstall + "/second" )
332 main.log.info( "Standard deviation of throughput: " + str( stdTP ) + " K" + toInstall + "/second" )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700333
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530334 resultsLog = open( str( resultFile ), "a" )
Devin Lim58046fa2017-07-05 16:55:00 -0700335 resultString = ( "'" + main.commit + "'," )
336 resultString += ( "'1gig'," )
sivachidambaram subramanian1c18af82017-08-03 14:36:18 +0530337 resultString += ( str( installCount ) + "," )
Devin Lim142b5342017-07-20 15:22:39 -0700338 resultString += ( str( main.Cluster.numCtrls ) + "," )
Devin Lim58046fa2017-07-05 16:55:00 -0700339 resultString += ( str( n ) + "," )
340 resultString += ( str( avgTP ) + "," + str( stdTP ) + "\n" )
341 resultsLog.write( resultString )
cameron@onlab.us946d99c2015-07-08 15:34:37 -0700342 resultsLog.close()
Jon Hall4ba53f02015-07-29 13:07:41 -0700343
Devin Lim58046fa2017-07-05 16:55:00 -0700344 main.log.report( "Result line to file: " + resultString )
Jon Hall4ba53f02015-07-29 13:07:41 -0700345
Devin Lim142b5342017-07-20 15:22:39 -0700346 main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress, [ "ERROR", "WARNING", "EXCEPT" ], outputMode="d" )