diff --git a/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py b/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py
index b8598e4..75e586f 100644
--- a/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py
+++ b/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py
@@ -963,8 +963,7 @@
 
     pingResult = main.Mininet1.pingall()
     hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
-    hosts = main.Mininet1.getHosts().keys()
-    # TODO: Make better use of new getHosts function
+    hosts = main.Mininet1.getHosts()
     for host in hosts:
         main.hostsData[ host ] = {}
         main.hostsData[ host ][ 'mac' ] =  \
diff --git a/TestON/tests/FuncNext13/FuncNext13.params b/TestON/tests/FuncNext13/FuncNext13.params
new file mode 100755
index 0000000..13a4691
--- /dev/null
+++ b/TestON/tests/FuncNext13/FuncNext13.params
@@ -0,0 +1,37 @@
+<PARAMS>
+    
+    <testcases>1,4,5,3</testcases>
+
+    #Environment variables
+    <ENV>
+        <cellName>driver_test</cellName>
+    </ENV>
+
+    <CTRL>
+        <ip1>10.128.20.11</ip1>
+        <port1>6633</port1>
+    </CTRL>
+
+    <PING>
+        <source1>h8</source1>
+        <source2>h9</source2>
+        <source3>h10</source3>
+        <source4>h11</source4>
+        <source5>h12</source5>
+        <source6>h13</source6>
+        <source7>h14</source7>
+        <source8>h15</source8>
+        <source9>h16</source9>
+        <source10>h17</source10>
+        <target1>10.0.0.18</target1>
+        <target2>10.0.0.19</target2>
+        <target3>10.0.0.20</target3>
+        <target4>10.0.0.21</target4>
+        <target5>10.0.0.22</target5>
+        <target6>10.0.0.23</target6>
+        <target7>10.0.0.24</target7>
+        <target8>10.0.0.25</target8>
+        <target9>10.0.0.26</target9>
+        <target10>10.0.0.27</target10>
+    </PING>
+</PARAMS>
diff --git a/TestON/tests/FuncNext13/FuncNext13.py b/TestON/tests/FuncNext13/FuncNext13.py
new file mode 100755
index 0000000..6b24695
--- /dev/null
+++ b/TestON/tests/FuncNext13/FuncNext13.py
@@ -0,0 +1,608 @@
+
+#Testing the basic functionality of ONOS Next
+#For sanity and driver functionality excercises only.
+
+import time
+import sys
+import os
+import re
+import time
+import json
+
+time.sleep(1)
+class FuncNext13:
+    def __init__(self):
+        self.default = ''
+
+    def CASE1(self, main):
+        '''
+        Startup sequence:
+        git pull
+        mvn clean install
+        onos-package
+        cell <name>
+        onos-verify-cell
+        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']
+        
+        main.case("Setting up test environment")
+        
+        main.step("Git checkout and pull master and get version")
+        main.ONOSbench.git_checkout("master")
+        git_pull_result = main.ONOSbench.git_pull()
+        print "git_pull_result = ", git_pull_result
+        version_result = main.ONOSbench.get_version()
+
+        if git_pull_result == 1:
+            main.step("Using mvn clean & install")
+            clean_install_result = main.ONOSbench.clean_install()
+            #clean_install_result = main.TRUE
+
+        main.step("Applying cell variable to environment")
+        cell_result1 = main.ONOSbench.set_cell(cell_name)
+        verify_result = main.ONOSbench.verify_cell()
+        cell_result2 = main.ONOS2.set_cell(cell_name)
+        #verify_result = main.ONOS2.verify_cell()
+        main.ONOS2.start_onos_cli(ONOS_ip=main.params['CTRL']['ip1'])
+        
+        cell_result = cell_result1 and cell_result2
+
+        main.step("Creating ONOS package")
+        package_result = main.ONOSbench.onos_package()
+
+        #main.step("Creating a cell")
+        #cell_create_result = main.ONOSbench.create_cell_file(**************)
+
+        main.step("Installing ONOS package")
+        onos_install_result = main.ONOSbench.onos_install()
+        onos1_isup = main.ONOSbench.isup()
+   
+        main.step("Starting ONOS service")
+        start_result = main.ONOSbench.onos_start(ONOS1_ip)
+
+        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")
+
+    def CASE11(self, main):
+        '''
+        Cleanup sequence:
+        onos-service <node_ip> stop
+        onos-uninstall
+
+        TODO: Define rest of cleanup
+        
+        '''
+
+        ONOS1_ip = main.params['CTRL']['ip1']
+
+        main.case("Cleaning up test environment")
+
+        main.step("Testing ONOS kill function")
+        kill_result = main.ONOSbench.onos_kill(ONOS1_ip)
+
+        main.step("Stopping ONOS service")
+        stop_result = main.ONOSbench.onos_stop(ONOS1_ip)
+
+        main.step("Uninstalling ONOS service") 
+        uninstall_result = main.ONOSbench.onos_uninstall()
+
+    def CASE3(self, main):
+        '''
+        Test 'onos' command and its functionality in driver
+        '''
+        
+        ONOS1_ip = 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)
+
+        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)
+
+
+
+    def CASE4(self, main):
+        import re
+        import time
+        main.case("Pingall Test")
+        main.step("Assigning switches to controllers")
+        for i in range(1,29):
+            if i ==1:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            elif i>=2 and i<5:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            elif i>=5 and i<8:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            elif i>=8 and i<18:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            elif i>=18 and i<28:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            else:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+        Switch_Mastership = main.TRUE
+        for i in range (1,29):
+            if i==1:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            elif i>=2 and i<5:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            elif i>=5 and i<8:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            elif i>=8 and i<18:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            elif i>=18 and i<28:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            else:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is" + str(response))
+                if re.search("tcp:" +ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+
+        if Switch_Mastership == main.TRUE:
+            main.log.report("MasterControllers assigned correctly")
+        utilities.assert_equals(expect = main.TRUE,actual=Switch_Mastership,
+                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)
+        '''
+        #REACTIVE FWD test
+
+        main.step("Get list of hosts from Mininet")
+        host_list = main.Mininet1.get_hosts()
+        main.log.info(host_list)
+
+        main.step("Get host list in ONOS format")
+        host_onos_list = main.ONOS2.get_hosts_id(host_list)
+        main.log.info(host_onos_list)
+        #time.sleep(5)
+
+        #We must use ping from hosts we want to add intents from 
+        #to make the hosts talk
+        #main.Mininet2.handle.sendline("\r")
+        #main.Mininet2.handle.sendline("h4 ping 10.1.1.1 -c 1 -W 1")
+        #time.sleep(3)
+        #main.Mininet2.handle.sendline("h5 ping 10.1.1.1 -c 1 -W 1")
+        #time.sleep(5)
+        
+        main.step("Pingall")
+        ping_result = main.FALSE
+        while ping_result == main.FALSE:
+            time1 = time.time()
+            ping_result = 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
+        #if there was no activity
+        main.ONOS2.start_onos_cli(ONOS_ip=main.params['CTRL']['ip1'])
+
+        main.step("Get hosts")
+        main.ONOS2.handle.sendline("hosts")
+        main.ONOS2.handle.expect("onos>")
+        hosts = main.ONOS2.handle.before
+        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)
+        
+        #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 point-to-point intents for mininet hosts h8 and h18 or ONOS hosts h8 and h12")
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000003008", 1, "of:0000000000006018", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006018", 1, "of:0000000000003008", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        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("of:0000000000003009", 1, "of:0000000000006019", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006019", 1, "of:0000000000003009", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+        
+        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("of:0000000000003010", 1, "of:0000000000006020", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006020", 1, "of:0000000000003010", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+            
+        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("of:0000000000003011", 1, "of:0000000000006021", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006021", 1, "of:0000000000003011", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+            
+        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("of:0000000000003012", 1, "of:0000000000006022", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006022", 1, "of:0000000000003012", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+            
+        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("of:0000000000003013", 1, "of:0000000000006023", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006023", 1, "of:0000000000003013", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+            
+        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("of:0000000000003014", 1, "of:0000000000006024", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006024", 1, "of:0000000000003014", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+            
+        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("of:0000000000003015", 1, "of:0000000000006025", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006025", 1, "of:0000000000003015", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+            
+        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("of:0000000000003016", 1, "of:0000000000006026", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006026", 1, "of:0000000000003016", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+        
+        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("of:0000000000003017", 1, "of:0000000000006027", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+       
+        ptp_intent_result = main.ONOS2.add_point_intent("of:0000000000006027", 1, "of:0000000000003017", 1)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+
+        print("_______________________________________________________________________________________")
+        '''
+
+        #Unistall onos-app-fwd app to disable reactive forwarding
+        appUninstall_result = main.ONOS2.feature_uninstall("onos-app-fwd")
+        main.log.info("onos-app-fwd uninstalled")
+
+        #After reactive forwarding is disabled, the reactive flows on switches timeout in 10-15s
+        #So sleep for 15s
+        time.sleep(15)
+        
+        flowHandle = main.ONOS2.flows()
+        print "flowHandle = ", flowHandle
+
+        count = 1
+        i = 8
+        Ping_Result = main.TRUE
+        #while i<10:
+        while i <18 :
+            main.log.info("\n\nh"+str(i)+" is Pinging h" + str(i+10))
+            ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+10))
+            if ping == main.FALSE and count <5:
+                count+=1
+                i = 8
+                Ping_Result = main.FALSE
+                main.log.report("Ping between h" + str(i) + " and h" + str(i+10) + " failed. Making attempt number "+str(count) + " in 2 seconds")
+                time.sleep(2)
+            elif ping==main.FALSE:
+                main.log.report("All ping attempts have failed")
+                i=19
+                Ping_Result = main.FALSE
+            elif ping==main.TRUE:
+                main.log.info("Ping test passed!")
+                i+=1
+                Ping_Result = main.TRUE
+            else:
+                main.log.info("Unknown error")
+                Ping_Result = main.ERROR
+        if Ping_Result==main.FALSE:
+            main.log.report("Intents have not ben installed correctly. Cleaning up")
+            #main.cleanup()
+            #main.exit()
+        if Ping_Result==main.TRUE:
+            main.log.report("Intents have been installed correctly")
+            
+        case4_result = Switch_Mastership and Ping_Result
+        utilities.assert_equals(expect=main.TRUE, actual=case4_result,
+                onpass="Pingall Test successful",
+                onfail="Pingall Test NOT successful")
+
+    def CASE5(self,main) :
+        import json
+        from subprocess import Popen, PIPE
+        from sts.topology.teston_topology import TestONTopology # assumes that sts is already in you PYTHONPATH
+        #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.step("Start continuous pings")
+        main.Mininet2.pingLong(src=main.params['PING']['source1'],
+                            target=main.params['PING']['target1'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source2'],
+                            target=main.params['PING']['target2'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source3'],
+                            target=main.params['PING']['target3'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source4'],
+                            target=main.params['PING']['target4'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source5'],
+                            target=main.params['PING']['target5'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source6'],
+                            target=main.params['PING']['target6'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source7'],
+                            target=main.params['PING']['target7'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source8'],
+                            target=main.params['PING']['target8'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source9'],
+                            target=main.params['PING']['target9'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source10'],
+                            target=main.params['PING']['target10'],pingTime=500)
+
+        main.step("Create TestONTopology object")
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ('ip' + str(count)) in main.params['CTRL']:
+                temp = temp + (getattr(main,('ONOS' + str(count))),)
+                temp = temp + ("ONOS"+str(count),)
+                temp = temp + (main.params['CTRL']['ip'+str(count)],)
+                temp = temp + (eval(main.params['CTRL']['port'+str(count)]),)
+                ctrls.append(temp)
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(main.Mininet1, ctrls) # can also add Intent API info for intent operations
+        MNTopo = Topo
+
+        Topology_Check = 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
+        
+        result1 = main.Mininet1.compare_switches(MNTopo, json.loads(devices_json))
+        print "***********************"
+        result2 = main.Mininet1.compare_links(MNTopo, json.loads(links_json))
+        print "***********************"
+        result3 = main.Mininet1.compare_ports(MNTopo, json.loads(ports_json))
+            
+        result = result1 and result2 and result3
+        print "***********************"
+        if result == main.TRUE:
+            main.log.report("ONOS"+ " Topology matches MN Topology")
+        utilities.assert_equals(expect=main.TRUE,actual=result,
+            onpass="ONOS" + " Topology matches MN Topology",
+            onfail="ONOS" + " Topology does not match MN Topology")
+        Topology_Check = Topology_Check and result
+        utilities.assert_equals(expect=main.TRUE,actual=Topology_Check,
+            onpass="Topology checks passed", onfail="Topology checks failed")
+    
+
+    def CASE7 (self,main):
+       
+        ONOS1_ip = main.params['CTRL']['ip1']
+
+        link_sleep = int(main.params['timers']['LinkDiscovery'])
+
+        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)
+        main.Mininet2.pingLong(src=main.params['PING']['source2'],
+                            target=main.params['PING']['target2'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source3'],
+                            target=main.params['PING']['target3'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source4'],
+                            target=main.params['PING']['target4'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source5'],
+                            target=main.params['PING']['target5'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source6'],
+                            target=main.params['PING']['target6'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source7'],
+                            target=main.params['PING']['target7'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source8'],
+                            target=main.params['PING']['target8'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source9'],
+                            target=main.params['PING']['target9'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source10'],
+                            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']
+        print "activeSwitches = ", type(activeSwitches)
+        print "links = ", type(links)
+        main.log.info("Currently there are %s switches and %s links"  %(str(activeSwitches), str(links)))
+
+        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(int(links)-2))
+        if Link_Down == main.TRUE:
+            main.log.report("Link Down discovered properly")
+        utilities.assert_equals(expect=main.TRUE,actual=Link_Down,
+                onpass="Link Down discovered properly",
+                onfail="Link down was not discovered in "+ str(link_sleep) + " seconds")
+        
+        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,activeSwitches,str(links))
+        if Link_Up == main.TRUE:
+            main.log.report("Link up discovered properly")
+        utilities.assert_equals(expect=main.TRUE,actual=Link_Up,
+                onpass="Link up discovered properly",
+                onfail="Link up was not discovered in "+ str(link_sleep) + " seconds")
+
+
+
+
+        main.step("Compare ONOS Topology to MN Topology")
+        Topo = TestONTopology(main.Mininet1, ctrls) # can also add Intent API info for intent operations
+        MNTopo = Topo
+        Topology_Check = main.TRUE
+        devices_json = main.ONOS2.devices()
+        links_json = main.ONOS2.links()
+        ports_json = main.ONOS2.ports()
+        print "devices_json= ", devices_json
+        
+        result1 = main.Mininet1.compare_switches(MNTopo, json.loads(devices_json))
+        print "***********************"
+        result2 = main.Mininet1.compare_links(MNTopo, json.loads(links_json))
+        print "***********************"
+        result3 = main.Mininet1.compare_ports(MNTopo, json.loads(ports_json))
+            
+        result = result1 and result2 and result3
+        print "***********************"
+        if result == main.TRUE:
+            main.log.report("ONOS"+ " Topology matches MN Topology")
+        utilities.assert_equals(expect=main.TRUE,actual=result,
+            onpass="ONOS" + " Topology matches MN Topology",
+            onfail="ONOS" + " Topology does not match MN Topology")
+        Topology_Check = Topology_Check and result
+        utilities.assert_equals(expect=main.TRUE,actual=Topology_Check,
+            onpass="Topology checks passed", onfail="Topology checks failed")
+    
+        result = Link_Down and Link_Up and Topology_Check
+        utilities.assert_equals(expect=main.TRUE,actual=result,
+                onpass="Link failure is discovered correctly",
+                onfail="Link Discovery failed")
+
+
+
diff --git a/TestON/tests/FuncNext13/FuncNext13.topo b/TestON/tests/FuncNext13/FuncNext13.topo
new file mode 100755
index 0000000..85b6cab
--- /dev/null
+++ b/TestON/tests/FuncNext13/FuncNext13.topo
@@ -0,0 +1,61 @@
+<TOPOLOGY>
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>10.128.10.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOSbench>
+
+        <ONOS1>
+            <host>10.128.10.11</host>
+            <user>sdn</user>
+            <password>sdn</password>
+            <type>OnosDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1>
+
+        <ONOS2>
+            <host>10.128.10.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2>
+
+        <Mininet1>
+            <host>10.128.10.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>MininetCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS>
+                #Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
+                <arg2> --topo mytopo </arg2>
+                <arg3> --switch ovs,protocols=OpenFlow13</arg3>
+                <controller> remote </controller>
+            </COMPONENTS>
+        </Mininet1>
+
+        <Mininet2>
+            <host>10.128.10.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>RemoteMininetDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS>
+                #Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
+                <arg2> --topo mytopo </arg2>
+                <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
+                <controller> remote </controller>
+            </COMPONENTS>
+        </Mininet2>
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/FuncNext13/__init__.py b/TestON/tests/FuncNext13/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/FuncNext13/__init__.py
diff --git a/TestON/tests/HATestClusterRestart/HATestClusterRestart.py b/TestON/tests/HATestClusterRestart/HATestClusterRestart.py
index 4ecc271..c08fc96 100644
--- a/TestON/tests/HATestClusterRestart/HATestClusterRestart.py
+++ b/TestON/tests/HATestClusterRestart/HATestClusterRestart.py
@@ -677,7 +677,7 @@
                 main.log.debug( "Intents in " + cli.name + ": " +
                                 str( sorted( onosIds ) ) )
                 if sorted( ids ) != sorted( intentIds ):
-                    main.log.warn( "Set of intent IDs doesn't match" )
+                    main.log.debug( "Set of intent IDs doesn't match" )
                     correct = False
                     break
                 else:
@@ -1104,6 +1104,8 @@
         assert utilities.assert_equals, "utilities.assert_equals not defined"
         assert CLIs, "CLIs not defined"
         assert nodes, "nodes not defined"
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology import TestONTopology
 
         main.case( "Setting up and gathering data for current state" )
         # The general idea for this test case is to pull the state of
@@ -1415,6 +1417,13 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        ctrls = []
+        for node in nodes:
+            temp = ( node, node.name, node.ip_address, 6633 )
+            ctrls.append( temp )
+        MNTopo = TestONTopology( main.Mininet1, ctrls )
+
         main.step( "Collecting topology information from ONOS" )
         devices = []
         threads = []
@@ -1572,21 +1581,14 @@
 
         main.step( "Comparing ONOS topology to MN" )
         devicesResults = main.TRUE
+        portsResults = main.TRUE
         linksResults = main.TRUE
-        hostsResults = main.TRUE
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
-        mnHosts = main.Mininet1.getHosts()
         for controller in range( numControllers ):
             controllerStr = str( controller + 1 )
-            if devices[ controller ] and ports[ controller ] and\
-                "Error" not in devices[ controller ] and\
-                "Error" not in ports[ controller ]:
-
+            if devices[ controller ] or "Error" not in devices[ controller ]:
                 currentDevicesResult = main.Mininet1.compareSwitches(
-                        mnSwitches,
-                        json.loads( devices[ controller ] ),
-                        json.loads( ports[ controller ] ) )
+                    MNTopo,
+                    json.loads( devices[ controller ] ) )
             else:
                 currentDevicesResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1595,10 +1597,24 @@
                                      " Switches view is correct",
                                      onfail="ONOS" + controllerStr +
                                      " Switches view is incorrect" )
-            if links[ controller ] and "Error" not in links[ controller ]:
+
+            if ports[ controller ] or "Error" not in ports[ controller ]:
+                currentPortsResult = main.Mininet1.comparePorts(
+                    MNTopo,
+                    json.loads( ports[ controller ] ) )
+            else:
+                currentPortsResult = main.FALSE
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=currentPortsResult,
+                                     onpass="ONOS" + controllerStr +
+                                     " ports view is correct",
+                                     onfail="ONOS" + controllerStr +
+                                     " ports view is incorrect" )
+
+            if links[ controller ] or "Error" not in links[ controller ]:
                 currentLinksResult = main.Mininet1.compareLinks(
-                        mnSwitches, mnLinks,
-                        json.loads( links[ controller ] ) )
+                    MNTopo,
+                    json.loads( links[ controller ] ) )
             else:
                 currentLinksResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1608,43 +1624,16 @@
                                      onfail="ONOS" + controllerStr +
                                      " links view is incorrect" )
 
-            if hosts[ controller ] or "Error" not in hosts[ controller ]:
-                currentHostsResult = main.Mininet1.compareHosts(
-                        mnHosts,
-                        hosts[ controller ] )
-            else:
-                currentHostsResult = main.FALSE
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=currentHostsResult,
-                                     onpass="ONOS" + controllerStr +
-                                     " hosts exist in Mininet",
-                                     onfail="ONOS" + controllerStr +
-                                     " hosts don't match Mininet" )
-
             devicesResults = devicesResults and currentDevicesResult
+            portsResults = portsResults and currentPortsResult
             linksResults = linksResults and currentLinksResult
-            hostsResults = hostsResults and currentHostsResult
 
-        main.step( "Device information is correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=devicesResults,
-            onpass="Device information is correct",
-            onfail="Device information is incorrect" )
-
-        main.step( "Links are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linksResults,
-            onpass="Link are correct",
-            onfail="Links are incorrect" )
-
-        main.step( "Hosts are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=hostsResults,
-            onpass="Hosts are correct",
-            onfail="Hosts are incorrect" )
+        topoResult = ( devicesResults and portsResults and linksResults
+                       and consistentHostsResult and consistentClustersResult
+                       and clusterResults and ipResult )
+        utilities.assert_equals( expect=main.TRUE, actual=topoResult,
+                                 onpass="Topology Check Test successful",
+                                 onfail="Topology Check Test NOT successful" )
 
     def CASE6( self, main ):
         """
@@ -2090,6 +2079,11 @@
         """
         Compare topo
         """
+        import sys
+        # FIXME add this path to params
+        sys.path.append( "/home/admin/sts" )
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology import TestONTopology
         import json
         import time
         assert numControllers, "numControllers not defined"
@@ -2101,9 +2095,25 @@
         main.case( "Compare ONOS Topology view to Mininet topology" )
         main.caseExplaination = "Compare topology objects between Mininet" +\
                                 " and ONOS"
+        main.step( "Create TestONTopology object" )
+        try:
+            ctrls = []
+            for node in nodes:
+                temp = ( node, node.name, node.ip_address, 6633 )
+                ctrls.append( temp )
+            MNTopo = TestONTopology( main.Mininet1, ctrls )
+        except Exception:
+            objResult = main.FALSE
+        else:
+            objResult = main.TRUE
+        utilities.assert_equals( expect=main.TRUE, actual=objResult,
+                                 onpass="Created TestONTopology object",
+                                 onfail="Exception while creating " +
+                                        "TestONTopology object" )
 
         main.step( "Comparing ONOS topology to MN" )
         devicesResults = main.TRUE
+        portsResults = main.TRUE
         linksResults = main.TRUE
         hostsResults = main.TRUE
         hostAttachmentResults = True
@@ -2115,6 +2125,9 @@
         # Give time for Gossip to work
         while topoResult == main.FALSE and elapsed < 60:
             count += 1
+            if count > 1:
+                # TODO: Deprecate STS usage
+                MNTopo = TestONTopology( main.Mininet1, ctrls )
             cliStart = time.time()
             devices = []
             threads = []
@@ -2195,19 +2208,13 @@
             print "Elapsed time: " + str( elapsed )
             print "CLI time: " + str( cliTime )
 
-            mnSwitches = main.Mininet1.getSwitches()
-            mnLinks = main.Mininet1.getLinks()
-            mnHosts = main.Mininet1.getHosts()
             for controller in range( numControllers ):
                 controllerStr = str( controller + 1 )
-                if devices[ controller ] and ports[ controller ] and\
-                    "Error" not in devices[ controller ] and\
-                    "Error" not in ports[ controller ]:
-
+                if devices[ controller ] or "Error" not in devices[
+                        controller ]:
                     currentDevicesResult = main.Mininet1.compareSwitches(
-                            mnSwitches,
-                            json.loads( devices[ controller ] ),
-                            json.loads( ports[ controller ] ) )
+                        MNTopo,
+                        json.loads( devices[ controller ] ) )
                 else:
                     currentDevicesResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2217,10 +2224,23 @@
                                          onfail="ONOS" + controllerStr +
                                          " Switches view is incorrect" )
 
-                if links[ controller ] and "Error" not in links[ controller ]:
+                if ports[ controller ] or "Error" not in ports[ controller ]:
+                    currentPortsResult = main.Mininet1.comparePorts(
+                        MNTopo,
+                        json.loads( ports[ controller ] ) )
+                else:
+                    currentPortsResult = main.FALSE
+                utilities.assert_equals( expect=main.TRUE,
+                                         actual=currentPortsResult,
+                                         onpass="ONOS" + controllerStr +
+                                         " ports view is correct",
+                                         onfail="ONOS" + controllerStr +
+                                         " ports view is incorrect" )
+
+                if links[ controller ] or "Error" not in links[ controller ]:
                     currentLinksResult = main.Mininet1.compareLinks(
-                            mnSwitches, mnLinks,
-                            json.loads( links[ controller ] ) )
+                        MNTopo,
+                        json.loads( links[ controller ] ) )
                 else:
                     currentLinksResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2232,8 +2252,7 @@
 
                 if hosts[ controller ] or "Error" not in hosts[ controller ]:
                     currentHostsResult = main.Mininet1.compareHosts(
-                            mnHosts,
-                            hosts[ controller ] )
+                        MNTopo, hosts[ controller ] )
                 else:
                     currentHostsResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2328,13 +2347,10 @@
 
                 # END CHECKING HOST ATTACHMENT POINTS
                 devicesResults = devicesResults and currentDevicesResult
+                portsResults = portsResults and currentPortsResult
                 linksResults = linksResults and currentLinksResult
                 hostsResults = hostsResults and currentHostsResult
-                hostAttachmentResults = hostAttachmentResults and\
-                                        hostAttachment
-                topoResult = ( devicesResults and linksResults
-                               and hostsResults and ipResult and
-                               hostAttachmentResults )
+                hostAttachmentResults = hostAttachmentResults and hostAttachment
 
         # Compare json objects for hosts and dataplane clusters
 
@@ -2423,7 +2439,7 @@
             onpass="ONOS shows 1 SCC",
             onfail="ONOS shows " + str( numClusters ) + " SCCs" )
 
-        topoResult = ( devicesResults and linksResults
+        topoResult = ( devicesResults and portsResults and linksResults
                        and hostsResults and consistentHostsResult
                        and consistentClustersResult and clusterResults
                        and ipResult and hostAttachmentResults )
@@ -2444,6 +2460,13 @@
             onpass="Device information is correct",
             onfail="Device information is incorrect" )
 
+        main.step( "Port information is correct" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=portsResults,
+            onpass="Port information is correct",
+            onfail="Port information is incorrect" )
+
         main.step( "Links are correct" )
         utilities.assert_equals(
             expect=main.TRUE,
diff --git a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py b/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py
index a81845f..7a21c01 100644
--- a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py
+++ b/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py
@@ -660,7 +660,7 @@
                 main.log.debug( "Intents in " + cli.name + ": " +
                                 str( sorted( onosIds ) ) )
                 if sorted( ids ) != sorted( intentIds ):
-                    main.log.warn( "Set of intent IDs doesn't match" )
+                    main.log.debug( "Set of intent IDs doesn't match" )
                     correct = False
                     break
                 else:
@@ -1077,6 +1077,8 @@
         assert utilities.assert_equals, "utilities.assert_equals not defined"
         assert CLIs, "CLIs not defined"
         assert nodes, "nodes not defined"
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology import TestONTopology
 
         main.case( "Setting up and gathering data for current state" )
         # The general idea for this test case is to pull the state of
@@ -1388,6 +1390,13 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        ctrls = []
+        for node in nodes:
+            temp = ( node, node.name, node.ip_address, 6633 )
+            ctrls.append( temp )
+        MNTopo = TestONTopology( main.Mininet1, ctrls )
+
         main.step( "Collecting topology information from ONOS" )
         devices = []
         threads = []
@@ -1545,21 +1554,14 @@
 
         main.step( "Comparing ONOS topology to MN" )
         devicesResults = main.TRUE
+        portsResults = main.TRUE
         linksResults = main.TRUE
-        hostsResults = main.TRUE
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
-        mnHosts = main.Mininet1.getHosts()
         for controller in range( numControllers ):
             controllerStr = str( controller + 1 )
-            if devices[ controller ] and ports[ controller ] and\
-                "Error" not in devices[ controller ] and\
-                "Error" not in ports[ controller ]:
-
+            if devices[ controller ] or "Error" not in devices[ controller ]:
                 currentDevicesResult = main.Mininet1.compareSwitches(
-                        mnSwitches,
-                        json.loads( devices[ controller ] ),
-                        json.loads( ports[ controller ] ) )
+                    MNTopo,
+                    json.loads( devices[ controller ] ) )
             else:
                 currentDevicesResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1568,10 +1570,24 @@
                                      " Switches view is correct",
                                      onfail="ONOS" + controllerStr +
                                      " Switches view is incorrect" )
-            if links[ controller ] and "Error" not in links[ controller ]:
+
+            if ports[ controller ] or "Error" not in ports[ controller ]:
+                currentPortsResult = main.Mininet1.comparePorts(
+                    MNTopo,
+                    json.loads( ports[ controller ] ) )
+            else:
+                currentPortsResult = main.FALSE
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=currentPortsResult,
+                                     onpass="ONOS" + controllerStr +
+                                     " ports view is correct",
+                                     onfail="ONOS" + controllerStr +
+                                     " ports view is incorrect" )
+
+            if links[ controller ] or "Error" not in links[ controller ]:
                 currentLinksResult = main.Mininet1.compareLinks(
-                        mnSwitches, mnLinks,
-                        json.loads( links[ controller ] ) )
+                    MNTopo,
+                    json.loads( links[ controller ] ) )
             else:
                 currentLinksResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1581,43 +1597,16 @@
                                      onfail="ONOS" + controllerStr +
                                      " links view is incorrect" )
 
-            if hosts[ controller ] or "Error" not in hosts[ controller ]:
-                currentHostsResult = main.Mininet1.compareHosts(
-                        mnHosts,
-                        hosts[ controller ] )
-            else:
-                currentHostsResult = main.FALSE
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=currentHostsResult,
-                                     onpass="ONOS" + controllerStr +
-                                     " hosts exist in Mininet",
-                                     onfail="ONOS" + controllerStr +
-                                     " hosts don't match Mininet" )
-
             devicesResults = devicesResults and currentDevicesResult
+            portsResults = portsResults and currentPortsResult
             linksResults = linksResults and currentLinksResult
-            hostsResults = hostsResults and currentHostsResult
 
-        main.step( "Device information is correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=devicesResults,
-            onpass="Device information is correct",
-            onfail="Device information is incorrect" )
-
-        main.step( "Links are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linksResults,
-            onpass="Link are correct",
-            onfail="Links are incorrect" )
-
-        main.step( "Hosts are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=hostsResults,
-            onpass="Hosts are correct",
-            onfail="Hosts are incorrect" )
+        topoResult = ( devicesResults and portsResults and linksResults
+                       and consistentHostsResult and consistentClustersResult
+                       and clusterResults and ipResult )
+        utilities.assert_equals( expect=main.TRUE, actual=topoResult,
+                                 onpass="Topology Check Test successful",
+                                 onfail="Topology Check Test NOT successful" )
 
     def CASE6( self, main ):
         """
@@ -2038,6 +2027,11 @@
         """
         Compare topo
         """
+        import sys
+        # FIXME add this path to params
+        sys.path.append( "/home/admin/sts" )
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology import TestONTopology
         import json
         import time
         assert numControllers, "numControllers not defined"
@@ -2049,9 +2043,25 @@
         main.case( "Compare ONOS Topology view to Mininet topology" )
         main.caseExplaination = "Compare topology objects between Mininet" +\
                                 " and ONOS"
+        main.step( "Create TestONTopology object" )
+        try:
+            ctrls = []
+            for node in nodes:
+                temp = ( node, node.name, node.ip_address, 6633 )
+                ctrls.append( temp )
+            MNTopo = TestONTopology( main.Mininet1, ctrls )
+        except Exception:
+            objResult = main.FALSE
+        else:
+            objResult = main.TRUE
+        utilities.assert_equals( expect=main.TRUE, actual=objResult,
+                                 onpass="Created TestONTopology object",
+                                 onfail="Exception while creating " +
+                                        "TestONTopology object" )
 
         main.step( "Comparing ONOS topology to MN" )
         devicesResults = main.TRUE
+        portsResults = main.TRUE
         linksResults = main.TRUE
         hostsResults = main.TRUE
         hostAttachmentResults = True
@@ -2063,6 +2073,9 @@
         # Give time for Gossip to work
         while topoResult == main.FALSE and elapsed < 60:
             count += 1
+            if count > 1:
+                # TODO: Deprecate STS usage
+                MNTopo = TestONTopology( main.Mininet1, ctrls )
             cliStart = time.time()
             devices = []
             threads = []
@@ -2143,19 +2156,13 @@
             print "Elapsed time: " + str( elapsed )
             print "CLI time: " + str( cliTime )
 
-            mnSwitches = main.Mininet1.getSwitches()
-            mnLinks = main.Mininet1.getLinks()
-            mnHosts = main.Mininet1.getHosts()
             for controller in range( numControllers ):
                 controllerStr = str( controller + 1 )
-                if devices[ controller ] and ports[ controller ] and\
-                    "Error" not in devices[ controller ] and\
-                    "Error" not in ports[ controller ]:
-
+                if devices[ controller ] or "Error" not in devices[
+                        controller ]:
                     currentDevicesResult = main.Mininet1.compareSwitches(
-                            mnSwitches,
-                            json.loads( devices[ controller ] ),
-                            json.loads( ports[ controller ] ) )
+                        MNTopo,
+                        json.loads( devices[ controller ] ) )
                 else:
                     currentDevicesResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2165,10 +2172,23 @@
                                          onfail="ONOS" + controllerStr +
                                          " Switches view is incorrect" )
 
-                if links[ controller ] and "Error" not in links[ controller ]:
+                if ports[ controller ] or "Error" not in ports[ controller ]:
+                    currentPortsResult = main.Mininet1.comparePorts(
+                        MNTopo,
+                        json.loads( ports[ controller ] ) )
+                else:
+                    currentPortsResult = main.FALSE
+                utilities.assert_equals( expect=main.TRUE,
+                                         actual=currentPortsResult,
+                                         onpass="ONOS" + controllerStr +
+                                         " ports view is correct",
+                                         onfail="ONOS" + controllerStr +
+                                         " ports view is incorrect" )
+
+                if links[ controller ] or "Error" not in links[ controller ]:
                     currentLinksResult = main.Mininet1.compareLinks(
-                            mnSwitches, mnLinks,
-                            json.loads( links[ controller ] ) )
+                        MNTopo,
+                        json.loads( links[ controller ] ) )
                 else:
                     currentLinksResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2180,8 +2200,7 @@
 
                 if hosts[ controller ] or "Error" not in hosts[ controller ]:
                     currentHostsResult = main.Mininet1.compareHosts(
-                            mnHosts,
-                            hosts[ controller ] )
+                        MNTopo, hosts[ controller ] )
                 else:
                     currentHostsResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2192,7 +2211,7 @@
                                          " hosts don't match Mininet" )
                 # CHECKING HOST ATTACHMENT POINTS
                 hostAttachment = True
-                zeroHosts = False
+                noHosts = False
                 # FIXME: topo-HA/obelisk specific mappings:
                 # key is mac and value is dpid
                 mappings = {}
@@ -2225,7 +2244,7 @@
                 if hosts[ controller ] or "Error" not in hosts[ controller ]:
                     if hosts[ controller ] == []:
                         main.log.warn( "There are no hosts discovered" )
-                        zeroHosts = True
+                        noHosts = True
                     else:
                         for host in hosts[ controller ]:
                             mac = None
@@ -2269,15 +2288,15 @@
                     main.log.error( "No hosts json output or \"Error\"" +
                                     " in output. hosts = " +
                                     repr( hosts[ controller ] ) )
-                if zeroHosts is False:
+                if noHosts is False:
                     hostAttachment = True
 
                 # END CHECKING HOST ATTACHMENT POINTS
                 devicesResults = devicesResults and currentDevicesResult
+                portsResults = portsResults and currentPortsResult
                 linksResults = linksResults and currentLinksResult
                 hostsResults = hostsResults and currentHostsResult
-                hostAttachmentResults = hostAttachmentResults and\
-                                        hostAttachment
+                hostAttachmentResults = hostAttachmentResults and hostAttachment
 
         # Compare json objects for hosts and dataplane clusters
 
@@ -2366,7 +2385,7 @@
             onpass="ONOS shows 1 SCC",
             onfail="ONOS shows " + str( numClusters ) + " SCCs" )
 
-        topoResult = ( devicesResults and linksResults
+        topoResult = ( devicesResults and portsResults and linksResults
                        and hostsResults and consistentHostsResult
                        and consistentClustersResult and clusterResults
                        and ipResult and hostAttachmentResults )
@@ -2387,6 +2406,13 @@
             onpass="Device information is correct",
             onfail="Device information is incorrect" )
 
+        main.step( "Port information is correct" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=portsResults,
+            onpass="Port information is correct",
+            onfail="Port information is incorrect" )
+
         main.step( "Links are correct" )
         utilities.assert_equals(
             expect=main.TRUE,
diff --git a/TestON/tests/HATestSanity/HATestSanity.py b/TestON/tests/HATestSanity/HATestSanity.py
index 8d952c7..83b4e51 100644
--- a/TestON/tests/HATestSanity/HATestSanity.py
+++ b/TestON/tests/HATestSanity/HATestSanity.py
@@ -665,7 +665,7 @@
                 main.log.debug( "Intents in " + cli.name + ": " +
                                 str( sorted( onosIds ) ) )
                 if sorted( ids ) != sorted( intentIds ):
-                    main.log.warn( "Set of intent IDs doesn't match" )
+                    main.log.debug( "Set of intent IDs doesn't match" )
                     correct = False
                     break
                 else:
@@ -1082,6 +1082,8 @@
         assert utilities.assert_equals, "utilities.assert_equals not defined"
         assert CLIs, "CLIs not defined"
         assert nodes, "nodes not defined"
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology import TestONTopology
 
         main.case( "Setting up and gathering data for current state" )
         # The general idea for this test case is to pull the state of
@@ -1398,6 +1400,13 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        ctrls = []
+        for node in nodes:
+            temp = ( node, node.name, node.ip_address, 6633 )
+            ctrls.append( temp )
+        MNTopo = TestONTopology( main.Mininet1, ctrls )
+
         main.step( "Collecting topology information from ONOS" )
         devices = []
         threads = []
@@ -1555,21 +1564,14 @@
 
         main.step( "Comparing ONOS topology to MN" )
         devicesResults = main.TRUE
+        portsResults = main.TRUE
         linksResults = main.TRUE
-        hostsResults = main.TRUE
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
-        mnHosts = main.Mininet1.getHosts()
         for controller in range( numControllers ):
             controllerStr = str( controller + 1 )
-            if devices[ controller ] and ports[ controller ] and\
-                "Error" not in devices[ controller ] and\
-                "Error" not in ports[ controller ]:
-
+            if devices[ controller ] or "Error" not in devices[ controller ]:
                 currentDevicesResult = main.Mininet1.compareSwitches(
-                        mnSwitches,
-                        json.loads( devices[ controller ] ),
-                        json.loads( ports[ controller ] ) )
+                    MNTopo,
+                    json.loads( devices[ controller ] ) )
             else:
                 currentDevicesResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1578,10 +1580,24 @@
                                      " Switches view is correct",
                                      onfail="ONOS" + controllerStr +
                                      " Switches view is incorrect" )
-            if links[ controller ] and "Error" not in links[ controller ]:
+
+            if ports[ controller ] or "Error" not in ports[ controller ]:
+                currentPortsResult = main.Mininet1.comparePorts(
+                    MNTopo,
+                    json.loads( ports[ controller ] ) )
+            else:
+                currentPortsResult = main.FALSE
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=currentPortsResult,
+                                     onpass="ONOS" + controllerStr +
+                                     " ports view is correct",
+                                     onfail="ONOS" + controllerStr +
+                                     " ports view is incorrect" )
+
+            if links[ controller ] or "Error" not in links[ controller ]:
                 currentLinksResult = main.Mininet1.compareLinks(
-                        mnSwitches, mnLinks,
-                        json.loads( links[ controller ] ) )
+                    MNTopo,
+                    json.loads( links[ controller ] ) )
             else:
                 currentLinksResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1591,43 +1607,16 @@
                                      onfail="ONOS" + controllerStr +
                                      " links view is incorrect" )
 
-            if hosts[ controller ] or "Error" not in hosts[ controller ]:
-                currentHostsResult = main.Mininet1.compareHosts(
-                        mnHosts,
-                        hosts[ controller ] )
-            else:
-                currentHostsResult = main.FALSE
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=currentHostsResult,
-                                     onpass="ONOS" + controllerStr +
-                                     " hosts exist in Mininet",
-                                     onfail="ONOS" + controllerStr +
-                                     " hosts don't match Mininet" )
-
             devicesResults = devicesResults and currentDevicesResult
+            portsResults = portsResults and currentPortsResult
             linksResults = linksResults and currentLinksResult
-            hostsResults = hostsResults and currentHostsResult
 
-        main.step( "Device information is correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=devicesResults,
-            onpass="Device information is correct",
-            onfail="Device information is incorrect" )
-
-        main.step( "Links are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linksResults,
-            onpass="Link are correct",
-            onfail="Links are incorrect" )
-
-        main.step( "Hosts are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=hostsResults,
-            onpass="Hosts are correct",
-            onfail="Hosts are incorrect" )
+        topoResult = ( devicesResults and portsResults and linksResults
+                       and consistentHostsResult and consistentClustersResult
+                       and clusterResults and ipResult )
+        utilities.assert_equals( expect=main.TRUE, actual=topoResult,
+                                 onpass="Topology Check Test successful",
+                                 onfail="Topology Check Test NOT successful" )
 
     def CASE6( self, main ):
         """
@@ -1990,6 +1979,11 @@
         """
         Compare topo
         """
+        import sys
+        # FIXME add this path to params
+        sys.path.append( "/home/admin/sts" )
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology import TestONTopology
         import json
         import time
         assert numControllers, "numControllers not defined"
@@ -2001,9 +1995,25 @@
         main.case( "Compare ONOS Topology view to Mininet topology" )
         main.caseExplaination = "Compare topology objects between Mininet" +\
                                 " and ONOS"
+        main.step( "Create TestONTopology object" )
+        try:
+            ctrls = []
+            for node in nodes:
+                temp = ( node, node.name, node.ip_address, 6633 )
+                ctrls.append( temp )
+            MNTopo = TestONTopology( main.Mininet1, ctrls )
+        except Exception:
+            objResult = main.FALSE
+        else:
+            objResult = main.TRUE
+        utilities.assert_equals( expect=main.TRUE, actual=objResult,
+                                 onpass="Created TestONTopology object",
+                                 onfail="Exception while creating " +
+                                        "TestONTopology object" )
 
         main.step( "Comparing ONOS topology to MN" )
         devicesResults = main.TRUE
+        portsResults = main.TRUE
         linksResults = main.TRUE
         hostsResults = main.TRUE
         hostAttachmentResults = True
@@ -2015,6 +2025,9 @@
         # Give time for Gossip to work
         while topoResult == main.FALSE and elapsed < 60:
             count += 1
+            if count > 1:
+                # TODO: Deprecate STS usage
+                MNTopo = TestONTopology( main.Mininet1, ctrls )
             cliStart = time.time()
             devices = []
             threads = []
@@ -2095,19 +2108,13 @@
             print "Elapsed time: " + str( elapsed )
             print "CLI time: " + str( cliTime )
 
-            mnSwitches = main.Mininet1.getSwitches()
-            mnLinks = main.Mininet1.getLinks()
-            mnHosts = main.Mininet1.getHosts()
             for controller in range( numControllers ):
                 controllerStr = str( controller + 1 )
-                if devices[ controller ] and ports[ controller ] and\
-                    "Error" not in devices[ controller ] and\
-                    "Error" not in ports[ controller ]:
-
+                if devices[ controller ] or "Error" not in devices[
+                        controller ]:
                     currentDevicesResult = main.Mininet1.compareSwitches(
-                            mnSwitches,
-                            json.loads( devices[ controller ] ),
-                            json.loads( ports[ controller ] ) )
+                        MNTopo,
+                        json.loads( devices[ controller ] ) )
                 else:
                     currentDevicesResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2117,10 +2124,23 @@
                                          onfail="ONOS" + controllerStr +
                                          " Switches view is incorrect" )
 
-                if links[ controller ] and "Error" not in links[ controller ]:
+                if ports[ controller ] or "Error" not in ports[ controller ]:
+                    currentPortsResult = main.Mininet1.comparePorts(
+                        MNTopo,
+                        json.loads( ports[ controller ] ) )
+                else:
+                    currentPortsResult = main.FALSE
+                utilities.assert_equals( expect=main.TRUE,
+                                         actual=currentPortsResult,
+                                         onpass="ONOS" + controllerStr +
+                                         " ports view is correct",
+                                         onfail="ONOS" + controllerStr +
+                                         " ports view is incorrect" )
+
+                if links[ controller ] or "Error" not in links[ controller ]:
                     currentLinksResult = main.Mininet1.compareLinks(
-                            mnSwitches, mnLinks,
-                            json.loads( links[ controller ] ) )
+                        MNTopo,
+                        json.loads( links[ controller ] ) )
                 else:
                     currentLinksResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2132,8 +2152,7 @@
 
                 if hosts[ controller ] or "Error" not in hosts[ controller ]:
                     currentHostsResult = main.Mininet1.compareHosts(
-                            mnHosts,
-                            hosts[ controller ] )
+                        MNTopo, hosts[ controller ] )
                 else:
                     currentHostsResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -2144,7 +2163,7 @@
                                          " hosts don't match Mininet" )
                 # CHECKING HOST ATTACHMENT POINTS
                 hostAttachment = True
-                zeroHosts = False
+                noHosts = False
                 # FIXME: topo-HA/obelisk specific mappings:
                 # key is mac and value is dpid
                 mappings = {}
@@ -2177,7 +2196,7 @@
                 if hosts[ controller ] or "Error" not in hosts[ controller ]:
                     if hosts[ controller ] == []:
                         main.log.warn( "There are no hosts discovered" )
-                        zeroHosts = True
+                        noHosts = True
                     else:
                         for host in hosts[ controller ]:
                             mac = None
@@ -2221,18 +2240,15 @@
                     main.log.error( "No hosts json output or \"Error\"" +
                                     " in output. hosts = " +
                                     repr( hosts[ controller ] ) )
-                if zeroHosts is False:
+                if noHosts is False:
                     hostAttachment = True
 
                 # END CHECKING HOST ATTACHMENT POINTS
                 devicesResults = devicesResults and currentDevicesResult
+                portsResults = portsResults and currentPortsResult
                 linksResults = linksResults and currentLinksResult
                 hostsResults = hostsResults and currentHostsResult
-                hostAttachmentResults = hostAttachmentResults and\
-                                        hostAttachment
-                topoResult = ( devicesResults and linksResults
-                               and hostsResults and ipResult and
-                               hostAttachmentResults )
+                hostAttachmentResults = hostAttachmentResults and hostAttachment
 
         # Compare json objects for hosts and dataplane clusters
 
@@ -2321,7 +2337,7 @@
             onpass="ONOS shows 1 SCC",
             onfail="ONOS shows " + str( numClusters ) + " SCCs" )
 
-        topoResult = ( devicesResults and linksResults
+        topoResult = ( devicesResults and portsResults and linksResults
                        and hostsResults and consistentHostsResult
                        and consistentClustersResult and clusterResults
                        and ipResult and hostAttachmentResults )
@@ -2342,6 +2358,13 @@
             onpass="Device information is correct",
             onfail="Device information is incorrect" )
 
+        main.step( "Port information is correct" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=portsResults,
+            onpass="Port information is correct",
+            onfail="Port information is incorrect" )
+
         main.step( "Links are correct" )
         utilities.assert_equals(
             expect=main.TRUE,
@@ -2349,13 +2372,6 @@
             onpass="Link are correct",
             onfail="Links are incorrect" )
 
-        main.step( "Hosts are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=hostsResults,
-            onpass="Hosts are correct",
-            onfail="Hosts are incorrect" )
-
         # FIXME: move this to an ONOS state case
         main.step( "Checking ONOS nodes" )
         nodesOutput = []
diff --git a/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.py b/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.py
index 4dcf0dd..a3a8a66 100644
--- a/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.py
+++ b/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.py
@@ -472,6 +472,7 @@
                 pass  # intent submitted is in onos
             else:
                 intentAddResult = False
+        # FIXME: DEBUG
         if intentAddResult:
             intentStop = time.time()
         else:
@@ -505,7 +506,6 @@
                            ( str( count ), str( i ), str( s ) ) )
         leaders = main.ONOScli1.leaders()
         try:
-            missing = False
             if leaders:
                 parsedLeaders = json.loads( leaders )
                 main.log.warn( json.dumps( parsedLeaders,
@@ -522,18 +522,11 @@
                     if topic not in ONOStopics:
                         main.log.error( "Error: " + topic +
                                         " not in leaders" )
-                        missing = True
             else:
                 main.log.error( "leaders() returned None" )
         except ( ValueError, TypeError ):
             main.log.exception( "Error parsing leaders" )
             main.log.error( repr( leaders ) )
-        # Check all nodes
-        if missing:
-            response = main.ONOScli1.leaders( jsonFormat=False)
-            main.log.warn( "ONOS1 leaders output: \n" +
-                           str( response ) )
-
         partitions = main.ONOScli1.partitions()
         try:
             if partitions :
@@ -580,17 +573,7 @@
                 main.log.debug( "Intents in " + cli.name + ": " +
                                 str( sorted( onosIds ) ) )
                 if sorted( ids ) != sorted( intentIds ):
-                    main.log.warn( "Set of intent IDs doesn't match" )
                     correct = False
-                    break
-                else:
-                    intents = json.loads( cli.intents() )
-                    for intent in intents:
-                        if intent[ 'state' ] != "INSTALLED":
-                            main.log.warn( "Intent " + intent[ 'id' ] +
-                                           " is " + intent[ 'state' ] )
-                            correct = False
-                            break
             if correct:
                 break
             else:
@@ -646,7 +629,6 @@
                                ( str( count ), str( i ), str( s ) ) )
             leaders = main.ONOScli1.leaders()
             try:
-                missing = False
                 if leaders:
                     parsedLeaders = json.loads( leaders )
                     main.log.warn( json.dumps( parsedLeaders,
@@ -666,17 +648,11 @@
                         if topic not in ONOStopics:
                             main.log.error( "Error: " + topic +
                                             " not in leaders" )
-                            missing = True
                 else:
                     main.log.error( "leaders() returned None" )
             except ( ValueError, TypeError ):
                 main.log.exception( "Error parsing leaders" )
                 main.log.error( repr( leaders ) )
-            # Check all nodes
-            if missing:
-                response = main.ONOScli1.leaders( jsonFormat=False)
-                main.log.warn( "ONOS1 leaders output: \n" +
-                               str( response ) )
             partitions = main.ONOScli1.partitions()
             try:
                 if partitions :
@@ -874,7 +850,6 @@
                                ( str( count ), str( i ), str( s ) ) )
             leaders = main.ONOScli1.leaders()
             try:
-                missing = False
                 if leaders:
                     parsedLeaders = json.loads( leaders )
                     main.log.warn( json.dumps( parsedLeaders,
@@ -894,16 +869,11 @@
                         if topic not in ONOStopics:
                             main.log.error( "Error: " + topic +
                                             " not in leaders" )
-                            missing = True
                 else:
                     main.log.error( "leaders() returned None" )
             except ( ValueError, TypeError ):
                 main.log.exception( "Error parsing leaders" )
                 main.log.error( repr( leaders ) )
-            if missing:
-                response = main.ONOScli1.leaders( jsonFormat=False)
-                main.log.warn( "ONOS1 leaders output: \n" +
-                               str( response ) )
             partitions = main.ONOScli1.partitions()
             try:
                 if partitions :
@@ -975,6 +945,8 @@
         assert numControllers, "numControllers not defined"
         assert main, "main not defined"
         assert utilities.assert_equals, "utilities.assert_equals not defined"
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology import TestONTopology
 
         main.case( "Setting up and gathering data for current state" )
         # The general idea for this test case is to pull the state of
@@ -1040,6 +1012,12 @@
                 main.log.warn( table )
         # TODO: Compare switch flow tables with ONOS flow tables
 
+        main.step( "Create TestONTopology object" )
+        ctrls = []
+        temp = ( nodes[0], nodes[0].name, nodes[0].ip_address, 6633 )
+        ctrls.append( temp )
+        MNTopo = TestONTopology( main.Mininet1, ctrls )
+
         main.step( "Collecting topology information from ONOS" )
         devices = []
         devices.append( main.ONOScli1.devices() )
@@ -1086,21 +1064,15 @@
 
         main.step( "Comparing ONOS topology to MN" )
         devicesResults = main.TRUE
+        portsResults = main.TRUE
         linksResults = main.TRUE
         hostsResults = main.TRUE
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
-        mnHosts = main.Mininet1.getHosts()
         for controller in range( numControllers ):
             controllerStr = str( controller + 1 )
-            if devices[ controller ] and ports[ controller ] and\
-                "Error" not in devices[ controller ] and\
-                "Error" not in ports[ controller ]:
-
+            if devices[ controller ] or "Error" not in devices[ controller ]:
                 currentDevicesResult = main.Mininet1.compareSwitches(
-                        mnSwitches,
-                        json.loads( devices[ controller ] ),
-                        json.loads( ports[ controller ] ) )
+                    MNTopo,
+                    json.loads( devices[ controller ] ) )
             else:
                 currentDevicesResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1109,10 +1081,24 @@
                                      " Switches view is correct",
                                      onfail="ONOS" + controllerStr +
                                      " Switches view is incorrect" )
-            if links[ controller ] and "Error" not in links[ controller ]:
+
+            if ports[ controller ] or "Error" not in ports[ controller ]:
+                currentPortsResult = main.Mininet1.comparePorts(
+                    MNTopo,
+                    json.loads( ports[ controller ] ) )
+            else:
+                currentPortsResult = main.FALSE
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=currentPortsResult,
+                                     onpass="ONOS" + controllerStr +
+                                     " ports view is correct",
+                                     onfail="ONOS" + controllerStr +
+                                     " ports view is incorrect" )
+
+            if links[ controller ] or "Error" not in links[ controller ]:
                 currentLinksResult = main.Mininet1.compareLinks(
-                        mnSwitches, mnLinks,
-                        json.loads( links[ controller ] ) )
+                    MNTopo,
+                    json.loads( links[ controller ] ) )
             else:
                 currentLinksResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1124,8 +1110,7 @@
 
             if hosts[ controller ] or "Error" not in hosts[ controller ]:
                 currentHostsResult = main.Mininet1.compareHosts(
-                        mnHosts,
-                        hosts[ controller ] )
+                    MNTopo, hosts[ controller ] )
             else:
                 currentHostsResult = main.FALSE
             utilities.assert_equals( expect=main.TRUE,
@@ -1136,29 +1121,15 @@
                                      " hosts don't match Mininet" )
 
             devicesResults = devicesResults and currentDevicesResult
+            portsResults = portsResults and currentPortsResult
             linksResults = linksResults and currentLinksResult
             hostsResults = hostsResults and currentHostsResult
 
-        main.step( "Device information is correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=devicesResults,
-            onpass="Device information is correct",
-            onfail="Device information is incorrect" )
-
-        main.step( "Links are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linksResults,
-            onpass="Link are correct",
-            onfail="Links are incorrect" )
-
-        main.step( "Hosts are correct" )
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=hostsResults,
-            onpass="Hosts are correct",
-            onfail="Hosts are incorrect" )
+        topoResult = devicesResults and portsResults and linksResults\
+                     and clusterResults and ipResult and hostsResults
+        utilities.assert_equals( expect=main.TRUE, actual=topoResult,
+                                 onpass="Topology Check Test successful",
+                                 onfail="Topology Check Test NOT successful" )
 
     def CASE6( self, main ):
         """
@@ -1283,6 +1254,7 @@
             main.log.warn( "ONOS1 intents response: " + repr( ONOS1Intents ) )
         else:
             intentCheck = main.TRUE
+            main.log.error( "Intents are consistent across all ONOS nodes" )
         utilities.assert_equals(
             expect=main.TRUE,
             actual=intentCheck,
@@ -1407,6 +1379,11 @@
         """
         Compare topo
         """
+        import sys
+        # FIXME add this path to params
+        sys.path.append( "/home/admin/sts" )
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology import TestONTopology
         import json
         import time
         assert numControllers, "numControllers not defined"
@@ -1416,12 +1393,27 @@
         main.case( "Compare ONOS Topology view to Mininet topology" )
         main.caseExplaination = "Compare topology objects between Mininet" +\
                                 " and ONOS"
+        main.step( "Create TestONTopology object" )
+        try:
+            ctrls = []
+            node = main.ONOS1
+            temp = ( node, node.name, node.ip_address, 6633 )
+            ctrls.append( temp )
+            MNTopo = TestONTopology( main.Mininet1, ctrls )
+        except Exception:
+            objResult = main.FALSE
+        else:
+            objResult = main.TRUE
+        utilities.assert_equals( expect=main.TRUE, actual=objResult,
+                                 onpass="Created TestONTopology object",
+                                 onfail="Exception while creating " +
+                                        "TestONTopology object" )
 
         main.step( "Comparing ONOS topology to MN" )
         devicesResults = main.TRUE
+        portsResults = main.TRUE
         linksResults = main.TRUE
         hostsResults = main.TRUE
-        hostAttachmentResults = True
         topoResult = main.FALSE
         elapsed = 0
         count = 0
@@ -1430,6 +1422,9 @@
         # Give time for Gossip to work
         while topoResult == main.FALSE and elapsed < 60:
             count += 1
+            if count > 1:
+                # TODO: Deprecate STS usage
+                MNTopo = TestONTopology( main.Mininet1, ctrls )
             cliStart = time.time()
             devices = []
             devices.append( main.ONOScli1.devices() )
@@ -1455,19 +1450,13 @@
             cliTime = time.time() - cliStart
             print "CLI time: " + str( cliTime )
 
-            mnSwitches = main.Mininet1.getSwitches()
-            mnLinks = main.Mininet1.getLinks()
-            mnHosts = main.Mininet1.getHosts()
             for controller in range( numControllers ):
                 controllerStr = str( controller + 1 )
-                if devices[ controller ] and ports[ controller ] and\
-                    "Error" not in devices[ controller ] and\
-                    "Error" not in ports[ controller ]:
-
+                if devices[ controller ] or "Error" not in devices[
+                        controller ]:
                     currentDevicesResult = main.Mininet1.compareSwitches(
-                            mnSwitches,
-                            json.loads( devices[ controller ] ),
-                            json.loads( ports[ controller ] ) )
+                        MNTopo,
+                        json.loads( devices[ controller ] ) )
                 else:
                     currentDevicesResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -1477,10 +1466,23 @@
                                          onfail="ONOS" + controllerStr +
                                          " Switches view is incorrect" )
 
-                if links[ controller ] and "Error" not in links[ controller ]:
+                if ports[ controller ] or "Error" not in ports[ controller ]:
+                    currentPortsResult = main.Mininet1.comparePorts(
+                        MNTopo,
+                        json.loads( ports[ controller ] ) )
+                else:
+                    currentPortsResult = main.FALSE
+                utilities.assert_equals( expect=main.TRUE,
+                                         actual=currentPortsResult,
+                                         onpass="ONOS" + controllerStr +
+                                         " ports view is correct",
+                                         onfail="ONOS" + controllerStr +
+                                         " ports view is incorrect" )
+
+                if links[ controller ] or "Error" not in links[ controller ]:
                     currentLinksResult = main.Mininet1.compareLinks(
-                            mnSwitches, mnLinks,
-                            json.loads( links[ controller ] ) )
+                        MNTopo,
+                        json.loads( links[ controller ] ) )
                 else:
                     currentLinksResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -1492,8 +1494,7 @@
 
                 if hosts[ controller ] or "Error" not in hosts[ controller ]:
                     currentHostsResult = main.Mininet1.compareHosts(
-                            mnHosts,
-                            hosts[ controller ] )
+                        MNTopo, hosts[ controller ] )
                 else:
                     currentHostsResult = main.FALSE
                 utilities.assert_equals( expect=main.TRUE,
@@ -1502,94 +1503,11 @@
                                          " hosts exist in Mininet",
                                          onfail="ONOS" + controllerStr +
                                          " hosts don't match Mininet" )
-                # CHECKING HOST ATTACHMENT POINTS
-                hostAttachment = True
-                zeroHosts = False
-                # FIXME: topo-HA/obelisk specific mappings:
-                # key is mac and value is dpid
-                mappings = {}
-                for i in range( 1, 29 ):  # hosts 1 through 28
-                    # set up correct variables:
-                    macId = "00:" * 5 + hex( i ).split( "0x" )[1].upper().zfill(2)
-                    if i == 1:
-                        deviceId = "1000".zfill(16)
-                    elif i == 2:
-                        deviceId = "2000".zfill(16)
-                    elif i == 3:
-                        deviceId = "3000".zfill(16)
-                    elif i == 4:
-                        deviceId = "3004".zfill(16)
-                    elif i == 5:
-                        deviceId = "5000".zfill(16)
-                    elif i == 6:
-                        deviceId = "6000".zfill(16)
-                    elif i == 7:
-                        deviceId = "6007".zfill(16)
-                    elif i >= 8 and i <= 17:
-                        dpid = '3' + str( i ).zfill( 3 )
-                        deviceId = dpid.zfill(16)
-                    elif i >= 18 and i <= 27:
-                        dpid = '6' + str( i ).zfill( 3 )
-                        deviceId = dpid.zfill(16)
-                    elif i == 28:
-                        deviceId = "2800".zfill(16)
-                    mappings[ macId ] = deviceId
-                if hosts[ controller ] or "Error" not in hosts[ controller ]:
-                    if hosts[ controller ] == []:
-                        main.log.warn( "There are no hosts discovered" )
-                        zeroHosts = True
-                    else:
-                        for host in hosts[ controller ]:
-                            mac = None
-                            location = None
-                            device = None
-                            port = None
-                            try:
-                                mac = host.get( 'mac' )
-                                assert mac, "mac field could not be found for this host object"
-
-                                location = host.get( 'location' )
-                                assert location, "location field could not be found for this host object"
-
-                                # Trim the protocol identifier off deviceId
-                                device = str( location.get( 'elementId' ) ).split(':')[1]
-                                assert device, "elementId field could not be found for this host location object"
-
-                                port = location.get( 'port' )
-                                assert port, "port field could not be found for this host location object"
-
-                                # Now check if this matches where they should be
-                                if mac and device and port:
-                                    if str( port ) != "1":
-                                        main.log.error( "The attachment port is incorrect for " +
-                                                        "host " + str( mac ) +
-                                                        ". Expected: 1 Actual: " + str( port) )
-                                        hostAttachment = False
-                                    if device != mappings[ str( mac ) ]:
-                                        main.log.error( "The attachment device is incorrect for " +
-                                                        "host " + str( mac ) +
-                                                        ". Expected: " + mappings[ str( mac ) ] +
-                                                        " Actual: " + device )
-                                        hostAttachment = False
-                                else:
-                                    hostAttachment = False
-                            except AssertionError:
-                                main.log.exception( "Json object not as expected" )
-                                main.log.error( repr( host ) )
-                                hostAttachment = False
-                else:
-                    main.log.error( "No hosts json output or \"Error\"" +
-                                    " in output. hosts = " +
-                                    repr( hosts[ controller ] ) )
-                if zeroHosts is False:
-                    hostAttachment = True
-
 
                 devicesResults = devicesResults and currentDevicesResult
+                portsResults = portsResults and currentPortsResult
                 linksResults = linksResults and currentLinksResult
                 hostsResults = hostsResults and currentHostsResult
-                hostAttachmentResults = hostAttachmentResults and\
-                                        hostAttachment
 
                 # "consistent" results don't make sense for single instance
             # there should always only be one cluster
@@ -1603,9 +1521,8 @@
                 onpass="ONOS shows 1 SCC",
                 onfail="ONOS shows " + str( numClusters ) + " SCCs" )
 
-            topoResult = ( devicesResults and linksResults
-                           and hostsResults and ipResult and clusterResults and
-                           hostAttachmentResults )
+            topoResult = ( devicesResults and portsResults and linksResults
+                           and hostsResults and ipResult and clusterResults )
 
         topoResult = topoResult and int( count <= 2 )
         note = "note it takes about " + str( int( cliTime ) ) + \
diff --git a/TestON/tests/MultiProd/MultiProd.py b/TestON/tests/MultiProd/MultiProd.py
index 682b6f1..6bf405b 100644
--- a/TestON/tests/MultiProd/MultiProd.py
+++ b/TestON/tests/MultiProd/MultiProd.py
@@ -255,6 +255,9 @@
 
     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
         ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
         ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
         ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
@@ -291,8 +294,6 @@
         # print "links1 = ", links1
         # print "links2 = ", links2
         # print "links3 = ", links3
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
 
         print "**************"
 
@@ -338,46 +339,97 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
+                temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
+                temp = temp + ( "ONOS" + str( count ), )
+                temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
+                temp = temp + \
+                    ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
+                ctrls.append( temp )
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+
         TopologyCheck = main.TRUE
         main.step( "Compare ONOS Topology to MN Topology" )
 
         switchesResults1 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
+            MNTopo,
+            json.loads( devices1 ) )
         print "switches_Result1 = ", switchesResults1
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults1,
                                 onpass="ONOS1 Switches view is correct",
                                 onfail="ONOS1 Switches view is incorrect" )
 
         switchesResults2 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices2 ), json.loads( ports2 ) )
+            MNTopo,
+            json.loads( devices2 ) )
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults2,
                                 onpass="ONOS2 Switches view is correct",
                                 onfail="ONOS2 Switches view is incorrect" )
 
         switchesResults3 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices3 ), json.loads( ports3 ) )
+            MNTopo,
+            json.loads( devices3 ) )
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults3,
                                 onpass="ONOS3 Switches view is correct",
                                 onfail="ONOS3 Switches view is incorrect" )
 
+        portsResults1 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports1 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults1,
+                onpass="ONOS1 Ports view is correct",
+                onfail="ONOS1 Ports view is incorrect" )
+
+        portsResults2 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports2 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults2,
+                onpass="ONOS2 Ports view is correct",
+                onfail="ONOS2 Ports view is incorrect" )
+
+        portsResults3 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports3 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults3,
+                onpass="ONOS3 Ports view is correct",
+                onfail="ONOS3 Ports view is incorrect" )
+
         linksResults1 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links1 ) )
+            MNTopo,
+            json.loads( links1 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults1,
                                 onpass="ONOS1 Links view is correct",
                                 onfail="ONOS1 Links view is incorrect" )
 
         linksResults2 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links2 ) )
+            MNTopo,
+            json.loads( links2 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults2,
                                 onpass="ONOS2 Links view is correct",
                                 onfail="ONOS2 Links view is incorrect" )
 
         linksResults3 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links3 ) )
+            MNTopo,
+            json.loads( links3 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults3,
                                 onpass="ONOS2 Links view is correct",
                                 onfail="ONOS2 Links view is incorrect" )
 
+        # topoResult = switchesResults1 and switchesResults2
+        # and switchesResults3\
+        # and portsResults1 and portsResults2 and portsResults3\
+        # and linksResults1 and linksResults2 and linksResults3
+
         topoResult = switchesResults1 and switchesResults2 and\
                      switchesResults3 and linksResults1 and linksResults2 and\
                      linksResults3
@@ -678,8 +730,6 @@
         # print "links1 = ", links1
         # print "links2 = ", links2
         # print "links3 = ", links3
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
 
         print "**************"
 
@@ -725,47 +775,98 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
+                temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
+                temp = temp + ( "ONOS" + str( count ), )
+                temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
+                temp = temp + \
+                    ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
+                ctrls.append( temp )
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+
+        TopologyCheck = main.TRUE
         main.step( "Compare ONOS Topology to MN Topology" )
 
         switchesResults1 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
+            MNTopo,
+            json.loads( devices1 ) )
         print "switches_Result1 = ", switchesResults1
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults1,
                                 onpass="ONOS1 Switches view is correct",
                                 onfail="ONOS1 Switches view is incorrect" )
 
         switchesResults2 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices2 ), json.loads( ports2 ) )
+            MNTopo,
+            json.loads( devices2 ) )
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults2,
                                 onpass="ONOS2 Switches view is correct",
                                 onfail="ONOS2 Switches view is incorrect" )
 
         switchesResults3 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices3 ), json.loads( ports3 ) )
+            MNTopo,
+            json.loads( devices3 ) )
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults3,
                                 onpass="ONOS3 Switches view is correct",
                                 onfail="ONOS3 Switches view is incorrect" )
 
+        """
+        portsResults1 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports1 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults1,
+                onpass="ONOS1 Ports view is correct",
+                onfail="ONOS1 Ports view is incorrect" )
+
+        portsResults2 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports2 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults2,
+                onpass="ONOS2 Ports view is correct",
+                onfail="ONOS2 Ports view is incorrect" )
+
+        portsResults3 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports3 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults3,
+                onpass="ONOS3 Ports view is correct",
+                onfail="ONOS3 Ports view is incorrect" )
+        """
         linksResults1 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links1 ) )
+            MNTopo,
+            json.loads( links1 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults1,
                                 onpass="ONOS1 Links view is correct",
                                 onfail="ONOS1 Links view is incorrect" )
 
         linksResults2 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links2 ) )
-
+            MNTopo,
+            json.loads( links2 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults2,
                                 onpass="ONOS2 Links view is correct",
                                 onfail="ONOS2 Links view is incorrect" )
 
         linksResults3 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links3 ) )
-
+            MNTopo,
+            json.loads( links3 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults3,
                                 onpass="ONOS2 Links view is correct",
                                 onfail="ONOS2 Links view is incorrect" )
 
+        # topoResult = switchesResults1 and switchesResults2
+        # and switchesResults3\
+        # and portsResults1 and portsResults2 and portsResults3\
+        # and linksResults1 and linksResults2 and linksResults3
+
         topoResult = switchesResults1 and switchesResults2\
                 and switchesResults3 and linksResults1 and\
                 linksResults2 and linksResults3
diff --git a/TestON/tests/MultiProd13/MultiProd13.py b/TestON/tests/MultiProd13/MultiProd13.py
index a458dec..ee62ce7 100644
--- a/TestON/tests/MultiProd13/MultiProd13.py
+++ b/TestON/tests/MultiProd13/MultiProd13.py
@@ -255,6 +255,9 @@
 
     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
         ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
         ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
         ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
@@ -336,46 +339,97 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
+                temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
+                temp = temp + ( "ONOS" + str( count ), )
+                temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
+                temp = temp + \
+                    ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
+                ctrls.append( temp )
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+
+        TopologyCheck = main.TRUE
         main.step( "Compare ONOS Topology to MN Topology" )
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
+
         switchesResults1 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
+            MNTopo,
+            json.loads( devices1 ) )
         print "switches_Result1 = ", switchesResults1
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults1,
                                 onpass="ONOS1 Switches view is correct",
                                 onfail="ONOS1 Switches view is incorrect" )
 
         switchesResults2 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices2 ), json.loads( ports2 ) )
+            MNTopo,
+            json.loads( devices2 ) )
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults2,
                                 onpass="ONOS2 Switches view is correct",
                                 onfail="ONOS2 Switches view is incorrect" )
 
         switchesResults3 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices3 ), json.loads( ports3 ) )
+            MNTopo,
+            json.loads( devices3 ) )
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults3,
                                 onpass="ONOS3 Switches view is correct",
                                 onfail="ONOS3 Switches view is incorrect" )
 
+        portsResults1 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports1 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults1,
+                onpass="ONOS1 Ports view is correct",
+                onfail="ONOS1 Ports view is incorrect" )
+
+        portsResults2 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports2 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults2,
+                onpass="ONOS2 Ports view is correct",
+                onfail="ONOS2 Ports view is incorrect" )
+
+        portsResults3 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports3 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults3,
+                onpass="ONOS3 Ports view is correct",
+                onfail="ONOS3 Ports view is incorrect" )
+
         linksResults1 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links1 ) )
+            MNTopo,
+            json.loads( links1 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults1,
                                 onpass="ONOS1 Links view is correct",
                                 onfail="ONOS1 Links view is incorrect" )
 
         linksResults2 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links2 ) )
+            MNTopo,
+            json.loads( links2 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults2,
                                 onpass="ONOS2 Links view is correct",
                                 onfail="ONOS2 Links view is incorrect" )
 
         linksResults3 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links3 ) )
+            MNTopo,
+            json.loads( links3 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults3,
                                 onpass="ONOS2 Links view is correct",
                                 onfail="ONOS2 Links view is incorrect" )
 
+        # topoResult = switchesResults1 and switchesResults2
+        # and switchesResults3\
+        # and portsResults1 and portsResults2 and portsResults3\
+        # and linksResults1 and linksResults2 and linksResults3
+
         topoResult = switchesResults1 and switchesResults2 and\
                      switchesResults3 and linksResults1 and linksResults2 and\
                      linksResults3
@@ -721,47 +775,98 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
+                temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
+                temp = temp + ( "ONOS" + str( count ), )
+                temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
+                temp = temp + \
+                    ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
+                ctrls.append( temp )
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+
+        TopologyCheck = main.TRUE
         main.step( "Compare ONOS Topology to MN Topology" )
 
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
         switchesResults1 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
+            MNTopo,
+            json.loads( devices1 ) )
         print "switches_Result1 = ", switchesResults1
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults1,
                                 onpass="ONOS1 Switches view is correct",
                                 onfail="ONOS1 Switches view is incorrect" )
 
         switchesResults2 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
+            MNTopo,
+            json.loads( devices2 ) )
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults2,
                                 onpass="ONOS2 Switches view is correct",
                                 onfail="ONOS2 Switches view is incorrect" )
 
         switchesResults3 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
+            MNTopo,
+            json.loads( devices3 ) )
         utilities.assertEquals( expect=main.TRUE, actual=switchesResults3,
                                 onpass="ONOS3 Switches view is correct",
                                 onfail="ONOS3 Switches view is incorrect" )
 
+        """
+        portsResults1 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports1 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults1,
+                onpass="ONOS1 Ports view is correct",
+                onfail="ONOS1 Ports view is incorrect" )
+
+        portsResults2 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports2 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults2,
+                onpass="ONOS2 Ports view is correct",
+                onfail="ONOS2 Ports view is incorrect" )
+
+        portsResults3 =  main.Mininet1.comparePorts( MNTopo,
+        json.loads( ports3 ) )
+        utilities.assertEquals( expect=main.TRUE, actual=portsResults3,
+                onpass="ONOS3 Ports view is correct",
+                onfail="ONOS3 Ports view is incorrect" )
+        """
         linksResults1 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links1 ) )
+            MNTopo,
+            json.loads( links1 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults1,
                                 onpass="ONOS1 Links view is correct",
                                 onfail="ONOS1 Links view is incorrect" )
 
         linksResults2 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links2 ) )
+            MNTopo,
+            json.loads( links2 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults2,
                                 onpass="ONOS2 Links view is correct",
                                 onfail="ONOS2 Links view is incorrect" )
 
         linksResults3 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( links3 ) )
+            MNTopo,
+            json.loads( links3 ) )
         utilities.assertEquals( expect=main.TRUE, actual=linksResults3,
                                 onpass="ONOS2 Links view is correct",
                                 onfail="ONOS2 Links view is incorrect" )
 
+        # topoResult = switchesResults1 and switchesResults2
+        # and switchesResults3\
+        # and portsResults1 and portsResults2 and portsResults3\
+        # and linksResults1 and linksResults2 and linksResults3
+
         topoResult = switchesResults1 and switchesResults2\
                 and switchesResults3 and linksResults1 and\
                 linksResults2 and linksResults3
diff --git a/TestON/tests/ProdFunc/ProdFunc.py b/TestON/tests/ProdFunc/ProdFunc.py
index 5673173..adbdb24 100644
--- a/TestON/tests/ProdFunc/ProdFunc.py
+++ b/TestON/tests/ProdFunc/ProdFunc.py
@@ -839,7 +839,7 @@
         time.sleep( 10 )
 
         main.step( "Get list of hosts from Mininet" )
-        hostList = main.Mininet1.getHosts().keys()
+        hostList = main.Mininet1.getHosts()
         main.log.info( hostList )
 
         main.step( "Get host list in ONOS format" )
@@ -1122,6 +1122,9 @@
             Check ONOS topology matches with mininet
         """
         import json
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology 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( "__________________________________" )
@@ -1168,19 +1171,43 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
+                temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
+                temp = temp + ( "ONOS" + str( count ), )
+                temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
+                temp = temp + \
+                    ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
+                ctrls.append( temp )
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+
         TopologyCheck = main.TRUE
         main.step( "Compare ONOS Topology to MN Topology" )
         devicesJson = main.ONOS2.devices()
         linksJson = main.ONOS2.links()
         portsJson = main.ONOS2.ports()
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
 
         result1 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
+            MNTopo,
+            json.loads( devicesJson ) )
         result2 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( linksJson ) )
+            MNTopo,
+            json.loads( linksJson ) )
 
+        result3 = main.Mininet1.comparePorts( MNTopo, json.loads( portsJson ) )
+        # result = result1 and result2 and result3
         result = result1 and result2
 
         print "***********************"
@@ -1210,6 +1237,8 @@
             down or up properly.
         """
 
+        from sts.topology.teston_topology import TestONTopology
+
         linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report( "This testscase is killing a link to ensure that" +
@@ -1304,18 +1333,25 @@
         # NOTE Check ping result here..add code for it
 
         main.step( "Compare ONOS Topology to MN Topology" )
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+        TopologyCheck = main.TRUE
 
         devicesJson = main.ONOS2.devices()
         linksJson = main.ONOS2.links()
         portsJson = main.ONOS2.ports()
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
 
         result1 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
+            MNTopo,
+            json.loads( devicesJson ) )
         result2 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( linksJson ) )
+            MNTopo,
+            json.loads( linksJson ) )
+        result3 = main.Mininet1.comparePorts( MNTopo, json.loads( portsJson ) )
 
+        # result = result1 and result2 and result3
         result = result1 and result2
         print "***********************"
 
@@ -1345,6 +1381,7 @@
         """
         Intent removal
         """
+        import time
         main.log.report( "This testcase removes any previously added intents" +
                          " before adding any new set of intents" )
         main.log.report( "__________________________________" )
diff --git a/TestON/tests/ProdFunc/ProdFunc.py.save b/TestON/tests/ProdFunc/ProdFunc.py.save
new file mode 100644
index 0000000..00b895c
--- /dev/null
+++ b/TestON/tests/ProdFunc/ProdFunc.py.save
@@ -0,0 +1,1518 @@
+
+# Testing the basic functionality of ONOS Next
+# For sanity and driver functionality excercises only.
+
+import time
+# import sys
+# import os
+# import re
+import json
+
+time.sleep( 1 )
+
+
+class ProdFunc:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):
+        import time
+        """
+        Startup sequence:
+        cell <name>
+        onos-verify-cell
+        onos-remove-raft-log
+        git pull
+        mvn clean install
+        onos-package
+        onos-install -f
+        onos-wait-for-start
+        """
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+
+        main.case( "Setting up test environment" )
+        main.log.report(
+            "This testcase is testing setting up test environment" )
+        main.log.report( "__________________________________" )
+
+        main.step( "Applying cell variable to environment" )
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
+
+        main.step( "Removing raft logs before a clen installation of ONOS" )
+        main.ONOSbench.onosRemoveRaftLogs()
+
+        main.step( "Git checkout and get version" )
+        #main.ONOSbench.gitCheckout( "master" )
+        gitPullResult = main.ONOSbench.gitPull()
+        main.log.info( "git_pull_result = " + str( gitPullResult ))
+        main.ONOSbench.getVersion( report=True )
+
+        if gitPullResult == 1:
+            main.step( "Using mvn clean & install" )
+            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" )
+        packageResult = main.ONOSbench.onosPackage()
+
+        main.step( "Installing ONOS package" )
+        onosInstallResult = main.ONOSbench.onosInstall()
+        if onosInstallResult == main.TRUE:
+            main.log.report( "Installing ONOS package successful" )
+        else:
+            main.log.report( "Installing ONOS package failed" )
+
+        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" )
+        startResult = main.ONOSbench.onosStart( ONOS1Ip )
+
+        main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+        main.step( "Starting Mininet CLI..." )
+        
+        # Starting the mininet using the old way
+        main.step( "Starting Mininet ..." )
+        netIsUp = main.Mininet1.startNet()
+        if netIsUp:
+            main.log.info("Mininet CLI is up")
+        
+        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 ):
+        """
+        Switch Down
+        """
+        # NOTE: You should probably run a topology check after this
+        import time
+
+        main.case( "Switch down discovery" )
+        main.log.report( "This testcase is testing a switch down discovery" )
+        main.log.report( "__________________________________" )
+
+        switchSleep = int( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
+
+        description = "Killing a switch to ensure it is discovered correctly"
+        main.log.report( description )
+        main.case( description )
+
+        # TODO: Make this switch parameterizable
+        main.step( "Kill s28 " )
+        main.log.report( "Deleting s28" )
+        # FIXME: use new dynamic topo functions
+        main.Mininet1.delSwitch( "s28" )
+        main.log.info(
+            "Waiting " +
+            str( switchSleep ) +
+            " seconds for switch down to be discovered" )
+        time.sleep( switchSleep )
+        # Peek at the deleted switch
+        device = main.ONOS2.getDevice( dpid="0028" )
+        print "device = ", device
+        if device[ u'available' ] == 'False':
+            case2Result = main.FALSE
+        else:
+            case2Result = main.TRUE
+        utilities.assert_equals( expect=main.TRUE, actual=case2Result,
+                                 onpass="Switch down discovery successful",
+                                 onfail="Switch down discovery failed" )
+
+    def CASE101( self, main ):
+        """
+        Cleanup sequence:
+        onos-service <nodeIp> stop
+        onos-uninstall
+
+        TODO: Define rest of cleanup
+
+        """
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+
+        main.case( "Cleaning up test environment" )
+
+        main.step( "Testing ONOS kill function" )
+        killResult = main.ONOSbench.onosKill( ONOS1Ip )
+
+        main.step( "Stopping ONOS service" )
+        stopResult = main.ONOSbench.onosStop( ONOS1Ip )
+
+        main.step( "Uninstalling ONOS service" )
+        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
+        """
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+
+        main.case( "Testing 'onos' command" )
+
+        main.step( "Sending command 'onos -w <onos-ip> system:name'" )
+        cmdstr1 = "system:name"
+        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"
+        cmdResult2 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 )
+        main.log.info( "onos command returned: " + cmdResult2 )
+
+    def CASE20( self ):
+        """
+            Exit from mininet cli
+            reinstall ONOS
+        """
+        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( "_____________________________________________" )
+        main.case( "Disconnecting mininet and restarting ONOS" )
+        main.step( "Disconnecting mininet and restarting ONOS" )
+        mininetDisconnect = main.Mininet1.disconnect()
+        print "mininetDisconnect = ", mininetDisconnect        
+
+        main.step( "Removing raft logs before a clen installation of ONOS" )
+        main.ONOSbench.onosRemoveRaftLogs()
+
+        main.step( "Applying cell variable to environment" )
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
+
+        onosInstallResult = main.ONOSbench.onosInstall()
+        if onosInstallResult == main.TRUE:
+            main.log.report( "Installing ONOS package successful" )
+        else:
+            main.log.report( "Installing ONOS package failed" )
+
+        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" )
+        startResult = main.ONOSbench.onosStart( ONOS1Ip )
+
+        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=case20Result,
+            onpass= "Exiting functionality mininet topology and reinstalling" +
+                    " ONOS successful",
+            onfail= "Exiting functionality mininet topology and reinstalling" +
+                    " ONOS failed" )
+
+    def CASE21( self, main ):
+        """
+            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(
+            "This testcase starts the packet layer topology and REST" )
+        main.log.report( "_____________________________________________" )
+        main.case( "Starting LINC-OE and other components" )
+        main.step( "Starting LINC-OE and other components" )
+        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 =", startConsoleResult
+        print "optical_mn_script = ", opticalMnScript
+        print "onos_topo_cfg_result =", onosTopoCfgResult
+
+        case21Result = startConsoleResult and opticalMnScript and \
+            onosTopoCfgResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            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 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" )
+        main.case( "Topology comparision" )
+        main.step( "Topology comparision" )
+        main.ONOS3.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+        devicesResult = main.ONOS3.devices( jsonFormat=False )
+
+        print "devices_result = ", devicesResult
+        devicesLinewise = devicesResult.split( "\n" )
+        devicesLinewise = devicesLinewise[ 1: ]
+        roadmCount = 0
+        packetLayerSWCount = 0
+        for line in devicesLinewise:
+            components = line.split( "," )
+            availability = components[ 1 ].split( "=" )[ 1 ]
+            type = components[ 3 ].split( "=" )[ 1 ]
+            if availability == 'true' and type == 'ROADM':
+                roadmCount += 1
+            elif availability == 'true' and type == 'SWITCH':
+                packetLayerSWCount += 1
+        if roadmCount == 4:
+            print "Number of Optical Switches = %d and is" % roadmCount +\
+                  " correctly detected"
+            main.log.info(
+                "Number of Optical Switches = " +
+                str( roadmCount ) +
+                " and is correctly detected" )
+            opticalSWResult = main.TRUE
+        else:
+            print "Number of Optical Switches = %d and is wrong" % roadmCount
+            main.log.info(
+                "Number of Optical Switches = " +
+                str( roadmCount ) +
+                " and is wrong" )
+            opticalSWResult = main.FALSE
+
+        if packetLayerSWCount == 2:
+            print "Number of Packet layer or mininet Switches = %d "\
+                    % packetLayerSWCount + "and is correctly detected"
+            main.log.info(
+                "Number of Packet layer or mininet Switches = " +
+                str( packetLayerSWCount ) +
+                " and is correctly detected" )
+            packetSWResult = main.TRUE
+        else:
+            print "Number of Packet layer or mininet Switches = %d and"\
+                    % packetLayerSWCount + " is wrong"
+            main.log.info(
+                "Number of Packet layer or mininet Switches = " +
+                str( packetLayerSWCount ) +
+                " and is wrong" )
+            packetSWResult = main.FALSE
+        print "_________________________________"
+
+        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
+        # Therfore, the below portion of the code is commented.
+        """
+        #Discover hosts using pingall
+        pingallResult = main.LincOE2.pingall()
+
+        hostsResult = main.ONOS3.hosts( jsonFormat=False )
+        main.log.info( "hosts_result = "+hostsResult )
+        main.log.info( "_________________________________" )
+        hostsLinewise = hostsResult.split( "\n" )
+        hostsLinewise = hostsLinewise[ 1:-1 ]
+        hostCount = 0
+        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" )
+            hostDiscovery = main.TRUE
+        else:
+            print "Number of hosts = %d and is wrong" %hostCount
+            main.log.info( "Number of hosts = " + str( hostCount ) +" and \
+                            is wrong" )
+            hostDiscovery = main.FALSE
+        """
+        case22Result = opticalSWResult and packetSWResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            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
+            ping mininet hosts
+        """
+        main.log.report(
+            "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" )
+        ptpIntentResult = main.ONOS3.addPointIntent(
+            "of:0000ffffffff0001/1",
+            "of:0000ffffffff0002/1" )
+        if ptpIntentResult == main.TRUE:
+            main.ONOS3.intents( jsonFormat=False )
+            main.log.info( "Point to point intent install successful" )
+
+        ptpIntentResult = main.ONOS3.addPointIntent(
+            "of:0000ffffffff0002/1",
+            "of:0000ffffffff0001/1" )
+        if ptpIntentResult == main.TRUE:
+            main.ONOS3.intents( jsonFormat=False )
+            main.log.info( "Point to point intent install successful" )
+
+        time.sleep( 10 )
+        flowHandle = main.ONOS3.flows()
+        main.log.info( "flows :" + flowHandle )
+
+        # Sleep for 30 seconds to provide time for the intent state to change
+        time.sleep( 30 )
+        intentHandle = main.ONOS3.intents( jsonFormat=False )
+        main.log.info( "intents :" + intentHandle )
+
+        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()
+        if ping == main.FALSE and count < 5:
+            count += 1
+            PingResult = main.FALSE
+            main.log.info(
+                "Ping between h1 and h2  failed. Making attempt number " +
+                str( count ) +
+                " in 2 seconds" )
+            time.sleep( 2 )
+        elif ping == main.FALSE:
+            main.log.info( "All ping attempts between h1 and h2 have failed" )
+            PingResult = main.FALSE
+        elif ping == main.TRUE:
+            main.log.info( "Ping test between h1 and h2 passed!" )
+            PingResult = main.TRUE
+        else:
+            main.log.info( "Unknown error" )
+            PingResult = main.ERROR
+
+        if PingResult == main.FALSE:
+            main.log.report(
+                "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" )
+
+        case23Result = PingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            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
+        """
+        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.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 )
+
+        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":
+                    linksState = item[ 'state' ]
+                    if linksState == "INACTIVE":
+                        main.log.info(
+                            "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" )
+                        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" )
+                        linksStateResult = main.FALSE
+
+        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" )
+        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()
+        if ping == main.FALSE and count < 5:
+            count += 1
+            PingResult = main.FALSE
+            main.log.info(
+                "Ping between h1 and h2  failed. Making attempt number " +
+                str( count ) +
+                " in 2 seconds" )
+            time.sleep( 2 )
+        elif ping == main.FALSE:
+            main.log.info( "All ping attempts between h1 and h2 have failed" )
+            PingResult = main.FALSE
+        elif ping == main.TRUE:
+            main.log.info( "Ping test between h1 and h2 passed!" )
+            PingResult = main.TRUE
+        else:
+            main.log.info( "Unknown error" )
+            PingResult = main.ERROR
+
+        if PingResult == main.TRUE:
+            main.log.report( "Ping test successful " )
+        if PingResult == main.FALSE:
+            main.log.report( "Ping test 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( "__________________________________" )
+        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.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            elif i >= 2 and i < 5:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            elif i >= 5 and i < 8:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            elif i >= 8 and i < 18:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            elif i >= 18 and i < 28:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            else:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+        SwitchMastership = main.TRUE
+        for i in range( 1, 29 ):
+            if i == 1:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            elif i >= 2 and i < 5:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            elif i >= 5 and i < 8:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            elif i >= 8 and i < 18:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            elif i >= 18 and i < 28:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            else:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is" + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+
+        if SwitchMastership == main.TRUE:
+            main.log.report( "Controller assignmnet successful" )
+        else:
+            main.log.report( "Controller assignmnet failed" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=SwitchMastership,
+            onpass="MasterControllers assigned correctly" )
+        """
+        for i in range ( 1,29 ):
+            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" )
+        hostList = main.Mininet1.getHosts()
+        main.log.info( hostList )
+
+        main.step( "Get host list in ONOS format" )
+        hostOnosList = main.ONOS2.getHostsId( hostList )
+        main.log.info( hostOnosList )
+        # time.sleep( 5 )
+
+        main.step( "Pingall" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        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
+        # if there was no activity
+        main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+
+        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" )
+
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case4Result,
+            onpass="Controller assignment and Pingall Test successful",
+            onfail="Controller assignment and Pingall Test NOT successful" )
+
+    def CASE10( self ):
+        main.log.report(
+            "This testcase uninstalls the reactive forwarding app" )
+        main.log.report( "__________________________________" )
+        main.case( "Uninstalling reactive forwarding app" )
+        # Unistall onos-app-fwd app to disable reactive forwarding
+        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
+        # So sleep for 15s
+        time.sleep( 15 )
+
+        flows = main.ONOS2.flows()
+        main.log.info( flows )
+
+        case10Result = appUninstallResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case10Result,
+            onpass="Reactive forwarding app uninstallation successful",
+            onfail="Reactive forwarding app uninstallation failed" )
+
+
+    def CASE11( self ):
+        # NOTE: This testcase require reactive forwarding mode enabled
+        # NOTE: in the beginning and then uninstall it before adding 
+        # NOTE: point intents. Again the app is installed so that 
+        # NOTE: testcase 10 can be ran successively
+        import time
+        main.log.report(
+            "This testcase moves a host from one switch to another to add" +
+            "point intents between them and then perform ping" )
+        main.log.report( "__________________________________" )
+        main.log.info( "Moving host from one switch to another" )
+        main.case( "Moving host from a device and attach it to another device" )
+        main.step( "Moving host h9 from device s9 and attach it to s8" )
+        main.Mininet1.moveHost(host = 'h9', oldSw = 's9', newSw = 's8')
+
+        time.sleep(15) #Time delay to have all the flows ready
+        main.step( "Pingall" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall()
+        time2 = time.time()
+        print "Time for pingall: %2f seconds" % ( time2 - time1 )
+
+        hosts = main.ONOS2.hosts( jsonFormat = False )
+        main.log.info( hosts )
+        
+        main.case( "Uninstalling reactive forwarding app" )
+        # Unistall onos-app-fwd app to disable reactive forwarding
+        appUninstallResult = main.ONOS2.featureUninstall( "onos-app-fwd" )
+        main.log.info( "onos-app-fwd uninstalled" )
+
+        main.step( "Add point intents between hosts on the same device")
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003008/1",
+            "of:0000000000003008/3" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003008/3",
+            "of:0000000000003008/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        main.case( "Ping hosts on the same devices" )
+        ping = main.Mininet1.pingHost( src = 'h8', target = 'h9' )
+
+        '''
+        main.case( "Installing reactive forwarding app" )
+        # Install onos-app-fwd app to enable reactive forwarding
+        appUninstallResult = main.ONOS2.featureInstall( "onos-app-fwd" )
+        main.log.info( "onos-app-fwd installed" )
+        '''
+
+        if ping == main.FALSE:
+            main.log.report(
+                "Point intents for hosts on same devices haven't" +
+                " been installed correctly. Cleaning up" )
+        if ping == main.TRUE:
+            main.log.report(
+                "Point intents for hosts on same devices" +
+                "installed correctly. Cleaning up" )
+
+        case11Result = ping and pingResult
+        utilities.assert_equals(
+            expect = main.TRUE,
+            actual = case11Result,
+            onpass = "Point intents for hosts on same devices" +
+                    "Ping Test successful",
+            onfail = "Point intents for hosts on same devices" +
+                    "Ping Test NOT successful" )
+
+
+    def CASE12( self ):
+        """
+        Verify the default flows on each switch in proactive mode
+        """
+        main.log.report( "This testcase is verifying num of default" +
+                         " flows on each switch" )
+        main.log.report( "__________________________________" )
+        main.case( "Verify num of default flows on each switch" )
+        main.step( "Obtaining the device id's and flowrule count on them" )
+
+        case12Result = main.TRUE
+        idList = main.ONOS2.getAllDevicesId()
+        for id in idList:
+            count = main.ONOS2.FlowAddedCount( id )
+            main.log.info("count = " +count)
+            if int(count) != 3:
+                case12Result = main.FALSE
+                break
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case12Result,
+            onpass = "Expected default num of flows exist",
+            onfail = "Expected default num of flows do not exist")
+    
+    
+        
+
+    def CASE6( self ):
+        import time
+        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.step( "Get all devices id" )
+        devicesIdList = main.ONOS2.getAllDevicesId()
+        main.log.info( devicesIdList )
+
+        # 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" )
+        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 ) )
+            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
+            host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
+      
+            host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
+            main.ONOS2.addHostIntent( host1Id, host2Id )
+
+        time.sleep( 10 )
+        hIntents = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intents:" + hIntents )
+        flows = main.ONOS2.flows()
+        main.log.info( "flows:" + flows )     
+
+        count = 1
+        i = 8
+        PingResult = main.TRUE
+        # while i<10:
+        while i < 18:
+            main.log.info(
+                "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
+            ping = main.Mininet1.pingHost(
+                src="h" + str( i ), target="h" + str( i + 10 ) )
+            if ping == main.FALSE and count < 5:
+                count += 1
+                # i = 8
+                PingResult = main.FALSE
+                main.log.report( "Ping between h" +
+                                 str( i ) +
+                                 " and h" +
+                                 str( i +
+                                      10 ) +
+                                 " failed. Making attempt number " +
+                                 str( count ) +
+                                 " in 2 seconds" )
+                time.sleep( 2 )
+            elif ping == main.FALSE:
+                main.log.report( "All ping attempts between h" +
+                                 str( i ) +
+                                 " and h" +
+                                 str( i +
+                                      10 ) +
+                                 "have failed" )
+                i = 19
+                PingResult = main.FALSE
+            elif ping == main.TRUE:
+                main.log.info( "Ping test between h" +
+                               str( i ) +
+                               " and h" +
+                               str( i +
+                                    10 ) +
+                               "passed!" )
+                i += 1
+                PingResult = main.TRUE
+            else:
+                main.log.info( "Unknown error" )
+                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 PingResult == main.TRUE:
+            main.log.report(
+                "Ping all test after Host intent addition successful" )
+
+        case6Result = PingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case6Result,
+            onpass="Pingall Test after Host intents addition successful",
+            onfail="Pingall Test after Host intents addition failed" )
+
+    def CASE5( self, main ):
+        import json
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology 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" )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source1' ],
+            target=main.params[ 'PING' ][ 'target1' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source2' ],
+            target=main.params[ 'PING' ][ 'target2' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source3' ],
+            target=main.params[ 'PING' ][ 'target3' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source4' ],
+            target=main.params[ 'PING' ][ 'target4' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source5' ],
+            target=main.params[ 'PING' ][ 'target5' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source6' ],
+            target=main.params[ 'PING' ][ 'target6' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source7' ],
+            target=main.params[ 'PING' ][ 'target7' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source8' ],
+            target=main.params[ 'PING' ][ 'target8' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source9' ],
+            target=main.params[ 'PING' ][ 'target9' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source10' ],
+            target=main.params[ 'PING' ][ 'target10' ],
+            pingTime=500 )
+
+        main.step( "Create TestONTopology object" )
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
+                temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
+                temp = temp + ( "ONOS" + str( count ), )
+                temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
+                temp = temp + \
+                    ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
+                ctrls.append( temp )
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+
+        TopologyCheck = main.TRUE
+        main.step( "Compare ONOS Topology to MN Topology" )
+        devicesJson = main.ONOS2.devices()
+        linksJson = main.ONOS2.links()
+        # portsJson = main.ONOS2.ports()
+
+        result1 = main.Mininet1.compareSwitches(
+            MNTopo,
+            json.loads( devicesJson ) )
+        result2 = main.Mininet1.compareLinks(
+            MNTopo,
+            json.loads( linksJson ) )
+        # result3 = main.Mininet1.comparePorts(
+        # MNTopo, json.loads( portsJson ) )
+
+        # result = result1 and result2 and result3
+        result = result1 and result2
+
+        print "***********************"
+pr        if result == main.TRUE:
+            main.log.report( "ONOS" + " Topology matches MN Topology" )
+        else:
+            main.log.report( "ONOS" + " Topology does not match MN Topology" )
+
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=result,
+            onpass="ONOS" +
+            " Topology matches MN Topology",
+            onfail="ONOS" +
+            " Topology does not match MN Topology" )
+
+        TopologyCheck = TopologyCheck and result
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=TopologyCheck,
+            onpass="Topology checks passed",
+            onfail="Topology checks failed" )
+
+    def CASE7( self, main ):
+        from sts.topology.teston_topology import TestONTopology
+
+        linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+
+        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.step( "Start continuous pings" )
+
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source1' ],
+                               target=main.params[ 'PING' ][ 'target1' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source2' ],
+                               target=main.params[ 'PING' ][ 'target2' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source3' ],
+                               target=main.params[ 'PING' ][ 'target3' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source4' ],
+                               target=main.params[ 'PING' ][ 'target4' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source5' ],
+                               target=main.params[ 'PING' ][ 'target5' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source6' ],
+                               target=main.params[ 'PING' ][ 'target6' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source7' ],
+                               target=main.params[ 'PING' ][ 'target7' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source8' ],
+                               target=main.params[ 'PING' ][ 'target8' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source9' ],
+                               target=main.params[ 'PING' ][ 'target9' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source10' ],
+                               target=main.params[ 'PING' ][ 'target10' ],
+                               pingTime=500 )
+        """
+        main.step( "Determine the current number of switches and links" )
+        topologyOutput = main.ONOS2.topology()
+        topologyResult = main.ONOS1.getTopology( topologyOutput )
+        activeSwitches = topologyResult[ 'deviceCount' ]
+        links = topologyResult[ 'linkCount' ]
+        print "activeSwitches = ", type( activeSwitches )
+        print "links = ", type( links )
+        main.log.info(
+            "Currently there are %s switches and %s links" %
+            ( str( activeSwitches ), str( links ) ) )
+
+        main.step( "Kill Link between s3 and s28" )
+        main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
+        time.sleep( linkSleep )
+        topologyOutput = main.ONOS2.topology()
+        LinkDown = main.ONOS1.checkStatus(
+            topologyOutput, activeSwitches, str(
+                int( links ) - 2 ) )
+        if LinkDown == main.TRUE:
+            main.log.report( "Link Down discovered properly" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=LinkDown,
+            onpass="Link Down discovered properly",
+            onfail="Link down was not discovered in " +
+            str( linkSleep ) +
+            " seconds" )
+
+        # Check ping result here..add code for it
+
+        main.step( "Bring link between s3 and s28 back up" )
+        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 LinkUp == main.TRUE:
+            main.log.report( "Link up discovered properly" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=LinkUp,
+            onpass="Link up discovered properly",
+            onfail="Link up was not discovered in " +
+            str( linkSleep ) +
+            " seconds" )
+
+        # NOTE Check ping result here..add code for it
+
+        main.step( "Compare ONOS Topology to MN Topology" )
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+        TopologyCheck = main.TRUE
+
+        devicesJson = main.ONOS2.devices()
+        linksJson = main.ONOS2.links()
+        portsJson = main.ONOS2.ports()
+
+        result1 = main.Mininet1.compareSwitches(
+            MNTopo,
+            json.loads( devicesJson ) )
+        result2 = main.Mininet1.compareLinks(
+            MNTopo,
+            json.loads( linksJson ) )
+        # result3 = main.Mininet1.comparePorts(
+        # MNTopo, json.loads( portsJson ) )
+
+        # result = result1 and result2 and result3
+        result = result1 and result2
+        print "***********************"
+
+        if result == main.TRUE:
+            main.log.report( "ONOS" + " Topology matches MN Topology" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=result,
+            onpass="ONOS" +
+            " Topology matches MN Topology",
+            onfail="ONOS" +
+            " Topology does not match MN Topology" )
+
+        TopologyCheck = TopologyCheck and result
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=TopologyCheck,
+            onpass="Topology checks passed",
+            onfail="Topology checks failed" )
+
+        result = LinkDown and LinkUp and TopologyCheck
+        utilities.assert_equals( expect=main.TRUE, actual=result,
+                                 onpass="Link failure is discovered correctly",
+                                 onfail="Link Discovery failed" )
+
+    def CASE8( self ):
+        """
+        Intent removal
+        """
+        import time
+        main.log.report( "This testcase removes any previously added intents" +
+                         " before adding any new set of intents" )
+        main.log.report( "__________________________________" )
+        main.log.info( "intent removal" )
+        main.case( "Removing installed intents" )
+        main.step( "Obtain the intent id's" )
+        intentResult = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intent_result = " + intentResult )
+        intentLinewise = intentResult.split( "\n" )
+
+        intentList = [line for line in intentLinewise \
+            if line.startswith( "id=")]
+        intentids = [line.split( "," )[ 0 ].split( "=" )[ 1 ] for line in \
+            intentList]
+        for id in intentids:
+            print "id = ", id
+
+        main.step(
+            "Iterate through the intentids list and remove each intent" )
+        for id in intentids:
+            main.ONOS2.removeIntent( intentId=id )
+
+        intentResult = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intent_result = " + intentResult )
+        
+        intentList = [line for line in intentResult.split( "\n" ) \
+            if line.startswith( "id=")]
+        intentState = [line.split( "," )[ 1 ].split( "=" )[ 1 ] for line in \
+            intentList]
+        for state in intentState:
+            print state
+        
+        case8Result = main.TRUE        
+        for state in intentState:
+            if state != 'WITHDRAWN':
+                case8Result = main.FALSE
+                break
+                
+        if case8Result == main.TRUE:
+            main.log.report( "Intent removal successful" )
+        else:
+            main.log.report( "Intent removal failed" )
+
+        PingResult = main.TRUE
+        if case8Result == main.TRUE:
+            i = 8
+            while i < 18:
+                main.log.info(
+                    "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
+                ping = main.Mininet1.pingHost(
+                    src="h" + str( i ), target="h" + str( i + 10 ) )
+                if ping == main.TRUE:
+                    i = 19
+                    PingResult = PingResult and main.TRUE
+                elif ping == main.FALSE:
+                    i += 1
+                    PingResult = PingResult and main.FALSE
+                else:
+                    main.log.info( "Unknown error" )
+                    PingResult = main.ERROR
+
+            # Note: If the ping result failed, that means the intents have been
+            # withdrawn correctly.
+        if PingResult == main.TRUE:
+            main.log.report( "Installed intents have not been withdrawn correctly" )
+            # main.cleanup()
+            # main.exit()
+        if PingResult == main.FALSE:
+            main.log.report( "Installed intents have been withdrawn correctly" )
+
+        case8Result = case8Result and PingResult
+
+        if case8Result == main.FALSE:
+            main.log.report( "Intent removal successful" )
+        else:
+            main.log.report( "Intent removal failed" )
+
+        utilities.assert_equals( expect=main.FALSE, actual=case8Result,
+                                 onpass="Intent removal test passed",
+                                 onfail="Intent removal test failed" )
+
+    def CASE9( self ):
+        main.log.report(
+            "This testcase adds point intents and then does pingall" )
+        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 )" )
+
+        main.step( "Add point intents for mn hosts h8 and h18 or" +
+                   "ONOS hosts h8 and h12" )
+        # main.step(var1)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003008/1",
+            "of:0000000000006018/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006018/1",
+            "of:0000000000003008/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var2 = "Add point intents for mn hosts h9&h19 or ONOS hosts h9&h13"
+        main.step(var2)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003009/1",
+            "of:0000000000006019/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006019/1",
+            "of:0000000000003009/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var3 = "Add point intents for MN hosts h10&h20 or ONOS hosts hA&h14"
+        main.step(var3)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003010/1",
+            "of:0000000000006020/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006020/1",
+            "of:0000000000003010/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var4 = "Add point intents for mininet hosts h11 and h21 or" +\
+               " ONOS hosts hB and h15"
+        main.case(var4)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003011/1",
+            "of:0000000000006021/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006021/1",
+            "of:0000000000003011/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var5 = "Add point intents for mininet hosts h12 and h22 " +\
+               "ONOS hosts hC and h16"
+        main.case(var5)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003012/1",
+            "of:0000000000006022/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006022/1",
+            "of:0000000000003012/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var6 = "Add point intents for mininet hosts h13 and h23 or" +\
+               " ONOS hosts hD and h17"
+        main.case(var6)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003013/1",
+            "of:0000000000006023/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006023/1",
+            "of:0000000000003013/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var7 = "Add point intents for mininet hosts h14 and h24 or" +\
+               " ONOS hosts hE and h18"
+        main.case(var7)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003014/1",
+            "of:0000000000006024/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006024/1",
+            "of:0000000000003014/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var8 = "Add point intents for mininet hosts h15 and h25 or" +\
+               " ONOS hosts hF and h19"
+        main.case(var8)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003015/1",
+            "of:0000000000006025/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006025/1",
+            "of:0000000000003015/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var9 = "Add intents for mininet hosts h16 and h26 or" +\
+               " ONOS hosts h10 and h1A"
+        main.case(var9)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003016/1",
+            "of:0000000000006026/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006026/1",
+            "of:0000000000003016/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var10 = "Add point intents for mininet hosts h17 and h27 or" +\
+                " ONOS hosts h11 and h1B"
+        main.case(var10)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003017/1",
+            "of:0000000000006027/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            #main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006027/1",
+            "of:0000000000003017/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            #main.log.info( getIntentResult )
+
+        print(
+            "___________________________________________________________" )
+
+        flowHandle = main.ONOS2.flows()
+        #main.log.info( "flows :" + flowHandle )
+
+        count = 1
+        i = 8
+        PingResult = main.TRUE
+        while i < 18:
+            main.log.info(
+                "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
+            ping = main.Mininet1.pingHost(
+                src="h" + str( i ), target="h" + str( i + 10 ) )
+            if ping == main.FALSE and count < 5:
+                count += 1
+                # i = 8
+                PingResult = main.FALSE
+                main.log.report( "Ping between h" +
+                                 str( i ) +
+                                 " and h" +
+                                 str( i +
+                                      10 ) +
+                                 " failed. Making attempt number " +
+                                 str( count ) +
+                                 " in 2 seconds" )
+                time.sleep( 2 )
+            elif ping == main.FALSE:
+                main.log.report( "All ping attempts between h" +
+                                 str( i ) +
+                                 " and h" +
+                                 str( i +
+                                      10 ) +
+                                 "have failed" )
+                i = 19
+                PingResult = main.FALSE
+            elif ping == main.TRUE:
+                main.log.info( "Ping test between h" +
+                               str( i ) +
+                               " and h" +
+                               str( i +
+                                    10 ) +
+                               "passed!" )
+                i += 1
+                PingResult = main.TRUE
+            else:
+                main.log.info( "Unknown error" )
+                PingResult = main.ERROR
+
+        if PingResult == main.FALSE:
+            main.log.report(
+                "Point intents have not ben installed correctly. Cleaning up" )
+            # main.cleanup()
+            # main.exit()
+        if PingResult == main.TRUE:
+            main.log.report( "Point Intents have been installed correctly" )
+
+        case9Result = PingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case9Result,
+            onpass="Point intents addition and Pingall Test successful",
+            onfail="Point intents addition and Pingall Test NOT successful" )
diff --git a/TestON/tests/ProdFunc/ProdFunc2.py b/TestON/tests/ProdFunc/ProdFunc2.py
new file mode 100644
index 0000000..2cd04c1
--- /dev/null
+++ b/TestON/tests/ProdFunc/ProdFunc2.py
@@ -0,0 +1,1542 @@
+
+# Testing the basic functionality of ONOS Next
+# For sanity and driver functionality excercises only.
+
+import time
+# import sys
+# import os
+# import re
+import json
+
+time.sleep( 1 )
+
+
+class ProdFunc:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):
+        import time
+        """
+        Startup sequence:
+        cell <name>
+        onos-verify-cell
+        onos-remove-raft-log
+        git pull
+        mvn clean install
+        onos-package
+        onos-install -f
+        onos-wait-for-start
+        """
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+
+        main.case( "Setting up test environment" )
+        main.log.report(
+            "This testcase is testing setting up test environment" )
+        main.log.report( "__________________________________" )
+
+        main.step( "Applying cell variable to environment" )
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
+
+        main.step( "Removing raft logs before a clen installation of ONOS" )
+        main.ONOSbench.onosRemoveRaftLogs()
+
+        main.step( "Git checkout and get version" )
+        #main.ONOSbench.gitCheckout( "master" )
+        gitPullResult = main.ONOSbench.gitPull()
+        main.log.info( "git_pull_result = " + str( gitPullResult ))
+        main.ONOSbench.getVersion( report=True )
+
+        if gitPullResult == 1:
+            main.step( "Using mvn clean & install" )
+            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" )
+        packageResult = main.ONOSbench.onosPackage()
+
+        main.step( "Installing ONOS package" )
+        onosInstallResult = main.ONOSbench.onosInstall()
+        if onosInstallResult == main.TRUE:
+            main.log.report( "Installing ONOS package successful" )
+        else:
+            main.log.report( "Installing ONOS package failed" )
+
+        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" )
+        startResult = main.ONOSbench.onosStart( ONOS1Ip )
+
+        main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+        main.step( "Starting Mininet CLI..." )
+        
+        # Starting the mininet using the old way
+        main.step( "Starting Mininet ..." )
+        netIsUp = main.Mininet1.startNet()
+        if netIsUp:
+            main.log.info("Mininet CLI is up")
+        
+        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 ):
+        """
+        Switch Down
+        """
+        # NOTE: You should probably run a topology check after this
+        import time
+
+        main.case( "Switch down discovery" )
+        main.log.report( "This testcase is testing a switch down discovery" )
+        main.log.report( "__________________________________" )
+
+        switchSleep = int( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
+
+        description = "Killing a switch to ensure it is discovered correctly"
+        main.log.report( description )
+        main.case( description )
+
+        # TODO: Make this switch parameterizable
+        main.step( "Kill s28 " )
+        main.log.report( "Deleting s28" )
+        # FIXME: use new dynamic topo functions
+        main.Mininet1.delSwitch( "s28" )
+        main.log.info(
+            "Waiting " +
+            str( switchSleep ) +
+            " seconds for switch down to be discovered" )
+        time.sleep( switchSleep )
+        # Peek at the deleted switch
+        device = main.ONOS2.getDevice( dpid="0028" )
+        print "device = ", device
+        if device[ u'available' ] == 'False':
+            case2Result = main.FALSE
+        else:
+            case2Result = main.TRUE
+        utilities.assert_equals( expect=main.TRUE, actual=case2Result,
+                                 onpass="Switch down discovery successful",
+                                 onfail="Switch down discovery failed" )
+
+    def CASE101( self, main ):
+        """
+        Cleanup sequence:
+        onos-service <nodeIp> stop
+        onos-uninstall
+
+        TODO: Define rest of cleanup
+
+        """
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+
+        main.case( "Cleaning up test environment" )
+
+        main.step( "Testing ONOS kill function" )
+        killResult = main.ONOSbench.onosKill( ONOS1Ip )
+
+        main.step( "Stopping ONOS service" )
+        stopResult = main.ONOSbench.onosStop( ONOS1Ip )
+
+        main.step( "Uninstalling ONOS service" )
+        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
+        """
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+
+        main.case( "Testing 'onos' command" )
+
+        main.step( "Sending command 'onos -w <onos-ip> system:name'" )
+        cmdstr1 = "system:name"
+        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"
+        cmdResult2 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 )
+        main.log.info( "onos command returned: " + cmdResult2 )
+
+    def CASE20( self ):
+        """
+            Exit from mininet cli
+            reinstall ONOS
+        """
+        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( "_____________________________________________" )
+        main.case( "Disconnecting mininet and restarting ONOS" )
+        main.step( "Disconnecting mininet and restarting ONOS" )
+        mininetDisconnect = main.Mininet1.disconnect()
+        print "mininetDisconnect = ", mininetDisconnect        
+
+        main.step( "Removing raft logs before a clen installation of ONOS" )
+        main.ONOSbench.onosRemoveRaftLogs()
+
+        main.step( "Applying cell variable to environment" )
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
+
+        onosInstallResult = main.ONOSbench.onosInstall()
+        if onosInstallResult == main.TRUE:
+            main.log.report( "Installing ONOS package successful" )
+        else:
+            main.log.report( "Installing ONOS package failed" )
+
+        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" )
+        startResult = main.ONOSbench.onosStart( ONOS1Ip )
+
+        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=case20Result,
+            onpass= "Exiting functionality mininet topology and reinstalling" +
+                    " ONOS successful",
+            onfail= "Exiting functionality mininet topology and reinstalling" +
+                    " ONOS failed" )
+
+    def CASE21( self, main ):
+        """
+            On ONOS bench, run this command:
+            sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1
+            which spawns packet optical topology 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(
+            "This testcase starts the packet layer topology and REST" )
+        main.log.report( "_____________________________________________" )
+        main.case( "Starting LINC-OE and other components" )
+        main.step( "Starting LINC-OE and other components" )
+        appInstallResult = main.ONOS2.featureInstall( "onos-app-optical" )
+        opticalMnScript = main.LincOE2.runOpticalMnScript()
+
+        case21Result = opticalMnScript and appInstallResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case21Result,
+            onpass="Packet optical topology spawned successsfully",
+            onfail="Packet optical topology spawning failed" )
+
+    def CASE22( self, main ):
+        """
+            Curretly we use, 10 optical switches(ROADM's) and
+            6 packet layer mininet switches each with one host.
+            Therefore, the roadmCount variable = 10,
+            packetLayerSWCount variable = 6, hostCount=6 and
+            links=42.
+            All 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" )
+        main.case( "Topology comparision" )
+        main.step( "Topology comparision" )
+        main.ONOS3.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+        devicesResult = main.ONOS3.devices( jsonFormat=False )
+
+        print "devices_result = ", devicesResult
+        devicesLinewise = devicesResult.split( "\n" )
+        devicesLinewise = devicesLinewise[ 1: ]
+        roadmCount = 0
+        packetLayerSWCount = 0
+        for line in devicesLinewise:
+            components = line.split( "," )
+            availability = components[ 1 ].split( "=" )[ 1 ]
+            type = components[ 3 ].split( "=" )[ 1 ]
+            if availability == 'true' and type == 'ROADM':
+                roadmCount += 1
+            elif availability == 'true' and type == 'SWITCH':
+                packetLayerSWCount += 1
+        if roadmCount == 10:
+            print "Number of Optical Switches = %d and is" % roadmCount +\
+                  " correctly detected"
+            main.log.info(
+                "Number of Optical Switches = " +
+                str( roadmCount ) +
+                " and is correctly detected" )
+            opticalSWResult = main.TRUE
+        else:
+            print "Number of Optical Switches = %d and is wrong" % roadmCount
+            main.log.info(
+                "Number of Optical Switches = " +
+                str( roadmCount ) +
+                " and is wrong" )
+            opticalSWResult = main.FALSE
+
+        if packetLayerSWCount == 6:
+            print "Number of Packet layer or mininet Switches = %d "\
+                    % packetLayerSWCount + "and is correctly detected"
+            main.log.info(
+                "Number of Packet layer or mininet Switches = " +
+                str( packetLayerSWCount ) +
+                " and is correctly detected" )
+            packetSWResult = main.TRUE
+        else:
+            print "Number of Packet layer or mininet Switches = %d and"\
+                    % packetLayerSWCount + " is wrong"
+            main.log.info(
+                "Number of Packet layer or mininet Switches = " +
+                str( packetLayerSWCount ) +
+                " and is wrong" )
+            packetSWResult = main.FALSE
+        print "_________________________________"
+
+        linksResult = main.ONOS3.links( jsonFormat=False )
+        print "links_result = ", linksResult
+        print "_________________________________"
+        linkActiveCount = linksResult.count("state=ACTIVE") 
+        main.log.info( "linkActiveCount = " + str( linkActiveCount ))
+        if linkActiveCount == 42:
+            linkActiveResult = main.TRUE
+            main.log.info(
+                "Number of links in ACTIVE state are correct")
+        else:
+            linkActiveResult = main.FALSE
+            main.log.info(
+                "Number of links in ACTIVE state are wrong")
+
+        # 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
+        pingallResult = main.LincOE2.pingall()
+
+        hostsResult = main.ONOS3.hosts( jsonFormat=False )
+        main.log.info( "hosts_result = "+hostsResult )
+        main.log.info( "_________________________________" )
+        hostsLinewise = hostsResult.split( "\n" )
+        hostsLinewise = hostsLinewise[ 1:-1 ]
+        hostCount = 0
+        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" )
+            hostDiscovery = main.TRUE
+        else:
+            print "Number of hosts = %d and is wrong" %hostCount
+            main.log.info( "Number of hosts = " + str( hostCount ) +" and \
+                            is wrong" )
+            hostDiscovery = main.FALSE
+        """
+        case22Result = opticalSWResult and packetSWResult and \
+                        linkActiveResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            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
+            ping mininet hosts
+        """
+        main.log.report(
+            "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" )
+        ptpIntentResult = main.ONOS3.addPointIntent(
+            "of:0000ffffffff0001/1",
+            "of:0000ffffffff0005/1" )
+        if ptpIntentResult == main.TRUE:
+            main.ONOS3.intents( jsonFormat=False )
+            main.log.info( "Point to point intent install successful" )
+
+        ptpIntentResult = main.ONOS3.addPointIntent(
+            "of:0000ffffffff0005/1",
+            "of:0000ffffffff0001/1" )
+        if ptpIntentResult == main.TRUE:
+            main.ONOS3.intents( jsonFormat=False )
+            main.log.info( "Point to point intent install successful" )
+
+        time.sleep( 30 )
+        flowHandle = main.ONOS3.flows()
+        main.log.info( "flows :" + flowHandle )
+
+        # Sleep for 30 seconds to provide time for the intent state to change
+        time.sleep( 60 )
+        intentHandle = main.ONOS3.intents( jsonFormat=False )
+        main.log.info( "intents :" + intentHandle )
+
+        PingResult = main.TRUE
+        count = 1
+        main.log.info( "\n\nh1 is Pinging h5" )
+        ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
+        # ping = main.LincOE2.pinghost()
+        if ping == main.FALSE and count < 5:
+            count += 1
+            PingResult = main.FALSE
+            main.log.info(
+                "Ping between h1 and h5  failed. Making attempt number " +
+                str( count ) +
+                " in 2 seconds" )
+            time.sleep( 2 )
+        elif ping == main.FALSE:
+            main.log.info( "All ping attempts between h1 and h5 have failed" )
+            PingResult = main.FALSE
+        elif ping == main.TRUE:
+            main.log.info( "Ping test between h1 and h5 passed!" )
+            PingResult = main.TRUE
+        else:
+            main.log.info( "Unknown error" )
+            PingResult = main.ERROR
+
+        if PingResult == main.FALSE:
+            main.log.report(
+                "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" )
+
+        case23Result = PingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            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
+        """
+            LINC uses its own switch IDs. You can use the following
+            command on the LINC console to find the mapping between 
+            DPIDs and LINC IDs.
+            rp(application:get_all_key(linc)).
+            
+            Test Rerouting of Packet Optical by bringing a port down
+            ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ), 
+            so that link
+            ( between switch1 port20 - switch5 port50 ) 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( "Attach to the Linc-OE session" )
+        attachConsole = main.LincOE1.attachLincOESession() 
+        print "attachConsole = ", attachConsole
+
+        main.step( "Bring a port down and verify the link state" )
+        main.LincOE1.portDown( swId="9", ptId="20" )
+        linksNonjson = main.ONOS3.links( jsonFormat=False )
+        main.log.info( "links = " + linksNonjson )
+
+        linkInactiveCount = linksNonjson.count("state=INACTIVE")
+        main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
+        if linkInactiveCount == 2:
+            main.log.info(
+                "Number of links in INACTIVE state are correct")
+        else:
+            main.log.info(
+                "Number of links in INACTIVE state are wrong")
+        
+        links = main.ONOS3.links()
+        main.log.info( "links = " + links )
+
+        linksResult = json.loads( links )
+        linksStateResult = main.FALSE
+        for item in linksResult:
+            if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
+                    'src' ][ 'port' ] == "20":
+                if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
+                        'dst' ][ 'port' ] == "50":
+                    linksState = item[ 'state' ]
+                    if linksState == "INACTIVE":
+                        main.log.info(
+                            "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" )
+                        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" )
+                        linksStateResult = main.FALSE
+
+        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" )
+        PingResult = main.TRUE
+        count = 1
+        main.log.info( "\n\nh1 is Pinging h5" )
+        ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
+        # ping = main.LincOE2.pinghost()
+        if ping == main.FALSE and count < 5:
+            count += 1
+            PingResult = main.FALSE
+            main.log.info(
+                "Ping between h1 and h5  failed. Making attempt number " +
+                str( count ) +
+                " in 2 seconds" )
+            time.sleep( 2 )
+        elif ping == main.FALSE:
+            main.log.info( "All ping attempts between h1 and h5 have failed" )
+            PingResult = main.FALSE
+        elif ping == main.TRUE:
+            main.log.info( "Ping test between h1 and h5 passed!" )
+            PingResult = main.TRUE
+        else:
+            main.log.info( "Unknown error" )
+            PingResult = main.ERROR
+
+        if PingResult == main.TRUE:
+            main.log.report( "Ping test successful " )
+        if PingResult == main.FALSE:
+            main.log.report( "Ping test 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( "__________________________________" )
+        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.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            elif i >= 2 and i < 5:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            elif i >= 5 and i < 8:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            elif i >= 8 and i < 18:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            elif i >= 18 and i < 28:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+            else:
+                main.Mininet1.assignSwController(
+                    sw=str( i ),
+                    ip1=ONOS1Ip,
+                    port1=ONOS1Port )
+        SwitchMastership = main.TRUE
+        for i in range( 1, 29 ):
+            if i == 1:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            elif i >= 2 and i < 5:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            elif i >= 5 and i < 8:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            elif i >= 8 and i < 18:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            elif i >= 18 and i < 28:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is " + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+            else:
+                response = main.Mininet1.getSwController( "s" + str( i ) )
+                print( "Response is" + str( response ) )
+                if re.search( "tcp:" + ONOS1Ip, response ):
+                    SwitchMastership = SwitchMastership and main.TRUE
+                else:
+                    SwitchMastership = main.FALSE
+
+        if SwitchMastership == main.TRUE:
+            main.log.report( "Controller assignmnet successful" )
+        else:
+            main.log.report( "Controller assignmnet failed" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=SwitchMastership,
+            onpass="MasterControllers assigned correctly" )
+        """
+        for i in range ( 1,29 ):
+            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" )
+        hostList = main.Mininet1.getHosts()
+        main.log.info( hostList )
+
+        main.step( "Get host list in ONOS format" )
+        hostOnosList = main.ONOS2.getHostsId( hostList )
+        main.log.info( hostOnosList )
+        # time.sleep( 5 )
+
+        main.step( "Pingall" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        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
+        # if there was no activity
+        main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
+
+        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" )
+
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case4Result,
+            onpass="Controller assignment and Pingall Test successful",
+            onfail="Controller assignment and Pingall Test NOT successful" )
+
+    def CASE10( self ):
+        main.log.report(
+            "This testcase uninstalls the reactive forwarding app" )
+        main.log.report( "__________________________________" )
+        main.case( "Uninstalling reactive forwarding app" )
+        # Unistall onos-app-fwd app to disable reactive forwarding
+        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
+        # So sleep for 15s
+        time.sleep( 15 )
+
+        flows = main.ONOS2.flows()
+        main.log.info( flows )
+
+        case10Result = appUninstallResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case10Result,
+            onpass="Reactive forwarding app uninstallation successful",
+            onfail="Reactive forwarding app uninstallation failed" )
+
+
+    def CASE11( self ):
+        # NOTE: This testcase require reactive forwarding mode enabled
+        # NOTE: in the beginning and then uninstall it before adding 
+        # NOTE: point intents. Again the app is installed so that 
+        # NOTE: testcase 10 can be ran successively
+        import time
+        main.log.report(
+            "This testcase moves a host from one switch to another to add" +
+            "point intents between them and then perform ping" )
+        main.log.report( "__________________________________" )
+        main.log.info( "Moving host from one switch to another" )
+        main.case( "Moving host from a device and attach it to another device" )
+        main.step( "Moving host h9 from device s9 and attach it to s8" )
+        main.Mininet1.moveHost(host = 'h9', oldSw = 's9', newSw = 's8')
+
+        time.sleep(15) #Time delay to have all the flows ready
+        main.step( "Pingall" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall()
+        time2 = time.time()
+        print "Time for pingall: %2f seconds" % ( time2 - time1 )
+
+        hosts = main.ONOS2.hosts( jsonFormat = False )
+        main.log.info( hosts )
+        
+        main.case( "Uninstalling reactive forwarding app" )
+        # Unistall onos-app-fwd app to disable reactive forwarding
+        appUninstallResult = main.ONOS2.featureUninstall( "onos-app-fwd" )
+        main.log.info( "onos-app-fwd uninstalled" )
+
+        main.step( "Add point intents between hosts on the same device")
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003008/1",
+            "of:0000000000003008/3" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003008/3",
+            "of:0000000000003008/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        main.case( "Ping hosts on the same devices" )
+        ping = main.Mininet1.pingHost( src = 'h8', target = 'h9' )
+
+        '''
+        main.case( "Installing reactive forwarding app" )
+        # Install onos-app-fwd app to enable reactive forwarding
+        appUninstallResult = main.ONOS2.featureInstall( "onos-app-fwd" )
+        main.log.info( "onos-app-fwd installed" )
+        '''
+
+        if ping == main.FALSE:
+            main.log.report(
+                "Point intents for hosts on same devices haven't" +
+                " been installed correctly. Cleaning up" )
+        if ping == main.TRUE:
+            main.log.report(
+                "Point intents for hosts on same devices" +
+                "installed correctly. Cleaning up" )
+
+        case11Result = ping and pingResult
+        utilities.assert_equals(
+            expect = main.TRUE,
+            actual = case11Result,
+            onpass = "Point intents for hosts on same devices" +
+                    "Ping Test successful",
+            onfail = "Point intents for hosts on same devices" +
+                    "Ping Test NOT successful" )
+
+
+    def CASE12( self ):
+        """
+        Verify the default flows on each switch in proactive mode
+        """
+        main.log.report( "This testcase is verifying num of default" +
+                         " flows on each switch" )
+        main.log.report( "__________________________________" )
+        main.case( "Verify num of default flows on each switch" )
+        main.step( "Obtaining the device id's and flowrule count on them" )
+
+        case12Result = main.TRUE
+        idList = main.ONOS2.getAllDevicesId()
+        for id in idList:
+            count = main.ONOS2.FlowAddedCount( id )
+            main.log.info("count = " +count)
+            if int(count) != 3:
+                case12Result = main.FALSE
+                break
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case12Result,
+            onpass = "Expected default num of flows exist",
+            onfail = "Expected default num of flows do not exist")
+    
+    
+        
+
+    def CASE6( self ):
+        import time
+        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.step( "Get all devices id" )
+        devicesIdList = main.ONOS2.getAllDevicesId()
+        main.log.info( devicesIdList )
+
+        # 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" )
+        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 ) )
+            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
+            if host1:
+                host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
+            if host2:
+                host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
+            if host1Id and host2Id:
+                main.ONOS2.addHostIntent( host1Id, host2Id )
+
+        time.sleep( 10 )
+        hIntents = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intents:" + hIntents )
+        flows = main.ONOS2.flows()
+        main.log.info( "flows:" + flows )     
+
+        count = 1
+        i = 8
+        PingResult = main.TRUE
+        # while i<10:
+        while i < 18:
+            main.log.info(
+                "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
+            ping = main.Mininet1.pingHost(
+                src="h" + str( i ), target="h" + str( i + 10 ) )
+            if ping == main.FALSE and count < 5:
+                count += 1
+                # i = 8
+                PingResult = main.FALSE
+                main.log.report( "Ping between h" +
+                                 str( i ) +
+                                 " and h" +
+                                 str( i +
+                                      10 ) +
+                                 " failed. Making attempt number " +
+                                 str( count ) +
+                                 " in 2 seconds" )
+                time.sleep( 2 )
+            elif ping == main.FALSE:
+                main.log.report( "All ping attempts between h" +
+                                 str( i ) +
+                                 " and h" +
+                                 str( i +
+                                      10 ) +
+                                 "have failed" )
+                i = 19
+                PingResult = main.FALSE
+            elif ping == main.TRUE:
+                main.log.info( "Ping test between h" +
+                               str( i ) +
+                               " and h" +
+                               str( i +
+                                    10 ) +
+                               "passed!" )
+                i += 1
+                PingResult = main.TRUE
+            else:
+                main.log.info( "Unknown error" )
+                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 PingResult == main.TRUE:
+            main.log.report(
+                "Ping all test after Host intent addition successful" )
+
+        case6Result = PingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case6Result,
+            onpass="Pingall Test after Host intents addition successful",
+            onfail="Pingall Test after Host intents addition failed" )
+
+    def CASE5( self, main ):
+        import json
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology 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" )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source1' ],
+            target=main.params[ 'PING' ][ 'target1' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source2' ],
+            target=main.params[ 'PING' ][ 'target2' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source3' ],
+            target=main.params[ 'PING' ][ 'target3' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source4' ],
+            target=main.params[ 'PING' ][ 'target4' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source5' ],
+            target=main.params[ 'PING' ][ 'target5' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source6' ],
+            target=main.params[ 'PING' ][ 'target6' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source7' ],
+            target=main.params[ 'PING' ][ 'target7' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source8' ],
+            target=main.params[ 'PING' ][ 'target8' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source9' ],
+            target=main.params[ 'PING' ][ 'target9' ],
+            pingTime=500 )
+        main.Mininet2.pingLong(
+            src=main.params[ 'PING' ][ 'source10' ],
+            target=main.params[ 'PING' ][ 'target10' ],
+            pingTime=500 )
+
+        main.step( "Create TestONTopology object" )
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
+                temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
+                temp = temp + ( "ONOS" + str( count ), )
+                temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
+                temp = temp + \
+                    ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
+                ctrls.append( temp )
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+
+        TopologyCheck = main.TRUE
+        main.step( "Compare ONOS Topology to MN Topology" )
+        devicesJson = main.ONOS2.devices()
+        linksJson = main.ONOS2.links()
+        # portsJson = main.ONOS2.ports()
+
+        result1 = main.Mininet1.compareSwitches(
+            MNTopo,
+            json.loads( devicesJson ) )
+        result2 = main.Mininet1.compareLinks(
+            MNTopo,
+            json.loads( linksJson ) )
+        # result3 = main.Mininet1.comparePorts(
+        # MNTopo, json.loads( portsJson ) )
+
+        # result = result1 and result2 and result3
+        result = result1 and result2
+
+        print "***********************"
+        if result == main.TRUE:
+            main.log.report( "ONOS" + " Topology matches MN Topology" )
+        else:
+            main.log.report( "ONOS" + " Topology does not match MN Topology" )
+
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=result,
+            onpass="ONOS" +
+            " Topology matches MN Topology",
+            onfail="ONOS" +
+            " Topology does not match MN Topology" )
+
+        TopologyCheck = TopologyCheck and result
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=TopologyCheck,
+            onpass="Topology checks passed",
+            onfail="Topology checks failed" )
+
+    def CASE7( self, main ):
+        from sts.topology.teston_topology import TestONTopology
+
+        linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+
+        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.step( "Start continuous pings" )
+
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source1' ],
+                               target=main.params[ 'PING' ][ 'target1' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source2' ],
+                               target=main.params[ 'PING' ][ 'target2' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source3' ],
+                               target=main.params[ 'PING' ][ 'target3' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source4' ],
+                               target=main.params[ 'PING' ][ 'target4' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source5' ],
+                               target=main.params[ 'PING' ][ 'target5' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source6' ],
+                               target=main.params[ 'PING' ][ 'target6' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source7' ],
+                               target=main.params[ 'PING' ][ 'target7' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source8' ],
+                               target=main.params[ 'PING' ][ 'target8' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source9' ],
+                               target=main.params[ 'PING' ][ 'target9' ],
+                               pingTime=500 )
+        main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source10' ],
+                               target=main.params[ 'PING' ][ 'target10' ],
+                               pingTime=500 )
+        """
+        main.step( "Determine the current number of switches and links" )
+        topologyOutput = main.ONOS2.topology()
+        topologyResult = main.ONOS1.getTopology( topologyOutput )
+        activeSwitches = topologyResult[ 'deviceCount' ]
+        links = topologyResult[ 'linkCount' ]
+        print "activeSwitches = ", type( activeSwitches )
+        print "links = ", type( links )
+        main.log.info(
+            "Currently there are %s switches and %s links" %
+            ( str( activeSwitches ), str( links ) ) )
+
+        main.step( "Kill Link between s3 and s28" )
+        main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
+        time.sleep( linkSleep )
+        topologyOutput = main.ONOS2.topology()
+        LinkDown = main.ONOS1.checkStatus(
+            topologyOutput, activeSwitches, str(
+                int( links ) - 2 ) )
+        if LinkDown == main.TRUE:
+            main.log.report( "Link Down discovered properly" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=LinkDown,
+            onpass="Link Down discovered properly",
+            onfail="Link down was not discovered in " +
+            str( linkSleep ) +
+            " seconds" )
+
+        # Check ping result here..add code for it
+
+        main.step( "Bring link between s3 and s28 back up" )
+        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 LinkUp == main.TRUE:
+            main.log.report( "Link up discovered properly" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=LinkUp,
+            onpass="Link up discovered properly",
+            onfail="Link up was not discovered in " +
+            str( linkSleep ) +
+            " seconds" )
+
+        # NOTE Check ping result here..add code for it
+
+        main.step( "Compare ONOS Topology to MN Topology" )
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+        TopologyCheck = main.TRUE
+
+        devicesJson = main.ONOS2.devices()
+        linksJson = main.ONOS2.links()
+        portsJson = main.ONOS2.ports()
+
+        result1 = main.Mininet1.compareSwitches(
+            MNTopo,
+            json.loads( devicesJson ) )
+        result2 = main.Mininet1.compareLinks(
+            MNTopo,
+            json.loads( linksJson ) )
+        # result3 = main.Mininet1.comparePorts(
+        # MNTopo, json.loads( portsJson ) )
+
+        # result = result1 and result2 and result3
+        result = result1 and result2
+        print "***********************"
+
+        if result == main.TRUE:
+            main.log.report( "ONOS" + " Topology matches MN Topology" )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=result,
+            onpass="ONOS" +
+            " Topology matches MN Topology",
+            onfail="ONOS" +
+            " Topology does not match MN Topology" )
+
+        TopologyCheck = TopologyCheck and result
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=TopologyCheck,
+            onpass="Topology checks passed",
+            onfail="Topology checks failed" )
+
+        result = LinkDown and LinkUp and TopologyCheck
+        utilities.assert_equals( expect=main.TRUE, actual=result,
+                                 onpass="Link failure is discovered correctly",
+                                 onfail="Link Discovery failed" )
+
+    def CASE8( self ):
+        """
+        Intent removal
+        """
+        import time
+        main.log.report( "This testcase removes any previously added intents" +
+                         " before adding any new set of intents" )
+        main.log.report( "__________________________________" )
+        main.log.info( "intent removal" )
+        main.case( "Removing installed intents" )
+        main.step( "Obtain the intent id's" )
+        intentResult = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intent_result = " + intentResult )
+        intentLinewise = intentResult.split( "\n" )
+
+        intentList = [line for line in intentLinewise \
+            if line.startswith( "id=")]
+        intentids = [line.split( "," )[ 0 ].split( "=" )[ 1 ] for line in \
+            intentList]
+        for id in intentids:
+            print "id = ", id
+
+        main.step(
+            "Iterate through the intentids list and remove each intent" )
+        for id in intentids:
+            main.ONOS2.removeIntent( intentId=id )
+
+        intentResult = main.ONOS2.intents( jsonFormat=False )
+        main.log.info( "intent_result = " + intentResult )
+        
+        intentList = [line for line in intentResult.split( "\n" ) \
+            if line.startswith( "id=")]
+        intentState = [line.split( "," )[ 1 ].split( "=" )[ 1 ] for line in \
+            intentList]
+        for state in intentState:
+            print state
+        
+        case8Result = main.TRUE        
+        for state in intentState:
+            if state != 'WITHDRAWN':
+                case8Result = main.FALSE
+                break
+                
+        if case8Result == main.TRUE:
+            main.log.report( "Intent removal successful" )
+        else:
+            main.log.report( "Intent removal failed" )
+
+        PingResult = main.TRUE
+        if case8Result == main.TRUE:
+            i = 8
+            while i < 18:
+                main.log.info(
+                    "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
+                ping = main.Mininet1.pingHost(
+                    src="h" + str( i ), target="h" + str( i + 10 ) )
+                if ping == main.TRUE:
+                    i = 19
+                    PingResult = PingResult and main.TRUE
+                elif ping == main.FALSE:
+                    i += 1
+                    PingResult = PingResult and main.FALSE
+                else:
+                    main.log.info( "Unknown error" )
+                    PingResult = main.ERROR
+
+            # Note: If the ping result failed, that means the intents have been
+            # withdrawn correctly.
+        if PingResult == main.TRUE:
+            main.log.report( "Installed intents have not been withdrawn correctly" )
+            # main.cleanup()
+            # main.exit()
+        if PingResult == main.FALSE:
+            main.log.report( "Installed intents have been withdrawn correctly" )
+
+        case8Result = case8Result and PingResult
+
+        if case8Result == main.FALSE:
+            main.log.report( "Intent removal successful" )
+        else:
+            main.log.report( "Intent removal failed" )
+
+        utilities.assert_equals( expect=main.FALSE, actual=case8Result,
+                                 onpass="Intent removal test passed",
+                                 onfail="Intent removal test failed" )
+
+    def CASE9( self ):
+        main.log.report(
+            "This testcase adds point intents and then does pingall" )
+        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 )" )
+
+        main.step( "Add point intents for mn hosts h8 and h18 or" +
+                   "ONOS hosts h8 and h12" )
+        # main.step(var1)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003008/1",
+            "of:0000000000006018/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006018/1",
+            "of:0000000000003008/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var2 = "Add point intents for mn hosts h9&h19 or ONOS hosts h9&h13"
+        main.step(var2)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003009/1",
+            "of:0000000000006019/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006019/1",
+            "of:0000000000003009/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var3 = "Add point intents for MN hosts h10&h20 or ONOS hosts hA&h14"
+        main.step(var3)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003010/1",
+            "of:0000000000006020/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006020/1",
+            "of:0000000000003010/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var4 = "Add point intents for mininet hosts h11 and h21 or" +\
+               " ONOS hosts hB and h15"
+        main.case(var4)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003011/1",
+            "of:0000000000006021/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006021/1",
+            "of:0000000000003011/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var5 = "Add point intents for mininet hosts h12 and h22 " +\
+               "ONOS hosts hC and h16"
+        main.case(var5)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003012/1",
+            "of:0000000000006022/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006022/1",
+            "of:0000000000003012/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var6 = "Add point intents for mininet hosts h13 and h23 or" +\
+               " ONOS hosts hD and h17"
+        main.case(var6)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003013/1",
+            "of:0000000000006023/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006023/1",
+            "of:0000000000003013/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var7 = "Add point intents for mininet hosts h14 and h24 or" +\
+               " ONOS hosts hE and h18"
+        main.case(var7)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003014/1",
+            "of:0000000000006024/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006024/1",
+            "of:0000000000003014/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var8 = "Add point intents for mininet hosts h15 and h25 or" +\
+               " ONOS hosts hF and h19"
+        main.case(var8)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003015/1",
+            "of:0000000000006025/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006025/1",
+            "of:0000000000003015/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var9 = "Add intents for mininet hosts h16 and h26 or" +\
+               " ONOS hosts h10 and h1A"
+        main.case(var9)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003016/1",
+            "of:0000000000006026/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006026/1",
+            "of:0000000000003016/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            # main.log.info( getIntentResult )
+
+        var10 = "Add point intents for mininet hosts h17 and h27 or" +\
+                " ONOS hosts h11 and h1B"
+        main.case(var10)
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000003017/1",
+            "of:0000000000006027/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            #main.log.info( getIntentResult )
+
+        ptpIntentResult = main.ONOS2.addPointIntent(
+            "of:0000000000006027/1",
+            "of:0000000000003017/1" )
+        if ptpIntentResult == main.TRUE:
+            getIntentResult = main.ONOS2.intents()
+            main.log.info( "Point to point intent install successful" )
+            #main.log.info( getIntentResult )
+
+        print(
+            "___________________________________________________________" )
+
+        flowHandle = main.ONOS2.flows()
+        #main.log.info( "flows :" + flowHandle )
+
+        count = 1
+        i = 8
+        PingResult = main.TRUE
+        while i < 18:
+            main.log.info(
+                "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
+            ping = main.Mininet1.pingHost(
+                src="h" + str( i ), target="h" + str( i + 10 ) )
+            if ping == main.FALSE and count < 5:
+                count += 1
+                # i = 8
+                PingResult = main.FALSE
+                main.log.report( "Ping between h" +
+                                 str( i ) +
+                                 " and h" +
+                                 str( i +
+                                      10 ) +
+                                 " failed. Making attempt number " +
+                                 str( count ) +
+                                 " in 2 seconds" )
+                time.sleep( 2 )
+            elif ping == main.FALSE:
+                main.log.report( "All ping attempts between h" +
+                                 str( i ) +
+                                 " and h" +
+                                 str( i +
+                                      10 ) +
+                                 "have failed" )
+                i = 19
+                PingResult = main.FALSE
+            elif ping == main.TRUE:
+                main.log.info( "Ping test between h" +
+                               str( i ) +
+                               " and h" +
+                               str( i +
+                                    10 ) +
+                               "passed!" )
+                i += 1
+                PingResult = main.TRUE
+            else:
+                main.log.info( "Unknown error" )
+                PingResult = main.ERROR
+
+        if PingResult == main.FALSE:
+            main.log.report(
+                "Point intents have not ben installed correctly. Cleaning up" )
+            # main.cleanup()
+            # main.exit()
+        if PingResult == main.TRUE:
+            main.log.report( "Point Intents have been installed correctly" )
+
+        case9Result = PingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case9Result,
+            onpass="Point intents addition and Pingall Test successful",
+            onfail="Point intents addition and Pingall Test NOT successful" )
diff --git a/TestON/tests/ProdFunc13/ProdFunc13.py b/TestON/tests/ProdFunc13/ProdFunc13.py
index a274c07..ade6d07 100644
--- a/TestON/tests/ProdFunc13/ProdFunc13.py
+++ b/TestON/tests/ProdFunc13/ProdFunc13.py
@@ -839,7 +839,7 @@
         time.sleep( 10 )
 
         main.step( "Get list of hosts from Mininet" )
-        hostList = main.Mininet1.getHosts().keys()
+        hostList = main.Mininet1.getHosts()
         main.log.info( hostList )
 
         main.step( "Get host list in ONOS format" )
@@ -1122,6 +1122,9 @@
             Check ONOS topology matches with mininet
         """
         import json
+        # assumes that sts is already in you PYTHONPATH
+        from sts.topology.teston_topology 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( "__________________________________" )
@@ -1168,19 +1171,43 @@
             target=main.params[ 'PING' ][ 'target10' ],
             pingTime=500 )
 
+        main.step( "Create TestONTopology object" )
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
+                temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
+                temp = temp + ( "ONOS" + str( count ), )
+                temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
+                temp = temp + \
+                    ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
+                ctrls.append( temp )
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
+
         TopologyCheck = main.TRUE
         main.step( "Compare ONOS Topology to MN Topology" )
         devicesJson = main.ONOS2.devices()
         linksJson = main.ONOS2.links()
         portsJson = main.ONOS2.ports()
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
 
         result1 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
+            MNTopo,
+            json.loads( devicesJson ) )
         result2 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( linksJson ) )
+            MNTopo,
+            json.loads( linksJson ) )
 
+        result3 = main.Mininet1.comparePorts( MNTopo, json.loads( portsJson ) )
+        # result = result1 and result2 and result3
         result = result1 and result2
 
         print "***********************"
@@ -1209,6 +1236,9 @@
             Link discovery test case. Checks if ONOS can discover a link
             down or up properly.
         """
+
+        from sts.topology.teston_topology import TestONTopology
+
         linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report( "This testscase is killing a link to ensure that" +
@@ -1303,19 +1333,25 @@
         # NOTE Check ping result here..add code for it
 
         main.step( "Compare ONOS Topology to MN Topology" )
+        Topo = TestONTopology(
+            main.Mininet1,
+            ctrls )  # can also add Intent API info for intent operations
+        MNTopo = Topo
         TopologyCheck = main.TRUE
 
         devicesJson = main.ONOS2.devices()
         linksJson = main.ONOS2.links()
         portsJson = main.ONOS2.ports()
-        mnSwitches = main.Mininet1.getSwitches()
-        mnLinks = main.Mininet1.getLinks()
 
         result1 = main.Mininet1.compareSwitches(
-            mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
+            MNTopo,
+            json.loads( devicesJson ) )
         result2 = main.Mininet1.compareLinks(
-            mnSwitches, mnLinks, json.loads( linksJson ) )
+            MNTopo,
+            json.loads( linksJson ) )
+        result3 = main.Mininet1.comparePorts( MNTopo, json.loads( portsJson ) )
 
+        # result = result1 and result2 and result3
         result = result1 and result2
         print "***********************"
 
diff --git a/TestON/tests/prevFuncNext/FuncNext.params b/TestON/tests/prevFuncNext/FuncNext.params
new file mode 100755
index 0000000..13a4691
--- /dev/null
+++ b/TestON/tests/prevFuncNext/FuncNext.params
@@ -0,0 +1,37 @@
+<PARAMS>
+    
+    <testcases>1,4,5,3</testcases>
+
+    #Environment variables
+    <ENV>
+        <cellName>driver_test</cellName>
+    </ENV>
+
+    <CTRL>
+        <ip1>10.128.20.11</ip1>
+        <port1>6633</port1>
+    </CTRL>
+
+    <PING>
+        <source1>h8</source1>
+        <source2>h9</source2>
+        <source3>h10</source3>
+        <source4>h11</source4>
+        <source5>h12</source5>
+        <source6>h13</source6>
+        <source7>h14</source7>
+        <source8>h15</source8>
+        <source9>h16</source9>
+        <source10>h17</source10>
+        <target1>10.0.0.18</target1>
+        <target2>10.0.0.19</target2>
+        <target3>10.0.0.20</target3>
+        <target4>10.0.0.21</target4>
+        <target5>10.0.0.22</target5>
+        <target6>10.0.0.23</target6>
+        <target7>10.0.0.24</target7>
+        <target8>10.0.0.25</target8>
+        <target9>10.0.0.26</target9>
+        <target10>10.0.0.27</target10>
+    </PING>
+</PARAMS>
diff --git a/TestON/tests/prevFuncNext/FuncNext.py b/TestON/tests/prevFuncNext/FuncNext.py
new file mode 100755
index 0000000..e556fa4
--- /dev/null
+++ b/TestON/tests/prevFuncNext/FuncNext.py
@@ -0,0 +1,311 @@
+
+#Testing the basic functionality of ONOS Next
+#For sanity and driver functionality excercises only.
+
+import time
+import sys
+import os
+import re
+import time
+
+time.sleep(1)
+class FuncNext:
+    def __init__(self):
+        self.default = ''
+
+    def CASE1(self, main):
+        '''
+        Startup sequence:
+        git pull
+        mvn clean install
+        onos-package
+        cell <name>
+        onos-verify-cell
+        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']
+        
+        main.case("Setting up test environment")
+        
+        main.step("Git checkout and pull master and get version")
+        main.ONOSbench.git_checkout("master")
+        git_pull_result = main.ONOSbench.git_pull()
+        version_result = main.ONOSbench.get_version()
+
+        main.step("Using mvn clean & install")
+        #clean_install_result = main.ONOSbench.clean_install()
+        #clean_install_result = main.TRUE
+
+        main.step("Applying cell variable to environment")
+        cell_result = main.ONOSbench.set_cell(cell_name)
+        verify_result = main.ONOSbench.verify_cell()
+        cell_result = main.ONOS2.set_cell(cell_name)
+        #verify_result = main.ONOS2.verify_cell()
+        main.ONOS2.start_onos_cli(ONOS_ip=main.params['CTRL']['ip1'])
+        
+        main.step("Creating ONOS package")
+        package_result = main.ONOSbench.onos_package()
+
+        #main.step("Creating a cell")
+        #cell_create_result = main.ONOSbench.create_cell_file(**************)
+
+        main.step("Installing ONOS package")
+        onos_install_result = main.ONOSbench.onos_install()
+        onos1_isup = main.ONOSbench.isup()
+   
+        main.step("Starting ONOS service")
+        start_result = main.ONOSbench.onos_start(ONOS1_ip)
+
+        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")
+
+    def CASE11(self, main):
+        '''
+        Cleanup sequence:
+        onos-service <node_ip> stop
+        onos-uninstall
+
+        TODO: Define rest of cleanup
+        
+        '''
+
+        ONOS1_ip = main.params['CTRL']['ip1']
+
+        main.case("Cleaning up test environment")
+
+        main.step("Testing ONOS kill function")
+        kill_result = main.ONOSbench.onos_kill(ONOS1_ip)
+
+        main.step("Stopping ONOS service")
+        stop_result = main.ONOSbench.onos_stop(ONOS1_ip)
+
+        main.step("Uninstalling ONOS service") 
+        uninstall_result = main.ONOSbench.onos_uninstall()
+
+    def CASE3(self, main):
+        '''
+        Test 'onos' command and its functionality in driver
+        '''
+        
+        ONOS1_ip = 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)
+
+        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)
+
+
+
+    def CASE4(self, main):
+        import re
+        import time
+        main.case("Pingall Test")
+        main.step("Assigning switches to controllers")
+        for i in range(1,29):
+            if i ==1:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            elif i>=2 and i<5:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            elif i>=5 and i<8:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            elif i>=8 and i<18:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            elif i>=18 and i<28:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+            else:
+                main.Mininet1.assign_sw_controller(sw=str(i),ip1=ONOS1_ip,port1=ONOS1_port)
+        Switch_Mastership = main.TRUE
+        for i in range (1,29):
+            if i==1:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            elif i>=2 and i<5:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            elif i>=5 and i<8:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            elif i>=8 and i<18:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            elif i>=18 and i<28:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is " + str(response))
+                if re.search("tcp:"+ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+            else:
+                response = main.Mininet1.get_sw_controller("s"+str(i))
+                print("Response is" + str(response))
+                if re.search("tcp:" +ONOS1_ip,response):
+                    Switch_Mastership = Switch_Mastership and main.TRUE
+                else:
+                    Switch_Mastership = main.FALSE
+
+        if Switch_Mastership == main.TRUE:
+            main.log.report("MasterControllers assigned correctly")
+        utilities.assert_equals(expect = main.TRUE,actual=Switch_Mastership,
+                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)
+        '''
+        #REACTIVE FWD test
+
+        main.step("Get list of hosts from Mininet")
+        host_list = main.Mininet1.get_hosts()
+        main.log.info(host_list)
+
+        main.step("Get host list in ONOS format")
+        host_onos_list = main.ONOS2.get_hosts_id(host_list)
+        main.log.info(host_onos_list)
+        #time.sleep(5)
+
+        #We must use ping from hosts we want to add intents from 
+        #to make the hosts talk
+        #main.Mininet2.handle.sendline("\r")
+        #main.Mininet2.handle.sendline("h4 ping 10.1.1.1 -c 1 -W 1")
+        #time.sleep(3)
+        #main.Mininet2.handle.sendline("h5 ping 10.1.1.1 -c 1 -W 1")
+        #time.sleep(5)
+        
+        main.step("Pingall")
+        ping_result = main.FALSE
+        while ping_result == main.FALSE:
+            time1 = time.time()
+            ping_result = 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
+        #if there was no activity
+        main.ONOS2.start_onos_cli(ONOS_ip=main.params['CTRL']['ip1'])
+
+        main.step("Get hosts")
+        main.ONOS2.handle.sendline("hosts")
+        main.ONOS2.handle.expect("onos>")
+        hosts = main.ONOS2.handle.before
+        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)
+        '''
+        main.step("Add point-to-point intents")
+        ptp_intent_result = main.ONOS2.add_point_intent(
+            devices_id_list[0], 1, devices_id_list[1], 2)
+        if ptp_intent_result == main.TRUE:
+            get_intent_result = main.ONOS2.intents()
+            main.log.info("Point to point intent install successful")
+            main.log.info(get_intent_result)
+        '''
+
+        case4_result = Switch_Mastership and ping_result
+        utilities.assert_equals(expect=main.TRUE, actual=case4_result,
+                onpass="Pingall Test successful",
+                onfail="Pingall Test NOT successful")
+
+    def CASE5(self,main) :
+        import time
+        from subprocess import Popen, PIPE
+        from sts.topology.teston_topology import TestONTopology # assumes that sts is already in you PYTHONPATH
+        #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.step("Start continuous pings")
+        main.Mininet2.pingLong(src=main.params['PING']['source1'],
+                            target=main.params['PING']['target1'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source2'],
+                            target=main.params['PING']['target2'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source3'],
+                            target=main.params['PING']['target3'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source4'],
+                            target=main.params['PING']['target4'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source5'],
+                            target=main.params['PING']['target5'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source6'],
+                            target=main.params['PING']['target6'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source7'],
+                            target=main.params['PING']['target7'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source8'],
+                            target=main.params['PING']['target8'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source9'],
+                            target=main.params['PING']['target9'],pingTime=500)
+        main.Mininet2.pingLong(src=main.params['PING']['source10'],
+                            target=main.params['PING']['target10'],pingTime=500)
+
+        main.step("Create TestONTopology object")
+        global ctrls
+        ctrls = []
+        count = 1
+        while True:
+            temp = ()
+            if ('ip' + str(count)) in main.params['CTRL']:
+                temp = temp + (getattr(main,('ONOS' + str(count))),)
+                temp = temp + ("ONOS"+str(count),)
+                temp = temp + (main.params['CTRL']['ip'+str(count)],)
+                temp = temp + (eval(main.params['CTRL']['port'+str(count)]),)
+                ctrls.append(temp)
+                count = count + 1
+            else:
+                break
+        global MNTopo
+        Topo = TestONTopology(main.Mininet1, ctrls) # can also add Intent API info for intent operations
+        MNTopo = Topo
+
+        Topology_Check = main.TRUE
+        main.step("Compare ONOS Topology to MN Topology")
+        '''for n in range(1,6):
+            result = main.Mininet1.compare_topo(MNTopo,
+                    main.ONOS1.get_json(main.params['CTRL']['ip'+str(n)]+":"+ \
+                        main.params['CTRL']['restPort'+str(n)]+main.params['TopoRest']))
+            if result == main.TRUE:
+                main.log.report("ONOS"+str(n) + " Topology matches MN Topology")
+            utilities.assert_equals(expect=main.TRUE,actual=result,
+                    onpass="ONOS" + str(n) + " Topology matches MN Topology",
+                    onfail="ONOS" + str(n) + " Topology does not match MN Topology")
+            Topology_Check = Topology_Check and result
+        utilities.assert_equals(expect=main.TRUE,actual=Topology_Check,
+                onpass="Topology checks passed", onfail="Topology checks failed")
+        '''
+
+
diff --git a/TestON/tests/prevFuncNext/FuncNext.topo b/TestON/tests/prevFuncNext/FuncNext.topo
new file mode 100755
index 0000000..5d453a6
--- /dev/null
+++ b/TestON/tests/prevFuncNext/FuncNext.topo
@@ -0,0 +1,61 @@
+<TOPOLOGY>
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>10.128.10.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOSbench>
+
+        <ONOS1>
+            <host>10.128.10.11</host>
+            <user>sdn</user>
+            <password>sdn</password>
+            <type>OnosDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1>
+
+        <ONOS2>
+            <host>10.128.10.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2>
+
+        <Mininet1>
+            <host>10.128.10.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>MininetCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS>
+                #Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
+                <arg2> --topo mytopo </arg2>
+                <arg3> --switch ovs,protocols=OpenFlow10 </arg3>
+                <controller> remote </controller>
+            </COMPONENTS>
+        </Mininet1>
+
+        <Mininet2>
+            <host>10.128.10.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>RemoteMininetDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS>
+                #Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
+                <arg2> --topo mytopo </arg2>
+                <arg3> --switch ovs,protocols=OpenFlow10 </arg3>
+                <controller> remote </controller>
+            </COMPONENTS>
+        </Mininet2>
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/prevFuncNext/__init__.py b/TestON/tests/prevFuncNext/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/prevFuncNext/__init__.py
