Changes for blackbird release 1.1
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.params b/TestON/tests/IntentEventTP/IntentEventTP.params
index d5dd65c..7f355dc 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.params
+++ b/TestON/tests/IntentEventTP/IntentEventTP.params
@@ -20,41 +20,41 @@
<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></MN>
+ <MN><ip1>10.254.1.200</ip1></MN>
<BENCH>
<user>admin</user>
- <ip1>10.128.5.55</ip1>
+ <ip1>10.254.1.200</ip1>
</BENCH>
<TEST>
- <loadFrom>1,0,0,0,0,0,0</loadFrom> #generate load on server, 1 = generator on
- <numSwitches>35</numSwitches>
+ <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>60</duration>
- <log_interval>5</log_interval>
+ <duration>600</duration>
+ <log_interval>20</log_interval>
</TEST>
<METRICS>
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.py b/TestON/tests/IntentEventTP/IntentEventTP.py
index b1f0e91..863599c 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.py
+++ b/TestON/tests/IntentEventTP/IntentEventTP.py
@@ -33,7 +33,7 @@
maxNodes = int(main.params[ 'availableNodes' ])
MNip = main.params[ 'MN' ][ 'ip1' ]
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- numSwitches = main.params[ 'TEST' ][ 'numSwitches' ]
+ numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
homeDir = os.path.expanduser('~')
@@ -83,68 +83,26 @@
if skipMvn != "yes":
mvnResult = main.ONOSbench.cleanInstall()
- #configure null device provider
- switchList = [0,int(numSwitches),0,0,0,0,0,0]
- devicesString = ""
- for node in range(1, maxNodes + 1):
- devicesString += (ONOSIp[node] + ":" + str(switchList[node] ))
- if node < maxNodes:
- devicesString += (",")
+ #null link
+ #null provider
+ #linkgraph
+ #intentPerf
- main.log.info("Configuring device provider: ONOS 1 with " + (numSwitches) + " switches")
- localPath = "/onos/tools/package/etc/org.onosproject.provider.nil.device.impl.NullDeviceProvider.cfg"
- filePath = homeDir + localPath
- main.log.info(filePath)
+ myDistribution = []
+ for node in range (1, clusterCount + 1):
+ myDistribution.append(numSwitches[node-1])
- configFile = open(filePath, 'w+')
- configFile.write("devConfigs = " + devicesString + "\n")
- configFile.write("#numPorts = 8")
- configFile.close()
- main.log.info("DevConfig = " + devicesString)
- main.log.info("Device provider file written and closed")
+ main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution)
+ main.ONOSbench.createNullDevProviderFile( BENCHIp, cellIp, myDistribution)
+ main.ONOSbench.createNullLinkProviderFile(BENCHIp)
- ## configuring null link provider
- main.log.info(" Configuring null provider to disable flicker" )
- homeDir = os.path.expanduser('~')
- main.log.info(homeDir)
- localPath = "/onos/tools/package/etc/org.onosproject.provider.nil.link.impl.NullLinkProvider.cfg"
- filePath = homeDir + localPath
- main.log.info(filePath)
-
- neighborsString = ""
- for node in range(1, maxNodes + 1):
- neighborsString += ONOSIp[node]
- if node < maxNodes:
- neighborsString += ","
-
- configFile = open(filePath, 'w+')
- configFile.write("#eventRate =\n")
- configFile.write("#cfgFile = /tmp/foo.cfg #If enabled, points to the full path to the topology file.\n")
- configFile.write("#neighbors = ")
- configFile.close()
- main.log.info("Configuration completed")
+ main.log.step("Writing IntentPerf config file")
+ intentPerfConfig = open( homeDir + "/onos/tools/package/etc/org.onosproject.intentperf.IntentPerfInstaller.cfg", "w+")
+ intentPerfConfig.write("numKeys = 40000\n")
+ intentPerfConfig.write("cyclePeriod = 1000\n")
+ intentPerfConfig.write("numNeighors = 0\n")
+ intentPerfConfig.close()
- main.log.info("Writing link graph configuration file..." )
- homeDir = os.path.expanduser('~')
- localPath = "/onos/tools/package/etc/linkGraph.cfg"
- filePath = homeDir + localPath
- linkGraph = open(filePath, 'w+')
- linkGraph.write("# NullLinkProvider topology description (config file).\n")
- linkGraph.write("# The NodeId is only added if the destination is another node's device.\n")
- linkGraph.write("# Bugs: Comments cannot be appended to a line to be read.\n")
-
- myPort = 6
- for node in range(1, clusterCount+1):
- linkGraph.write("graph " + ONOSIp[node] + " {\n")
- for switch in range (0, switchList[node]-1):
- line = ""
- line = ("\t" + str(switch) + ":" + str(myPort))
- line += " -- "
- line += (str(switch+1) + ":" + str(myPort-1) + "\n")
- linkGraph.write(line)
- linkGraph.write("}")
- linkGraph.close()
-
main.step( "Creating ONOS package" )
packageResult = main.ONOSbench.onosPackage()
@@ -170,7 +128,7 @@
main.ONOSbench.handle.expect(":~")
clusterCheck = ((main.ONOSbench.handle.before).splitlines())[3]
print("\nBefore: " + str(clusterCheck))
- if "SCC(s)=1," in clusterCheck and ("devices=" + str(numSwitches)) in clusterCheck: #check for links and devices too
+ if "SCC(s)=1," in clusterCheck:
break
if clusterCheck != lastOutput:
sameOutput = False
@@ -205,7 +163,7 @@
cellName = main.params[ 'ENV' ][ 'cellName' ]
MNip = main.params[ 'MN' ][ 'ip1' ]
BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- numSwitches = int(main.params[ 'TEST' ][ 'numSwitches' ])
+ numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
scale = int( main.params[ 'SCALE' ] )
maxNodes = int(main.params[ 'availableNodes' ])
clusterCount += scale
@@ -234,53 +192,23 @@
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
- baselineSwitchCount = numSwitches/clusterCount
- switchList = [0,0,0,0,0,0,0,0]
-
- for node in range(1, clusterCount + 1):
- switchList[node] = baselineSwitchCount
-
- for node in range(1, (numSwitches%clusterCount)+1):
- switchList[node] += 1
-
- devicesString = ""
- for node in range(1, maxNodes + 1):
- devicesString += (ONOSIp[node] + ":" + str(switchList[node] ))
- if node < maxNodes:
- devicesString += (",")
+ myDistribution = []
+ for node in range (1, clusterCount + 1):
+ myDistribution.append(numSwitches[node-1])
- main.log.info("Configuring device provider")
- localPath = "/onos/tools/package/etc/org.onosproject.provider.nil.device.impl.NullDeviceProvider.cfg"
- filePath = homeDir + localPath
- main.log.info(filePath)
+ main.ONOSbench.createLinkGraphFile( BENCHIp, cellIp, myDistribution)
+ main.ONOSbench.createNullDevProviderFile( BENCHIp, cellIp, myDistribution)
+ main.ONOSbench.createNullLinkProviderFile( BENCHIp )
- configFile = open(filePath, 'w+')
- configFile.write("devConfigs = " + devicesString +"\n")
- configFile.write("# numPorts = 8")
- configFile.close()
- main.log.info("DevConfig = " + devicesString)
- main.log.info("Device provider file written and closed")
+ #neighbors = max(1, clusterCount-1)
+ neighbors = 0
- main.log.info("Writing link graph configuration file..." )
- homeDir = os.path.expanduser('~')
- localPath = "/onos/tools/package/etc/linkGraph.cfg"
- filePath = homeDir + localPath
- linkGraph = open(filePath, 'w+')
- linkGraph.write("# NullLinkProvider topology description (config file).\n")
- linkGraph.write("# The NodeId is only added if the destination is another node's device.\n")
- linkGraph.write("# Bugs: Comments cannot be appended to a line to be read.\n")
-
- myPort = 6
- for node in range(1, clusterCount+1):
- linkGraph.write("graph " + ONOSIp[node] + " {\n")
- for switch in range (0, switchList[node]-1):
- line = ""
- line = ("\t" + str(switch) + ":" + str(myPort))
- line += " -- "
- line += (str(switch+1) + ":" + str(myPort-1) + "\n")
- linkGraph.write(line)
- linkGraph.write("}\n")
- linkGraph.close()
+ main.log.step("Writing IntentPerf config file")
+ intentPerfConfig = open( homeDir + "/onos/tools/package/etc/org.onosproject.intentperf.IntentPerfInstaller.cfg", "w+")
+ intentPerfConfig.write("numKeys = 40000\n")
+ intentPerfConfig.write("cyclePeriod = 1000\n")
+ intentPerfConfig.write("numNeighors = " + str(neighbors) + "\n")
+ intentPerfConfig.close()
main.step( "Creating ONOS package, preparing to reinstall" )
packageResult = main.ONOSbench.onosPackage()
@@ -306,7 +234,7 @@
main.ONOSbench.handle.expect(":~")
clusterCheck = ((main.ONOSbench.handle.before).splitlines())[3]
print("\nBefore: " + str(clusterCheck))
- if "SCC(s)=1," in clusterCheck and ("nodes=" + str(clusterCount)) in clusterCheck and ("devices=" + str(numSwitches)) in clusterCheck:
+ if ("SCC(s)=1,") in clusterCheck:
break
if clusterCheck != lastOutput:
sameOutput = False
@@ -326,6 +254,7 @@
import json
import string
import csv
+ import numpy
main.log.info("Cluster Count = " + str(clusterCount))
@@ -338,7 +267,7 @@
metricList = [intentsRate, intentsWithdrawn, intentsFailed]
- tempsleep =40
+ tempsleep =20
main.log.info("sleeping " + str(tempsleep))
time.sleep(tempsleep)
@@ -351,47 +280,59 @@
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
main.log.info("Load initiated on node " + str(node))
-
+
+ time.sleep(5)
+ actcmd = "onos $OC" + str(node) + " intent-perf-start"
+ main.ONOSbench.handle.sendline(actcmd)
+ main.ONOSbench.handle.expect(":~")
+ main.log.info("Starting ONOS " + str(node) + " intent-perf...")
+
main.log.info( "Starting test loop for " + str(testDuration) + " seconds...\n" )
stop = time.time() + float( testDuration )
while time.time() < stop:
time.sleep( float( logInterval ) )
+ groupResult = []
for node in range (1, clusterCount + 1):
- myResults = ['0','0','0']
- for metric in metricList:
-
- onosEnv = "onos $OC" + str(node)
- cmd = onosEnv + " " + metric
- main.log.info("COMMAND: " + cmd)
- main.ONOSbench.handle.sendline( cmd )
- time.sleep(10)
- main.ONOSbench.handle.expect(":~")
- rawResult = main.ONOSbench.handle.before
- rawResult = (rawResult.splitlines())
-
- tempResult = "--"
- for word in rawResult:
- if debug: print("word: " + word)
- if "m1" in str(word):
- tempResult = word
- break
-
- if tempResult == "--":
- main.log.error("WRONG pexepct.before data\n" + str(rawResult))
- main.log.info("retrying command... ")
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- test = main.ONOSbench.handle.before
- print ("\n\n" + str(test))
-
- tempResult = round(float(tempResult.replace("m1=","")),1)
- tempResult = str(tempResult) # easy way to clean up number/prep to log
- resultIndex = metricList.index(metric)
- myResults[resultIndex] = tempResult
+ if loadFrom[node] == "0": continue
+ groupResult.append(0)
- main.log.info("\tNode " + str(node))
- main.log.info("Installed\tWithdrawn\tFailed")
- main.log.info(myResults[0] + "\t\t " + myResults[1] + "\t\t" + myResults[2] + "\n")
-
+ cmd = " onos-ssh $OC" + str(node) + """ cat /opt/onos/log/karaf.log | grep "SNAPSHOT | Throughput" | tail -1 """
+ main.log.info("COMMAND: " + str(cmd))
+
+ x = 0
+ while True:
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+ raw = main.ONOSbench.handle.before
+ if "OVERALL=" in raw:
+ break
+ x += 1
+ if x > 10:
+ main.log.error("Expected output not being recieved... continuing")
+ break
+ time.sleep(2)
+ raw = raw.splitlines()
+ splitResults = []
+ for line in raw:
+ splitResults.extend(line.split(" "))
+
+ myResult = "--"
+ for field in splitResults:
+ if "OVERALL" in field:
+ myResult = field
+
+ if myResult == "--":
+ main.log.error("Parsing/Pexpect error\n" + str(splitResults))
+
+ myResult = myResult.replace(";", "")
+ myResult = myResult.replace("OVERALL=","")
+ myResult = float(myResult)
+ groupResult[len(groupResult) -1] = myResult
+
+ main.log.info("Node " + str(node) + " overall rate: " + str(myResult))
+
+ main.log.report("Results from this round of polling: " + str(groupResult))
+ main.log.report("Cluster Total: " + str(numpy.sum(groupResult)) + "\n")
+
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.topo b/TestON/tests/IntentEventTP/IntentEventTP.topo
index 30a1467..0e45e0f 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.topo
+++ b/TestON/tests/IntentEventTP/IntentEventTP.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>