diff --git a/README.md b/README.md
index b29c092..5986719 100644
--- a/README.md
+++ b/README.md
@@ -26,13 +26,47 @@
 ------------
 1. ONOS
 
-2. Mininet
+2. Mininet - Some driver functions rely on a modified version of Mininet. These functions are noted in the mininet driver file. To checkout this branch from your Mininet folder:
 
-3. Install python packages configObj and pexpect. they can be installed as :
+    $ git remote add jhall11 https://github.com/jhall11/mininet.git
 
-     $ sudo pip install configObj
+    $ git fetch jhall11
 
-     $ sudo easy_install pexpect 
+    $ git checkout -b dynamic_topo remotes/jhall11/dynamic_topo
+
+    $ git pull
+
+    Note that you may need to run 'sudo make develop' if your mnexec.c file changed when switching branches.
+
+3. Install python packages configObj and pexpect (Note: pexpect 3.3 has a known bug. We recommend using version 3.2 for now). They can be installed as :
+
+    $ sudo pip install configObj
+
+    $ sudo pip install pexpect==3.2
+
+    $ sudo pip install numpy
+
+4. STS  - This can be installed by:
+
+    $ git clone https://github.com/jhall11/sts.git
+
+5. Linc-OE - Some testcases use this to emulate optical devices
+
+    Requirements:
+
+    1. Erlang R15B, R16B, R17 - if possible please use R17
+
+    2. libpcap-dev package if eth interfaces will be used
+
+    Building and Running:
+
+    $ git clone https://github.com/shivarammysore/LINC-Switch.git linc-oe
+
+    $ cd linc-oe
+
+    $ git checkout tags/oe-0.3
+
+    $ make rel
 
 Configuration
 ------------
@@ -58,7 +92,7 @@
 
 3. Run the test 
 
-    teston> run MininetTest 
+    teston> run PingallExample
 
 The Tests
 -----------------------------------------------
@@ -68,7 +102,7 @@
 
 1. .ospk file
 
-    - This is written in Openspeak, an word based language developed by Paxterra.
+    - This is written in Openspeak, a word based language developed by Paxterra.
 
     - It defines the cases and sequence of events for the test 
 
diff --git a/TestON/bin/unpep8 b/TestON/bin/unpep8
index 94e956e..733d5a3 100755
--- a/TestON/bin/unpep8
+++ b/TestON/bin/unpep8
@@ -180,6 +180,7 @@
    oldProgram = program
    # Program text transforms
    program = reinstateCapWords( program )  # Turning off for now
+   program = reinstateCapWords( program )
    program = fixKeywords( program )
    program = insertExtraSpaces( program )
    # Undo string damage
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 9edd126..4b30f4d 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -2,7 +2,7 @@
 """
 Created on 26-Oct-2012
 
-author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
+author: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
 
 
 TestON is free software: you can redistribute it and/or modify
@@ -19,7 +19,22 @@
 along with TestON.  If not, see <http://www.gnu.org/licenses/>.
 
 
-MininetCliDriver is the basic driver which will handle the Mininet functions"""
+MininetCliDriver is the basic driver which will handle the Mininet functions
+
+Some functions rely on STS module. To install this,
+    git clone https://github.com/jhall11/sts.git
+
+Some functions rely on a modified version of Mininet. These functions
+should all be noted in the comments. To get this MN version run these commands
+from within your Mininet folder:
+    git remote add jhall11 https://github.com/jhall11/mininet.git
+    git fetch jhall11
+    git checkout -b dynamic_topo remotes/jhall11/dynamic_topo
+    git pull
+
+
+    Note that you may need to run 'sudo make develop' if your mnexec.c file
+changed when switching branches."""
 import traceback
 import pexpect
 import re
@@ -892,7 +907,8 @@
     def addSwitch( self, sw, **kwargs ):
         """
         adds a switch to the mininet topology
-        NOTE: this uses a custom mn function
+        NOTE: This uses a custom mn function. MN repo should be on
+            dynamic_topo branch
         NOTE: cannot currently specify what type of switch
         required params:
             switchname = name of the new switch as a string
@@ -926,11 +942,12 @@
 
     def delSwitch( self, sw ):
         """
-           delete a switch from the mininet topology
-           NOTE: this uses a custom mn function
-           required params:
+        delete a switch from the mininet topology
+        NOTE: This uses a custom mn function. MN repo should be on
+            dynamic_topo branch
+        required params:
             switchname = name of the switch as a string
-           returns: main.FASLE on an error, else main.TRUE"""
+        returns: main.FASLE on an error, else main.TRUE"""
         command = "delswitch " + str( sw )
         try:
             response = self.execute(
@@ -957,7 +974,8 @@
     def addLink( self, node1, node2 ):
         """
            add a link to the mininet topology
-           NOTE: this uses a custom mn function
+           NOTE: This uses a custom mn function. MN repo should be on
+                dynamic_topo branch
            NOTE: cannot currently specify what type of link
            required params:
            node1 = the string node name of the first endpoint of the link
@@ -989,7 +1007,8 @@
     def delLink( self, node1, node2 ):
         """
            delete a link from the mininet topology
-           NOTE: this uses a custom mn function
+           NOTE: This uses a custom mn function. MN repo should be on
+                dynamic_topo branch
            required params:
            node1 = the string node name of the first endpoint of the link
            node2 = the string node name of the second endpoint of the link
@@ -1020,7 +1039,8 @@
     def addHost( self, hostname, **kwargs ):
         """
         Add a host to the mininet topology
-        NOTE: this uses a custom mn function
+        NOTE: This uses a custom mn function. MN repo should be on
+            dynamic_topo branch
         NOTE: cannot currently specify what type of host
         required params:
             hostname = the string hostname
@@ -1058,6 +1078,8 @@
     def delHost( self, hostname ):
         """
            delete a host from the mininet topology
+           NOTE: This uses a custom mn function. MN repo should be on
+               dynamic_topo branch
            NOTE: this uses a custom mn function
            required params:
            hostname = the string hostname
diff --git a/TestON/scripts/Cass_clr.sh b/TestON/scripts/Cass_clr.sh
deleted file mode 100755
index a74ea5d..0000000
--- a/TestON/scripts/Cass_clr.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-#1 = testname
-#2 = buildnumber
-
-basename="autoONOS"
-machine1="admin@10.128.100.1"
-machine2="admin@10.128.100.4"
-machine3="admin@10.128.100.5"
-machine4="admin@10.128.100.6"
-logmachine="onos@10.254.1.111"
-
-ssh $machine1 "~/ONOS/start-cassandra.sh stop"
-ssh $machine2 "~/ONOS/start-cassandra.sh stop"
-ssh $machine3 "~/ONOS/start-cassandra.sh stop"
-ssh $machine4 "~/ONOS/start-cassandra.sh stop"
-ssh $machine1 "~/clrCass.sh"
-ssh $machine2 "~/clrCass.sh"
-ssh $machine3 "~/clrCass.sh"
-ssh $machine4 "~/clrCass.sh"
-
-
-
-
-
diff --git a/TestON/scripts/get_reroute_times.py b/TestON/scripts/get_reroute_times.py
deleted file mode 100755
index 4e1f6b8..0000000
--- a/TestON/scripts/get_reroute_times.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /usr/bin/env python
-import sys
-import time
-import os
-import re
-import json
-
-
-CONFIG_FILE="/home/admin/ping.h10"
-
- 
-  
-def get_times(pingfile):
-  icmp_reqs = [] 
-  times = []
-  f = open(pingfile)
-  for line in f.readlines():
-    if re.search('64\sbytes', line): 
-      icmp_reqs.append( (line.split()[4]).split('=')[1] )
-  f.close()
-  #print icmp_reqs
-  lastnum = int(icmp_reqs[0]) - 1 
-  for num in icmp_reqs: 
-    if int(num) != (lastnum + 1):
-      times.append(int(num) - lastnum) 
-    lastnum = int(num)
-
-  return times
-
-if __name__ == "__main__":
-  total = 0 
-  count = 0 
-  flow = 1
-  for i in os.popen("ls /tmp/ping.*"):
-    print "Flow %d  " % flow
-    for time in get_times(i.strip("\n")):
-      total = total + time
-      count = count + 1
-      print "  %d" % time     
-    flow = flow + 1
-  print "Average: %d" % (total / count ) 
- 
diff --git a/TestON/tests/ProdFunc/ProdFunc.py b/TestON/tests/ProdFunc/ProdFunc.py
old mode 100644
new mode 100755
index 62d1ec8..6f4b72b
--- a/TestON/tests/ProdFunc/ProdFunc.py
+++ b/TestON/tests/ProdFunc/ProdFunc.py
@@ -3,9 +3,9 @@
 # For sanity and driver functionality excercises only.
 
 import time
-import sys
-import os
-import re
+# import sys
+# import os
+# import re
 import json
 
 time.sleep( 1 )
@@ -28,9 +28,8 @@
         onos-install -f
         onos-wait-for-start
         """
