Implemented driver function to aid debugging
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 4a91f6e..a78f4f2 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -1966,3 +1966,82 @@
return ONOSIps
+
+ def onosErrorLog(self, nodeIp):
+
+ cmd = "onos-ssh " + nodeIp + " cat /opt/onos/log/karaf.log | grep WARN"
+ self.handle.sendline(cmd)
+ self.handle.expect(":~")
+ before = (self.handle.before).splitlines()
+
+ warnings = []
+
+ for line in before:
+ if "WARN" in line and "grep" not in line:
+ warnings.append(line)
+ main.warnings[main.warnings[0]+1] = line
+ main.warnings[0] += 1
+ if main.warnings[0] >= 10:
+ main.warnings[0] = 0
+
+ cmd = "onos-ssh " + nodeIp + " cat /opt/onos/log/karaf.log | grep ERROR"
+ self.handle.sendline(cmd)
+ self.handle.expect(":~")
+ before = (self.handle.before).splitlines()
+
+ errors = []
+
+ for line in before:
+ if "ERROR" in line and "grep" not in line:
+ errors.append(line)
+ main.errors[main.errors[0]+1] = line
+ main.errors[0] += 1
+ if main.errors[0] >= 10:
+ main.errors[0] = 0
+
+ cmd = "onos-ssh " + nodeIp + " cat /opt/onos/log/karaf.log | grep Exept"
+ self.handle.sendline(cmd)
+ self.handle.expect(":~")
+ before = (self.handle.before).splitlines()
+
+ exceptions = []
+
+ for line in before:
+ if "Except" in line and "grep" not in line:
+ exceptions.append(line)
+ main.exceptions[main.errors[0]+1] = line
+ main.exceptions[0] += 1
+ if main.exceptions[0] >= 10:
+ main.exceptions[0] = 0
+
+
+
+ ################################################################
+
+ msg1 = "WARNINGS: \n"
+ for i in main.warnings:
+ if type(i) is not int:
+ msg1 += ( i + "\n")
+
+ msg2 = "ERRORS: \n"
+ for i in main.errors:
+ if type(i) is not int:
+ msg2 += ( i + "\n")
+
+ msg3 = "EXCEPTIONS: \n"
+ for i in main.exceptions:
+ if type(i) is not int:
+ msg3 += ( i + "\n")
+
+ main.log.info("===============================================================\n")
+ main.log.info( "Warnings: " + str(len(warnings)))
+ main.log.info( "Errors: " + str(len(errors)))
+ main.log.info( "Exceptions: " + str(len(exceptions)))
+ if len(warnings) > 0:
+ main.log.info(msg1)
+ if len(errors) > 0:
+ main.log.info(msg2)
+ if len(exceptions) > 0:
+ main.log.info(msg3)
+ main.log.info("===============================================================\n")
+
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.params b/TestON/tests/IntentEventTP/IntentEventTP.params
index 8c65377..ddda23e 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.params
+++ b/TestON/tests/IntentEventTP/IntentEventTP.params
@@ -1,7 +1,8 @@
<PARAMS>
- <testcases>1,2,1,2,1,2,1,2</testcases>
+ <testcases>1,2,1,2,1,2,1,2,1,2,1,2,1,2</testcases>
+ <isOnBaremetal>True</isOnBaremetal>
<debugMode></debugMode> #nothing means false
<ENV>
@@ -9,7 +10,7 @@
<cellApps>drivers,null,intentperf</cellApps>
</ENV>
- <SCALE>1,3,5,7</SCALE>
+ <SCALE>1,3,3,5,5,7,7</SCALE>
<availableNodes>7</availableNodes>
<GIT>
@@ -20,33 +21,33 @@
<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.55</ip5>
<port5>6633</port5>
- <ip6>10.254.1.206</ip6>
+ <ip6>10.128.5.56</ip6>
<port6>6633</port6>
- <ip7>10.254.1.207</ip7>
+ <ip7>10.128.5.57</ip7>
<port7>6633</port7>
</CTRL>
- <MN><ip1>10.254.1.200</ip1></MN>
+ <MN><ip1>10.128.5.50</ip1></MN>
<BENCH>
<user>admin</user>
- <ip1>10.254.1.200</ip1>
+ <ip1>10.128.5.50</ip1>
</BENCH>
<TEST>
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.py b/TestON/tests/IntentEventTP/IntentEventTP.py
index ba63f4c..fc52a7e 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.py
+++ b/TestON/tests/IntentEventTP/IntentEventTP.py
@@ -16,6 +16,8 @@
def CASE1( self, main ):
import time
+ import os.path
+
global init
try:
if type(init) is not bool:
@@ -36,7 +38,8 @@
cellName = main.params[ 'ENV' ][ 'cellName' ]
numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
flowRuleBU = main.params[ 'TEST' ][ 'flowRuleBUEnabled' ]
-
+ onBaremetal = main.params['isOnBaremetal']
+ homeDir = os.path.expanduser('~')
# -- INIT SECTION, ONLY RUNS ONCE -- #
if init == False:
@@ -45,7 +48,10 @@
global ONOSIp #list of ONOS IP addresses
global scale
global commit
-
+
+ main.exceptions = [0]*11
+ main.warnings = [0]*11
+ main.errors = [0]*11
clusterCount = 0
ONOSIp = [ 0 ]
scale = (main.params[ 'SCALE' ]).split(",")
@@ -110,7 +116,24 @@
myDistribution.append(numSwitches[node-1])
#main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution)
-
+
+ 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()
+ main.log.info("Set /onos/tools/package/bin/onos-service with 8G Xms/Xmx Options.")
+
main.step( "Creating ONOS package" )
packageResult = main.ONOSbench.onosPackage()
@@ -198,7 +221,7 @@
break
lastOutput = clusterCheck
time.sleep(5)
-
+ main.ONOSbench.onosErrorLog(ONOSIp[1])
def CASE2( self, main ):
import time
@@ -206,6 +229,26 @@
import string
import csv
import numpy
+ import os.path
+
+ global currentNeighbors
+ neighbors = []
+
+ try:
+ currentNeighbors
+ except:
+ currentNeighbors = "0"
+ neighbors = ['0']
+ else:
+ if currentNeighbors == "r": #reset
+ currentNeighbors = "a"
+ neighbors = ['0']
+ else:
+ currentNeighbors = "r"
+ neighbors = ['a']
+
+ if clusterCount == 1:
+ currentNeighbors = "r"
main.log.info("Cluster Count = " + str(clusterCount))
@@ -217,7 +260,7 @@
debug = main.params[ 'debugMode' ]
numKeys = main.params[ 'TEST' ][ 'numKeys' ]
cyclePeriod = main.params[ 'TEST' ][ 'cyclePeriod' ]
- neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
+ #neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
metricList = [intentsRate, intentsWithdrawn, intentsFailed]
for n in range(0, len(neighbors)):
@@ -289,7 +332,9 @@
clusterTotal = str(numpy.sum(groupResult))
main.log.report("Results from this round of polling: " + str(groupResult))
main.log.report("Cluster Total: " + clusterTotal + "\n")
-
+
+ main.ONOSbench.onosErrorLog(ONOSIp[1])
+
cmd = "onos $OC1 intent-perf-stop"
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
@@ -308,6 +353,7 @@
resultsDB.write(resultString)
resultsDB.close()
-
+
+ main.ONOSbench.onosErrorLog(ONOSIp[1])
diff --git a/TestON/tests/flowTP1g/flowTP1g.params b/TestON/tests/flowTP1g/flowTP1g.params
index cbe2da5..54320a7 100644
--- a/TestON/tests/flowTP1g/flowTP1g.params
+++ b/TestON/tests/flowTP1g/flowTP1g.params
@@ -35,36 +35,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.55</ip5>
<port5>6633</port5>
- <ip6>10.254.1.206</ip6>
+ <ip6>10.128.5.56</ip6>
<port6>6633</port6>
- <ip7>10.254.1.207</ip7>
+ <ip7>10.128.5.57</ip7>
<port7>6633</port7>
</CTRL>
<MN>
- <ip1>10.254.1.200</ip1>
+ <ip1>10.128.5.59</ip1>
</MN>
<BENCH>
<user>admin</user>
- <ip1>10.254.1.200</ip1>
+ <ip1>10.128.5.50</ip1>
</BENCH>
<JSON>
diff --git a/TestON/tests/flowTP1g/flowTP1g.topo b/TestON/tests/flowTP1g/flowTP1g.topo
index 0e45e0f..763a4d6 100644
--- a/TestON/tests/flowTP1g/flowTP1g.topo
+++ b/TestON/tests/flowTP1g/flowTP1g.topo
@@ -3,7 +3,7 @@
<COMPONENT>
<ONOSbench>
- <host>10.254.1.200</host>
+ <host>10.128.5.50</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.50</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.50</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.50</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.50</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.50</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.50</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.50</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.55</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.56</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.57</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
@@ -141,6 +141,4 @@
</COMPONENT>
</TOPOLOGY>
-
-
-
+