Tests- stable versions
diff --git a/TestON/tests/flowTP1g/flowTP1g.params b/TestON/tests/flowTP1g/flowTP1g.params
index d3273ef..cbe2da5 100644
--- a/TestON/tests/flowTP1g/flowTP1g.params
+++ b/TestON/tests/flowTP1g/flowTP1g.params
@@ -1,9 +1,9 @@
<PARAMS>
- <testcases>1,2,1,2</testcases>
+ <testcases>1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2</testcases>
<isOnBaremetal>False</isOnBaremetal>
- <SCALE>3,3</SCALE>
+ <SCALE>1,3,3,5,5,7,7</SCALE>
<availableNodes>7</availableNodes>
@@ -14,12 +14,12 @@
</ENV>
<TEST>
- <enableFlowRuleStoreBackup>false</enableFlowRuleStoreBackup>
+ <enableFlowRuleStoreBackup>true</enableFlowRuleStoreBackup>
<skipCleanInstall>yes</skipCleanInstall>
- <warmUp>1</warmUp> #number of runs to warm up the system
- <sampleSize>1</sampleSize> #number of runs to take data from
+ <warmUp>5</warmUp> #number of runs to warm up the system
+ <sampleSize>20</sampleSize> #number of runs to take data from
<neighbors>0,a</neighbors> #list of number of neighbors, a = all
- <flows>3500</flows>
+ <flows>122500</flows>
<switches>35</switches>
<cooldown>10</cooldown>
<testCMD0>flow-tester.py -f</testCMD0> #base command
@@ -28,43 +28,43 @@
</TEST>
<GIT>
- <autopull>off</autopull>
+ <autopull>on</autopull>
<checkout>master</checkout>
</GIT>
<CTRL>
<USER>admin</USER>
- <ip1>10.128.5.51</ip1>
+ <ip1>10.254.1.201</ip1>
<port1>6633</port1>
- <ip2>10.128.5.52</ip2>
+ <ip2>10.254.1.202</ip2>
<port2>6633</port2>
- <ip3>10.128.5.53</ip3>
+ <ip3>10.254.1.203</ip3>
<port3>6633</port3>
- <ip4>10.128.5.54</ip4>
+ <ip4>10.254.1.204</ip4>
<port4>6633</port4>
- <ip5>10.128.5.65</ip5>
+ <ip5>10.254.1.205</ip5>
<port5>6633</port5>
- <ip6>10.128.5.66</ip6>
+ <ip6>10.254.1.206</ip6>
<port6>6633</port6>
- <ip7>10.128.5.67</ip7>
+ <ip7>10.254.1.207</ip7>
<port7>6633</port7>
</CTRL>
<MN>
- <ip1>10.128.5.55</ip1>
+ <ip1>10.254.1.200</ip1>
</MN>
<BENCH>
<user>admin</user>
- <ip1>10.128.5.55</ip1>
+ <ip1>10.254.1.200</ip1>
</BENCH>
<JSON>
diff --git a/TestON/tests/flowTP1g/flowTP1g.py b/TestON/tests/flowTP1g/flowTP1g.py
index 24fa8d6..3c92d7b 100644
--- a/TestON/tests/flowTP1g/flowTP1g.py
+++ b/TestON/tests/flowTP1g/flowTP1g.py
@@ -144,15 +144,15 @@
import datetime
import traceback
- global currentNeighbors
- try:
+ global currentNeighbors
+ try:
currentNeighbors
- except:
+ except:
currentNeighbors = "0"
- else:
+ else:
if currentNeighbors == "r": #reset
currentNeighbors = "0"
- else:
+ else:
currentNeighbors = "a"
testCMD = [ 0,0,0,0 ]
@@ -172,25 +172,21 @@
maxNodes = int(main.params[ 'availableNodes' ])
homeDir = os.path.expanduser('~')
flowRuleBackup = str(main.params[ 'TEST' ][ 'enableFlowRuleStoreBackup' ])
- print flowRuleBackup
-
+ main.log.info("Flow Rule Backup is set to:" + flowRuleBackup)
servers = str(clusterCount)
- #for i in range(0, len(neighborList)):
- # if neighborList[i] == 'a':
- # neighborList[i] = str(clusterCount - 1)
if clusterCount == 1:
neighborList = ['0']
currentNeighbors = "r"
- else:
- if currentNeighbors == "a":
+ else:
+ if currentNeighbors == "a":
neighborList = [str(clusterCount-1)]
- currentNeughbors = "r"
+ currentNeighbors = "r"
else:
- neighborList = ['0']
+ neighborList = ['0']
- #main.log.info("neightborlist: " + str(neighborList))
+ main.log.info("neightborlist: " + str(neighborList))
ts = time.time()
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
@@ -239,12 +235,17 @@
main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
main.ONOSbench.handle.expect(":~")
time.sleep(3)
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.store.flow.impl.DistributedFlowRuleStore backupEnabled """ + str(flowRuleBackup) + """ " """)
+ main.log.info("""onos $OC1 "cfg set org.onosproject.store.flow.impl.NewDistributedFlowRuleStore backupEnabled """ + flowRuleBackup + """" """)
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.store.flow.impl.NewDistributedFlowRuleStore backupEnabled """ + flowRuleBackup + """" """)
main.ONOSbench.handle.expect(":~")
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
check = main.ONOSbench.handle.before
+
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg get" """)
+ main.ONOSbench.handle.expect(":~")
+ check = main.ONOSbench.handle.before
main.log.info("\nStart up check: \n" + check + "\n")
#devide flows
@@ -322,8 +323,8 @@
data[test-warmUp] = result
# wait for flows = 0
- for checkCount in range(0,3):
- time.sleep(6)
+ for checkCount in range(0,5):
+ time.sleep(10)
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
flowCheck = main.ONOSbench.handle.before
diff --git a/TestON/tests/flowTP1g/flowTP1g.topo b/TestON/tests/flowTP1g/flowTP1g.topo
index 30a1467..0e45e0f 100644
--- a/TestON/tests/flowTP1g/flowTP1g.topo
+++ b/TestON/tests/flowTP1g/flowTP1g.topo
@@ -3,7 +3,7 @@
<COMPONENT>
<ONOSbench>
- <host>10.128.5.55</host>
+ <host>10.254.1.200</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosDriver</type>
@@ -12,7 +12,7 @@
</ONOSbench>
<ONOS1cli>
- <host>10.128.5.55</host>
+ <host>10.254.1.200</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -21,7 +21,7 @@
</ONOS1cli>
<ONOS2cli>
- <host>10.128.5.55</host>
+ <host>10.254.1.200</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -30,7 +30,7 @@
</ONOS2cli>
<ONOS3cli>
- <host>10.128.5.55</host>
+ <host>10.254.1.200</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -39,7 +39,7 @@
</ONOS3cli>
<ONOS4cli>
- <host>10.128.5.55</host>
+ <host>10.254.1.200</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -48,7 +48,7 @@
</ONOS4cli>
<ONOS5cli>
- <host>10.128.5.55</host>
+ <host>10.254.1.200</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -57,7 +57,7 @@
</ONOS5cli>
<ONOS6cli>
- <host>10.128.5.55</host>
+ <host>10.254.1.200</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -66,7 +66,7 @@
</ONOS6cli>
<ONOS7cli>
- <host>10.128.5.55</host>
+ <host>10.254.1.200</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -75,7 +75,7 @@
</ONOS7cli>
<ONOS1>
- <host>10.128.5.51</host>
+ <host>10.254.1.201</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -84,7 +84,7 @@
</ONOS1>
<ONOS2>
- <host>10.128.5.52</host>
+ <host>10.254.1.202</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -93,7 +93,7 @@
</ONOS2>
<ONOS3>
- <host>10.128.5.53</host>
+ <host>10.254.1.203</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -102,7 +102,7 @@
</ONOS3>
<ONOS4>
- <host>10.128.5.54</host>
+ <host>10.254.1.204</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -112,7 +112,7 @@
<ONOS5>
- <host>10.128.5.65</host>
+ <host>10.254.1.205</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -121,7 +121,7 @@
</ONOS5>
<ONOS6>
- <host>10.128.5.66</host>
+ <host>10.254.1.206</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -130,7 +130,7 @@
</ONOS6>
<ONOS7>
- <host>10.128.5.67</host>
+ <host>10.254.1.207</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
diff --git a/TestON/tests/flowTP1g/flowTP1gbackup b/TestON/tests/flowTP1g/flowTP1gbackup
deleted file mode 100644
index 4d319fb..0000000
--- a/TestON/tests/flowTP1g/flowTP1gbackup
+++ /dev/null
@@ -1,359 +0,0 @@
-# ScaleOutTemplate -> flowTP
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
-
-import sys
-import os.path
-
-
-class flowTP1g:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
-
- import time
- global init
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
- #Load values from params file
- checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
- gitPull = main.params[ 'GIT' ][ 'autopull' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- Apps = main.params[ 'ENV' ][ 'cellApps' ]
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- MN1Ip = main.params[ 'MN' ][ 'ip1' ]
- maxNodes = int(main.params[ 'availableNodes' ])
- skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
- init = True
- global clusterCount #number of nodes running
- global ONOSIp #list of ONOS IP addresses
- global scale
- global commit
-
- clusterCount = 0
- ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
- clusterCount = int(scale[0])
-
- #Populate ONOSIp with ips from params
- for i in range(1, maxNodes + 1):
- ipString = 'ip' + str(i)
- ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
-
- #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
- if skipMvn != "yes":
- mvnResult = main.ONOSbench.cleanInstall()
-
- #git
- main.step( "Git checkout and pull " + checkoutBranch )
- if gitPull == 'on':
- checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
- pullResult = main.ONOSbench.gitPull()
-
- else:
- checkoutResult = main.TRUE
- pullResult = main.TRUE
- main.log.info( "Skipped git checkout and pull" )
-
- commit = main.ONOSbench.getVersion()
- commit = (commit.split(" "))[1]
-
- resultsDB = open("flowTP1gDB", "w+")
- resultsDB.close()
-
- # -- END OF INIT SECTION --#
-
- clusterCount = int(scale[0])
- scale.remove(scale[0])
- main.log.info("CLUSTER COUNT: " + str(clusterCount))
-
- #kill off all onos processes
- main.log.step("Safety check, killing all ONOS processes")
- main.log.step("before initiating enviornment setup")
- for node in range(1, maxNodes + 1):
- main.ONOSbench.onosDie(ONOSIp[node])
-
- #Uninstall everywhere
- main.log.step( "Cleaning Enviornment..." )
- for i in range(1, maxNodes + 1):
- main.log.info(" Uninstalling ONOS " + str(i) )
- main.ONOSbench.onosUninstall( ONOSIp[i] )
-
- #construct the cell file
- main.log.info("Creating cell file")
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
-
- main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
- main.log.info("Cell Ip list: " + str(cellIp))
-
- main.step( "Set Cell" )
- main.ONOSbench.setCell(cellName)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "verify cells" )
- verifyCellResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
- for node in range(1, clusterCount + 1):
- main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
- main.ONOSbench.onosInstall( ONOSIp[node])
-
- for node in range(1, clusterCount + 1):
- for i in range( 2 ):
- isup = main.ONOSbench.isup( ONOSIp[node] )
- if isup:
- main.log.info("ONOS " + str(node) + " is up\n")
- break
- if not isup:
- main.log.report( "ONOS " + str(node) + " didn't start!" )
-
- for node in range(1, clusterCount + 1):
- exec "a = main.ONOS%scli.startOnosCli" %str(node)
- a(ONOSIp[node])
-
- main.log.info("Startup sequence complete")
-
-
- def CASE2( self, main ):
- #
- # This is the flow TP test
- #
- import os.path
- import numpy
- import math
- import time
- import datetime
- import traceback
-
- testCMD = [ 0,0,0,0 ]
- warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
- sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
- switches = int(main.params[ 'TEST' ][ 'switches' ])
- neighborList = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
- testCMD[0] = main.params[ 'TEST' ][ 'testCMD0' ]
- testCMD[1] = main.params[ 'TEST' ][ 'testCMD1' ]
- maxNodes = main.params[ 'availableNodes' ]
- onBaremetal = main.params['isOnBaremetal']
- cooldown = main.params[ 'TEST' ][ 'cooldown' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- MN1Ip = main.params[ 'MN' ][ 'ip1' ]
- maxNodes = int(main.params[ 'availableNodes' ])
- homeDir = os.path.expanduser('~')
-
- servers = str(clusterCount)
- for i in range(0, len(neighborList)):
- if neighborList[i] == 'a':
- neighborList[i] = str(clusterCount - 1)
-
- if clusterCount == 1:
- neighborList = ['0']
- main.log.info("neightborlist: " + str(neighborList))
-
- ts = time.time()
- st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
-
- #write file to change mem limit to 32 gigs (BAREMETAL ONLY!)
- if onBaremetal == "true":
- filename = "/onos/tools/package/bin/onos-service"
- serviceConfig = open(homeDir + filename, 'w+')
- serviceConfig.write("#!/bin/bash\n ")
- serviceConfig.write("#------------------------------------- \n ")
- serviceConfig.write("# Starts ONOS Apache Karaf container\n ")
- serviceConfig.write("#------------------------------------- \n ")
- serviceConfig.write("#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}\n ")
- serviceConfig.write("""export JAVA_OPTS="${JAVA_OPTS:--Xms8G -Xmx8G}" \n """)
- serviceConfig.write("")
- serviceConfig.write("ONOS_HOME=/opt/onos \n ")
- serviceConfig.write("")
- serviceConfig.write("[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..\n")
- serviceConfig.write("""${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@" \n """)
- serviceConfig.close()
-
- for n in neighborList:
- main.log.step("\tSTARTING TEST")
- main.log.step("\tLOADING FROM SERVERS: \t" + str(clusterCount) )
- main.log.step("\tNEIGHBORS:\t" + n )
- main.log.info("=============================================================")
- main.log.info("=============================================================")
- #write file to configure nil link
- ipCSV = ""
- for i in range (1, int(maxNodes) + 1):
- tempstr = "ip" + str(i)
- ipCSV += main.params[ 'CTRL' ][ tempstr ]
- if i < int(maxNodes):
- ipCSV +=","
-
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg setorg.onosproject.provider.nil.NullProviders enabled true" """)
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders deviceCount 35" """)
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders topoShape linear" """)
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("""onos $OC1 "null-simulation start" """)
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
- main.ONOSbench.handle.expect(":~")
-
- #devide flows
- flows = int(main.params[ 'TEST' ][ 'flows' ])
- main.log.info("Flow Target = " + str(flows))
-
- flows = (flows *max(int(n)+1,int(servers)))/((int(n) + 1)*int(servers)*(switches))
-
- main.log.info("Flows per switch = " + str(flows))
-
- #build list of servers in "$OC1, $OC2...." format
- serverEnvVars = ""
- for i in range (1,int(servers)+1):
- serverEnvVars += ("-s " + ONOSIp[i] + " ")
-
- data = [[""]*int(servers)]*int(sampleSize)
- maxes = [""]*int(sampleSize)
-
- for test in range(0, (warmUp + sampleSize)):
- flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
- flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1]
- flowCMD += " " + str(n) + " " + str(serverEnvVars)
- print("\n")
- main.log.info("COMMAND: " + flowCMD)
- main.log.info("Executing command")
-
- for i in range(0,15):
- main.ONOSbench.handle.sendline(flowCMD)
- time.sleep(5)
- main.ONOSbench.handle.expect(":~")
- rawResult = main.ONOSbench.handle.before
- if " -> " in rawResult:
- break
-
- result = [""]*(clusterCount)
- rawResult = rawResult.splitlines()
- print(rawResult)
- for node in range(1, clusterCount + 1):
- for line in rawResult:
- if ONOSIp[node] in line and " -> " in line:
- myLine = line.split(" ")
- for word in myLine:
- if "ms" in word:
- result[node-1] = int(word.replace("ms",""))
- main.log.info("Parsed result: " + str(result[node-1]))
- break
- break
-
- if test >= warmUp:
- for i in result:
- if i == "":
- main.log.error("Missing data point, critical failure incoming")
-
- print result
- maxes[test-warmUp] = max(result)
- main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize))
- main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")
-
- if test >= warmUp:
- data[test-warmUp] = result
-
- # wait for flows = 0
- removedFlows = False
- repeat = 0
- time.sleep(3)
- while ( removedFlows == False and repeat <= 10 ):
- main.ONOSbench.handle.sendline("onos $OC1 summary| cut -d ' ' -f6")
- main.ONOSbench.handle.expect("~")
- before = main.ONOSbench.handle.before
- parseTest = before.splitlines()
- flowsummary = ""
- for line in parseTest:
- if "flow" in str(line):
- flowsummary = line
- break
- currentflow = ""
- for word in flowsummary.split(" "):
- if "flow" in str(word):
- currentflow = str(word)
- currentflow = currentflow.replace(",","")
- currentflow = currentflow.replace("\n","")
- #main.log.info(currentflow)
-
- zeroFlow = "flows=0"
- if zeroFlow in before:
- removedFlows = True
- main.log.info("\t Wait " + cooldown + " sec of cool down...")
- time.sleep(int(cooldown))
-
- time.sleep(5)
- repeat +=1
-
- main.log.info("raw data: " + str(data))
- main.log.info("maxes:" + str(maxes))
-
-
- # report data
- print("")
- main.log.info("\t Results (measurments are in milliseconds)")
- print("")
-
- nodeString = ""
- for i in range(1, int(servers) + 1):
- nodeString += ("\tNode " + str(i))
-
- for test in range(0, sampleSize ):
- main.log.info("\t Test iteration " + str(test + 1) )
- main.log.info("\t------------------")
- main.log.info(nodeString)
- resultString = ""
-
- for i in range(0, int(servers) ):
- resultString += ("\t" + str(data[test][i]) )
- main.log.info(resultString)
-
- print("\n")
-
- avgOfMaxes = numpy.mean(maxes)
- main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes))
-
- stdOfMaxes = numpy.std(maxes)
- main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))
- print("\n\n")
-
- avgTP = int(main.params[ 'TEST' ][ 'flows' ]) / avgOfMaxes #result in kflows/second
-
- tp = []
- for i in maxes:
- tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i ))
-
- stdTP = numpy.std(tp)
-
- main.log.info("Average thoughput: " + str(avgTP) + " Kflows/second" )
- main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second")
-
- resultsLog = open("flowTP1gDB","a")
- resultString = ("'" + commit + "',")
- resultString += ("'1gig',")
- resultString += ((main.params[ 'TEST' ][ 'flows' ]) + ",")
- resultString += (str(clusterCount) + ",")
- resultString += (str(n) + ",")
- resultString += (str(avgTP) + "," + str(stdTP) + "\n")
- resultsLog.write(resultString)
- resultsLog.close()
-
- main.log.report("Result line to file: " + resultString)