-        cell_name = main.params[ 'ENV' ][ 'cellName' ]
-        ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS1_port = main.params[ 'CTRL' ][ 'port1' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
 
         main.case( "Setting up test environment" )
         main.log.report(
@@ -38,55 +37,55 @@
         main.log.report( "__________________________________" )
 
         main.step( "Applying cell variable to environment" )
-        cell_result = main.ONOSbench.set_cell( cell_name )
-        verify_result = main.ONOSbench.verify_cell()
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
 
         main.step( "Removing raft logs before a clen installation of ONOS" )
-        main.ONOSbench.onos_remove_raft_logs()
+        main.ONOSbench.onosRemoveRaftLogs()
 
         main.step( "Git checkout and pull master and get version" )
-        main.ONOSbench.git_checkout( "master" )
-        git_pull_result = main.ONOSbench.git_pull()
-        main.log.info( "git_pull_result = " + git_pull_result )
-        version_result = main.ONOSbench.get_version( report=True )
+        main.ONOSbench.gitCheckout( "master" )
+        gitPullResult = main.ONOSbench.gitPull()
+        main.log.info( "git_pull_result = " + gitPullResult )
+        main.ONOSbench.getVersion( report=True )
 
-        if git_pull_result == 1:
+        if gitPullResult == 1:
             main.step( "Using mvn clean & install" )
-            clean_install_result = main.ONOSbench.clean_install()
-            #clean_install_result = main.TRUE
-        elif git_pull_result == 0:
+            main.ONOSbench.cleanInstall()
+        elif gitPullResult == 0:
             main.log.report(
                 "Git Pull Failed, look into logs for detailed reason" )
             main.cleanup()
             main.exit()
 
         main.step( "Creating ONOS package" )
-        package_result = main.ONOSbench.onos_package()
+        packageResult = main.ONOSbench.onosPackage()
 
         main.step( "Installing ONOS package" )
-        onos_install_result = main.ONOSbench.onos_install()
-        if onos_install_result == main.TRUE:
+        onosInstallResult = main.ONOSbench.onosInstall()
+        if onosInstallResult == main.TRUE:
             main.log.report( "Installing ONOS package successful" )
         else:
             main.log.report( "Installing ONOS package failed" )
 
-        onos1_isup = main.ONOSbench.isup()
-        if onos1_isup == main.TRUE:
+        onos1Isup = main.ONOSbench.isup()
+        if onos1Isup == main.TRUE:
             main.log.report( "ONOS instance is up and ready" )
         else:
             main.log.report( "ONOS instance may not be up" )
 
         main.step( "Starting ONOS service" )
-        start_result = main.ONOSbench.onos_start( ONOS1_ip )
+        startResult = main.ONOSbench.onosStart( ONOS1Ip )
 
-        main.ONOS2.start_onos_cli( ONOS_ip=main.params[ 'CTRL' ][ 'ip1' ] )
+        main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
 
-        case1_result = ( package_result and
-                         cell_result and verify_result and onos_install_result and
-                         onos1_isup and start_result )
-        utilities.assert_equals( expect=main.TRUE, actual=case1_result,
-                                 onpass="Test startup successful",
-                                 onfail="Test startup NOT successful" )
+        case1Result = ( packageResult and
+                        cellResult and verifyResult
+                        and onosInstallResult and
+                        onos1Isup and startResult )
+        utilities.assert_equals( expect=main.TRUE, actual=case1Result,
+                                onpass="Test startup successful",
+                                onfail="Test startup NOT successful" )
 
     def CASE2( self, main ):
         """
@@ -94,13 +93,12 @@
         """
         # NOTE: You should probably run a topology check after this
         import time
-        import json
 
         main.case( "Switch down discovery" )
         main.log.report( "This testcase is testing a switch down discovery" )
         main.log.report( "__________________________________" )
 
-        switch_sleep = int( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
+        switchSleep = int( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
 
         description = "Killing a switch to ensure it is discovered correctly"
         main.log.report( description )
@@ -110,120 +108,125 @@
         main.step( "Kill s28 " )
         main.log.report( "Deleting s28" )
         # FIXME: use new dynamic topo functions
-        main.Mininet1.del_switch( "s28" )
+        main.Mininet1.delSwitch( "s28" )
         main.log.info(
             "Waiting " +
-            str( switch_sleep ) +
+            str( switchSleep ) +
             " seconds for switch down to be discovered" )
-        time.sleep( switch_sleep )
+        time.sleep( switchSleep )
         # Peek at the deleted switch
-        device = main.ONOS2.get_device( dpid="0028" )
+        device = main.ONOS2.getDevice( dpid="0028" )
         print "device = ", device
         if device[ u'available' ] == 'False':
-            case2_result = main.FALSE
+            case2Result = main.FALSE
         else:
-            case2_result = main.TRUE
-        utilities.assert_equals( expect=main.TRUE, actual=case2_result,
-                                 onpass="Switch down discovery successful",
-                                 onfail="Switch down discovery failed" )
+            case2Result = main.TRUE
+        utilities.assert_equals( expect=main.TRUE, actual=case2Result,
+                                onpass="Switch down discovery successful",
+                                onfail="Switch down discovery failed" )
 
     def CASE11( self, main ):
         """
         Cleanup sequence:
-        onos-service <node_ip> stop
+        onos-service <nodeIp> stop
         onos-uninstall
 
         TODO: Define rest of cleanup
 
         """
-        ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
 
         main.case( "Cleaning up test environment" )
 
         main.step( "Testing ONOS kill function" )
-        kill_result = main.ONOSbench.onos_kill( ONOS1_ip )
+        killResult = main.ONOSbench.onosKill( ONOS1Ip )
 
         main.step( "Stopping ONOS service" )
-        stop_result = main.ONOSbench.onos_stop( ONOS1_ip )
+        stopResult = main.ONOSbench.onosStop( ONOS1Ip )
 
         main.step( "Uninstalling ONOS service" )
-        uninstall_result = main.ONOSbench.onos_uninstall()
+        uninstallResult = main.ONOSbench.onosUninstall()
+
+        case11Result = killResult and stopResult and uninstallResult
+        utilities.assert_equals( expect=main.TRUE, actual=case11Result,
+                                onpass="Cleanup successful",
+                                onfail="Cleanup failed" )
 
     def CASE3( self, main ):
         """
         Test 'onos' command and its functionality in driver
         """
-        ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
 
         main.case( "Testing 'onos' command" )
 
         main.step( "Sending command 'onos -w <onos-ip> system:name'" )
         cmdstr1 = "system:name"
-        cmd_result1 = main.ONOSbench.onos_cli( ONOS1_ip, cmdstr1 )
-        main.log.info( "onos command returned: " + cmd_result1 )
+        cmdResult1 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr1 )
+        main.log.info( "onos command returned: " + cmdResult1 )
 
         main.step( "Sending command 'onos -w <onos-ip> onos:topology'" )
         cmdstr2 = "onos:topology"
-        cmd_result2 = main.ONOSbench.onos_cli( ONOS1_ip, cmdstr2 )
-        main.log.info( "onos command returned: " + cmd_result2 )
+        cmdResult2 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 )
+        main.log.info( "onos command returned: " + cmdResult2 )
 
     def CASE20( self ):
         """
             Exit from mininet cli
             reinstall ONOS
         """
-        cell_name = main.params[ 'ENV' ][ 'cellName' ]
-        ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS1_port = main.params[ 'CTRL' ][ 'port1' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
 
-        main.log.report(
-            "This testcase exits the mininet cli and reinstalls ONOS to switch over to Packet Optical topology" )
+        main.log.report( "This testcase exits the mininet cli and reinstalls\
+                        ONOS to switch over to Packet Optical topology" )
         main.log.report( "_____________________________________________" )
         main.case( "Disconnecting mininet and restarting ONOS" )
         main.step( "Disconnecting mininet and restarting ONOS" )
-        mininet_disconnect = main.Mininet1.disconnect()
+        mininetDisconnect = main.Mininet1.disconnect()
 
         main.step( "Removing raft logs before a clen installation of ONOS" )
-        main.ONOSbench.onos_remove_raft_logs()
+        main.ONOSbench.onosRemoveRaftLogs()
 
         main.step( "Applying cell variable to environment" )
-        cell_result = main.ONOSbench.set_cell( cell_name )
-        verify_result = main.ONOSbench.verify_cell()
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
 
-        onos_install_result = main.ONOSbench.onos_install()
-        if onos_install_result == main.TRUE:
+        onosInstallResult = main.ONOSbench.onosInstall()
+        if onosInstallResult == main.TRUE:
             main.log.report( "Installing ONOS package successful" )
         else:
             main.log.report( "Installing ONOS package failed" )
 
-        onos1_isup = main.ONOSbench.isup()
-        if onos1_isup == main.TRUE:
+        onos1Isup = main.ONOSbench.isup()
+        if onos1Isup == main.TRUE:
             main.log.report( "ONOS instance is up and ready" )
         else:
             main.log.report( "ONOS instance may not be up" )
 
         main.step( "Starting ONOS service" )
-        start_result = main.ONOSbench.onos_start( ONOS1_ip )
+        startResult = main.ONOSbench.onosStart( ONOS1Ip )
 
-        main.ONOS2.start_onos_cli( ONOS_ip=main.params[ 'CTRL' ][ 'ip1' ] )
-        print "mininet_disconnect =", mininet_disconnect
-        print "onos_install_result =", onos_install_result
-        print "onos1_isup =", onos1_isup
-        print "start_result =", start_result
-
-        case20_result = mininet_disconnect and cell_result and onos_install_result and onos1_isup and start_result
+        main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+        case20Result = mininetDisconnect and cellResult and verifyResult \
+            and onosInstallResult and onos1Isup and \
+            startResult
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=case20_result,
-            onpass="Exiting functionality mininet topology and reinstalling ONOS successful",
-            onfail="Exiting functionality mininet topology and reinstalling ONOS failed" )
+            actual=case20Result,
+            onpass="Exiting functionality mininet topology and reinstalling \
+                    ONOS successful",
+            onfail="Exiting functionality mininet topology and reinstalling \
+                    ONOS failed" )
 
     def CASE21( self, main ):
-        import time
         """
-            On ONOS bench, run this command: ./~/ONOS/tools/test/bin/onos-topo-cfg
-            which starts the rest and copies the links json file to the onos instance
-            Note that in case of Packet Optical, the links are not learnt from the topology, instead the links are learnt
+            On ONOS bench, run this command:
+             ./~/ONOS/tools/test/bin/onos-topo-cfg
+            which starts the rest and copies the links
+            json file to the onos instance.
+            Note that in case of Packet Optical, the links are not learnt
+            from the topology, instead the links are learnt
             from the json config file
         """
         main.log.report(
@@ -231,42 +234,47 @@
         main.log.report( "_____________________________________________" )
         main.case( "Starting LINC-OE and other components" )
         main.step( "Starting LINC-OE and other components" )
-        start_console_result = main.LincOE1.start_console()
-        optical_mn_script = main.LincOE2.run_optical_mn_script()
-        onos_topo_cfg_result = main.ONOSbench.run_onos_topo_cfg(
-            instance_name=main.params[ 'CTRL' ][ 'ip1' ],
-            json_file=main.params[ 'OPTICAL' ][ 'jsonfile' ] )
+        startConsoleResult = main.LincOE1.startConsole()
+        opticalMnScript = main.LincOE2.runOpticalMnScript()
+        onosTopoCfgResult = main.ONOSbench.runOnosTopoCfg(
+            instanceName=main.params[ 'CTRL' ][ 'ip1' ],
+            jsonFile=main.params[ 'OPTICAL' ][ 'jsonfile' ] )
 
-        print "start_console_result =", start_console_result
-        print "optical_mn_script = ", optical_mn_script
-        print "onos_topo_cfg_result =", onos_topo_cfg_result
+        print "start_console_result =", startConsoleResult
+        print "optical_mn_script = ", opticalMnScript
+        print "onos_topo_cfg_result =", onosTopoCfgResult
 
-        case21_result = start_console_result and optical_mn_script and onos_topo_cfg_result
+        case21Result = startConsoleResult and opticalMnScript and \
+            onosTopoCfgResult
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=case21_result,
+            actual=case21Result,
             onpass="Packet optical topology spawned successsfully",
             onfail="Packet optical topology spawning failed" )
 
     def CASE22( self, main ):
         """
-            Curretly we use, 4 linear switch optical topology and 2 packet layer mininet switches each with one host.
-             Therefore, the roadmCount variable = 4, packetLayerSWCount variable = 2, hostCount =2
-            and this is hardcoded in the testcase. If the topology changes, these hardcoded values need to be changed
+            Curretly we use, 4 linear switch optical topology and
+            2 packet layer mininet switches each with one host.
+            Therefore, the roadmCount variable = 4,
+            packetLayerSWCount variable = 2 and hostCount = 2
+            and this is hardcoded in the testcase. If the topology changes,
+            these hardcoded values need to be changed
         """
         main.log.report(
-            "This testcase compares the optical+packet topology against what is expected" )
+            "This testcase compares the optical+packet topology against what\
+             is expected" )
         main.case( "Topology comparision" )
         main.step( "Topology comparision" )
-        main.ONOS3.start_onos_cli( ONOS_ip=main.params[ 'CTRL' ][ 'ip1' ] )
-        devices_result = main.ONOS3.devices( json_format=False )
+        main.ONOS3.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+        devicesResult = main.ONOS3.devices( jsonFormat=False )
 
-        print "devices_result = ", devices_result
-        devices_linewise = devices_result.split( "\n" )
-        devices_linewise = devices_linewise[ 1:-1 ]
+        print "devices_result = ", devicesResult
+        devicesLinewise = devicesResult.split( "\n" )
+        devicesLinewise = devicesLinewise[ 1:-1 ]
         roadmCount = 0
         packetLayerSWCount = 0
-        for line in devices_linewise:
+        for line in devicesLinewise:
             components = line.split( "," )
             availability = components[ 1 ].split( "=" )[ 1 ]
             type = components[ 3 ].split( "=" )[ 1 ]
@@ -275,93 +283,101 @@
             elif availability == 'true' and type == 'SWITCH':
                 packetLayerSWCount += 1
         if roadmCount == 4:
-            print "Number of Optical Switches = %d and is correctly detected" % roadmCount
+            print "Number of Optical Switches = %d and is \
+                    correctly detected" % roadmCount
             main.log.info(
                 "Number of Optical Switches = " +
                 str( roadmCount ) +
                 " and is correctly detected" )
-            opticalSW_result = main.TRUE
+            opticalSWResult = main.TRUE
         else:
-            print "Number of Optical Switches = %d and is wrong" % roadCount
+            print "Number of Optical Switches = %d and is wrong" % roadmCount
             main.log.info(
                 "Number of Optical Switches = " +
                 str( roadmCount ) +
                 " and is wrong" )
-            opticalSW_result = main.FALSE
+            opticalSWResult = main.FALSE
 
         if packetLayerSWCount == 2:
-            print "Number of Packet layer or mininet Switches = %d and is correctly detected" % packetLayerSWCount
+            print "Number of Packet layer or mininet Switches = %d and \
+                    is correctly detected" % packetLayerSWCount
             main.log.info(
                 "Number of Packet layer or mininet Switches = " +
                 str( packetLayerSWCount ) +
                 " and is correctly detected" )
-            packetSW_result = main.TRUE
+            packetSWResult = main.TRUE
         else:
-            print "Number of Packet layer or mininet Switches = %d and is wrong" % packetLayerSWCount
+            print "Number of Packet layer or mininet Switches = %d and \
+                    is wrong" % packetLayerSWCount
             main.log.info(
                 "Number of Packet layer or mininet Switches = " +
                 str( packetLayerSWCount ) +
                 " and is wrong" )
-            packetSW_result = main.FALSE
+            packetSWResult = main.FALSE
         print "_________________________________"
 
-        links_result = main.ONOS3.links( json_format=False )
-        print "links_result = ", links_result
+        linksResult = main.ONOS3.links( jsonFormat=False )
+        print "links_result = ", linksResult
         print "_________________________________"
 
-        # NOTE:Since only point intents are added, there is no requirement to discover the hosts
+        # NOTE:Since only point intents are added, there is no
+        # requirement to discover the hosts
         # Therfore, the below portion of the code is commented.
         """
         #Discover hosts using pingall
-        pingall_result = main.LincOE2.pingall()
+        pingallResult = main.LincOE2.pingall()
 
-        hosts_result = main.ONOS3.hosts( json_format=False )
-        main.log.info( "hosts_result = "+hosts_result )
+        hostsResult = main.ONOS3.hosts( jsonFormat=False )
+        main.log.info( "hosts_result = "+hostsResult )
         main.log.info( "_________________________________" )
-        hosts_linewise = hosts_result.split( "\n" )
-        hosts_linewise = hosts_linewise[ 1:-1 ]
+        hostsLinewise = hostsResult.split( "\n" )
+        hostsLinewise = hostsLinewise[ 1:-1 ]
         hostCount = 0
-        for line in hosts_linewise:
+        for line in hostsLinewise:
             hostid = line.split( "," )[ 0 ].split( "=" )[ 1 ]
             hostCount +=1
         if hostCount ==2:
             print "Number of hosts = %d and is correctly detected" %hostCount
-            main.log.info( "Number of hosts = " + str( hostCount ) +" and is correctly detected" )
+            main.log.info( "Number of hosts = " + str( hostCount ) +" and \
+                            is correctly detected" )
             hostDiscovery = main.TRUE
         else:
             print "Number of hosts = %d and is wrong" %hostCount
-            main.log.info( "Number of hosts = " + str( hostCount ) +" and is wrong" )
+            main.log.info( "Number of hosts = " + str( hostCount ) +" and \
+                            is wrong" )
             hostDiscovery = main.FALSE
         """
-        case22_result = opticalSW_result and packetSW_result
+        case22Result = opticalSWResult and packetSWResult
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=case22_result,
+            actual=case22Result,
             onpass="Packet optical topology discovery successful",
             onfail="Packet optical topology discovery failed" )
 
     def CASE23( self, main ):
         import time
         """
-            Add bidirectional point intents between 2 packet layer( mininet ) devices and
+            Add bidirectional point intents between 2 packet layer( mininet )
+            devices and
             ping mininet hosts
         """
         main.log.report(
-            "This testcase adds bidirectional point intents between 2 packet layer(mininet) devices and ping mininet hosts" )
+            "This testcase adds bidirectional point intents between 2 \
+                packet layer( mininet ) devices and ping mininet hosts" )
         main.case( "Topology comparision" )
         main.step( "Adding point intents" )
-        ptp_intent_result = main.ONOS3.add_point_intent(
+        ptpIntentResult = main.ONOS3.addPointIntent(
             "of:0000ffffffff0001/1",
             "of:0000ffffffff0002/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS3.intents( json_format=False )
+        if ptpIntentResult == main.TRUE:
+            main.ONOS3.intents( jsonFormat=False )
             main.log.info( "Point to point intent install successful" )
 
-        ptp_intent_result = main.ONOS3.add_point_intent(
+        ptpIntentResult = main.ONOS3.addPointIntent(
             "of:0000ffffffff0002/1",
             "of:0000ffffffff0001/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS3.intents( json_format=False )
+        if ptpIntentResult == main.TRUE:
+            main.ONOS3.intents( jsonFormat=False )
             main.log.info( "Point to point intent install successful" )
 
         time.sleep( 10 )
@@ -370,17 +386,17 @@
 
         # Sleep for 30 seconds to provide time for the intent state to change
         time.sleep( 30 )
-        intentHandle = main.ONOS3.intents( json_format=False )
+        intentHandle = main.ONOS3.intents( jsonFormat=False )
         main.log.info( "intents :" + intentHandle )
 
-        Ping_Result = main.TRUE
+        PingResult = main.TRUE
         count = 1
         main.log.info( "\n\nh1 is Pinging h2" )
         ping = main.LincOE2.pingHostOptical( src="h1", target="h2" )
-        #ping = main.LincOE2.pinghost()
+        # ping = main.LincOE2.pinghost()
         if ping == main.FALSE and count < 5:
             count += 1
-            Ping_Result = main.FALSE
+            PingResult = main.FALSE
             main.log.info(
                 "Ping between h1 and h2  failed. Making attempt number " +
                 str( count ) +
@@ -388,82 +404,91 @@
             time.sleep( 2 )
         elif ping == main.FALSE:
             main.log.info( "All ping attempts between h1 and h2 have failed" )
-            Ping_Result = main.FALSE
+            PingResult = main.FALSE
         elif ping == main.TRUE:
             main.log.info( "Ping test between h1 and h2 passed!" )
-            Ping_Result = main.TRUE
+            PingResult = main.TRUE
         else:
             main.log.info( "Unknown error" )
-            Ping_Result = main.ERROR
+            PingResult = main.ERROR
 
-        if Ping_Result == main.FALSE:
+        if PingResult == main.FALSE:
             main.log.report(
-                "Point intents for packet optical have not ben installed correctly. Cleaning up" )
-        if Ping_Result == main.TRUE:
+                "Point intents for packet optical have not ben installed\
+                correctly. Cleaning up" )
+        if PingResult == main.TRUE:
             main.log.report(
-                "Point Intents for packet optical have been installed correctly" )
+                "Point Intents for packet optical have been\
+                installed correctly" )
 
-        case23_result = Ping_Result
+        case23Result = PingResult
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=case23_result,
-            onpass="Point intents addition for packet optical and Pingall Test successful",
-            onfail="Point intents addition for packet optical and Pingall Test NOT successful" )
+            actual=case23Result,
+            onpass="Point intents addition for packet optical and\
+                    Pingall Test successful",
+            onfail="Point intents addition for packet optical and\
+                    Pingall Test NOT successful" )
 
     def CASE24( self, main ):
         import time
         import json
         """
-            Test Rerouting of Packet Optical by bringing a port down ( port 22 ) of a switch( switchID=1 ), so that link ( between switch1 port22 - switch4-port30 ) is inactive
-            and do a ping test. If rerouting is successful, ping should pass. also check the flows
+            Test Rerouting of Packet Optical by bringing a port down
+            ( port 22 ) of a switch( switchID=1 ), so that link
+            ( between switch1 port22 - switch4-port30 ) is inactive
+            and do a ping test. If rerouting is successful,
+            ping should pass. also check the flows
         """
         main.log.report(
             "This testcase tests rerouting and pings mininet hosts" )
         main.case( "Test rerouting and pings mininet hosts" )
         main.step( "Bring a port down and verify the link state" )
-        main.LincOE1.port_down( sw_id="1", pt_id="22" )
-        links_nonjson = main.ONOS3.links( json_format=False )
-        main.log.info( "links = " + links_nonjson )
+        main.LincOE1.portDown( swId="1", ptId="22" )
+        linksNonjson = main.ONOS3.links( jsonFormat=False )
+        main.log.info( "links = " + linksNonjson )
 
         links = main.ONOS3.links()
         main.log.info( "links = " + links )
 
-        links_result = json.loads( links )
-        links_state_result = main.FALSE
-        for item in links_result:
+        linksResult = json.loads( links )
+        linksStateResult = main.FALSE
+        for item in linksResult:
             if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
                     'src' ][ 'port' ] == "22":
                 if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff04" and item[
                         'dst' ][ 'port' ] == "30":
-                    links_state = item[ 'state' ]
-                    if links_state == "INACTIVE":
+                    linksState = item[ 'state' ]
+                    if linksState == "INACTIVE":
                         main.log.info(
-                            "Links state is inactive as expected due to one of the ports being down" )
+                            "Links state is inactive as expected due to one \
+                            of the ports being down" )
                         main.log.report(
-                            "Links state is inactive as expected due to one of the ports being down" )
-                        links_state_result = main.TRUE
+                            "Links state is inactive as expected due to one \
+                            of the ports being down" )
+                        linksStateResult = main.TRUE
                         break
                     else:
                         main.log.info(
                             "Links state is not inactive as expected" )
                         main.log.report(
                             "Links state is not inactive as expected" )
-                        links_state_result = main.FALSE
+                        linksStateResult = main.FALSE
 
-        print "links_state_result = ", links_state_result
+        print "links_state_result = ", linksStateResult
         time.sleep( 10 )
         flowHandle = main.ONOS3.flows()
         main.log.info( "flows :" + flowHandle )
 
         main.step( "Verify Rerouting by a ping test" )
-        Ping_Result = main.TRUE
+        PingResult = main.TRUE
         count = 1
         main.log.info( "\n\nh1 is Pinging h2" )
         ping = main.LincOE2.pingHostOptical( src="h1", target="h2" )
-        #ping = main.LincOE2.pinghost()
+        # ping = main.LincOE2.pinghost()
         if ping == main.FALSE and count < 5:
             count += 1
-            Ping_Result = main.FALSE
+            PingResult = main.FALSE
             main.log.info(
                 "Ping between h1 and h2  failed. Making attempt number " +
                 str( count ) +
@@ -471,159 +496,163 @@
             time.sleep( 2 )
         elif ping == main.FALSE:
             main.log.info( "All ping attempts between h1 and h2 have failed" )
-            Ping_Result = main.FALSE
+            PingResult = main.FALSE
         elif ping == main.TRUE:
             main.log.info( "Ping test between h1 and h2 passed!" )
-            Ping_Result = main.TRUE
+            PingResult = main.TRUE
         else:
             main.log.info( "Unknown error" )
-            Ping_Result = main.ERROR
+            PingResult = main.ERROR
 
-        if Ping_Result == main.TRUE:
+        if PingResult == main.TRUE:
             main.log.report( "Ping test successful " )
-        if Ping_Result == main.FALSE:
+        if PingResult == main.FALSE:
             main.log.report( "Ping test failed" )
 
-        case24_result = Ping_Result and links_state_result
-        utilities.assert_equals( expect=main.TRUE, actual=case24_result,
-                                 onpass="Packet optical rerouting successful",
-                                 onfail="Packet optical rerouting failed" )
+        case24Result = PingResult and linksStateResult
+        utilities.assert_equals( expect=main.TRUE, actual=case24Result,
+                                onpass="Packet optical rerouting successful",
+                                onfail="Packet optical rerouting failed" )
 
     def CASE4( self, main ):
         import re
         import time
-        main.log.report(
-            "This testcase is testing the assignment of all the switches to all the controllers and discovering the hosts in reactive mode" )
+        main.log.report( "This testcase is testing the assignment of \
+                         all the switches to all the controllers and \
+                         discovering the hists in reactive mode" )
         main.log.report( "__________________________________" )
         main.case( "Pingall Test" )
         main.step( "Assigning switches to controllers" )
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+        ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
         for i in range( 1, 29 ):
             if i == 1:
-                main.Mininet1.assign_sw_controller(
+                main.Mininet1.assignSwController(
                     sw=str( i ),
-                    ip1=ONOS1_ip,
-                    port1=ONOS1_port )
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
             elif i >= 2 and i < 5:
-                main.Mininet1.assign_sw_controller(
+                main.Mininet1.assignSwController(
                     sw=str( i ),
-                    ip1=ONOS1_ip,
-                    port1=ONOS1_port )
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
             elif i >= 5 and i < 8:
-                main.Mininet1.assign_sw_controller(
+                main.Mininet1.assignSwController(
                     sw=str( i ),
-                    ip1=ONOS1_ip,
-                    port1=ONOS1_port )
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
             elif i >= 8 and i < 18:
-                main.Mininet1.assign_sw_controller(
+                main.Mininet1.assignSwController(
                     sw=str( i ),
-                    ip1=ONOS1_ip,
-                    port1=ONOS1_port )
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
             elif i >= 18 and i < 28:
-                main.Mininet1.assign_sw_controller(
+                main.Mininet1.assignSwController(
                     sw=str( i ),
-                    ip1=ONOS1_ip,
-                    port1=ONOS1_port )
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
             else:
-                main.Mininet1.assign_sw_controller(
+                main.Mininet1.assignSwController(
                     sw=str( i ),
-                    ip1=ONOS1_ip,
-                    port1=ONOS1_port )
-        Switch_Mastership = main.TRUE
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+        SwitchMastership = main.TRUE
         for i in range( 1, 29 ):
             if i == 1:
-                response = main.Mininet1.get_sw_controller( "s" + str( i ) )
+                response = main.Mininet1.getSwController( "s" + str( i ) )
                 print( "Response is " + str( response ) )
-                if re.search( "tcp:" + ONOS1_ip, response ):
-                    Switch_Mastership = Switch_Mastership and main.TRUE
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
                 else:
-                    Switch_Mastership = main.FALSE
+                    SwitchMastership = main.FALSE
             elif i >= 2 and i < 5:
-                response = main.Mininet1.get_sw_controller( "s" + str( i ) )
+                response = main.Mininet1.getSwController( "s" + str( i ) )
                 print( "Response is " + str( response ) )
-                if re.search( "tcp:" + ONOS1_ip, response ):
-                    Switch_Mastership = Switch_Mastership and main.TRUE
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
                 else:
-                    Switch_Mastership = main.FALSE
+                    SwitchMastership = main.FALSE
             elif i >= 5 and i < 8:
-                response = main.Mininet1.get_sw_controller( "s" + str( i ) )
+                response = main.Mininet1.getSwController( "s" + str( i ) )
                 print( "Response is " + str( response ) )
-                if re.search( "tcp:" + ONOS1_ip, response ):
-                    Switch_Mastership = Switch_Mastership and main.TRUE
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
                 else:
-                    Switch_Mastership = main.FALSE
+                    SwitchMastership = main.FALSE
             elif i >= 8 and i < 18:
-                response = main.Mininet1.get_sw_controller( "s" + str( i ) )
+                response = main.Mininet1.getSwController( "s" + str( i ) )
                 print( "Response is " + str( response ) )
-                if re.search( "tcp:" + ONOS1_ip, response ):
-                    Switch_Mastership = Switch_Mastership and main.TRUE
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
                 else:
-                    Switch_Mastership = main.FALSE
+                    SwitchMastership = main.FALSE
             elif i >= 18 and i < 28:
-                response = main.Mininet1.get_sw_controller( "s" + str( i ) )
+                response = main.Mininet1.getSwController( "s" + str( i ) )
                 print( "Response is " + str( response ) )
-                if re.search( "tcp:" + ONOS1_ip, response ):
-                    Switch_Mastership = Switch_Mastership and main.TRUE
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
                 else:
-                    Switch_Mastership = main.FALSE
+                    SwitchMastership = main.FALSE
             else:
-                response = main.Mininet1.get_sw_controller( "s" + str( i ) )
+                response = main.Mininet1.getSwController( "s" + str( i ) )
                 print( "Response is" + str( response ) )
-                if re.search( "tcp:" + ONOS1_ip, response ):
-                    Switch_Mastership = Switch_Mastership and main.TRUE
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
                 else:
-                    Switch_Mastership = main.FALSE
+                    SwitchMastership = main.FALSE
 
-        if Switch_Mastership == main.TRUE:
+        if SwitchMastership == main.TRUE:
             main.log.report( "Controller assignmnet successful" )
         else:
             main.log.report( "Controller assignmnet failed" )
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=Switch_Mastership,
+            actual=SwitchMastership,
             onpass="MasterControllers assigned correctly" )
         """
         for i in range ( 1,29 ):
-            main.Mininet1.assign_sw_controller( sw=str( i ),count=5,
-                    ip1=ONOS1_ip,port1=ONOS1_port,
-                    ip2=ONOS2_ip,port2=ONOS2_port,
-                    ip3=ONOS3_ip,port3=ONOS3_port,
-                    ip4=ONOS4_ip,port4=ONOS4_port,
-                    ip5=ONOS5_ip,port5=ONOS5_port )
+            main.Mininet1.assignSwController( sw=str( i ),count=5,
+                    ip1=ONOS1Ip,port1=ONOS1Port,
+                    ip2=ONOS2Ip,port2=ONOS2Port,
+                    ip3=ONOS3Ip,port3=ONOS3Port,
+                    ip4=ONOS4Ip,port4=ONOS4Port,
+                    ip5=ONOS5Ip,port5=ONOS5Port )
         """
         # REACTIVE FWD test
 
         main.step( "Get list of hosts from Mininet" )
-        host_list = main.Mininet1.get_hosts()
-        main.log.info( host_list )
+        hostList = main.Mininet1.getHosts()
+        main.log.info( hostList )
 
         main.step( "Get host list in ONOS format" )
-        host_onos_list = main.ONOS2.get_hosts_id( host_list )
-        main.log.info( host_onos_list )
+        hostOnosList = main.ONOS2.getHostsId( hostList )
+        main.log.info( hostOnosList )
         # time.sleep( 5 )
 
         main.step( "Pingall" )
-        ping_result = main.FALSE
-        while ping_result == main.FALSE:
+        pingResult = main.FALSE
+        while pingResult == main.FALSE:
             time1 = time.time()
-            ping_result = main.Mininet1.pingall()
+            pingResult = main.Mininet1.pingall()
             time2 = time.time()
             print "Time for pingall: %2f seconds" % ( time2 - time1 )
 
-        # Start onos cli again because u might have dropped out of onos prompt to the shell prompt
+        # Start onos cli again because u might have dropped out of
+        # onos prompt to the shell prompt
         # if there was no activity
-        main.ONOS2.start_onos_cli( ONOS_ip=main.params[ 'CTRL' ][ 'ip1' ] )
+        main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
 
-        case4_result = Switch_Mastership and ping_result
-        if ping_result == main.TRUE:
-            main.log.report(
-                "Pingall Test in reactive mode to discover the hosts successful" )
+        case4Result = SwitchMastership and pingResult
+        if pingResult == main.TRUE:
+            main.log.report( "Pingall Test in reactive mode to \
+                             discover the hosts successful" )
         else:
-            main.log.report(
-                "Pingall Test in reactive mode to discover the hosts failed" )
+            main.log.report( "Pingall Test in reactive mode to \
+                              discover the hosts failed" )
 
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=case4_result,
+            actual=case4Result,
             onpass="Controller assignment and Pingall Test successful",
             onfail="Controller assignment and Pingall Test NOT successful" )
 
@@ -633,74 +662,87 @@
         main.log.report( "__________________________________" )
         main.case( "Uninstalling reactive forwarding app" )
         # Unistall onos-app-fwd app to disable reactive forwarding
-        appUninstall_result = main.ONOS2.feature_uninstall( "onos-app-fwd" )
+        appUninstallResult = main.ONOS2.featureUninstall( "onos-app-fwd" )
         main.log.info( "onos-app-fwd uninstalled" )
 
-        # After reactive forwarding is disabled, the reactive flows on switches timeout in 10-15s
+        # After reactive forwarding is disabled, the reactive flows on
+        # switches timeout in 10-15s
         # So sleep for 15s
         time.sleep( 15 )
 
         flows = main.ONOS2.flows()
         main.log.info( flows )
 
-        case10_result = appUninstall_result
+        case10Result = appUninstallResult
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=case10_result,
+            actual=case10Result,
             onpass="Reactive forwarding app uninstallation successful",
             onfail="Reactive forwarding app uninstallation failed" )
 
     def CASE6( self ):
-        main.log.report(
-            "This testcase is testing the addition of host intents and then does pingall" )
+        main.log.report( "This testcase is testing the addition of \
+                         host intents and then does pingall" )
         main.log.report( "__________________________________" )
         main.case( "Obtaining host id's" )
         main.step( "Get hosts" )
         hosts = main.ONOS2.hosts()
-        # main.log.info( hosts )
+        main.log.info( hosts )
 
         main.step( "Get all devices id" )
-        devices_id_list = main.ONOS2.get_all_devices_id()
-        # main.log.info( devices_id_list )
+        devicesIdList = main.ONOS2.getAllDevicesId()
+        main.log.info( devicesIdList )
 
-        # ONOS displays the hosts in hex format unlike mininet which does in decimal format
+        # ONOS displays the hosts in hex format unlike mininet which does
+        # in decimal format
         # So take care while adding intents
         """
-        main.step( "Add host-to-host intents for mininet hosts h8 and h18 or ONOS hosts h8 and h12" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:08/-1", "00:00:00:00:00:12/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:09/-1", "00:00:00:00:00:13/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:0A/-1", "00:00:00:00:00:14/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:0B/-1", "00:00:00:00:00:15/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:0C/-1", "00:00:00:00:00:16/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:0D/-1", "00:00:00:00:00:17/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:0E/-1", "00:00:00:00:00:18/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:0F/-1", "00:00:00:00:00:19/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:10/-1", "00:00:00:00:00:1A/-1" )
-        hth_intent_result = main.ONOS2.add_host_intent( "00:00:00:00:00:11/-1", "00:00:00:00:00:1B/-1" )
-        print "_____________________________________________________________________________________"
+        main.step( "Add host-to-host intents for mininet hosts h8 and h18 or
+                    ONOS hosts h8 and h12" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:08/-1", "00:00:00:00:00:12/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:09/-1", "00:00:00:00:00:13/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:0A/-1", "00:00:00:00:00:14/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:0B/-1", "00:00:00:00:00:15/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:0C/-1", "00:00:00:00:00:16/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:0D/-1", "00:00:00:00:00:17/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:0E/-1", "00:00:00:00:00:18/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:0F/-1", "00:00:00:00:00:19/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:10/-1", "00:00:00:00:00:1A/-1" )
+        hthIntentResult = main.ONOS2.addHostIntent(
+                            "00:00:00:00:00:11/-1", "00:00:00:00:00:1B/-1" )
+        print "______________________________________________________"
         """
         for i in range( 8, 18 ):
             main.log.info(
-                "Adding host intent between h" + str( i ) + " and h" + str( i + 10 ) )
+                "Adding host intent between h" + str( i ) +
+                " and h" + str( i + 10 ) )
             host1 = "00:00:00:00:00:" + \
                 str( hex( i )[ 2: ] ).zfill( 2 ).upper()
             host2 = "00:00:00:00:00:" + \
                 str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
             # NOTE: get host can return None
             # TODO: handle this
-            host1_id = main.ONOS2.get_host( host1 )[ 'id' ]
-            host2_id = main.ONOS2.get_host( host2 )[ 'id' ]
-            tmp_result = main.ONOS2.add_host_intent( host1_id, host2_id )
+            host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
+            host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
+            main.ONOS2.addHostIntent( host1Id, host2Id )
 
         time.sleep( 10 )
-        h_intents = main.ONOS2.intents( json_format=False )
-        main.log.info( "intents:" + h_intents )
-        flowHandle = main.ONOS2.flows()
-        #main.log.info( "flow:" +flowHandle )
+        hIntents = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intents:" + hIntents )
+        main.ONOS2.flows()
 
         count = 1
         i = 8
-        Ping_Result = main.TRUE
+        PingResult = main.TRUE
         # while i<10:
         while i < 18:
             main.log.info(
@@ -709,8 +751,8 @@
                 src="h" + str( i ), target="h" + str( i + 10 ) )
             if ping == main.FALSE and count < 5:
                 count += 1
-                #i = 8
-                Ping_Result = main.FALSE
+                # i = 8
+                PingResult = main.FALSE
                 main.log.report( "Ping between h" +
                                  str( i ) +
                                  " and h" +
@@ -728,7 +770,7 @@
                                       10 ) +
                                  "have failed" )
                 i = 19
-                Ping_Result = main.FALSE
+                PingResult = main.FALSE
             elif ping == main.TRUE:
                 main.log.info( "Ping test between h" +
                                str( i ) +
@@ -737,39 +779,33 @@
                                     10 ) +
                                "passed!" )
                 i += 1
-                Ping_Result = main.TRUE
+                PingResult = main.TRUE
             else:
                 main.log.info( "Unknown error" )
-                Ping_Result = main.ERROR
-        if Ping_Result == main.FALSE:
+                PingResult = main.ERROR
+        if PingResult == main.FALSE:
             main.log.report(
                 "Ping all test after Host intent addition failed. Cleaning up" )
             # main.cleanup()
             # main.exit()
-        if Ping_Result == main.TRUE:
+        if PingResult == main.TRUE:
             main.log.report(
                 "Ping all test after Host intent addition successful" )
 
-        case6_result = Ping_Result
+        case6Result = PingResult
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=case6_result,
+            actual=case6Result,
             onpass="Pingall Test after Host intents addition successful",
             onfail="Pingall Test after Host intents addition failed" )
 
     def CASE5( self, main ):
         import json
-        from subprocess import Popen, PIPE
         # assumes that sts is already in you PYTHONPATH
-        from sts.topology.teston_topology import TestONTopology
-        # main.ONOS2.start_onos_cli( ONOS_ip=main.params[ 'CTRL' ][ 'ip1' ] )
-        deviceResult = main.ONOS2.devices()
-        linksResult = main.ONOS2.links()
-        #portsResult = main.ONOS2.ports()
-        print "**************"
-
-        main.log.report(
-            "This testcase is testing if all ONOS nodes are in topology sync with mininet" )
+        from sts.topology.testonTopology import TestONTopology
+        # main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+        main.log.report( "This testcase is testing if all ONOS nodes \
+                         are in topology sync with mininet" )
         main.log.report( "__________________________________" )
         main.case( "Comparing Mininet topology with the topology of ONOS" )
         main.step( "Start continuous pings" )
@@ -836,22 +872,22 @@
             ctrls )  # can also add Intent API info for intent operations
         MNTopo = Topo
 
-        Topology_Check = main.TRUE
+        TopologyCheck = main.TRUE
         main.step( "Compare ONOS Topology to MN Topology" )
-        devices_json = main.ONOS2.devices()
-        links_json = main.ONOS2.links()
-        #ports_json = main.ONOS2.ports()
-        print "devices_json= ", devices_json
+        devicesJson = main.ONOS2.devices()
+        linksJson = main.ONOS2.links()
+        # portsJson = main.ONOS2.ports()
 
