andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 1 | # ScaleOutTemplate --> LinkEventTP |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 2 | # |
| 3 | # CASE1 starts number of nodes specified in param file |
| 4 | # |
| 5 | # cameron@onlab.us |
| 6 | |
| 7 | import sys |
| 8 | import os |
| 9 | |
| 10 | |
| 11 | class LinkEventTP: |
| 12 | |
| 13 | def __init__( self ): |
| 14 | self.default = '' |
| 15 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 16 | def CASE1( self, main ): #This is the initialization case |
| 17 | import os.path #this case will clean up all nodes |
| 18 | #but only node 1 isnodestarted in this case |
| 19 | |
| 20 | global clusterCount #number of nodes running |
| 21 | global ONOSIp #list of ONOS IP addresses |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 22 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 23 | clusterCount = 1 |
| 24 | ONOSIp = [ 0 ] |
| 25 | |
| 26 | #Load values from params file |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 27 | checkoutBranch = main.params[ 'GIT' ][ 'checkout' ] |
| 28 | gitPull = main.params[ 'GIT' ][ 'autopull' ] |
| 29 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 30 | Features= main.params[ 'ENV' ][ 'cellFeatures' ] |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 31 | BENCHIp = main.params[ 'BENCH' ][ 'ip1' ] |
| 32 | BENCHUser = main.params[ 'BENCH' ][ 'user' ] |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 33 | maxNodes = int(main.params[ 'availableNodes' ]) |
| 34 | Features = main.params[ 'ENV' ][ 'cellFeatures' ] |
| 35 | skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ] |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 36 | flickerRate = main.params[ 'TEST' ][ 'flickerRate'] |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 37 | deviceDistribution = (main.params[ 'TEST' ][ 'devicesPerNode']).split(",") |
| 38 | MNip = main.params[ 'TEST' ][ 'MN' ] |
jenkins | b8dd1aa | 2015-03-24 10:31:10 -0700 | [diff] [blame^] | 39 | logFileName = main.params[ 'TEST' ][ 'logFile' ] |
| 40 | onBaremetal = main.params[ 'ENV' ][ 'onBaremetal' ] |
| 41 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 42 | main.ONOSbench.handle.sendline("export TERM=vt100") |
| 43 | main.ONOSbench.handle.expect(":~") |
jenkins | b8dd1aa | 2015-03-24 10:31:10 -0700 | [diff] [blame^] | 44 | homeDir = os.path.expanduser('~') |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 45 | |
| 46 | #Populate ONOSIp with ips from params |
| 47 | for i in range(1, maxNodes + 1): |
| 48 | ipString = 'ip' + str(i) |
| 49 | ONOSIp.append(main.params[ 'CTRL' ][ ipString ]) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 50 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 51 | #kill off all onos processes |
| 52 | main.log.step("Safety check, killing all ONOS processes") |
| 53 | main.log.step("before initiating enviornment setup") |
| 54 | for node in range(1, maxNodes + 1): |
| 55 | main.ONOSbench.onosDie(ONOSIp[node]) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 56 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 57 | #construct the cell file |
| 58 | main.log.step("Creating cell file") |
| 59 | cellIp = [] |
| 60 | for node in range (1, clusterCount + 1): |
| 61 | cellIp.append(ONOSIp[node]) |
| 62 | main.ONOSbench.createCellFile(BENCHIp,cellName,MNip,str(Features), *cellIp) |
| 63 | |
| 64 | main.step( "Set Cell" ) |
| 65 | main.ONOSbench.setCell(cellName) |
| 66 | |
| 67 | #Uninstall everywhere |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 68 | main.log.step( "Cleaning Enviornment..." ) |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 69 | for i in range(1, maxNodes + 1): |
| 70 | main.log.info(" Uninstalling ONOS " + str(i) ) |
| 71 | main.ONOSbench.onosUninstall( ONOSIp[i] ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 72 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 73 | myDistribution = [] |
| 74 | for node in range (1, clusterCount + 1): |
| 75 | myDistribution.append(deviceDistribution[node-1]) |
| 76 | |
| 77 | main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution) |
| 78 | main.ONOSbench.createNullDevProviderFile( BENCHIp, cellIp, myDistribution) |
| 79 | main.ONOSbench.createNullLinkProviderFile(BENCHIp) |
| 80 | |
| 81 | #git step - skipable |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 82 | main.step( "Git checkout and pull " + checkoutBranch ) |
| 83 | if gitPull == 'on': |
| 84 | checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch ) |
| 85 | pullResult = main.ONOSbench.gitPull() |
| 86 | |
| 87 | else: |
| 88 | checkoutResult = main.TRUE |
| 89 | pullResult = main.TRUE |
| 90 | main.log.info( "Skipped git checkout and pull" ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 91 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 92 | #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test |
| 93 | if skipMvn != "yes": |
| 94 | mvnResult = main.ONOSbench.cleanInstall() |
jenkins | 9301fd0 | 2015-02-10 14:13:33 -0800 | [diff] [blame] | 95 | |
jenkins | 9301fd0 | 2015-02-10 14:13:33 -0800 | [diff] [blame] | 96 | ### configure event rate file ### |
| 97 | main.log.step("Writing Default Topology Provider config file") |
| 98 | localPath = main.params[ 'TEST' ][ 'configFile' ] |
| 99 | filePath = homeDir + localPath |
| 100 | main.log.info(filePath) |
| 101 | configFile = open(filePath, 'w+') |
| 102 | main.log.info("File Opened") |
| 103 | configFile.write("maxEvents = 1\n") |
| 104 | configFile.write("maxIdleMs = 0\n") |
| 105 | configFile.write("maxBatchMs = 0\n") |
| 106 | main.log.info("File written and closed") |
jenkins | 9301fd0 | 2015-02-10 14:13:33 -0800 | [diff] [blame] | 107 | configFile.close() |
jenkins | 9301fd0 | 2015-02-10 14:13:33 -0800 | [diff] [blame] | 108 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 109 | logFile = open(logFileName, 'w+') |
| 110 | main.log.info("Created log File") |
| 111 | logFile.close() |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 112 | |
jenkins | b8dd1aa | 2015-03-24 10:31:10 -0700 | [diff] [blame^] | 113 | if onBaremetal == "true": |
| 114 | filename = "/onos/tools/package/bin/onos-service" |
| 115 | serviceConfig = open(homeDir + filename, 'w+') |
| 116 | serviceConfig.write("#!/bin/bash\n ") |
| 117 | serviceConfig.write("#------------------------------------- \n ") |
| 118 | serviceConfig.write("# Starts ONOS Apache Karaf container\n ") |
| 119 | serviceConfig.write("#------------------------------------- \n ") |
| 120 | serviceConfig.write("#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}\n ") |
| 121 | serviceConfig.write("""export JAVA_OPTS="${JAVA_OPTS:--Xms256m -Xmx8G}" \n """) |
| 122 | serviceConfig.write("") |
| 123 | serviceConfig.write("ONOS_HOME=/opt/onos \n ") |
| 124 | serviceConfig.write("") |
| 125 | serviceConfig.write("[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..\n") |
| 126 | serviceConfig.write("""${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@" \n """) |
| 127 | serviceConfig.close() |
| 128 | |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 129 | main.step( "Creating ONOS package" ) |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 130 | packageResult = main.ONOSbench.onosPackage() |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 131 | |
| 132 | main.step( "Installing ONOS package" ) |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 133 | install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 134 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 135 | main.step( "Verify cells" ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 136 | verifyCellResult = main.ONOSbench.verifyCell() |
| 137 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 138 | main.step( "Enviornment setup and verification complete." ) |
| 139 | main.ONOS1cli.startOnosCli( ONOSIp[1] ) |
| 140 | main.step( "ONOS 1 is up and running." ) |
| 141 | main.ONOSbench.handle.expect(":~") #there is a dangling sendline somewhere... |
andrew@onlab.us | 8f9032d | 2015-03-11 15:50:49 -0700 | [diff] [blame] | 142 | |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 143 | def CASE2( self, main ): |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 144 | # This case increases the cluster size by whatever scale is |
| 145 | # Note: 'scale' is the size of the step |
| 146 | # if scaling is not a part of your test, simply run this case |
| 147 | # once after CASE1 to set up your enviornment for your desired |
| 148 | # cluster size. If scaling is a part of you test call this case each time |
| 149 | # you want to increase cluster size |
| 150 | |
| 151 | '' |
| 152 | 'Increase number of nodes and initiate CLI' |
| 153 | '' |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 154 | import time |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 155 | global clusterCount |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 156 | |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 157 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 158 | Features= main.params[ 'ENV' ][ 'cellFeatures' ] |
| 159 | BENCHIp = main.params[ 'BENCH' ][ 'ip1' ] |
| 160 | MNip = main.params[ 'TEST' ][ 'MN' ] |
| 161 | deviceDistribution = (main.params[ 'TEST' ][ 'devicesPerNode']).split(",") |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 162 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 163 | scale = int( main.params[ 'SCALE' ] ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 164 | clusterCount += scale |
| 165 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 166 | main.log.step( "Cleaning Enviornment..." ) |
| 167 | for i in range(1, maxNodes + 1): |
| 168 | main.ONOSbench.onosDie(ONOSIp[i]) |
| 169 | main.log.info(" Uninstalling ONOS " + str(i) ) |
| 170 | main.ONOSbench.onosUninstall( ONOSIp[i] ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 171 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 172 | myDistribution = [] |
| 173 | for node in range (1, clusterCount + 1): |
| 174 | myDistribution.append(deviceDistribution[node-1]) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 175 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 176 | main.log.step("Creating cell file") |
| 177 | cellIp = [] |
| 178 | for node in range (1, clusterCount + 1): |
| 179 | cellIp.append(ONOSIp[node]) |
| 180 | main.ONOSbench.createCellFile(BENCHIp,cellName,MNip,str(Features), *cellIp) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 181 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 182 | main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution) |
| 183 | main.ONOSbench.createNullDevProviderFile( BENCHIp, cellIp, myDistribution) |
| 184 | main.ONOSbench.createNullLinkProviderFile(BENCHIp) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 185 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 186 | main.step( "Set Cell" ) |
| 187 | main.ONOSbench.setCell(cellName) |
| 188 | |
jenkins | b8dd1aa | 2015-03-24 10:31:10 -0700 | [diff] [blame^] | 189 | main.step( "Packaging" ) |
| 190 | main.ONOSbench.onosPackage() |
| 191 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 192 | main.log.report( "Increasing cluster size to " + str( clusterCount ) ) |
| 193 | for node in range(1, clusterCount + 1): |
| 194 | time.sleep(10) |
| 195 | main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node]) |
jenkins | b8dd1aa | 2015-03-24 10:31:10 -0700 | [diff] [blame^] | 196 | main.ONOSbench.onosInstall( node=ONOSIp[node] ) |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 197 | exec "a = main.ONOS%scli.startOnosCli" %str(node) |
| 198 | a(ONOSIp[node]) |
andrew@onlab.us | 8f9032d | 2015-03-11 15:50:49 -0700 | [diff] [blame] | 199 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 200 | for node in range(1, clusterCount + 1): |
| 201 | for i in range( 2 ): |
| 202 | isup = main.ONOSbench.isup( ONOSIp[node] ) |
| 203 | if isup: |
| 204 | main.log.info("ONOS " + str(node) + " is up\n") |
| 205 | break |
| 206 | if not isup: |
| 207 | main.log.report( "ONOS " + str(node) + " didn't start!" ) |
| 208 | |
| 209 | def CASE3( self, main ): |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 210 | import time |
| 211 | import json |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 212 | import string |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 213 | import csv |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 214 | import os.path |
| 215 | import requests |
| 216 | import numpy |
| 217 | |
| 218 | sustainability = float(main.params[ 'TEST' ][ 'linkgraphdif' ]) |
| 219 | flickerRates = (main.params[ 'TEST' ][ 'flickerRates']).split(",") |
| 220 | homeDir = os.path.expanduser('~') |
| 221 | |
| 222 | linkResult = main.FALSE |
| 223 | scale = int( main.params[ 'SCALE' ] ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 224 | |
jenkins | b8dd1aa | 2015-03-24 10:31:10 -0700 | [diff] [blame^] | 225 | testDelay = main.params[ 'TEST' ][ 'wait' ] |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 226 | |
| 227 | for node in range(1, clusterCount + 1): |
| 228 | main.log.info("Writing flicker file to node " + str(node)) |
| 229 | main.ONOSbench.createNullLinkProviderFile( ONOSIp[node], eventRate=flickerRates[node-1], onNode=True ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 230 | |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 231 | testDuration = main.params[ 'TEST' ][ 'duration' ] |
| 232 | stop = time.time() + float( testDuration ) |
| 233 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 234 | msg = ( "Starting test loop for " + str(testDuration) + " seconds on a " + str(clusterCount) + " node cluster" ) |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 235 | main.log.info( msg ) |
| 236 | logInterval = main.params[ 'TEST' ][ 'log_interval' ] |
| 237 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 238 | linkResults = [0,0,0,0,0,0,0,0] |
| 239 | graphResults = [0,0,0,0,0,0,0,0] |
| 240 | JsonStr = [ 0,0,0,0,0,0,0,0 ] |
| 241 | JsonObj = [ 0,0,0,0,0,0,0,0 ] |
andrew@onlab.us | 2ae3a11 | 2015-02-02 11:24:32 -0800 | [diff] [blame] | 242 | |
andrew@onlab.us | 30d9ba4 | 2015-03-11 15:05:24 -0700 | [diff] [blame] | 243 | while time.time() < stop: |
| 244 | time.sleep( float( logInterval ) ) |
| 245 | for node in range(1, clusterCount+1): |
| 246 | main.ONOSbench.handle.sendline("""onos $OC1 topology-events-metrics|grep "Topology Link Events"|cut -d ' ' -f7 """) |
| 247 | main.ONOSbench.handle.expect(":~") |
| 248 | raw = (main.ONOSbench.handle.before).splitlines() |
| 249 | myresult = "--" |
| 250 | for word in raw: |
| 251 | if "m1" in word: |
| 252 | myresult = word |
| 253 | myresult = myresult.replace("m1=","") |
| 254 | break |
| 255 | if myresult == "--": |
| 256 | main.log.error("Parse error or no data error") |
| 257 | msg = ( "Node " + str(node) + " Link Event TP: " + str(myresult) ) |
| 258 | main.log.info( msg ) |
| 259 | linkResults[node] = round(float(myresult),2) |
| 260 | myLinkRate = round(float(myresult),2) |
| 261 | |
| 262 | main.ONOSbench.handle.sendline("""onos $OC1 topology-events-metrics|grep "Topology Graph Events"|cut -d ' ' -f7 """) |
| 263 | main.ONOSbench.handle.expect(":~") |
| 264 | raw = (main.ONOSbench.handle.before).splitlines() |
| 265 | myresult = "--" |
| 266 | for word in raw: |
| 267 | if "m1" in word: |
| 268 | myresult = word |
| 269 | myresult = myresult.replace("m1=","") |
| 270 | break |
| 271 | if myresult == "--": |
| 272 | main.log.error("Parse error or no data error") |
| 273 | msg = ( "Node " + str(node) + " Graph Event TP: " + str(myresult) ) |
| 274 | main.log.info( msg ) |
| 275 | graphResults[node] = round(float(myresult),2) |
| 276 | myGraphRate = round(float(myresult),2) |
| 277 | |
| 278 | difLinkGraph = float(myLinkRate - myGraphRate) |
| 279 | difLinkGraph = numpy.absolute(difLinkGraph) |
| 280 | main.log.info("Node " + str(node) + " abs(Link event - Graph event) = " + str(difLinkGraph)) |
| 281 | tempx = numpy.divide(difLinkGraph,float(myLinkRate)) |
| 282 | if tempx > sustainability: |
| 283 | main.log.error("Difference in link event rate and graph event rate above " + str(sustainability) + " tolerance") |
| 284 | print("") |
| 285 | |
| 286 | print("") |
| 287 | print("") |
| 288 | |
| 289 | main.log.report("Final Link Event TP Results on " + str(clusterCount) + " node cluster") |
| 290 | main.log.report("_______________________________________________") |
| 291 | for node in range(1, clusterCount+1): |
| 292 | main.log.report("Node " + str(node) + ": " + str(linkResults[node])) |
| 293 | |
| 294 | print("") |
| 295 | print("") |
| 296 | |
| 297 | main.log.report("Final Graph Event TP Results on " + str(clusterCount) + " node cluster") |
| 298 | main.log.report("_______________________________________________") |
| 299 | for node in range(1, clusterCount+1): |
| 300 | main.log.report("Node " + str(node) + ": " + str(graphResults[node])) |
| 301 | |
| 302 | ################################################################################# |
| 303 | # Data Logging |
| 304 | |
| 305 | logFileName = main.params[ 'TEST' ][ 'logFile' ] |
| 306 | logFile = open(logFileName, 'a') |
| 307 | main.log.info("Log file opened") |
| 308 | flickerRate = main.params[ 'TEST' ][ 'flickerRate'] |
| 309 | |
| 310 | for node in range (1, clusterCount + 1): |
| 311 | # replare -> logFile.write( str(clusterCount) + "," + flickerNodes + "," ) |
| 312 | logFile.write("'" + "baremetal" + str(node) + "'," ) |
| 313 | logFile.write( testDuration + "," ) |
| 314 | logFile.write( flickerRate + "," ) |
| 315 | logFile.write( str(linkResults[node]) + "," ) |
| 316 | logFile.write( str(graphResults[node]) + "\n" ) |
| 317 | |
| 318 | logFile.close() |
| 319 | main.log.info("Log file closed") |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |