diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index abe064f..2f9e752 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -142,12 +142,13 @@
                 # Expect the cellname in the ONOSCELL variable.
                 # Note that this variable name is subject to change
                 #   and that this driver will have to change accordingly
-                self.handle.expect( "ONOS_CELL=" + str( cellname ) )
+                self.handle.expect(str(cellname))
+
                 handleBefore = self.handle.before
                 handleAfter = self.handle.after
                 # Get the rest of the handle
-                self.handle.sendline( "" )
-                self.handle.expect( "\$" )
+                self.handle.sendline("")
+                self.handle.expect("\$")
                 handleMore = self.handle.before
 
                 main.log.info( "Cell call returned: " + handleBefore +
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index c92a608..b05a132 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -595,13 +595,13 @@
                 # Expect the cellname in the ONOSCELL variable.
                 # Note that this variable name is subject to change
                 #   and that this driver will have to change accordingly
-                self.handle.expect( "ONOS_CELL=" + str( cellname ) )
-                handleBefore = self.handle.before
-                handleAfter = self.handle.after
+                self.handle.expect(str(cellname))
+                handle_before = self.handle.before
+                handle_after = self.handle.after
                 # Get the rest of the handle
-                self.handle.sendline( "" )
-                self.handle.expect( "\$" )
-                handleMore = self.handle.before
+                self.handle.sendline("")
+                self.handle.expect("\$")
+                handle_more = self.handle.before
 
                 main.log.info( "Cell call returned: " + handleBefore +
                                handleAfter + handleMore )
@@ -1031,18 +1031,18 @@
             main.cleanup()
             main.exit()
 
-    def isup( self, node="" ):
+    def isup(self, node = "", timeout = 120):
         """
         Run's onos-wait-for-start which only returns once ONOS is at run
-        level 100( ready for use )
+        level 100(ready for use)
 
         Returns: main.TRUE if ONOS is running and main.FALSE on timeout
         """
         try:
-            self.handle.sendline( "onos-wait-for-start " + node )
-            self.handle.expect( "onos-wait-for-start" )
+            self.handle.sendline("onos-wait-for-start " + node )
+            self.handle.expect("onos-wait-for-start")
             # NOTE: this timeout is arbitrary"
-            i = self.handle.expect( [ "\$", pexpect.TIMEOUT ], timeout=120 )
+            i = self.handle.expect(["\$", pexpect.TIMEOUT], timeout)
             if i == 0:
                 main.log.info( self.name + ": " + node + " is up" )
                 return main.TRUE
diff --git a/TestON/tests/IntentsLoad/.IntentsLoad.py.swo b/TestON/tests/IntentsLoad/.IntentsLoad.py.swo
new file mode 100644
index 0000000..fe9088a
--- /dev/null
+++ b/TestON/tests/IntentsLoad/.IntentsLoad.py.swo
Binary files differ
diff --git a/TestON/tests/IntentsLoad/IntentsLoad.py b/TestON/tests/IntentsLoad/IntentsLoad.py
index f13e60d..faaec26 100644
--- a/TestON/tests/IntentsLoad/IntentsLoad.py
+++ b/TestON/tests/IntentsLoad/IntentsLoad.py
@@ -4,260 +4,290 @@
 #
 # cameron@onlab.us
 
-import sys 
-import os 
+import sys
+import os
 
 
 class IntentsLoad:
-    def __init__(self):
+
+    def __init__( self ):
         self.default = ''
-   
-    def CASE1(self, main):
-        
-        global cluster_count 
-        cluster_count = 1        
 
-        checkout_branch = main.params['GIT']['checkout']
-        git_pull = main.params['GIT']['autopull']
-        cell_name = main.params['ENV']['cellName']
-        BENCH_ip = main.params['BENCH']['ip1']
-        BENCH_user = main.params['BENCH']['user']
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        MN1_ip = main.params['MN']['ip1']
+    def CASE1( self, main ):
 
-        main.log.step("Cleaning Enviornment...")
-        main.ONOSbench.onos_uninstall(ONOS1_ip)
-        main.ONOSbench.onos_uninstall(ONOS2_ip)
-        main.ONOSbench.onos_uninstall(ONOS3_ip)                                     
-        
-        main.step("Git checkout and pull "+checkout_branch)
-        if git_pull == 'on':
-            checkout_result = main.ONOSbench.git_checkout(checkout_branch)       
-            pull_result = main.ONOSbench.git_pull()
-            
+        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' ]
+        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+
+        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:
-            checkout_result = main.TRUE
-            pull_result = main.TRUE
-            main.log.info("Skipped git checkout and pull")
+            checkoutResult = main.TRUE
+            pullResult = main.TRUE
+            main.log.info( "Skipped git checkout and pull" )
 
-        #mvn_result = main.ONOSbench.clean_install()
-                                                                   
-        main.step("Set cell for ONOS cli env")
-        main.ONOS1cli.set_cell(cell_name)
-        main.ONOS2cli.set_cell(cell_name)
-        main.ONOS3cli.set_cell(cell_name)
+        #mvnResult = main.ONOSbench.cleanInstall()
 
-        main.step("Creating ONOS package")
-        package_result = main.ONOSbench.onos_package()                             #no file or directory 
+        main.step( "Set cell for ONOS cli env" )
+        main.ONOS1cli.setCell( cellName )
+        main.ONOS2cli.setCell( cellName )
+        main.ONOS3cli.setCell( cellName )
 
-        main.step("Installing ONOS package")
-        install1_result = main.ONOSbench.onos_install(node=ONOS1_ip)
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage()  # no file or directory
 
-        cell_name = main.params['ENV']['cellName']
-        main.step("Applying cell file to environment")
-        cell_apply_result = main.ONOSbench.set_cell(cell_name)
-        main.step("verify cells")
-        verify_cell_result = main.ONOSbench.verify_cell()
+        main.step( "Installing ONOS package" )
+        install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
 
-        main.step("Set cell for ONOS cli env")
-        main.ONOS1cli.set_cell(cell_name) 
- 
-        cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip) 
+        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()
 
-    def CASE2(self, main):
+        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 cluster_count
-        
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        #ONOS4_ip = main.params['CTRL']['ip4']
-        #ONOS5_ip = main.params['CTRL']['ip5']
-        #ONOS6_ip = main.params['CTRL']['ip6']
-        #ONOS7_ip = main.params['CTRL']['ip7']
-        cell_name = main.params['ENV']['cellName']
-        scale = int(main.params['SCALE'])
+        """
+        import time
 
+        global clusterCount
 
-        #Cluster size increased everytime the case is defined
-        cluster_count += scale
- 
-        main.log.report("Increasing cluster size to "+
-                str(cluster_count))
-        install_result = main.FALSE
-        
+        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 cluster_count == 3:
-                main.log.info("Installing nodes 2 and 3")
-                install2_result = main.ONOSbench.onos_install(node=ONOS2_ip)
-                install3_result = main.ONOSbench.onos_install(node=ONOS3_ip)
-                cli2 = main.ONOS2cli.start_onos_cli(ONOS2_ip)
-                cli3 = main.ONOS3cli.start_onos_cli(ONOS3_ip) 
-            '''
-            elif cluster_count == 5:
+            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 )
+            """
+            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" )
+                install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
+                cli2 = main.ONOS2cli.startOnosCli( ONOS2Ip )
 
-                main.log.info("Installing nodes 4 and 5")
-                node4_result = main.ONOSbench.onos_install(node=ONOS4_ip)
-                node5_result = main.ONOSbench.onos_install(node=ONOS5_ip)
-                install_result = node4_result and node5_result
-                time.sleep(5)
+            if clusterCount == 3:
+                main.log.info( "Installing node 3" )
+                install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
+                cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
 
-                main.ONOS4cli.start_onos_cli(ONOS4_ip)
-                main.ONOS5cli.start_onos_cli(ONOS5_ip)
-
-            elif cluster_count == 7:
-
-                main.log.info("Installing nodes 4 and 5")
-                node6_result = main.ONOSbench.onos_install(node=ONOS6_ip)
-                node7_result = main.ONOSbench.onos_install(node=ONOS7_ip)
-                install_result = node6_result and node7_result
-                time.sleep(5)
-
-                main.ONOS6cli.start_onos_cli(ONOS6_ip)
-                main.ONOS7cli.start_onos_cli(ONOS7_ip)
-            '''
-        if scale == 1: 
-            if cluster_count == 2:
-                main.log.info("Installing node 2")
-                install2_result = main.ONOSbench.onos_install(node=ONOS2_ip)
-                cli2 = main.ONOS2cli.start_onos_cli(ONOS2_ip)
-
-            if cluster_count == 3:
-                main.log.info("Installing node 3")
-                install3_result = main.ONOSbench.onos_install(node=ONOS3_ip)
-                cli3 = main.ONOS3cli.start_onos_cli(ONOS3_ip)
-    
-    
-    
-    def CASE3(self,main):
-        import time 
-        import json
-        import string
-        
-        intents_rate = main.params['JSON']['intents_rate']
-
-        default_sw_port = main.params[ 'CTRL' ][ 'port1' ]
-
-        main.Mininet1.assign_sw_controller(sw="1", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="2", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="3", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="4", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="5", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="6", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="7", ip1=ONOS1_ip, port1=default_sw_port )
-        
-        mn_arp = main.params['TEST']['arping']
-        main.Mininet1.handle.sendline(mn_arp)
-
-        generate_load = main.params['TEST']['loadstart']
-   
-        main.ONOS1.handle.sendline(generate_load)
-        main.ONOS1.handle.expect("sdn")
-        print("before: ", main.ONOS1.handle.before)
-        print("after: ",main.ONOS1.handle.after)
-        
-        load_confirm = main.ONOS1.handle.after
-        if load_confirm == "{}":
-            main.log.info("Load started")
-
-        else: 
-            main.log.error("Load start failure")
-            main.log.error("expected '{}', got: " + str(load_confirm))
-     
-        devices_json_str = main.ONOS1cli.devices()
-        devices_json_obj = json.loads(devices_json_str)
-
-        get_metric = main.params['TEST']['metric1']
-        test_duration = main.params['TEST']['duration']
-        stop = time.time() + float(test_duration)
-
-
-        main.log.info("Starting test loop...")
-        log_interval = main.params['TEST']['log_interval']
-
-        while time.time() < stop: 
-            time.sleep(float(log_interval))
-         
-            intents_json_str_1 = main.ONOS1cli.intents_events_metrics()
-            intents_json_obj_1 = json.loads(intents_json_str_1)
-            main.log.info("Node 1 rate: " + str(intents_json_obj_1[intents_rate]['m1_rate']))
-            last_rate_1 = intents_json_obj_1[intents_rate]['m1_rate']
-        
-        stop_load = main.params['TEST']['loadstop']
-        main.ONOS1.handle.sendline(stop_load)
-        
-        
-        msg = ("Final rate on node 1: " + str(last_rate_1))
-        main.log.report(msg)
-
-    def CASE4(self, main):      #2 node scale 
+    def CASE3( self, main ):
         import time
         import json
         import string
 
-        intents_rate = main.params['JSON']['intents_rate']
-        
-        default_sw_port = main.params[ 'CTRL' ][ 'port1' ]
+        intentsRate = main.params[ 'JSON' ][ 'intents_rate' ]
 
-        main.Mininet1.assign_sw_controller(sw="1", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="2", ip1=ONOS2_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="3", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="4", ip1=ONOS2_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="5", ip1=ONOS1_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="6", ip1=ONOS2_ip, port1=default_sw_port )
-        main.Mininet1.assign_sw_controller(sw="7", ip1=ONOS1_ip, port1=default_sw_port )
+        defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
 
-        mn_arp = main.params['TEST']['arping']
-        main.Mininet1.handle.sendline(mn_arp)
+        main.Mininet1.assignSwController(
+            sw="1",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="2",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="3",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="4",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="5",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="6",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="7",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
 
-        generate_load = main.params['TEST']['loadstart']
+        mnArp = main.params[ 'TEST' ][ 'arping' ]
+        main.Mininet1.handle.sendline( mnArp )
 
-        main.ONOS1.handle.sendline(generate_load)
-        main.ONOS2.handle.sendline(generate_load)
+        generateLoad = main.params[ 'TEST' ][ 'loadstart' ]
 
-        devices_json_str_1 = main.ONOS1cli.devices()
-        devices_json_obj_1 = json.loads(devices_json_str_1)
-        devices_json_str_2 = main.ONOS2cli.devices()
-        devices_json_obj_2 = json.loads(devices_json_str_2)
+        main.ONOS1.handle.sendline( generateLoad )
+        main.ONOS1.handle.expect( "sdn" )
+        print( "before: ", main.ONOS1.handle.before )
+        print( "after: ", main.ONOS1.handle.after )
 
-        get_metric = main.params['TEST']['metric1']
-        test_duration = main.params['TEST']['duration']
-        stop = time.time() + float(test_duration)
+        loadConfirm = main.ONOS1.handle.after
+        if loadConfirm == "{}":
+            main.log.info( "Load started" )
 
+        else:
+            main.log.error( "Load start failure" )
+            main.log.error( "expected '{}', got: " + str( loadConfirm ) )
 
-        main.log.info("Starting test loop...")
-        log_interval = main.params['TEST']['log_interval']
+        devicesJsonStr = main.ONOS1cli.devices()
+        devicesJsonObj = json.loads( devicesJsonStr )
+
+        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(log_interval))
+            time.sleep( float( logInterval ) )
 
-            intents_json_str_1 = main.ONOS1cli.intents_events_metrics()
-            intents_json_obj_1 = json.loads(intents_json_str_1)
-            main.log.info("Node 1 rate: " + str(intents_json_obj_1[intents_rate]['m1_rate']))
-            last_rate_1 = intents_json_obj_1[intents_rate]['m1_rate']
-            
-            intents_json_str_2 = main.ONOS2cli.intents_events_metrics()
-            intents_json_obj_2 = json.loads(intents_json_str_2)
-            main.log.info("Node 2 rate: " + str(intents_json_obj_2[intents_rate]['m1_rate']))
-            last_rate_2 = intents_json_obj_2[intents_rate]['m1_rate']
+            intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics()
+            intentsJsonObj1 = json.loads( intentsJsonStr1 )
+            main.log.info( "Node 1 rate: " +
+                           str( intentsJsonObj1[ intentsRate ][ 'm1_rate' ] ) )
+            lastRate1 = intentsJsonObj1[ intentsRate ][ 'm1_rate' ]
 
-        stop_load = main.params['TEST']['loadstop']
-        main.ONOS1.handle.sendline(stop_load)
-        main.ONOS2.handle.sendline(stop_load)
+        stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+        main.ONOS1.handle.sendline( stopLoad )
 
+        msg = ( "Final rate on node 1: " + str( lastRate1 ) )
+        main.log.report( msg )
 
-        msg = ("Final rate on node 1: " + str(last_rate_1))
-        main.log.report(msg)
-    
-        msg = ("Final rate on node 2: " + str(last_rate_2))
-        main.log.report(msg)
+    def CASE4( 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=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="4",
+            ip1=ONOS2Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="5",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="6",
+            ip1=ONOS2Ip,
+            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 )
+
+        devicesJsonStr1 = main.ONOS1cli.devices()
+        devicesJsonObj1 = json.loads( devicesJsonStr1 )
+        devicesJsonStr2 = main.ONOS2cli.devices()
+        devicesJsonObj2 = json.loads( devicesJsonStr2 )
+
+        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' ]
+
+        stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+        main.ONOS1.handle.sendline( stopLoad )
+        main.ONOS2.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 )
diff --git a/TestON/tests/IntentsLoad/IntentsLoad.py.fixed b/TestON/tests/IntentsLoad/IntentsLoad.py.fixed
new file mode 100644
index 0000000..faaec26
--- /dev/null
+++ b/TestON/tests/IntentsLoad/IntentsLoad.py.fixed
@@ -0,0 +1,293 @@
+# ScaleOutTemplate --> IntentsLoad
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os
+
+
+class IntentsLoad:
+
+    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' ]
+        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+
+        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 )
+            """
+            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" )
+                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
+
+        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=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="3",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="4",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="5",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="6",
+            ip1=ONOS1Ip,
+            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.ONOS1.handle.expect( "sdn" )
+        print( "before: ", main.ONOS1.handle.before )
+        print( "after: ", main.ONOS1.handle.after )
+
+        loadConfirm = main.ONOS1.handle.after
+        if loadConfirm == "{}":
+            main.log.info( "Load started" )
+
+        else:
+            main.log.error( "Load start failure" )
+            main.log.error( "expected '{}', got: " + str( loadConfirm ) )
+
+        devicesJsonStr = main.ONOS1cli.devices()
+        devicesJsonObj = json.loads( devicesJsonStr )
+
+        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' ]
+
+        stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+        main.ONOS1.handle.sendline( stopLoad )
+
+        msg = ( "Final rate on node 1: " + str( lastRate1 ) )
+        main.log.report( msg )
+
+    def CASE4( 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=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="4",
+            ip1=ONOS2Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="5",
+            ip1=ONOS1Ip,
+            port1=defaultSwPort )
+        main.Mininet1.assignSwController(
+            sw="6",
+            ip1=ONOS2Ip,
+            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 )
+
+        devicesJsonStr1 = main.ONOS1cli.devices()
+        devicesJsonObj1 = json.loads( devicesJsonStr1 )
+        devicesJsonStr2 = main.ONOS2cli.devices()
+        devicesJsonObj2 = json.loads( devicesJsonStr2 )
+
+        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' ]
+
+        stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+        main.ONOS1.handle.sendline( stopLoad )
+        main.ONOS2.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 )
diff --git a/TestON/tests/ScaleOutTemplate/.ScaleOutTemplate.py.swo b/TestON/tests/ScaleOutTemplate/.ScaleOutTemplate.py.swo
new file mode 100644
index 0000000..a1a28ae
--- /dev/null
+++ b/TestON/tests/ScaleOutTemplate/.ScaleOutTemplate.py.swo
Binary files differ
diff --git a/TestON/tests/ScaleOutTemplate/NOTES.txt b/TestON/tests/ScaleOutTemplate/NOTES.txt
new file mode 100644
index 0000000..6942f14
--- /dev/null
+++ b/TestON/tests/ScaleOutTemplate/NOTES.txt
@@ -0,0 +1,5 @@
+create the params file to go with the topofile and write the python case 
+need an __init__ doc? always empty? ask/look up
+remember to write in startup verification and check manually the first few times
+remember to refer to TopoConvNext for reference
+might need to delete THIS file when done 
diff --git a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
index a75d694..b5a1e2e 100644
--- a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
+++ b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
@@ -4,133 +4,132 @@
 #
 # cameron@onlab.us
 
-import sys 
-import os 
+import sys
+import os
 
 
 class ScaleOutTemplate:
-    def __init__(self):
+
+    def __init__( self ):
         self.default = ''
-   
-    def CASE1(self, main):
-        
-        global cluster_count 
-        cluster_count = 1        
 
-        checkout_branch = main.params['GIT']['checkout']
-        git_pull = main.params['GIT']['autopull']
-        cell_name = main.params['ENV']['cellName']
-        BENCH_ip = main.params['BENCH']['ip1']
-        BENCH_user = main.params['BENCH']['user']
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        MN1_ip = main.params['MN']['ip1']
+    def CASE1( self, main ):
 
-        main.log.step("Cleaning Enviornment...")
-        main.ONOSbench.onos_uninstall(ONOS1_ip)
-        main.ONOSbench.onos_uninstall(ONOS2_ip)
-        main.ONOSbench.onos_uninstall(ONOS3_ip)                                     
-        
-        main.step("Git checkout and pull "+checkout_branch)
-        if git_pull == 'on':
-            checkout_result = main.ONOSbench.git_checkout(checkout_branch)       
-            pull_result = main.ONOSbench.git_pull()
-            
+        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' ]
+        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+
+        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:
-            checkout_result = main.TRUE
-            pull_result = main.TRUE
-            main.log.info("Skipped git checkout and pull")
+            checkoutResult = main.TRUE
+            pullResult = main.TRUE
+            main.log.info( "Skipped git checkout and pull" )
 
-        mvn_result = main.ONOSbench.clean_install()
-                                                                   
-        main.step("Set cell for ONOS cli env")
-        main.ONOS1cli.set_cell(cell_name)
-        main.ONOS2cli.set_cell(cell_name)
-        main.ONOS3cli.set_cell(cell_name)
+        #mvnResult = main.ONOSbench.cleanInstall()
 
-        main.step("Creating ONOS package")
-        package_result = main.ONOSbench.onos_package()                             #no file or directory 
+        main.step( "Set cell for ONOS cli env" )
+        main.ONOS1cli.setCell( cellName )
+        main.ONOS2cli.setCell( cellName )
+        main.ONOS3cli.setCell( cellName )
 
-        main.step("Installing ONOS package")
-        install1_result = main.ONOSbench.onos_install(node=ONOS1_ip)
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage()  
 
-        cell_name = main.params['ENV']['cellName']
-        main.step("Applying cell file to environment")
-        cell_apply_result = main.ONOSbench.set_cell(cell_name)
-        main.step("verify cells")
-        verify_cell_result = main.ONOSbench.verify_cell()
+        main.step( "Installing ONOS package" )
+        install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
 
-        main.step("Set cell for ONOS cli env")
-        main.ONOS1cli.set_cell(cell_name) 
-        cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip)  
-       
+        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()
 
-    def CASE2(self, main):
+        main.step( "Set cell for ONOS cli env" )
+        main.ONOS1cli.setCell()
+        cli1 = main.ONOS1cli.startOnosCli( ONOS1Ip )
 
-        '''  
-        Increase number of nodes and initiate CLI
-        '''
-        import time 
-        
-        global cluster_count
-        
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        #ONOS4_ip = main.params['CTRL']['ip4']
-        #ONOS5_ip = main.params['CTRL']['ip5']
-        #ONOS6_ip = main.params['CTRL']['ip6']
-        #ONOS7_ip = main.params['CTRL']['ip7']
-        cell_name = main.params['ENV']['cellName']
-        scale = int(main.params['SCALE'])
-       
-        #Cluster size increased everytime the case is defined
-        cluster_count += scale
- 
-        main.log.report("Increasing cluster size to "+
-                str(cluster_count))
-        install_result = main.FALSE
-        
+    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 cluster_count == 3:
-                main.log.info("Installing nodes 2 and 3")
-                install2_result = main.ONOSbench.onos_install(node=ONOS2_ip)
-                install3_result = main.ONOSbench.onos_install(node=ONOS3_ip)
-                cli2 = main.ONOS1cli.start_onos_cli(ONOS2_ip)
-                cli3 = main.ONOS1cli.start_onos_cli(ONOS3_ip)
+            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.ONOS1cli.startOnosCli(ONOS1_ip)
+                cli3 = main.ONOS1cli.startOnosCli(ONOS2_ip)
 
-            '''
-            elif cluster_count == 5:
+            
+            #elif clusterCount == 5:
 
-                main.log.info("Installing nodes 4 and 5")
-                node4_result = main.ONOSbench.onos_install(node=ONOS4_ip)
-                node5_result = main.ONOSbench.onos_install(node=ONOS5_ip)
-                install_result = node4_result and node5_result
-                time.sleep(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.start_onos_cli(ONOS4_ip)
-                main.ONOS5cli.start_onos_cli(ONOS5_ip)
+            #    main.ONOS4cli.startOnosCli( ONOS4Ip )
+            #    main.ONOS5cli.startOnosCli( ONOS5Ip )
 
-            elif cluster_count == 7:
+            #elif clusterCount == 7:
 
-                main.log.info("Installing nodes 4 and 5")
-                node6_result = main.ONOSbench.onos_install(node=ONOS6_ip)
-                node7_result = main.ONOSbench.onos_install(node=ONOS7_ip)
-                install_result = node6_result and node7_result
-                time.sleep(5)
+            #    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 )
+            #
 
-                main.ONOS6cli.start_onos_cli(ONOS6_ip)
-                main.ONOS7cli.start_onos_cli(ONOS7_ip)
-            '''
-        if scale == 1: 
-            if cluster_count == 2:
-                main.log.info("Installing node 2")
-                install2_result = main.ONOSbench.onos_install(node=ONOS2_ip)
-                cli2 = main.ONOS1cli.start_onos_cli(ONOS2_ip)
+        if scale == 1:
+            if clusterCount == 2:
+                main.log.info( "Installing node 2" )
+                install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
+                cli2 = main.ONOS1cli.startOnosCli(ONOS2_ip)
 
-            if cluster_count == 3:
-                main.log.info("Installing node 3")
-                install3_result = main.ONOSbench.onos_install(node=ONOS3_ip)
-                cli3 = main.ONOS1cli.start_onos_cli(ONOS3_ip)
-
+            if clusterCount == 3:
+                main.log.info( "Installing node 3" )
+                install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
+                cli3 = main.ONOS1cli.startOnosCli(ONOS3_ip)