-        result1 = main.Mininet1.compare_switches(
+        result1 = main.Mininet1.compareSwitches(
             MNTopo,
-            json.loads( devices_json ) )
-        result2 = main.Mininet1.compare_links(
+            json.loads( devicesJson ) )
+        result2 = main.Mininet1.compareLinks(
             MNTopo,
-            json.loads( links_json ) )
-        #result3 = main.Mininet1.compare_ports( MNTopo, json.loads( ports_json ) )
+            json.loads( linksJson ) )
+        # result3 = main.Mininet1.comparePorts(
+        # MNTopo, json.loads( portsJson ) )
 
-        #result = result1 and result2 and result3
+        # result = result1 and result2 and result3
         result = result1 and result2
 
         print "***********************"
@@ -868,55 +904,64 @@
             onfail="ONOS" +
             " Topology does not match MN Topology" )
 
-        Topology_Check = Topology_Check and result
+        TopologyCheck = TopologyCheck and result
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=Topology_Check,
+            actual=TopologyCheck,
             onpass="Topology checks passed",
             onfail="Topology checks failed" )
 
     def CASE7( self, main ):
+        from sts.topology.testonTopology import TestONTopology
 
-        ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
+        linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
-        main.log.report(
-            "This testscase is killing a link to ensure that link discovery is consistent" )
+        main.log.report( "This testscase is killing a link to ensure that \
+                         link discovery is consistent" )
         main.log.report( "__________________________________" )
-        main.log.report(
-            "Killing a link to ensure that link discovery is consistent" )
-        main.case(
-            "Killing a link to Ensure that Link Discovery is Working Properly" )
+        main.log.report( "Killing a link to ensure that link discovery \
+                         is consistent" )
+        main.case( "Killing a link to Ensure that Link Discovery \
+                   is Working Properly" )
         """
         main.step( "Start continuous pings" )
 
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source1' ],
-                            target=main.params[ 'PING' ][ 'target1' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target1' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source2' ],
-                            target=main.params[ 'PING' ][ 'target2' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target2' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source3' ],
-                            target=main.params[ 'PING' ][ 'target3' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target3' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source4' ],
-                            target=main.params[ 'PING' ][ 'target4' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target4' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source5' ],
-                            target=main.params[ 'PING' ][ 'target5' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target5' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source6' ],
-                            target=main.params[ 'PING' ][ 'target6' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target6' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source7' ],
-                            target=main.params[ 'PING' ][ 'target7' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target7' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source8' ],
-                            target=main.params[ 'PING' ][ 'target8' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target8' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source9' ],
-                            target=main.params[ 'PING' ][ 'target9' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target9' ],
+                               pingTime=500 )
         main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source10' ],
-                            target=main.params[ 'PING' ][ 'target10' ],pingTime=500 )
+                               target=main.params[ 'PING' ][ 'target10' ],
+                               pingTime=500 )
         """
         main.step( "Determine the current number of switches and links" )
-        topology_output = main.ONOS2.topology()
-        topology_result = main.ONOS1.get_topology( topology_output )
-        activeSwitches = topology_result[ 'devices' ]
-        links = topology_result[ 'links' ]
+        topologyOutput = main.ONOS2.topology()
+        topologyResult = main.ONOS1.getTopology( topologyOutput )
+        activeSwitches = topologyResult[ 'devices' ]
+        links = topologyResult[ 'links' ]
         print "activeSwitches = ", type( activeSwitches )
         print "links = ", type( links )
         main.log.info(
@@ -925,39 +970,39 @@
 
         main.step( "Kill Link between s3 and s28" )
         main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
-        time.sleep( link_sleep )
-        topology_output = main.ONOS2.topology()
-        Link_Down = main.ONOS1.check_status(
-            topology_output, activeSwitches, str(
+        time.sleep( linkSleep )
+        topologyOutput = main.ONOS2.topology()
+        LinkDown = main.ONOS1.checkStatus(
+            topologyOutput, activeSwitches, str(
                 int( links ) - 2 ) )
-        if Link_Down == main.TRUE:
+        if LinkDown == main.TRUE:
             main.log.report( "Link Down discovered properly" )
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=Link_Down,
+            actual=LinkDown,
             onpass="Link Down discovered properly",
             onfail="Link down was not discovered in " +
-            str( link_sleep ) +
+            str( linkSleep ) +
             " seconds" )
 
         # Check ping result here..add code for it
 
         main.step( "Bring link between s3 and s28 back up" )
-        Link_Up = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
-        time.sleep( link_sleep )
-        topology_output = main.ONOS2.topology()
-        Link_Up = main.ONOS1.check_status(
-            topology_output,
+        LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
+        time.sleep( linkSleep )
+        topologyOutput = main.ONOS2.topology()
+        LinkUp = main.ONOS1.checkStatus(
+            topologyOutput,
             activeSwitches,
             str( links ) )
-        if Link_Up == main.TRUE:
+        if LinkUp == main.TRUE:
             main.log.report( "Link up discovered properly" )
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=Link_Up,
+            actual=LinkUp,
             onpass="Link up discovered properly",
             onfail="Link up was not discovered in " +
-            str( link_sleep ) +
+            str( linkSleep ) +
             " seconds" )
 
         # NOTE Check ping result here..add code for it
@@ -967,22 +1012,22 @@
             main.Mininet1,
             ctrls )  # can also add Intent API info for intent operations
         MNTopo = Topo
-        Topology_Check = main.TRUE
+        TopologyCheck = main.TRUE
 
-        devices_json = main.ONOS2.devices()
-        links_json = main.ONOS2.links()
-        ports_json = main.ONOS2.ports()
-        print "devices_json= ", devices_json
+        devicesJson = main.ONOS2.devices()
+        linksJson = main.ONOS2.links()
+        portsJson = main.ONOS2.ports()
 
-        result1 = main.Mininet1.compare_switches(
+        result1 = main.Mininet1.compareSwitches(
             MNTopo,
-            json.loads( devices_json ) )
-        result2 = main.Mininet1.compare_links(
+            json.loads( devicesJson ) )
+        result2 = main.Mininet1.compareLinks(
             MNTopo,
-            json.loads( links_json ) )
-        #result3 = main.Mininet1.compare_ports( MNTopo, json.loads( ports_json ) )
+            json.loads( linksJson ) )
+        # result3 = main.Mininet1.comparePorts(
+        # MNTopo, json.loads( portsJson ) )
 
-        #result = result1 and result2 and result3
+        # result = result1 and result2 and result3
         result = result1 and result2
         print "***********************"
 
@@ -996,34 +1041,34 @@
             onfail="ONOS" +
             " Topology does not match MN Topology" )
 
-        Topology_Check = Topology_Check and result
+        TopologyCheck = TopologyCheck and result
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=Topology_Check,
+            actual=TopologyCheck,
             onpass="Topology checks passed",
             onfail="Topology checks failed" )
 
-        result = Link_Down and Link_Up and Topology_Check
+        result = LinkDown and LinkUp and TopologyCheck
         utilities.assert_equals( expect=main.TRUE, actual=result,
-                                 onpass="Link failure is discovered correctly",
-                                 onfail="Link Discovery failed" )
+                                onpass="Link failure is discovered correctly",
+                                onfail="Link Discovery failed" )
 
     def CASE8( self ):
         """
         Host intents removal
         """
-        main.log.report(
-            "This testcase removes any previously added intents before adding the same intents or point intents" )
+        main.log.report( "This testcase removes any previously added intents \
+                         before adding the same intents or point intents" )
         main.log.report( "__________________________________" )
         main.log.info( "Host intents removal" )
         main.case( "Removing host intents" )
         main.step( "Obtain the intent id's" )
