cmbenchbm
diff --git a/TestON/tests/CbenchBM/CbenchBM.params b/TestON/tests/CbenchBM/CbenchBM.params
new file mode 100644
index 0000000..33dc069
--- /dev/null
+++ b/TestON/tests/CbenchBM/CbenchBM.params
@@ -0,0 +1,60 @@
+<PARAMS>
+
+ <testcases>1,2</testcases>
+
+ <SCALE>1</SCALE>
+ <availableNodes>7</availableNodes>
+
+ <ENV>
+ <cellName>CbenchBMcell</cellName>
+ </ENV>
+
+ <TEST>
+ <skipCleanInstall>yes</skipCleanInstall>
+ <mode>t</mode> #t throughput
+ </TEST>
+
+ <GIT>
+ <autopull>off</autopull>
+ <checkout>master</checkout>
+ </GIT>
+
+ <CTRL>
+ <USER>admin</USER>
+
+ <ip1>10.254.1.207</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.128.5.205</ip5>
+ <port5>6633</port5>
+
+ <ip6>10.128.5.206</ip6>
+ <port6>6633</port6>
+
+ <ip7>10.128.5.201</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/CbenchBM/CbenchBM.py b/TestON/tests/CbenchBM/CbenchBM.py
new file mode 100644
index 0000000..d042f45
--- /dev/null
+++ b/TestON/tests/CbenchBM/CbenchBM.py
@@ -0,0 +1,184 @@
+# ScaleOutTemplate --> CbenchBM
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os.path
+
+
+class CbenchBM:
+
+ def __init__( self ):
+ self.default = ''
+
+ def CASE1( self, main ):
+
+ import time
+ global init
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
+ #Load values from params file
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+ BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+ MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+ maxNodes = int(main.params[ 'availableNodes' ])
+ skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
+ init = True
+ global clusterCount #number of nodes running
+ global ONOSIp #list of ONOS IP addresses
+ global scale
+
+ clusterCount = 0
+ ONOSIp = [ 0 ]
+ scale = (main.params[ 'SCALE' ]).split(",")
+ clusterCount = int(scale[0])
+
+ #Populate ONOSIp with ips from params
+ for i in range(1, maxNodes + 1):
+ ipString = 'ip' + str(i)
+ ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
+
+ #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+ if skipMvn != "yes":
+ mvnResult = main.ONOSbench.cleanInstall()
+
+ #git
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
+
+ else:
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
+
+ # -- END OF INIT SECTION --#
+
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
+ #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] )
+
+ main.step( "Set Cell" )
+ main.ONOSbench.setCell(cellName)
+
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
+
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
+
+ main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
+ for node in range(1, clusterCount + 1):
+ main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+ main.ONOSbench.onosInstall( ONOSIp[node])
+
+ for node in range(1, clusterCount + 1):
+ for i in range( 2 ):
+ isup = main.ONOSbench.isup( ONOSIp[node] )
+ if isup:
+ main.log.info("ONOS " + str(node) + " is up\n")
+ break
+ if not isup:
+ main.log.report( "ONOS " + str(node) + " didn't start!" )
+ main.log.info("Startup sequence complete")
+
+ for i in range(5):
+ main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.fwd.ReactiveForwarding","packetOutOnly true")
+ time.sleep(5)
+ main.ONOSbench.handle.sendline("onos $OC1 cfg get|grep packetOutOnly")
+ main.ONOSbench.handle.expect(":~")
+ check = main.ONOSbench.handle.before
+ if "value=true" in check:
+ main.log.info("cfg set successful")
+ break
+ if i == 4:
+ main.log.info("Cfg set failed")
+ else:
+ time.sleep(5)
+
+
+
+
+
+ def CASE2( self, main ):
+
+ mode = main.params[ 'TEST' ][ 'mode' ]
+ if mode != "t":
+ mode = " "
+
+ runCbench = ( "ssh admin@" + ONOSIp[1] + " cbench -c localhost -p 6633 -m 1000 -l 25 -s 16 -M 100000 -w 15 -D 10000 -" + mode )
+ main.ONOSbench.handle.sendline(runCbench)
+ time.sleep(30)
+ main.ONOSbench.handle.expect(":~")
+ output = main.ONOSbench.handle.before
+ main.log.info(output)
+
+ output = output.splitlines()
+ for line in output:
+ if "RESULT: " in line:
+ print line
+ break
+
+ resultLine = line.split(" ")
+ for word in resultLine:
+ if word == "min/max/avg/stdev":
+ resultsIndex = resultLine.index(word)
+ print resultsIndex
+ break
+
+ finalDataString = resultLine[resultsIndex + 2]
+ print finalDataString
+ finalDataList = finalDataString.split("/")
+ avg = finalDataList[2]
+ stdev = finalDataList[3]
+
+ main.log.info("Average: \t\t\t" + avg)
+ main.log.info("Standard Deviation: \t" + stdev)
+
+ if mode == " ":
+ mode = "l"
+
+ commit = main.ONOSbench.getVersion()
+ commit = (commit.split(" "))[1]
+
+ dbfile = open("CbenchBMDB", "w+")
+ temp = "'" + commit + "',"
+ temp += "'" + mode + "',"
+ temp += "'" + avg + "',"
+ temp += "'" + stdev + "'\n"
+ dbfile.write(temp)
+ dbfile.close()
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
+
+
+
+
+
+
+
+
+
diff --git a/TestON/tests/CbenchBM/CbenchBM.topo b/TestON/tests/CbenchBM/CbenchBM.topo
new file mode 100644
index 0000000..7b39c4e
--- /dev/null
+++ b/TestON/tests/CbenchBM/CbenchBM.topo
@@ -0,0 +1,144 @@
+<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/CbenchBM/__init__.py b/TestON/tests/CbenchBM/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/CbenchBM/__init__.py