Merge branch 'master' of https://github.com/opennetworkinglab/ONLabTest
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index ee3999a..7a74ab3 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -1858,7 +1858,7 @@
main.cleanup()
main.exit()
- def configNullLink( self,fileName="/opt/onos/apache-karaf-3.0.2/etc/linkGraph.cfg", eventRate=0):
+ def configNullLink( self,fileName="/opt/onos/apache-karaf-3.0.3/etc/linkGraph.cfg", eventRate=0):
'''
fileName default is currently the same as the default on ONOS, specify alternate file if
you want to use a different topology file than linkGraph.cfg
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.params b/TestON/tests/IntentEventTP/IntentEventTP.params
index 6ea5285..fb2e625 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.params
+++ b/TestON/tests/IntentEventTP/IntentEventTP.params
@@ -1,6 +1,6 @@
<PARAMS>
- <testcases>1,2</testcases>
+ <testcases>1,2,1,2</testcases>
<debugMode></debugMode> #nothing means false
@@ -53,7 +53,7 @@
<loadFrom>1,1,1,1,1,1,1</loadFrom> #generate load on server, 1 = generator on
<numSwitches>10,10,10,10,10,10,10</numSwitches>
<skipCleanInstall>yes</skipCleanInstall>
- <duration>15</duration>
+ <duration>30</duration>
<log_interval>20</log_interval>
<numKeys>5000</numKeys>
<cyclePeriod>1000</cyclePeriod>
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.py b/TestON/tests/IntentEventTP/IntentEventTP.py
index 9a6f938..0e8af7d 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.py
+++ b/TestON/tests/IntentEventTP/IntentEventTP.py
@@ -37,17 +37,13 @@
numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
- # ?? homeDir = os.path.expanduser('~')
- # ?? main.ONOSbench.handle.sendline("export TERM=vt100")
- # ?^ dump = main.ONOSbench.handle.expect(":~")
-
-
# -- 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 ]
@@ -74,6 +70,12 @@
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
+ commit = main.ONOSbench.getVersion()
+ commit = (commit.split(" "))[1]
+
+ resultsDB = open("IntentEventTPDB", "w+")
+ resultsDB.close()
+
# -- END OF INIT SECTION --#
clusterCount = int(scale[0])
@@ -106,7 +108,7 @@
for node in range (1, clusterCount + 1):
myDistribution.append(numSwitches[node-1])
- main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution)
+ #main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution)
main.step( "Creating ONOS package" )
packageResult = main.ONOSbench.onosPackage()
@@ -129,6 +131,28 @@
main.log.report( "ONOS " + str(node) + " didn't start!" )
main.log.info("Startup sequence complete")
+ time.sleep(20)
+
+ #main.ONOSbench.handle.sendline("""onos $OC1 "cfg setorg.onosproject.provider.nil.NullProviders enabled true" """)
+ #main.ONOSbench.handle.expect(":~")
+ #print main.ONOSbench.handle.before
+
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders deviceCount """ + str(clusterCount*10) + """ " """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ time.sleep(10)
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders topoShape linear" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ time.sleep(10)
+ main.ONOSbench.handle.sendline("""onos $OC1 "null-simulation start" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ time.sleep(10)
+ main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+
lastOutput = "--"
origin = time.time()
clockStarted = False
@@ -151,7 +175,6 @@
lastOutput = clusterCheck
time.sleep(5)
- main.ONOSbench.configNullDev(cellIp, myDistribution)
def CASE2( self, main ):
import time
@@ -176,8 +199,9 @@
for n in range(0, len(neighbors)):
if neighbors[n] == 'a':
neighbors[n] = str(clusterCount -1)
- print str(neighbors)
-
+ if int(clusterCount) == 1:
+ neighbors = neighbors.pop()
+
for n in neighbors:
main.log.info("Run with " + n + " neighbors")
time.sleep(5)
@@ -238,11 +262,28 @@
main.log.info("Node " + str(node) + " overall rate: " + str(myResult))
+ clusterTotal = str(numpy.sum(groupResult))
main.log.report("Results from this round of polling: " + str(groupResult))
- main.log.report("Cluster Total: " + str(numpy.sum(groupResult)) + "\n")
+ main.log.report("Cluster Total: " + clusterTotal + "\n")
cmd = "onos $OC1 intent-perf-stop"
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
main.log.info("Stopping intentperf" )
-
+
+ resultsDB = open("IntentEventTPDB", "a")
+ for node in groupResult:
+
+ resultString = "'" + commit + "',"
+ resultString += "'1gig',"
+ resultString += str(clusterCount) + ","
+ resultString += "'baremetal" + str(int(groupResult.index(node)) + 1) + "',"
+ resultString += n + ","
+ resultString += str(node) + ","
+ resultString += str(0) + "\n" #no stddev
+ resultsDB.write(resultString)
+
+ resultsDB.close()
+
+
+
diff --git a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py
index 6d0e2b3..be8f38c 100644
--- a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py
+++ b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py
@@ -42,7 +42,8 @@
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(",")
@@ -67,7 +68,13 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
+ commit = main.ONOSbench.getVersion()
+ commit = (commit.split(" "))[1]
+
+ resultsDB = open("IntentInstallWithdrawLatDB", "w+")
+ resultsDB.close()
+
# -- END OF INIT SECTION --#
clusterCount = int(scale[0])
@@ -96,8 +103,6 @@
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
- main.ONOSbench.createLinkGraphFile(BENCHIp, cellIp, switchCount)
-
main.step( "Creating ONOS package" )
packageResult = main.ONOSbench.onosPackage()
@@ -120,8 +125,24 @@
main.ONOS1cli.startOnosCli( ONOSIp[1] )
main.log.info("Startup sequence complete")
+
+ time.sleep(30)
- main.ONOSbench.configNullDev(cellIp, switchCount)
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg setorg.onosproject.provider.nil.NullProviders enabled true" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders deviceCount """ + str(switchCount) + """ " """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders topoShape linear" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ main.ONOSbench.handle.sendline("""onos $OC1 "null-simulation start" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
def CASE2( self, main ):
@@ -224,3 +245,13 @@
main.log.report("Withdraw standard deviation: " + str(numpy.std(withdrawn)))
main.log.report(" ")
+ resultString = "'" + commit + "',"
+ resultString += str(clusterCount) + ","
+ resultString += str(intentSize) + ","
+ resultString += str(numpy.mean(installed)) + ","
+ resultString += str(numpy.std(installed)) + ","
+ resultString += str(numpy.mean(withdrawn)) + ","
+ resultString += str(numpy.std(withdrawn)) + "\n"
+ resultsDB = open("IntentInstallWithdrawLatDB", "w+")
+ resultsDB.write(resultString)
+ resultsDB.close()
diff --git a/TestON/tests/IntentReroute/IntentReroute.params b/TestON/tests/IntentReroute/IntentReroute.params
deleted file mode 100644
index 4139613..0000000
--- a/TestON/tests/IntentReroute/IntentReroute.params
+++ /dev/null
@@ -1,78 +0,0 @@
-<PARAMS>
-
- <testcases>1,3,2,3,2,3,2,3</testcases>
-
- <SCALE>2</SCALE>
- <availableNodes>7</availableNodes>
-
- <ENV>
- <cellName>intentRerouteCell</cellName>
- <cellFeatures>webconsole,onos-core,onos-api,onos-cli,onos-null,onos-gui,onos-rest,onos-app-metrics,onos-app-metrics-intent,onos-app-metrics-topology </cellFeatures>
- <scale1switches>8,</scale1switches>
- <scale3switches>2,3,3</scale3switches>
- <scale5switches>2,3,1,1,1</scale5switches>
- <scale7switches>1,1,2,1,1,1,1</scale7switches>
-
- </ENV>
-
- <TEST>
- <skipCleanInstall>yes</skipCleanInstall>
- <warmUp>4</warmUp>
- <sampleSize>20</sampleSize>
- <wait></wait>
- <intents>1,100,1000,5000</intents> #list format, will be split on ','
- <debug>True</debug>
- </TEST>
-
- <METRICS>
- <Submitted>0</Submitted>
- <Installed>1</Installed>
- <Failed>0</Failed>
- <Withdraw>0</Withdraw>
- <Withdrawn>0</Withdrawn>
- </METRICS>
-
- <GIT>
- <autopull>on</autopull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <USER>admin</USER>
-
- <ip1>10.254.1.201</ip1>
- <port1>6633</port1>
-
- <ip2>10.254.1.202</ip2>
- <port2>6633</port2>
-
- <ip3>10.254.1.203</ip3>
- <port3>6633</port3>
-
- <ip4>10.254.1.204</ip4>
- <port4>6633</port4>
-
- <ip5>10.254.1.205</ip5>
- <port5>6633</port5>
-
- <ip6>10.254.1.206</ip6>
- <port6>6633</port6>
-
- <ip7>10.254.1.207</ip7>
- <port7>6633</port7>
-
- </CTRL>
-
- <MN>
- <ip1>10.254.1.200</ip1>
- </MN>
-
- <BENCH>
- <user>admin</user>
- <ip1>10.254.1.200</ip1>
- </BENCH>
-
- <JSON>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/IntentReroute/IntentReroute.py b/TestON/tests/IntentReroute/IntentReroute.py
deleted file mode 100644
index 4a778f8..0000000
--- a/TestON/tests/IntentReroute/IntentReroute.py
+++ /dev/null
@@ -1,468 +0,0 @@
-# ScaleOutTemplate - IntentReroute
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
-
-import sys
-import os.path
-
-
-class IntentReroute:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ): #This is the initialization case
- #this case will clean up all nodes
- import time #but only node 1 is started in this case
- import os.path
-
- global clusterCount #number of nodes running
- global ONOSIp #list of ONOS IP addresses
- clusterCount = 1
- ONOSIp = [ 0 ]
-
-
- #Load values from params file
- checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
- gitPull = main.params[ 'GIT' ][ 'autopull' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- Features= main.params[ 'ENV' ][ 'cellFeatures' ]
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- MN1Ip = main.params[ 'MN' ][ 'ip1' ]
- maxNodes = int(main.params[ 'availableNodes' ])
- Features = main.params[ 'ENV' ][ 'cellFeatures' ]
- skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- switchCount = (main.params[ 'ENV' ][ 'scale1switches' ]).split(",")
- homeDir = os.path.expanduser('~')
-
- #Populate ONOSIp with ips from params
- for i in range(1, maxNodes + 1):
- ipString = 'ip' + str(i)
- ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
-
- tempIp = []
- for node in range( 1, clusterCount + 1):
- tempIp.append(ONOSIp[node])
-
- #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])
-
- #construct the cell file
- main.log.info("Creating cell file")
- exec "a = main.ONOSbench.createCellFile"
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
- a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
-
- main.step( "Applying cell file to environment" )
- cellApplyResult = main.ONOSbench.setCell( cellName )
-
- #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] )
-
- #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" )
-
- main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/oneNode7linear.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/oneNode7linearCut.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.expect(":~")
-
- main.ONOSbench.createNullDevProviderFile(BENCHIp, tempIp, switchCount)
- main.ONOSbench.createNullLinkProviderFile(BENCHIp, fileName=("/opt/onos/apache-karaf-3.0.2/etc/oneNode7linear.cfg"))
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] )
-
- main.step( "verify cells" )
- verifyCellResult = main.ONOSbench.verifyCell()
-
- main.step( "Set cell for ONOS cli env" )
- cli1 = main.ONOS1cli.startOnosCli( ONOSIp[1] )
-
-
- def CASE2( self, main ):
- # This case increases the cluster size by whatever scale is
- # Note: 'scale' is the size of the step
- # if scaling is not a part of your test, simply run this case
- # once after CASE1 to set up your enviornment for your desired
- # cluster size. If scaling is a part of you test call this case each time
- # you want to increase cluster size
-
- ''
- 'Increase number of nodes and initiate CLI'
- ''
- import time
- global clusterCount
-
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- scale = int( main.params[ 'SCALE' ] )
- clusterCount += scale
- homeDir = os.path.expanduser('~')
- switchParams = ("scale" + str(clusterCount) + "switches")
- switchCount = (main.params[ 'ENV' ][ switchParams ]).split(",")
-
- if clusterCount == 1:
- temp = "one"
- if clusterCount == 3:
- temp = "three"
- if clusterCount == 5:
- temp = "five"
- if clusterCount == 7:
- temp = "seven"
-
- lgfile = temp + "Node7linear.cfg"
- main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/" + lgfile + " ~/onos/tools/package/etc/")
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/" + temp + "Node7linearCut.cfg" + " ~/onos/tools/package/etc/")
- main.ONOSbench.handle.expect(":~")
-
- main.log.info("Creating cell file")
- exec "a = main.ONOSbench.createCellFile"
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
- a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
-
- main.step( "Applying cell file to environment" )
- cellApplyResult = main.ONOSbench.setCell( cellName )
-
- #Uninstall everywhere
- main.log.step( "Cleaning Enviornment..." )
- for node in range(1, maxNodes + 1):
- main.ONOSbench.onosDie(ONOSIp[node])
- main.log.info(" Uninstalling ONOS " + str(node) )
- main.ONOSbench.onosUninstall( ONOSIp[node] )
-
- tempIp = []
- for node in range( 1, clusterCount + 1):
- tempIp.append(ONOSIp[node])
-
- main.ONOSbench.createNullDevProviderFile(BENCHIp, tempIp, switchCount)
- main.ONOSbench.createNullLinkProviderFile(BENCHIp, fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfile))
-
- main.ONOSbench.onosPackage()
-
-
- main.log.report( "Increasing cluster size to " + str( clusterCount ) )
- for node in range(1, clusterCount + 1):
- main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
- main.ONOSbench.onosInstall( node=ONOSIp[node])
- if node == 1:
- main.ONOS1cli.startOnosCli( ONOSIp[1] )
-
- 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!" )
-
- def CASE3( self, main ):
-
- import time
- import numpy
- import datetime
- #from scipy import stats
-
- ts = time.time()
- date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d')
-
- sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
- warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
- intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
- debug = main.params[ 'TEST' ][ 'debug' ]
- for i in range(0,len(intentsList)):
- intentsList[i] = int(intentsList[i])
-
- timestampMetrics = []
- if main.params['METRICS']['Submitted'] == "1":
- timestampMetrics.append("Submitted")
- if main.params['METRICS']['Installed'] == "1":
- timestampMetrics.append("Installed")
- if main.params['METRICS']['Failed'] == "1":
- timestampMetrics.append("Failed")
- if main.params['METRICS']['Withdraw'] == "1":
- timestampMetrics.append("Withdraw")
- if main.params['METRICS']['Withdrawn'] == "1":
- timestampMetrics.append("Withdrawn")
- if debug: main.log.info(timestampMetrics)
-
- if debug == "True":
- debug = True
- else:
- debug = False
-
- if clusterCount == 1:
- temp = "one"
- if clusterCount == 3:
- temp = "three"
- if clusterCount == 5:
- temp = "five"
- if clusterCount == 7:
- temp = "seven"
-
- lgfile = temp + "Node7linear.cfg"
- lgfileCut = temp + "Node7linearCut.cfg"
- linkCount = 0
-
- for i in range(0,15):
- main.ONOSbench.handle.sendline("onos $OC1 links|wc -l")
- main.ONOSbench.handle.expect(":~")
- linkCount = main.ONOSbench.handle.before
- if debug: main.log.info("Link Count check: " + linkCount)
- if str(16) in linkCount:
- break
- time.sleep(3)
- main.log.info("waiting for links")
-
- links = "--"
- while "=null:" not in links:
- if debug: main.log.info("top of loop")
- main.ONOSbench.handle.sendline("onos $OC1 links")
- main.ONOSbench.handle.expect(":~")
- links = main.ONOSbench.handle.before
- if debug: main.log.info(str(links))
- time.sleep(1)
- links = links.splitlines()
- templinks = links
-
- tempDevices = []
- for line in links:
- temp = line.split(" ")
- temp[0].replace("src=","")
- temp[0] = (temp[0].split("/"))[0]
- tempDevices.append(temp[0])
-
- tempDevices.sort()
- devices = []
- for i in tempDevices:
- if "src=null" in i:
- devices.append(i.replace("src=", ""))
- if debug: main.log.info(str(devices))
-
- ingress = devices[0]
- egress = devices.pop()
- if debug: main.log.info("ingress: " + ingress)
- if debug: main.log.info("egress: " + egress)
-
-
- for intents in intentsList:
- main.log.report("Intent Batch size: " + str(intents) + "\n ")
- myResult = [["latency", "lastNode"] for x in range(sampleSize)]
-
- for run in range(0, (warmUp + sampleSize)):
- if run > warmUp:
- main.log.info("Starting test iteration " + str(run-warmUp))
-
- cmd = """onos $OC1 "push-test-intents -i """
- cmd += ingress + "/0 "
- cmd += egress + "/0 "
- cmd += str(intents) +""" 1" """
- if debug: main.log.info(cmd)
-
- withdrawCmd = cmd.replace("intents -i", "intents -w ")
-
- #push-test-intents
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- myRawResult = main.ONOSbench.handle.before
-
- for i in range(0, 40):
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- linkCheck = main.ONOSbench.handle.before
- if ("flows=" + str(8*intents) + ",") in linkCheck:
- break
- if i == 39:
- main.log.error("Flow count incorrect, data invalid.")
-
- #cut link
- nodesLinksCut = []
- if clusterCount == 1:
- nodesLinksCut.append(1)
- if clusterCount == 3 or clusterCount == 5:
- nodesLinksCut.append(2)
- if clusterCount == 7:
- nodesLinksCut.append(3)
- nodesLinksCut.append(4)
-
- for node in nodesLinksCut:
- exec "a = main.ONOS%s.createNullLinkProviderFile" %str(node)
- a(ONOSIp[node], fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfileCut), onNode=True)
-
- #collect timestamp from link cut
- cmd = "onos-ssh $OC" + str(nodesLinksCut[len(nodesLinksCut)-1]) + " cat /opt/onos/log/karaf.log | grep " + lgfileCut + "| tail -1"
- if debug: main.log.info("COMMAND: " + str(cmd))
-
- for i in range(0,10):
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- raw = main.ONOSbench.handle.before
- if "NullLinkProvider" in raw:
- break
- if i >= 9:
- main.log.error("Expected output not being recieved... continuing")
- main.log.info(raw)
- break
- time.sleep(2)
-
- temp = raw.splitlines()
- for line in temp:
- if str(date) in line:
- temp = line
- break
-
- cutTimestamp = (temp.split(" "))[0] + " " + (temp.split(" "))[1]
-
- #validate link count and flow count
- for i in range(0, 40):
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- linkCheck = main.ONOSbench.handle.before
- if "links=14," in linkCheck and ("flows=" + str(7*intents) + ",") in linkCheck:
- break
- if i == 39:
- main.log.error("Link or flow count incorrect, data invalid.")
-
- #intents events metrics installed timestamp
- IEMtimestamps = [0]*(clusterCount + 1)
- installedTemp = [0]*(clusterCount + 1)
- for node in range(1, clusterCount +1):
- cmd = "onos $OC" + str(node) + " intents-events-metrics|grep Timestamp"
- raw = ""
- while "Timestamp" not in raw:
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- raw = main.ONOSbench.handle.before
-
- intentsTimestamps = {}
- rawTimestamps = raw.splitlines()
- for line in rawTimestamps:
- if "Timestamp" in line and "grep" not in line:
- metricKey = (line.split(" "))[1]
- metricTimestamp = (line.split(" ")[len(line.split(" ")) -1]).replace("epoch)=","")
- metricTimestamp = float(metricTimestamp)
- metricTimestamp = numpy.divide(metricTimestamp, 1000)
- if debug: main.log.info(repr(metricTimestamp))
- intentsTimestamps[metricKey] = metricTimestamp
- if metricKey == "Installed":
- installedTemp[node] = metricTimestamp
-
- main.log.info("Node: " + str(node) + " Timestamps: " + str(intentsTimestamps))
- IEMtimestamps[node] = intentsTimestamps
-
- myMax = max(installedTemp)
- indexOfMax = installedTemp.index(myMax)
-
- #number crunch
- for metric in timestampMetrics: #this is where we sould add support for computing other timestamp metrics
- if metric == "Installed":
- if run >= warmUp:
- main.log.report("link cut timestamp: " + cutTimestamp)
- #readableInstalledTimestamp = str(intentsTimestamps["Installed"])
- readableInstalledTimestamp = str(myMax)
-
- #main.log.report("Intent Installed timestamp: " + str(intentsTimestamps["Installed"]))
- main.log.report("Intent Installed timestamp: " + str(myMax))
-
- cutEpoch = time.mktime(time.strptime(cutTimestamp, "%Y-%m-%d %H:%M:%S,%f"))
- if debug: main.log.info("cutEpoch=" + str(cutEpoch))
- #rerouteLatency = float(intentsTimestamps["Installed"] - cutEpoch)
- rerouteLatency = float(myMax - cutEpoch)
-
- rerouteLatency = numpy.divide(rerouteLatency, 1000)
- main.log.report("Reroute latency:" + str(rerouteLatency) + " (seconds)\n ")
- myResult[run-warmUp][0] = rerouteLatency
- myResult[run-warmUp][1] = indexOfMax
- if debug: main.log.info("Latency: " + str(myResult[run-warmUp][0]))
- if debug: main.log.info("last node: " + str(myResult[run-warmUp][1]))
-
- #time.sleep(12)
-
- #reset
- for node in nodesLinksCut:
- exec "a = main.ONOS%s.createNullLinkProviderFile" %str(node)
- a(ONOSIp[node], fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfile), onNode=True)
-
- #wait for intent withdraw
- if debug: main.log.info(withdrawCmd)
- main.ONOSbench.handle.sendline(withdrawCmd)
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("onos $OC1 intents|grep WITHDRAWN|wc -l")
- main.ONOSbench.handle.expect(":~")
- intentWithdrawCheck = main.ONOSbench.handle.before
- if (str(intents)) in intentWithdrawCheck:
- main.log.info("intents withdrawn")
- if debug: main.log.info(intentWithdrawCheck)
-
- # wait for links to be reestablished
- for i in range(0, 10):
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- linkCheck = main.ONOSbench.handle.before
- if "links=16," in linkCheck:
- break
- time.sleep(1)
- if i == 9:
- main.log.info("Links Failed to reconnect, next iteration of data invalid.")
-
- if run < warmUp:
- main.log.info("Warm up run " + str(run+1) + " completed")
-
- if debug: main.log.info(myResult)
- latTemp = []
- nodeTemp = []
- for i in myResult:
- latTemp.append(i[0])
- nodeTemp.append(i[1])
-
- mode = {}
- for i in nodeTemp:
- if i in mode:
- mode[i] += 1
- else:
- mode[i] = 1
-
- for i in mode.keys():
- if mode[i] == max(mode.values()):
- nodeMode = i
-
- average = numpy.average(latTemp)
- stdDev = numpy.std(latTemp)
-
- main.log.report("Scale: " + str(clusterCount) + " \tIntent batch: " + str(intents))
- main.log.report("Latency average:................" + str(average))
- main.log.report("Latency standard deviation:....." + str(stdDev))
- main.log.report("Mode of last node to respond:..." + str(nodeMode))
- main.log.report("________________________________________________________")
-
-
-
diff --git a/TestON/tests/IntentReroute/IntentReroute.topo b/TestON/tests/IntentReroute/IntentReroute.topo
deleted file mode 100644
index 0e45e0f..0000000
--- a/TestON/tests/IntentReroute/IntentReroute.topo
+++ /dev/null
@@ -1,146 +0,0 @@
-<TOPOLOGY>
-
- <COMPONENT>
-
- <ONOSbench>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS><home>~/onos</home></COMPONENTS>
- </ONOSbench>
-
- <ONOS1cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <ONOS4cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4cli>
-
- <ONOS5cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5cli>
-
- <ONOS6cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6cli>
-
- <ONOS7cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7cli>
-
- <ONOS1>
- <host>10.254.1.201</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.254.1.202</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.254.1.203</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.254.1.204</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
-
- <ONOS5>
- <host>10.254.1.205</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.254.1.206</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.254.1.207</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- </COMPONENT>
-
-</TOPOLOGY>
-
-
-
diff --git a/TestON/tests/IntentReroute/__init__.py b/TestON/tests/IntentReroute/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/IntentReroute/__init__.py
+++ /dev/null
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.params b/TestON/tests/IntentRerouteLat/IntentRerouteLat.params
index 4139613..27af1f2 100644
--- a/TestON/tests/IntentRerouteLat/IntentRerouteLat.params
+++ b/TestON/tests/IntentRerouteLat/IntentRerouteLat.params
@@ -1,26 +1,26 @@
<PARAMS>
- <testcases>1,3,2,3,2,3,2,3</testcases>
+ <testcases>1,2</testcases>
- <SCALE>2</SCALE>
+ <SCALE>1</SCALE>
<availableNodes>7</availableNodes>
<ENV>
<cellName>intentRerouteCell</cellName>
- <cellFeatures>webconsole,onos-core,onos-api,onos-cli,onos-null,onos-gui,onos-rest,onos-app-metrics,onos-app-metrics-intent,onos-app-metrics-topology </cellFeatures>
- <scale1switches>8,</scale1switches>
- <scale3switches>2,3,3</scale3switches>
- <scale5switches>2,3,1,1,1</scale5switches>
- <scale7switches>1,1,2,1,1,1,1</scale7switches>
+ <cellApps>null,intentperf,metrics</cellApps>
+ <scale1switches>8</scale1switches>
+ <scale3switches>2,2,3</scale3switches>
+ <scale5switches>2,2,1,1,1</scale5switches>
+ <scale7switches>1,1,1,1,1,1,1</scale7switches>
</ENV>
<TEST>
<skipCleanInstall>yes</skipCleanInstall>
- <warmUp>4</warmUp>
- <sampleSize>20</sampleSize>
+ <warmUp>1</warmUp>
+ <sampleSize>2</sampleSize>
<wait></wait>
- <intents>1,100,1000,5000</intents> #list format, will be split on ','
+ <intents>1,10</intents> #list format, will be split on ','
<debug>True</debug>
</TEST>
@@ -40,36 +40,36 @@
<CTRL>
<USER>admin</USER>
- <ip1>10.254.1.201</ip1>
+ <ip1>10.128.5.51</ip1>
<port1>6633</port1>
- <ip2>10.254.1.202</ip2>
+ <ip2>10.128.5.52</ip2>
<port2>6633</port2>
- <ip3>10.254.1.203</ip3>
+ <ip3>10.128.5.53</ip3>
<port3>6633</port3>
- <ip4>10.254.1.204</ip4>
+ <ip4>10.128.5.54</ip4>
<port4>6633</port4>
- <ip5>10.254.1.205</ip5>
+ <ip5>10.128.5.65</ip5>
<port5>6633</port5>
- <ip6>10.254.1.206</ip6>
+ <ip6>10.128.5.66</ip6>
<port6>6633</port6>
- <ip7>10.254.1.207</ip7>
+ <ip7>10.128.5.67</ip7>
<port7>6633</port7>
</CTRL>
<MN>
- <ip1>10.254.1.200</ip1>
+ <ip1>10.128.5.55</ip1>
</MN>
<BENCH>
<user>admin</user>
- <ip1>10.254.1.200</ip1>
+ <ip1>10.128.5.55</ip1>
</BENCH>
<JSON>
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.py b/TestON/tests/IntentRerouteLat/IntentRerouteLat.py
index 7198108..84d5c03 100644
--- a/TestON/tests/IntentRerouteLat/IntentRerouteLat.py
+++ b/TestON/tests/IntentRerouteLat/IntentRerouteLat.py
@@ -1,4 +1,4 @@
-# ScaleOutTemplate - IntentReroute
+# ScaleOutTemplate
#
# CASE1 starts number of nodes specified in param file
#
@@ -13,67 +13,50 @@
def __init__( self ):
self.default = ''
- def CASE1( self, main ): #This is the initialization case
- #this case will clean up all nodes
- import time #but only node 1 is started in this case
- import os.path
-
- global clusterCount #number of nodes running
- global ONOSIp #list of ONOS IP addresses
- clusterCount = 1
- ONOSIp = [ 0 ]
-
-
+ 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' ]
- Features= main.params[ 'ENV' ][ 'cellFeatures' ]
+ 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' ])
- Features = main.params[ 'ENV' ][ 'cellFeatures' ]
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- switchCount = (main.params[ 'ENV' ][ 'scale1switches' ]).split(",")
- homeDir = os.path.expanduser('~')
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
- #Populate ONOSIp with ips from params
- for i in range(1, maxNodes + 1):
- ipString = 'ip' + str(i)
- ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
-
- tempIp = []
- for node in range( 1, clusterCount + 1):
- tempIp.append(ONOSIp[node])
+ # -- 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
- #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])
+ clusterCount = 0
+ ONOSIp = [ 0 ]
+ scale = (main.params[ 'SCALE' ]).split(",")
+ clusterCount = int(scale[0])
- #construct the cell file
- main.log.info("Creating cell file")
- exec "a = main.ONOSbench.createCellFile"
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
- a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
+ #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()
- main.step( "Applying cell file to environment" )
- cellApplyResult = main.ONOSbench.setCell( cellName )
-
- #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] )
-
- #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':
@@ -84,142 +67,44 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
- main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/oneNode7linear.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/oneNode7linearCut.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.expect(":~")
+
+ commit = main.ONOSbench.getVersion()
+ commit = (commit.split(" "))[1]
- main.ONOSbench.createNullDevProviderFile(BENCHIp, tempIp, switchCount)
- main.ONOSbench.createNullLinkProviderFile(BENCHIp, fileName=("/opt/onos/apache-karaf-3.0.2/etc/oneNode7linear.cfg"))
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ resultsDB = open("IntentRerouteLatDB", "w+")
+ resultsDB.close()
- main.step( "Installing ONOS package" )
- install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] )
-
- main.step( "verify cells" )
- verifyCellResult = main.ONOSbench.verifyCell()
-
- main.step( "Set cell for ONOS cli env" )
- cli1 = main.ONOS1cli.startOnosCli( ONOSIp[1] )
-
-
- def CASE2( self, main ):
- # This case increases the cluster size by whatever scale is
- # Note: 'scale' is the size of the step
- # if scaling is not a part of your test, simply run this case
- # once after CASE1 to set up your enviornment for your desired
- # cluster size. If scaling is a part of you test call this case each time
- # you want to increase cluster size
-
- ''
- 'Increase number of nodes and initiate CLI'
- ''
- import time
- global clusterCount
-
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- scale = int( main.params[ 'SCALE' ] )
- clusterCount += scale
- homeDir = os.path.expanduser('~')
+ # -- END OF INIT SECTION --#
+
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
switchParams = ("scale" + str(clusterCount) + "switches")
- switchCount = (main.params[ 'ENV' ][ switchParams ]).split(",")
+ switchCount = (main.params[ 'ENV' ][ switchParams ]).split(",")
- if clusterCount == 1:
- temp = "one"
- if clusterCount == 3:
- temp = "three"
- if clusterCount == 5:
- temp = "five"
- if clusterCount == 7:
- temp = "seven"
-
- lgfile = temp + "Node7linear.cfg"
- main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/" + lgfile + " ~/onos/tools/package/etc/")
- main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/" + temp + "Node7linearCut.cfg" + " ~/onos/tools/package/etc/")
- main.ONOSbench.handle.expect(":~")
+ #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")
- exec "a = main.ONOSbench.createCellFile"
cellIp = []
for node in range (1, clusterCount + 1):
cellIp.append(ONOSIp[node])
- a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
-
- main.step( "Applying cell file to environment" )
- cellApplyResult = main.ONOSbench.setCell( cellName )
- #Uninstall everywhere
- main.log.step( "Cleaning Enviornment..." )
- for node in range(1, maxNodes + 1):
- main.ONOSbench.onosDie(ONOSIp[node])
- main.log.info(" Uninstalling ONOS " + str(node) )
- main.ONOSbench.onosUninstall( ONOSIp[node] )
+ main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
- tempIp = []
- for node in range( 1, clusterCount + 1):
- tempIp.append(ONOSIp[node])
-
- main.ONOSbench.createNullDevProviderFile(BENCHIp, tempIp, switchCount)
- main.ONOSbench.createNullLinkProviderFile(BENCHIp, fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfile))
-
- main.ONOSbench.onosPackage()
+ main.step( "Set Cell" )
+ main.ONOSbench.setCell(cellName)
-
- main.log.report( "Increasing cluster size to " + str( clusterCount ) )
- for node in range(1, clusterCount + 1):
- main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
- main.ONOSbench.onosInstall( node=ONOSIp[node])
- if node == 1:
- main.ONOS1cli.startOnosCli( ONOSIp[1] )
-
- 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!" )
-
- def CASE3( self, main ):
-
- import time
- import numpy
- import datetime
- #from scipy import stats
-
- ts = time.time()
- date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d')
-
- sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
- warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
- intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
- debug = main.params[ 'TEST' ][ 'debug' ]
- for i in range(0,len(intentsList)):
- intentsList[i] = int(intentsList[i])
-
- timestampMetrics = []
- if main.params['METRICS']['Submitted'] == "1":
- timestampMetrics.append("Submitted")
- if main.params['METRICS']['Installed'] == "1":
- timestampMetrics.append("Installed")
- if main.params['METRICS']['Failed'] == "1":
- timestampMetrics.append("Failed")
- if main.params['METRICS']['Withdraw'] == "1":
- timestampMetrics.append("Withdraw")
- if main.params['METRICS']['Withdrawn'] == "1":
- timestampMetrics.append("Withdrawn")
- if debug: main.log.info(timestampMetrics)
-
- if debug == "True":
- debug = True
- else:
- debug = False
-
if clusterCount == 1:
temp = "one"
if clusterCount == 3:
@@ -229,144 +114,204 @@
if clusterCount == 7:
temp = "seven"
- lgfile = temp + "Node7linear.cfg"
- lgfileCut = temp + "Node7linearCut.cfg"
- linkCount = 0
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
- for i in range(0,15):
- main.ONOSbench.handle.sendline("onos $OC1 links|wc -l")
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
+
+ main.log.report( "Initializing " + 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!" )
+ main.log.info("Startup sequence complete")
+
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders deviceCount 8 " """)
+ main.ONOSbench.handle.expect(":~")
+ print repr(main.ONOSbench.handle.before)
+ time.sleep(3)
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders topoShape reroute" """)
+ main.ONOSbench.handle.expect(":~")
+ print repr(main.ONOSbench.handle.before)
+ time.sleep(3)
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders enabled true" """)
+ main.ONOSbench.handle.expect(":~")
+ print repr(main.ONOSbench.handle.before)
+
+ while True:
+ main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
- linkCount = main.ONOSbench.handle.before
- if debug: main.log.info("Link Count check: " + linkCount)
- if str(16) in linkCount:
+ x = main.ONOSbench.handle.before
+ if "devices=8" in x:
break
- time.sleep(3)
- main.log.info("waiting for links")
+ else:
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders enabled false" """)
+ main.ONOSbench.handle.expect(":~")
+ time.sleep(3)
+ main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders enabled true" """)
+ main.ONOSbench.handle.expect(":~")
+ main.log.error("Null provider start failed, retrying..")
+ time.sleep(8)
- links = "--"
- while "=null:" not in links:
- if debug: main.log.info("top of loop")
- main.ONOSbench.handle.sendline("onos $OC1 links")
- main.ONOSbench.handle.expect(":~")
- links = main.ONOSbench.handle.before
- if debug: main.log.info(str(links))
- time.sleep(1)
- links = links.splitlines()
- templinks = links
+ main.ONOSbench.handle.sendline("""onos $OC1 "null-simulation start" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ time.sleep(10)
+ main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
+ main.ONOSbench.handle.expect(":~")
+
+ temp = 1
+ for node in range(1, clusterCount + 1):
+ for switch in range (0, int(switchCount[node-1])):
+ cmd = ("""onos $OC1 "device-role null:000000000000000""" + str(temp) + " " + ONOSIp[node] + """ master" """)
+ main.ONOSbench.handle.sendline(cmd)
+ main.log.info( cmd )
+ main.ONOSbench.handle.expect(":~")
+ temp += 1
- tempDevices = []
- for line in links:
- temp = line.split(" ")
- temp[0].replace("src=","")
- temp[0] = (temp[0].split("/"))[0]
- tempDevices.append(temp[0])
- tempDevices.sort()
- devices = []
- for i in tempDevices:
- if "src=null" in i:
- devices.append(i.replace("src=", ""))
- if debug: main.log.info(str(devices))
+ # cmd = ( """onos $OC1 "device-role null:0000000000000008 10.128.5.52 master" """)
+ #if clusterCount == 7:
+ # cmd = ( """onos $OC1 "device-role null:0000000000000008 10.128.5.53 master" """)
+
+ #main.ONOSbench.handle.sendline(cmd)
+ #main.log.info( cmd )
+ #main.ONOSbench.handle.expect(":~")
- ingress = devices[0]
- egress = devices.pop()
- if debug: main.log.info("ingress: " + ingress)
- if debug: main.log.info("egress: " + egress)
+ #print "sleeping"
+ #time.sleep(120)
+ def CASE2( self, main ):
+
+ import time
+ import numpy
+ import datetime
+ #from scipy import stats
+
+ ts = time.time()
+ date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d')
+
+ sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
+ warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
+ intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
+ debug = main.params[ 'TEST' ][ 'debug' ]
+ for i in range(0,len(intentsList)):
+ intentsList[i] = int(intentsList[i])
+
+ timestampMetrics = []
+ if main.params['METRICS']['Submitted'] == "1":
+ timestampMetrics.append("Submitted")
+ if main.params['METRICS']['Installed'] == "1":
+ timestampMetrics.append("Installed")
+ if main.params['METRICS']['Failed'] == "1":
+ timestampMetrics.append("Failed")
+ if main.params['METRICS']['Withdraw'] == "1":
+ timestampMetrics.append("Withdraw")
+ if main.params['METRICS']['Withdrawn'] == "1":
+ timestampMetrics.append("Withdrawn")
+ if debug: main.log.info(timestampMetrics)
+
+ if debug == "True":
+ debug = True
+ else:
+ debug = False
+
+ ingress = "null:0000000000000001"
+ egress = "null:0000000000000008"
for intents in intentsList:
- main.log.report("Intent Batch size: " + str(intents) + "\n ")
+ main.log.report("Intent Batch size: " + str(intents) + "\n ")
myResult = [["latency", "lastNode"] for x in range(sampleSize)]
-
- for run in range(0, (warmUp + sampleSize)):
- if run > warmUp:
- main.log.info("Starting test iteration " + str(run-warmUp))
- cmd = """onos $OC1 "push-test-intents -i """
+ for run in range(0, (warmUp + sampleSize)):
+ if run > warmUp:
+ main.log.info("Starting test iteration " + str(run-warmUp))
+
+ cmd = """onos $OC1 push-test-intents -i" """
cmd += ingress + "/0 "
cmd += egress + "/0 "
cmd += str(intents) +""" 1" """
if debug: main.log.info(cmd)
withdrawCmd = cmd.replace("intents -i", "intents -w ")
-
- #push-test-intents
+
+ #push-test-intents
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
myRawResult = main.ONOSbench.handle.before
-
+
for i in range(0, 40):
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
linkCheck = main.ONOSbench.handle.before
- if ("flows=" + str(8*intents) + ",") in linkCheck:
+ if ("flows=16,") in linkCheck:
break
if i == 39:
- main.log.error("Flow count incorrect, data invalid.")
+ main.log.error("Flow count incorrect, data invalid."+ linkCheck)
- #cut link
- nodesLinksCut = []
- if clusterCount == 1:
- nodesLinksCut.append(1)
- if clusterCount == 3 or clusterCount == 5:
- nodesLinksCut.append(2)
- if clusterCount == 7:
- nodesLinksCut.append(3)
- nodesLinksCut.append(4)
- for node in nodesLinksCut:
- exec "a = main.ONOS%s.createNullLinkProviderFile" %str(node)
- a(ONOSIp[node], fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfileCut), onNode=True)
-
- #collect timestamp from link cut
- cmd = "onos-ssh $OC" + str(nodesLinksCut[len(nodesLinksCut)-1]) + " cat /opt/onos/log/karaf.log | grep " + lgfileCut + "| tail -1"
+ #collect timestamp from link cut
+ cmd = """onos $OC1 null-link "null:0000000000000004/1 null:0000000000000003/2 down" """
if debug: main.log.info("COMMAND: " + str(cmd))
-
+ main.ONOSbench.handle.sendline(cmd)
+
+ cmd = "onos-ssh $OC1 cat /opt/onos/log/karaf.log | grep TopologyManager| tail -1"
for i in range(0,10):
main.ONOSbench.handle.sendline(cmd)
+ time.sleep(2)
main.ONOSbench.handle.expect(":~")
raw = main.ONOSbench.handle.before
- if "NullLinkProvider" in raw:
+ if "NullLinkProvider" in raw and "links=14" in raw:
break
if i >= 9:
main.log.error("Expected output not being recieved... continuing")
main.log.info(raw)
break
- time.sleep(2)
+ time.sleep(2)
temp = raw.splitlines()
- for line in temp:
- if str(date) in line:
- temp = line
+ for line in temp:
+ if str(date) in line:
+ temp = line
break
cutTimestamp = (temp.split(" "))[0] + " " + (temp.split(" "))[1]
+ if debug: main.log.info("Cut timestamp: " + cutTimestamp)
#validate link count and flow count
for i in range(0, 40):
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
linkCheck = main.ONOSbench.handle.before
- if "links=14," in linkCheck and ("flows=" + str(7*intents) + ",") in linkCheck:
+ if "links=" + str(7*intents)+ "," in linkCheck and ("flows=" + str(7*intents) + ",") in linkCheck:
break
if i == 39:
- main.log.error("Link or flow count incorrect, data invalid.")
+ main.log.error("Link or flow count incorrect, data invalid." + linkCheck)
- #intents events metrics installed timestamp
+ #intents events metrics installed timestamp
IEMtimestamps = [0]*(clusterCount + 1)
installedTemp = [0]*(clusterCount + 1)
- for node in range(1, clusterCount +1):
+ for node in range(1, clusterCount +1):
cmd = "onos $OC" + str(node) + " intents-events-metrics|grep Timestamp"
raw = ""
while "Timestamp" not in raw:
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
- raw = main.ONOSbench.handle.before
+ raw = main.ONOSbench.handle.before
intentsTimestamps = {}
rawTimestamps = raw.splitlines()
- for line in rawTimestamps:
- if "Timestamp" in line and "grep" not in line:
+ for line in rawTimestamps:
+ if "Timestamp" in line and "grep" not in line:
metricKey = (line.split(" "))[1]
metricTimestamp = (line.split(" ")[len(line.split(" ")) -1]).replace("epoch)=","")
metricTimestamp = float(metricTimestamp)
@@ -374,23 +319,23 @@
if debug: main.log.info(repr(metricTimestamp))
intentsTimestamps[metricKey] = metricTimestamp
if metricKey == "Installed":
- installedTemp[node] = metricTimestamp
+ installedTemp[node] = metricTimestamp
main.log.info("Node: " + str(node) + " Timestamps: " + str(intentsTimestamps))
IEMtimestamps[node] = intentsTimestamps
-
+
myMax = max(installedTemp)
indexOfMax = installedTemp.index(myMax)
#number crunch
for metric in timestampMetrics: #this is where we sould add support for computing other timestamp metrics
if metric == "Installed":
- if run >= warmUp:
+ if run >= warmUp:
main.log.report("link cut timestamp: " + cutTimestamp)
#readableInstalledTimestamp = str(intentsTimestamps["Installed"])
readableInstalledTimestamp = str(myMax)
- #main.log.report("Intent Installed timestamp: " + str(intentsTimestamps["Installed"]))
+ #main.log.report("Intent Installed timestamp: " + str(intentsTimestamps["Installed"]))
main.log.report("Intent Installed timestamp: " + str(myMax))
cutEpoch = time.mktime(time.strptime(cutTimestamp, "%Y-%m-%d %H:%M:%S,%f"))
@@ -399,70 +344,71 @@
rerouteLatency = float(myMax - cutEpoch)
rerouteLatency = numpy.divide(rerouteLatency, 1000)
- main.log.report("Reroute latency:" + str(rerouteLatency) + " (seconds)\n ")
+ main.log.report("Reroute latency:" + str(rerouteLatency) + " (seconds)\n ")
myResult[run-warmUp][0] = rerouteLatency
myResult[run-warmUp][1] = indexOfMax
- if debug: main.log.info("Latency: " + str(myResult[run-warmUp][0]))
- if debug: main.log.info("last node: " + str(myResult[run-warmUp][1]))
+ if debug: main.log.info("Latency: " + str(myResult[run-warmUp][0]))
+ if debug: main.log.info("last node: " + str(myResult[run-warmUp][1]))
- #time.sleep(12)
-
- #reset
- for node in nodesLinksCut:
- exec "a = main.ONOS%s.createNullLinkProviderFile" %str(node)
- a(ONOSIp[node], fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfile), onNode=True)
+ cmd = """ onos $OC1 null-link "null:0000000000000004/1 null:0000000000000003/2 up" """
#wait for intent withdraw
- if debug: main.log.info(withdrawCmd)
- main.ONOSbench.handle.sendline(withdrawCmd)
+ if debug: main.log.info(cmd)
+ main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
main.ONOSbench.handle.sendline("onos $OC1 intents|grep WITHDRAWN|wc -l")
main.ONOSbench.handle.expect(":~")
intentWithdrawCheck = main.ONOSbench.handle.before
- if (str(intents)) in intentWithdrawCheck:
+ if (str(intents)) in intentWithdrawCheck:
main.log.info("intents withdrawn")
if debug: main.log.info(intentWithdrawCheck)
-
- # wait for links to be reestablished
- for i in range(0, 10):
+
+ # wait for links to be reestablished
+ for i in range(0, 10):
main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.expect(":~")
linkCheck = main.ONOSbench.handle.before
if "links=16," in linkCheck:
break
time.sleep(1)
- if i == 9:
- main.log.info("Links Failed to reconnect, next iteration of data invalid.")
+ if i == 9:
+ main.log.info("Links Failed to reconnect, next iteration of data invalid." + linkCheck)
- if run < warmUp:
- main.log.info("Warm up run " + str(run+1) + " completed")
-
+ if run < warmUp:
+ main.log.info("Warm up run " + str(run+1) + " completed")
+
if debug: main.log.info(myResult)
latTemp = []
nodeTemp = []
- for i in myResult:
+ for i in myResult:
latTemp.append(i[0])
nodeTemp.append(i[1])
-
+
mode = {}
- for i in nodeTemp:
- if i in mode:
+ for i in nodeTemp:
+ if i in mode:
mode[i] += 1
- else:
+ else:
mode[i] = 1
for i in mode.keys():
if mode[i] == max(mode.values()):
- nodeMode = i
-
+ nodeMode = i
+
average = numpy.average(latTemp)
- stdDev = numpy.std(latTemp)
+ stdDev = numpy.std(latTemp)
main.log.report("Scale: " + str(clusterCount) + " \tIntent batch: " + str(intents))
- main.log.report("Latency average:................" + str(average))
+ main.log.report("Latency average:................" + str(average))
main.log.report("Latency standard deviation:....." + str(stdDev))
main.log.report("Mode of last node to respond:..." + str(nodeMode))
main.log.report("________________________________________________________")
+ resultsDB = open("IntentRerouteLatDB", "w+")
+ resultsDB.write("'" + commit + "',")
+ resultsDB.write(str(clusterCount) + ",")
+ resultsDB.write(str(intents) + ",")
+ resultsDB.write(str(average) + ",")
+ resultsDB.write(str(stdDev) + "\n")
+ resultsDB.close()
-
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo b/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo
index 0e45e0f..30a1467 100644
--- a/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo
+++ b/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo
@@ -3,7 +3,7 @@
<COMPONENT>
<ONOSbench>
- <host>10.254.1.200</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosDriver</type>
@@ -12,7 +12,7 @@
</ONOSbench>
<ONOS1cli>
- <host>10.254.1.200</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -21,7 +21,7 @@
</ONOS1cli>
<ONOS2cli>
- <host>10.254.1.200</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -30,7 +30,7 @@
</ONOS2cli>
<ONOS3cli>
- <host>10.254.1.200</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -39,7 +39,7 @@
</ONOS3cli>
<ONOS4cli>
- <host>10.254.1.200</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -48,7 +48,7 @@
</ONOS4cli>
<ONOS5cli>
- <host>10.254.1.200</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -57,7 +57,7 @@
</ONOS5cli>
<ONOS6cli>
- <host>10.254.1.200</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -66,7 +66,7 @@
</ONOS6cli>
<ONOS7cli>
- <host>10.254.1.200</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -75,7 +75,7 @@
</ONOS7cli>
<ONOS1>
- <host>10.254.1.201</host>
+ <host>10.128.5.51</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -84,7 +84,7 @@
</ONOS1>
<ONOS2>
- <host>10.254.1.202</host>
+ <host>10.128.5.52</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -93,7 +93,7 @@
</ONOS2>
<ONOS3>
- <host>10.254.1.203</host>
+ <host>10.128.5.53</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -102,7 +102,7 @@
</ONOS3>
<ONOS4>
- <host>10.254.1.204</host>
+ <host>10.128.5.54</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -112,7 +112,7 @@
<ONOS5>
- <host>10.254.1.205</host>
+ <host>10.128.5.65</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -121,7 +121,7 @@
</ONOS5>
<ONOS6>
- <host>10.254.1.206</host>
+ <host>10.128.5.66</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -130,7 +130,7 @@
</ONOS6>
<ONOS7>
- <host>10.254.1.207</host>
+ <host>10.128.5.67</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
diff --git a/TestON/tests/flowTP1g/flowTP1g.params b/TestON/tests/flowTP1g/flowTP1g.params
index bb05f0e..0f08c9a 100644
--- a/TestON/tests/flowTP1g/flowTP1g.params
+++ b/TestON/tests/flowTP1g/flowTP1g.params
@@ -3,7 +3,7 @@
<testcases>1,2</testcases>
<isOnBaremetal>False</isOnBaremetal>
- <SCALE>7</SCALE>
+ <SCALE>3</SCALE>
<availableNodes>7</availableNodes>
@@ -16,7 +16,7 @@
<TEST>
<skipCleanInstall>yes</skipCleanInstall>
<warmUp>4</warmUp> #number of runs to warm up the system
- <sampleSize>2</sampleSize> #number of runs to take data from
+ <sampleSize>3</sampleSize> #number of runs to take data from
<neighbors>0,a</neighbors> #list of number of neighbors, a = all
<flows>3500</flows>
<switches>35</switches>
diff --git a/TestON/tests/flowTP1g/flowTP1g.py b/TestON/tests/flowTP1g/flowTP1g.py
index 946864c..352341e 100644
--- a/TestON/tests/flowTP1g/flowTP1g.py
+++ b/TestON/tests/flowTP1g/flowTP1g.py
@@ -44,6 +44,7 @@
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
global scale
+ global commit
clusterCount = 0
ONOSIp = [ 0 ]
@@ -69,6 +70,12 @@
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 --#
@@ -166,10 +173,9 @@
ts = time.time()
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
- logFileName = "../logs/flowTPResultsLog" + str(st)
#initialize log file, remove any previous data
- resultsLog = open("flowTPResultsLog","w+")
+ resultsLog = open("flowTP1gDB","w+")
resultsLog.close()
#write file to change mem limit to 32 gigs (BAREMETAL ONLY!)
@@ -210,13 +216,17 @@
main.log.info(" NullLinkProvider.cfg: " + ipCSV)
linkConfig.close()
- #config null device
- cellIp = []
- for node in range(1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
- main.log.info(" NullDeviceProvider.cfg: " + str(cellIp))
- main.ONOSbench.configNullDev(cellIp, switches)
-
+ 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))
@@ -224,7 +234,6 @@
flows = (flows *max(int(n)+1,int(servers)))/((int(n) + 1)*int(servers)*(switches))
main.log.info("Flows per switch = " + str(flows))
- #main.log.info("Total flows = " + str(switches * flows))
#build list of servers in "$OC1, $OC2...." format
serverEnvVars = ""
@@ -254,7 +263,7 @@
rawResult = rawResult.splitlines()
print(rawResult)
for node in range(1, clusterCount + 1):
- for line in rawResult
+ for line in rawResult:
if ONOSIp[node] in line and " -> " in line:
myLine = line.split(" ")
for word in myLine:
@@ -351,9 +360,13 @@
main.log.info("Average thoughput: " + str(avgTP) + " Kflows/second" )
main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second")
- resultsLog = open(logFileName,"a")
- resultsLog.write(str(main.params[ 'TEST' ][ 'flows' ]) + "," + n + "," + str(servers) + str(switches) + "," + str(warmUp))
- resultsLog.write("," +str(sampleSize) + "," + str(avgTP) + "," + str(stdTP) + "\n")
+ resultsLog = open("flowTP1gDB","a")
+ resultsLog.write("'" + commit + "',")
+ resultsLog.write("'1gig',")
+ resultsLog.write((main.params[ 'TEST' ][ 'flows' ]) + ",")
+ resultsLog.write(str(clusterCount)+ ",")
+ resultsLog.write(str(n) + ",")
+ resultsLog.write(str(avgTP) + "," + str(stdTP) + "\n")
resultsLog.close()
-
+
diff --git a/TestON/tests/pushTestIntents/__init__.py b/TestON/tests/pushTestIntents/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/pushTestIntents/__init__.py
+++ /dev/null
diff --git a/TestON/tests/pushTestIntents/pushTestIntents.params b/TestON/tests/pushTestIntents/pushTestIntents.params
deleted file mode 100644
index 067ff8e..0000000
--- a/TestON/tests/pushTestIntents/pushTestIntents.params
+++ /dev/null
@@ -1,66 +0,0 @@
-<PARAMS>
-
- <testcases>1,3,2,3,2,3,2,3</testcases>
-
- <SCALE>2</SCALE>
- <availableNodes>7</availableNodes>
-
- <ENV>
- <cellName>defaultCell</cellName>
- <cellFeatures>webconsole,onos-core,onos-api,onos-cli,onos-null,onos-gui,onos-rest,onos-app-metrics,onos-app-metrics-intent,onos-app-metrics-topology </cellFeatures>
- </ENV>
-
- <TEST>
- <skipCleanInstall>yes</skipCleanInstall>
- <switchCount>7</switchCount>
- <warmUp>4</warmUp>
- <sampleSize>10</sampleSize>
- <wait></wait>
- <intents>1000</intents> #list format, will be split on ','
- <debug>False</debug> #"True" for true
- </TEST>
-
- <GIT>
- <autopull>on</autopull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <USER>admin</USER>
-
- <ip1>10.254.1.201</ip1>
- <port1>6633</port1>
-
- <ip2>10.254.1.202</ip2>
- <port2>6633</port2>
-
- <ip3>10.254.1.203</ip3>
- <port3>6633</port3>
-
- <ip4>10.254.1.204</ip4>
- <port4>6633</port4>
-
- <ip5>10.254.1.205</ip5>
- <port5>6633</port5>
-
- <ip6>10.254.1.206</ip6>
- <port6>6633</port6>
-
- <ip7>10.254.1.207</ip7>
- <port7>6633</port7>
-
- </CTRL>
-
- <MN>
- <ip1>10.254.1.200</ip1>
- </MN>
-
- <BENCH>
- <user>admin</user>
- <ip1>10.254.1.200</ip1>
- </BENCH>
-
- <JSON>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/pushTestIntents/pushTestIntents.py b/TestON/tests/pushTestIntents/pushTestIntents.py
deleted file mode 100644
index 1594345..0000000
--- a/TestON/tests/pushTestIntents/pushTestIntents.py
+++ /dev/null
@@ -1,277 +0,0 @@
-# ScaleOutTemplate
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
-
-import sys
-import os.path
-
-
-class pushTestIntents:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ): #This is the initialization case
- #this case will clean up all nodes
- import time #but only node 1 is started in this case
-
- global clusterCount #number of nodes running
- global ONOSIp #list of ONOS IP addresses
- clusterCount = 1
- ONOSIp = [ 0 ]
-
-
- #Load values from params file
- checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
- gitPull = main.params[ 'GIT' ][ 'autopull' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- Features= main.params[ 'ENV' ][ 'cellFeatures' ]
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- MN1Ip = main.params[ 'MN' ][ 'ip1' ]
- maxNodes = int(main.params[ 'availableNodes' ])
- Features = main.params[ 'ENV' ][ 'cellFeatures' ]
- skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- switchCount = main.params[ 'TEST' ][ 'switchCount' ]
-
- #Populate ONOSIp with ips from params
- for i in range(1, maxNodes + 1):
- ipString = 'ip' + str(i)
- ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
-
- tempIp = []
- for node in range( 1, clusterCount + 1):
- tempIp.append(ONOSIp[node])
-
- #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])
-
- #construct the cell file
- main.log.info("Creating cell file")
- exec "a = main.ONOSbench.createCellFile"
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
- a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
-
- main.step( "Applying cell file to environment" )
- cellApplyResult = main.ONOSbench.setCell( cellName )
-
- #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] )
-
- #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" )
-
- main.ONOSbench.createLinkGraphFile(BENCHIp, tempIp, switchCount)
- main.ONOSbench.createNullDevProviderFile(BENCHIp, tempIp, switchCount)
- main.ONOSbench.createNullLinkProviderFile(BENCHIp)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] )
-
- main.step( "verify cells" )
- verifyCellResult = main.ONOSbench.verifyCell()
-
- main.step( "Set cell for ONOS cli env" )
- cli1 = main.ONOS1cli.startOnosCli( ONOSIp[1] )
-
-
- def CASE2( self, main ):
- # This case increases the cluster size by whatever scale is
- # Note: 'scale' is the size of the step
- # if scaling is not a part of your test, simply run this case
- # once after CASE1 to set up your enviornment for your desired
- # cluster size. If scaling is a part of you test call this case each time
- # you want to increase cluster size
-
- ''
- 'Increase number of nodes and initiate CLI'
- ''
- import time
- global clusterCount
-
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- scale = int( main.params[ 'SCALE' ] )
- clusterCount += scale
- switchCount = main.params[ 'TEST' ][ 'switchCount' ]
-
- main.log.info("Creating cell file")
- exec "a = main.ONOSbench.createCellFile"
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
- a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
-
- main.step( "Applying cell file to environment" )
- cellApplyResult = main.ONOSbench.setCell( cellName )
-
- #Uninstall everywhere
- main.log.step( "Cleaning Enviornment..." )
- for node in range(1, maxNodes + 1):
- main.ONOSbench.onosDie(ONOSIp[node])
- main.log.info(" Uninstalling ONOS " + str(node) )
- main.ONOSbench.onosUninstall( ONOSIp[node] )
-
- tempIp = []
- for node in range( 1, clusterCount + 1):
- tempIp.append(ONOSIp[node])
-
- main.ONOSbench.createLinkGraphFile(BENCHIp, tempIp, switchCount)
- main.ONOSbench.createNullDevProviderFile(BENCHIp, tempIp, switchCount)
- main.ONOSbench.createNullLinkProviderFile(BENCHIp)
-
- main.ONOSbench.onosPackage()
-
- main.log.report( "Increasing cluster size to " + str( clusterCount ) )
- for node in range(1, clusterCount + 1):
- main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
- main.ONOSbench.onosInstall( node=ONOSIp[node])
- if node == 1:
- main.ONOS1cli.startOnosCli( ONOSIp[1] )
-
- 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!" )
-
- def CASE3( self, main ):
-
- import time
- import numpy
-
-
- sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
- warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
- intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
- switchCount = int(main.params[ 'TEST' ][ 'switchCount' ])
- debug = main.params[ 'TEST' ][ 'switchCount' ]
- for i in range(0,len(intentsList)):
- intentsList[i] = int(intentsList[i])
-
- if debug == "True":
- debug = True
- else:
- debug = False
-
- linkCount = 0
- for i in range(0,10):
- main.ONOSbench.handle.sendline("onos $OC1 links|wc -l")
- main.ONOSbench.handle.expect(":~")
- linkCount = main.ONOSbench.handle.before
- if debug: main.log.info("Link Count check: " + linkCount)
- if str((switchCount*2)-2) in linkCount:
- break
- time.sleep(2)
-
- links = "--"
- while "=null:" not in links:
- if debug: main.log.info("top of loop")
- main.ONOSbench.handle.sendline("onos $OC1 links")
- main.ONOSbench.handle.expect(":~")
- links = main.ONOSbench.handle.before
- if debug: main.log.info(str(links))
- time.sleep(1)
- links = links.splitlines()
- templinks = links
-
- tempDevices = []
- for line in links:
- temp = line.split(" ")
- temp[0].replace("src=","")
- temp[0] = (temp[0].split("/"))[0]
- tempDevices.append(temp[0])
-
- tempDevices.sort()
- devices = []
- for i in tempDevices:
- if "src=null" in i:
- devices.append(i.replace("src=", ""))
- if debug: main.log.info(str(devices))
-
- ingress = devices[0]
- egress = devices.pop()
- if debug: main.log.info(ingress)
- if debug: main.log.info(egress)
-
- for intentSize in intentsList:
- cmd = "onos $OC1 push-test-intents "
- cmd += ingress + "/6 "
- cmd += egress + "/5 "
- cmd += str(intentSize) + " 1"
- installed = []
- withdrawn = []
-
- for run in range(0, (warmUp + sampleSize)):
- if run > warmUp:
- time.sleep(5)
-
- myRawResult = "--"
- while "ms" not in myRawResult:
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- myRawResult = main.ONOSbench.handle.before
- if debug: main.log.info(myRawResult)
-
- if debug: main.log.info(myRawResult)
-
- if run >= warmUp:
- myRawResult = myRawResult.splitlines()
- for line in myRawResult:
- if "install" in line:
- installed.append(int(line.split(" ")[5]))
-
- for line in myRawResult:
- if "withdraw" in line:
- withdrawn.append(int(line.split(" ")[5]))
-
- print("installed: " + str(installed))
- print("withraw: " + str(withdrawn) + "\n")
-
- main.log.report("----------------------------------------------------")
- main.log.report("Scale: " + str(clusterCount) + "\tIntent batch size: " + str(intentSize))
- main.log.report("Installed average: " + str(numpy.mean(installed)))
- main.log.report("Installed standard deviation: " + str(numpy.std(installed)))
- main.log.report("Withdraw average: " + str(numpy.mean(withdrawn)))
- main.log.report("Withdraw standard deviation: " + str(numpy.std(withdrawn)))
- main.log.report(" ")
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/TestON/tests/pushTestIntents/pushTestIntents.topo b/TestON/tests/pushTestIntents/pushTestIntents.topo
deleted file mode 100644
index 0e45e0f..0000000
--- a/TestON/tests/pushTestIntents/pushTestIntents.topo
+++ /dev/null
@@ -1,146 +0,0 @@
-<TOPOLOGY>
-
- <COMPONENT>
-
- <ONOSbench>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS><home>~/onos</home></COMPONENTS>
- </ONOSbench>
-
- <ONOS1cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <ONOS4cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4cli>
-
- <ONOS5cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5cli>
-
- <ONOS6cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6cli>
-
- <ONOS7cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7cli>
-
- <ONOS1>
- <host>10.254.1.201</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.254.1.202</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.254.1.203</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.254.1.204</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
-
- <ONOS5>
- <host>10.254.1.205</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.254.1.206</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.254.1.207</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- </COMPONENT>
-
-</TOPOLOGY>
-
-
-