-        intent_result = main.ONOS2.intents( json_format=False )
-        main.log.info( "intent_result = " + intent_result )
+        intentResult = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intent_result = " + intentResult )
 
-        intent_linewise = intent_result.split( "\n" )
+        intentLinewise = intentResult.split( "\n" )
         intentList = []
-        for line in intent_linewise:
+        for line in intentLinewise:
             if line.startswith( "id=" ):
                 intentList.append( line )
 
@@ -1036,19 +1081,19 @@
         main.step(
             "Iterate through the intentids list and remove each intent" )
         for id in intentids:
-            main.ONOS2.remove_intent( intent_id=id )
+            main.ONOS2.removeIntent( intentId=id )
 
-        intent_result = main.ONOS2.intents( json_format=False )
-        main.log.info( "intent_result = " + intent_result )
+        intentResult = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intent_result = " + intentResult )
 
-        case8_result = main.TRUE
-        if case8_result == main.TRUE:
+        case8Result = main.TRUE
+        if case8Result == main.TRUE:
             main.log.report( "Intent removal successful" )
         else:
             main.log.report( "Intent removal failed" )
 
-        Ping_Result = main.TRUE
-        if case8_result == main.TRUE:
+        PingResult = main.TRUE
+        if case8Result == main.TRUE:
             i = 8
             while i < 18:
                 main.log.info(
@@ -1057,33 +1102,33 @@
                     src="h" + str( i ), target="h" + str( i + 10 ) )
                 if ping == main.TRUE:
                     i = 19
-                    Ping_Result = Ping_Result and main.TRUE
+                    PingResult = PingResult and main.TRUE
                 elif ping == main.FALSE:
                     i += 1
-                    Ping_Result = Ping_Result and main.FALSE
+                    PingResult = PingResult and main.FALSE
                 else:
                     main.log.info( "Unknown error" )
-                    Ping_Result = main.ERROR
+                    PingResult = main.ERROR
 
             # Note: If the ping result failed, that means the intents have been
             # withdrawn correctly.
-        if Ping_Result == main.TRUE:
+        if PingResult == main.TRUE:
             main.log.report( "Host intents have not been withdrawn correctly" )
             # main.cleanup()
             # main.exit()
-        if Ping_Result == main.FALSE:
+        if PingResult == main.FALSE:
             main.log.report( "Host intents have been withdrawn correctly" )
 
-        case8_result = case8_result and Ping_Result
+        case8Result = case8Result and PingResult
 
-        if case8_result == main.FALSE:
+        if case8Result == main.FALSE:
             main.log.report( "Intent removal successful" )
         else:
             main.log.report( "Intent removal failed" )
 
-        utilities.assert_equals( expect=main.FALSE, actual=case8_result,
-                                 onpass="Intent removal test failed",
-                                 onfail="Intent removal test passed" )
+        utilities.assert_equals( expect=main.FALSE, actual=case8Result,
+                                onpass="Intent removal test failed",
+                                onfail="Intent removal test passed" )
 
     def CASE9( self ):
         main.log.report(
@@ -1091,189 +1136,201 @@
         main.log.report( "__________________________________" )
         main.log.info( "Adding point intents" )
         main.case(
-            "Adding bidirectional point for mn hosts(h8-h18,h9-h19,h10-h20,h11-h21,h12-h22,h13-h23,h14-h24,h15-h25,h16-h26,h17-h27)" )
+            "Adding bidirectional point for mn hosts \
+                  ( h8-h18, h9-h19, h10-h20, h11-h21, h12-h22,\
+                   h13-h23, h14-h24, h15-h25, h16-h26, h17-h27 )" )
         main.step(
-            "Add point-to-point intents for mininet hosts h8 and h18 or ONOS hosts h8 and h12" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h8 and h18 or \
+                  ONOS hosts h8 and h12" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003008/1",
             "of:0000000000006018/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006018/1",
             "of:0000000000003008/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h9 and h19 or ONOS hosts h9 and h13" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h9 and h19 or \
+                  ONOS hosts h9 and h13" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003009/1",
             "of:0000000000006019/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006019/1",
             "of:0000000000003009/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h10 and h20 or ONOS hosts hA and h14" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h10 and h20 or \
+                  ONOS hosts hA and h14" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003010/1",
             "of:0000000000006020/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006020/1",
             "of:0000000000003010/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h11 and h21 or ONOS hosts hB and h15" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h11 and h21 or \
+                  ONOS hosts hB and h15" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003011/1",
             "of:0000000000006021/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006021/1",
             "of:0000000000003011/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h12 and h22 or ONOS hosts hC and h16" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h12 and h22 \
+                  ONOS hosts hC and h16" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003012/1",
             "of:0000000000006022/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006022/1",
             "of:0000000000003012/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h13 and h23 or ONOS hosts hD and h17" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h13 and h23 or \
+                  ONOS hosts hD and h17" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003013/1",
             "of:0000000000006023/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006023/1",
             "of:0000000000003013/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h14 and h24 or ONOS hosts hE and h18" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h14 and h24 or \
+                  ONOS hosts hE and h18" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003014/1",
             "of:0000000000006024/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006024/1",
             "of:0000000000003014/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h15 and h25 or ONOS hosts hF and h19" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h15 and h25 or \
+                  ONOS hosts hF and h19" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003015/1",
             "of:0000000000006025/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006025/1",
             "of:0000000000003015/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h16 and h26 or ONOS hosts h10 and h1A" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add intents for mininet hosts h16 and h26 or \
+                  ONOS hosts h10 and h1A" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003016/1",
             "of:0000000000006026/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006026/1",
             "of:0000000000003016/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            # main.log.info( getIntentResult )
 
         main.step(
-            "Add point-to-point intents for mininet hosts h17 and h27 or ONOS hosts h11 and h1B" )
-        ptp_intent_result = main.ONOS2.add_point_intent(
+            "Add point intents for mininet hosts h17 and h27 or \
+                  ONOS hosts h11 and h1B" )
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000003017/1",
             "of:0000000000006027/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            main.log.info( getIntentResult )
 
-        ptp_intent_result = main.ONOS2.add_point_intent(
+        ptpIntentResult = main.ONOS2.addPointIntent(
             "of:0000000000006027/1",
             "of:0000000000003017/1" )
-        if ptp_intent_result == main.TRUE:
-            get_intent_result = main.ONOS2.intents()
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
             main.log.info( "Point to point intent install successful" )
-            # main.log.info( get_intent_result )
+            main.log.info( getIntentResult )
 
         print(
-            "_______________________________________________________________________________________" )
+            "___________________________________________________________" )
 
         flowHandle = main.ONOS2.flows()
         # print "flowHandle = ", flowHandle
@@ -1281,7 +1338,7 @@
 
         count = 1
         i = 8
-        Ping_Result = main.TRUE
+        PingResult = main.TRUE
         while i < 18:
             main.log.info(
                 "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
@@ -1289,8 +1346,8 @@
                 src="h" + str( i ), target="h" + str( i + 10 ) )
             if ping == main.FALSE and count < 5:
                 count += 1
-                #i = 8
-                Ping_Result = main.FALSE
+                # i = 8
+                PingResult = main.FALSE
                 main.log.report( "Ping between h" +
                                  str( i ) +
                                  " and h" +
@@ -1308,7 +1365,7 @@
                                       10 ) +
                                  "have failed" )
                 i = 19
-                Ping_Result = main.FALSE
+                PingResult = main.FALSE
             elif ping == main.TRUE:
                 main.log.info( "Ping test between h" +
                                str( i ) +
@@ -1317,22 +1374,22 @@
                                     10 ) +
                                "passed!" )
                 i += 1
-                Ping_Result = main.TRUE
+                PingResult = main.TRUE
             else:
                 main.log.info( "Unknown error" )
-                Ping_Result = main.ERROR
+                PingResult = main.ERROR
 
-        if Ping_Result == main.FALSE:
+        if PingResult == main.FALSE:
             main.log.report(
                 "Point intents have not ben installed correctly. Cleaning up" )
             # main.cleanup()
             # main.exit()
-        if Ping_Result == main.TRUE:
+        if PingResult == main.TRUE:
             main.log.report( "Point Intents have been installed correctly" )
 
-        case9_result = Ping_Result
+        case9Result = PingResult
         utilities.assert_equals(
             expect=main.TRUE,
-            actual=case9_result,
+            actual=case9Result,
             onpass="Point intents addition and Pingall Test successful",
             onfail="Point intents addition and Pingall Test NOT successful" )
