initial commit for NetworkTP test- script finished
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index b05a132..f0baa25 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -596,12 +596,12 @@
                 # Note that this variable name is subject to change
                 #   and that this driver will have to change accordingly
                 self.handle.expect(str(cellname))
-                handle_before = self.handle.before
-                handle_after = self.handle.after
+                handleBefore = self.handle.before
+                handleAfter = self.handle.after
                 # Get the rest of the handle
                 self.handle.sendline("")
                 self.handle.expect("\$")
-                handle_more = self.handle.before
+                handleMore = self.handle.before
 
                 main.log.info( "Cell call returned: " + handleBefore +
                                handleAfter + handleMore )
diff --git a/TestON/tests/IntentsLoad/IntentsLoad.params b/TestON/tests/IntentsLoad/IntentsLoad.params
index b60621c..20e9835 100644
--- a/TestON/tests/IntentsLoad/IntentsLoad.params
+++ b/TestON/tests/IntentsLoad/IntentsLoad.params
@@ -1,6 +1,6 @@
 <PARAMS>
 
-    <testcases>1,2,4</testcases>
+    <testcases>1,2,2,5</testcases>
 
     <ENV>
     <cellName>cam_cells</cellName>
@@ -38,7 +38,7 @@
     <loadstop>curl --fail http://localhost:8181/onos/demo/intents/teardown</loadstop>
     <arping>py [h.cmd("arping -c 1 -w 1 10.0.0.225") for h in net.hosts]</arping>
     <metric1>intents-events-metrics|grep "Intent Installed Events"</metric1>
-    <duration>90</duration>
+    <duration>30</duration>
     <log_interval>5</log_interval>
     </TEST>
 
diff --git a/TestON/tests/IntentsLoad/IntentsLoad.py b/TestON/tests/IntentsLoad/IntentsLoad.py
index faaec26..2605351 100644
--- a/TestON/tests/IntentsLoad/IntentsLoad.py
+++ b/TestON/tests/IntentsLoad/IntentsLoad.py
@@ -99,24 +99,7 @@
                 install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
                 cli2 = main.ONOS2cli.startOnosCli( ONOS2Ip )
                 cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
-            """
-            elif clusterCount == 5:
-                main.log.info( "Installing nodes 4 and 5" )
-                node4Result = main.ONOSbench.onosInstall( node=ONOS4Ip )
-                node5Result = main.ONOSbench.onosInstall( node=ONOS5Ip )
-                installResult = node4Result and node5Result
-                time.sleep( 5 )
-                main.ONOS4cli.startOnosCli( ONOS4Ip )
-                main.ONOS5cli.startOnosCli( ONOS5Ip )
-            elif clusterCount == 7:
-                main.log.info( "Installing nodes 4 and 5" )
-                node6Result = main.ONOSbench.onosInstall( node=ONOS6Ip )
-                node7Result = main.ONOSbench.onosInstall( node=ONOS7Ip )
-                installResult = node6Result and node7Result
-                time.sleep( 5 )
-                main.ONOS6cli.startOnosCli( ONOS6Ip )
-                main.ONOS7cli.startOnosCli( ONOS7Ip )
-            """
+              
         if scale == 1:
             if clusterCount == 2:
                 main.log.info( "Installing node 2" )
@@ -291,3 +274,104 @@
 
         msg = ( "Final rate on node 2: " + str( lastRate2 ) )
         main.log.report( msg )
+
+
+    
+    def CASE5( self, main ):  # 2 node scale
+        import time
+        import json
+        import string
+
+        intentsRate = main.params[ 'JSON' ][ 'intents_rate' ]
+
+        defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
+
+        main.Mininet1.assignSwController(
+            sw="1",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="2",
+            ip1=ONOS2Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="3",
+            ip1=ONOS3Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="4",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="5",
+            ip1=ONOS2Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="6",
+            ip1=ONOS3Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="7",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+
+        mnArp = main.params[ 'TEST' ][ 'arping' ]
+        main.Mininet1.handle.sendline( mnArp )
+
+        generateLoad = main.params[ 'TEST' ][ 'loadstart' ]
+
+        main.ONOS1.handle.sendline( generateLoad )
+        main.ONOS2.handle.sendline( generateLoad )
+        main.ONOS3.handle.sendline( generateLoad )        
+
+        devicesJsonStr1 = main.ONOS1cli.devices()
+        devicesJsonObj1 = json.loads( devicesJsonStr1 )
+        devicesJsonStr2 = main.ONOS2cli.devices()
+        devicesJsonObj2 = json.loads( devicesJsonStr2 )
+        devicesJsonStr3 = main.ONOS3cli.devices()
+        devicesJsonObj3 = json.loads( devicesJsonStr3 )
+
+        getMetric = main.params[ 'TEST' ][ 'metric1' ]
+        testDuration = main.params[ 'TEST' ][ 'duration' ]
+        stop = time.time() + float( testDuration )
+
+        main.log.info( "Starting test loop..." )
+        logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+
+        while time.time() < stop:
+            time.sleep( float( logInterval ) )
+
+            intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics()
+            intentsJsonObj1 = json.loads( intentsJsonStr1 )
+            main.log.info( "Node 1 rate: " +
+                           str( intentsJsonObj1[ intentsRate ][ 'm1_rate' ] ) )
+            lastRate1 = intentsJsonObj1[ intentsRate ][ 'm1_rate' ]
+
+            intentsJsonStr2 = main.ONOS2cli.intentsEventsMetrics()
+            intentsJsonObj2 = json.loads( intentsJsonStr2 )
+            main.log.info( "Node 2 rate: " +
+                           str( intentsJsonObj2[ intentsRate ][ 'm1_rate' ] ) )
+            lastRate2 = intentsJsonObj2[ intentsRate ][ 'm1_rate' ]
+
+            intentsJsonStr3 = main.ONOS3cli.intentsEventsMetrics()
+            intentsJsonObj3 = json.loads( intentsJsonStr3 )
+            main.log.info( "Node 3 rate: " +
+                           str( intentsJsonObj3[ intentsRate ][ 'm1_rate' ] ) )
+            lastRate3 = intentsJsonObj3[ intentsRate ][ 'm1_rate' ]
+
+        stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+        main.ONOS1.handle.sendline( stopLoad )
+        main.ONOS2.handle.sendline( stopLoad )
+        main.ONOS3.handle.sendline( stopLoad )
+
+        msg = ( "Final rate on node 1: " + str( lastRate1 ) )
+        main.log.report( msg )
+
+        msg = ( "Final rate on node 2: " + str( lastRate2 ) )
+        main.log.report( msg )
+
+        msg = ( "Final rate on node 3: " + str( lastRate3 ) )
+        main.log.report( msg )
+
+
+    
diff --git a/TestON/tests/NetworkTP/.IntentsLoad.py.swo b/TestON/tests/NetworkTP/.IntentsLoad.py.swo
new file mode 100644
index 0000000..fe9088a
--- /dev/null
+++ b/TestON/tests/NetworkTP/.IntentsLoad.py.swo
Binary files differ
diff --git a/TestON/tests/NetworkTP/NetworkTP.params b/TestON/tests/NetworkTP/NetworkTP.params
new file mode 100644
index 0000000..72a92c1
--- /dev/null
+++ b/TestON/tests/NetworkTP/NetworkTP.params
@@ -0,0 +1,45 @@
+<PARAMS>
+
+    <testcases>1,3,2,4,2,5</testcases>
+
+    <ENV>
+    <cellName>network_tp_test</cellName>
+    </ENV>
+
+    <SCALE>1</SCALE>
+
+    <GIT>
+        <autopull>off</autopull>
+        <checkout>master</checkout>
+    </GIT>
+
+    <CTRL>
+        <USER>admin</USER>
+        <ip1>10.128.5.51</ip1>
+        <port1>6633</port1>
+        <ip2>10.128.5.52</ip2>
+        <port2>6633</port2>
+        <ip3>10.128.5.53</ip3>
+        <port3>6633</port3>
+    </CTRL>
+
+    <BENCH>
+        <user>admin</user>
+        <ip1>10.128.5.55</ip1>
+    </BENCH>
+
+    <TEST>                              #   duration =      time the test loop runs
+                                        #   log_interval =  how often the data is reported 
+                                        #   wait =          time between tests, used to let the averages run down 
+                                         
+    <metric1>topologyLinkEventRate</metric1>
+    <duration>30</duration>
+    <log_interval>5</log_interval>
+    <wait>5</wait>
+    </TEST>
+
+    <JSON>
+        <intents_rate>intentInstalledRate</intents_rate>
+    </JSON>
+
+</PARAMS>
diff --git a/TestON/tests/NetworkTP/NetworkTP.py b/TestON/tests/NetworkTP/NetworkTP.py
new file mode 100644
index 0000000..c64a106
--- /dev/null
+++ b/TestON/tests/NetworkTP/NetworkTP.py
@@ -0,0 +1,237 @@
+# ScaleOutTemplate --> NetworkTP
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os
+
+
+class NetworkTP:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):
+
+        global clusterCount
+        clusterCount = 1
+
+        checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+        gitPull = main.params[ 'GIT' ][ 'autopull' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+        BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
+        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
+        
+
+        main.log.step( "Cleaning Enviornment..." )
+        main.ONOSbench.onosUninstall( ONOS1Ip )
+        main.ONOSbench.onosUninstall( ONOS2Ip )
+        main.ONOSbench.onosUninstall( ONOS3Ip )
+
+        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" )
+
+        #mvnResult = main.ONOSbench.cleanInstall()
+
+        main.step( "Set cell for ONOS cli env" )
+        main.ONOS1cli.setCell( cellName )
+        main.ONOS2cli.setCell( cellName )
+        main.ONOS3cli.setCell( cellName )
+
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage()  # no file or directory
+
+        main.step( "Installing ONOS package" )
+        install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
+
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        main.step( "Applying cell file to environment" )
+        cellApplyResult = main.ONOSbench.setCell( cellName )
+        main.step( "verify cells" )
+        verifyCellResult = main.ONOSbench.verifyCell()
+
+        main.step( "Set cell for ONOS cli env" )
+        main.ONOS1cli.setCell( cellName )
+
+        cli1 = main.ONOS1cli.startOnosCli( ONOS1Ip )
+
+    def CASE2( self, main ):
+        """
+        Increase number of nodes and initiate CLI
+        """
+        import time
+
+        global clusterCount
+
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
+        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
+        #ONOS4Ip = main.params[ 'CTRL' ][ 'ip4' ]
+        #ONOS5Ip = main.params[ 'CTRL' ][ 'ip5' ]
+        #ONOS6Ip = main.params[ 'CTRL' ][ 'ip6' ]
+        #ONOS7Ip = main.params[ 'CTRL' ][ 'ip7' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        scale = int( main.params[ 'SCALE' ] )
+
+        # Cluster size increased everytime the case is defined
+        clusterCount += scale
+
+        main.log.report( "Increasing cluster size to " +
+                         str( clusterCount ) )
+        installResult = main.FALSE
+
+        if scale == 2:
+            if clusterCount == 3:
+                main.log.info( "Installing nodes 2 and 3" )
+                install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
+                install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
+                cli2 = main.ONOS2cli.startOnosCli( ONOS2Ip )
+                cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
+              
+        if scale == 1:
+            if clusterCount == 2:
+                main.log.info( "Installing node 2" )
+                install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
+                cli2 = main.ONOS2cli.startOnosCli( ONOS2Ip )
+
+            if clusterCount == 3:
+                main.log.info( "Installing node 3" )
+                install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
+                cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
+
+
+    def CASE3( self, main ):
+        import time
+        import json
+        import string
+
+        testDelay = main.params[ 'TEST' ][ 'wait']
+        time.sleep( float( testDelay ) )
+
+        getMetric = main.params[ 'TEST' ][ 'metric1' ]
+        testDuration = main.params[ 'TEST' ][ 'duration' ]
+        stop = time.time() + float( testDuration )
+    
+        main.ONOS1cli.featureInstall("onos-null")
+
+        msg = ( "Starting test loop for " + str(testDuration) + " seconds" )
+        main.log.info( msg )
+        logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+
+        while time.time() < stop:
+            time.sleep( float( logInterval ) )
+
+            intentsJsonStr1 = main.ONOS1cli.topologyEventsMetrics() 
+            intentsJsonObj1 = json.loads( intentsJsonStr1 ) 
+            msg = ( "Node 1 TP: " + str( intentsJsonObj1[ getMetric  ][ 'm1_rate' ] ) )
+            main.log.info( msg ) 
+            lastRate1 = intentsJsonObj1[ getMetric  ][ 'm1_rate' ]
+
+        msg = ( "Final TP on node 1: " + str( lastRate1 ) )
+        main.log.report( msg )
+
+
+    def CASE4( self, main ):
+        import time
+        import json
+        import string
+
+        testDelay = main.params[ 'TEST' ][ 'wait']
+        time.sleep( float( testDelay ) )
+
+        getMetric = main.params[ 'TEST' ][ 'metric1' ]
+        testDuration = main.params[ 'TEST' ][ 'duration' ]
+        stop = time.time() + float( testDuration )
+
+        main.ONOS2cli.featureInstall("onos-null")
+
+        msg = ( "Starting test loop for " + str(testDuration) + " seconds" )
+        main.log.info( msg )
+        logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+
+        while time.time() < stop:
+            time.sleep( float( logInterval ) )
+
+            intentsJsonStr1 = main.ONOS1cli.topologyEventsMetrics() 
+            intentsJsonObj1 = json.loads( intentsJsonStr1 )
+            msg = ( "Node 1 TP: " + str( intentsJsonObj1[ getMetric  ][ 'm1_rate' ] ) )
+            main.log.info( msg )
+            lastRate1 = intentsJsonObj1[ getMetric  ][ 'm1_rate' ]
+
+
+            intentsJsonStr2 = main.ONOS2cli.topologyEventsMetrics() 
+            intentsJsonObj2 = json.loads( intentsJsonStr2 )
+            msg = ( "Node 2 TP: " + str( intentsJsonObj2[ getMetric  ][ 'm1_rate' ] ) )
+            main.log.info( msg )
+            lastRate2 = intentsJsonObj2[ getMetric  ][ 'm1_rate' ]
+
+
+        msg = ( "Final TP on node 1: " + str( lastRate1 ) )
+        main.log.report( msg )
+
+        msg = ( "Final TP on node 2: " + str( lastRate2 ) )
+        main.log.report( msg )
+
+    def CASE5( self, main ):
+        import time
+        import json
+        import string
+
+        testDelay = main.params[ 'TEST' ][ 'wait']
+        time.sleep( float( testDelay ) )
+
+        getMetric = main.params[ 'TEST' ][ 'metric1' ]
+        testDuration = main.params[ 'TEST' ][ 'duration' ]
+        stop = time.time() + float( testDuration )
+
+        main.ONOS3cli.featureInstall("onos-null")
+
+        msg = ( "Starting test loop for " + str(testDuration) + " seconds" )
+        main.log.info( msg )
+        logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+
+        while time.time() < stop:
+            time.sleep( float( logInterval ) )
+
+            intentsJsonStr1 = main.ONOS1cli.topologyEventsMetrics()
+            intentsJsonObj1 = json.loads( intentsJsonStr1 )
+            msg = ( "Node 1 TP: " + str( intentsJsonObj1[ getMetric  ][ 'm1_rate' ] ) )
+            main.log.info( msg )
+            lastRate1 = intentsJsonObj1[ getMetric  ][ 'm1_rate' ]
+
+
+            intentsJsonStr2 = main.ONOS2cli.topologyEventsMetrics()
+            intentsJsonObj2 = json.loads( intentsJsonStr2 )
+            msg = ( "Node 2 TP: " + str( intentsJsonObj2[ getMetric  ][ 'm1_rate' ] ) )
+            main.log.info( msg )
+            lastRate2 = intentsJsonObj2[ getMetric  ][ 'm1_rate' ]
+    
+            intentsJsonStr3 = main.ONOS3cli.topologyEventsMetrics()
+            intentsJsonObj3 = json.loads( intentsJsonStr3 )
+            msg = ( "Node 3 TP: " + str( intentsJsonObj3[ getMetric  ][ 'm1_rate' ] ) )
+            main.log.info( msg )
+            lastRate3 = intentsJsonObj3[ getMetric  ][ 'm1_rate' ]
+
+        msg = ( "Final TP on node 1: " + str( lastRate1 ) )
+        main.log.report( msg )
+
+        msg = ( "Final TP on node 2: " + str( lastRate2 ) )
+        main.log.report( msg )
+
+        msg = ( "Final TP on node 3: " + str( lastRate3 ) )
+        main.log.report( msg )
+
+
+
diff --git a/TestON/tests/NetworkTP/NetworkTP.topo b/TestON/tests/NetworkTP/NetworkTP.topo
new file mode 100644
index 0000000..dda5114
--- /dev/null
+++ b/TestON/tests/NetworkTP/NetworkTP.topo
@@ -0,0 +1,70 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOSbench>
+
+        <ONOS1cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1cli>
+        
+        <ONOS2cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2cli>
+
+        <ONOS3cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3cli>
+
+        <ONOS1>
+            <host>10.128.5.51</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1>
+
+        <ONOS2>
+            <host>10.128.5.52</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2>
+
+        <ONOS3>
+            <host>10.128.5.53</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3>
+    </COMPONENT>
+
+</TOPOLOGY>
+
diff --git a/TestON/tests/NetworkTP/__init__.py b/TestON/tests/NetworkTP/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/NetworkTP/__init__.py