diff --git a/TestON/tests/CHOtest/CHOtest.params b/TestON/tests/CHOtest/CHOtest.params
new file mode 100644
index 0000000..31b4e08
--- /dev/null
+++ b/TestON/tests/CHOtest/CHOtest.params
@@ -0,0 +1,87 @@
+<PARAMS>
+    # 1,20,3,[40,5,60,70,80,10,90,71,81,10,93,10]*50,21,3,[41,5,61,72,82,10,91,73,83,10,94,10]*50,22,3,[42,5,62,10,92,10,95,10,98,10]*50
+    # 1. Starts ONOS cluster with 5 nodes
+    # 20. Starts Att Topology
+    # 21. Starts Chordal Topology
+    # 22. Starts Spine-Leaf Topology
+    # 3. Checks the consistency of ONOS and Mininet's topologies
+    # 4X. Reactive forwarding | host discovery
+    # 5. ONOS Topology verification
+    # 6X. host intents
+    # 7X. Bring random links down( Unique for each topology)
+    # 8X. Bring random links back up
+    # 9X Point,Multi-single,Single-Multi Intents
+
+    <testcases>1,20,3,[40,5,60,70,80,10,90,71,81,10]*50,21,3,[41,5,61,72,82,10,91,73,83,10]*50,22,3,[42,5,62,74,84,10,92,10]*50</testcases>
+
+    <GIT>
+        #autoPull 'on' or 'off'
+        <autoPull>on</autoPull>
+        <branch>master</branch>
+    </GIT>
+
+    <CTRL>
+        <numCtrl>3</numCtrl>
+        <karafCliTimeout>3600000</karafCliTimeout>
+    </CTRL>
+
+    <TOPO1>
+        <topo>~/mininet/custom/topoAtt.py</topo>
+        <numSwitches>25</numSwitches>
+        <numHosts>25</numHosts>
+        <numLinks>114</numLinks>
+        <numPaths>1</numPaths>
+    </TOPO1>
+
+    <TOPO2>
+        <topo>~/mininet/custom/topoChordal.py</topo>
+        <numSwitches>25</numSwitches>
+        <numHosts>25</numHosts>
+        <numLinks>600</numLinks>
+        <numPaths>1</numPaths>
+    </TOPO2>
+
+    <TOPO3>
+        <topo>~/mininet/custom/topoSpine.py</topo>
+        <numSwitches>78</numSwitches>
+        <numHosts>68</numHosts>
+        <numLinks>284</numLinks>
+        <numPaths>1</numPaths>
+    </TOPO3>
+
+    <HOSTS>
+        <startMAC>00:00:00:00:00:01</startMAC>
+        <endMAC>00:00:00:00:00:19</endMAC>
+    </HOSTS>
+
+    <ATTCORELINKS>
+        <toggleLinks>1</toggleLinks>
+
+        <linkS3a>s3</linkS3a>
+        <linkS3b>s1,s4,s7,s10,s16,s17,s18,s21,s22</linkS3b>
+        #######s1,s4,s7,s10,s16,s17,s18,s21,s22########
+
+        <linkS14a>s14</linkS14a>
+        <linkS14b>s6,s9,s10,s11,s12,s13,s16,s17,s23</linkS14b>
+        ########s6,s9,s10,s11,s12,s13,s16,s17,s18,s23########
+
+        <linkS18a>s18</linkS18a>
+        <linkS18b>s14,s16,s17,s19,s20,s21,s22,s23</linkS18b>
+        #######s3,s14,s16,s17,s19,s20,s21,s22,s23########
+    </ATTCORELINKS>
+
+    <SPINECORELINKS>
+        <linkS9>s9</linkS9>
+        <linkS9top>s1,s3,s5,s7</linkS9top>
+        <linkS9bot>s11,s12</linkS9bot>
+        <linkS10>s10</linkS10>
+        <linkS10top>s2,s4,s6,s8</linkS10top>
+        <linkS10bot>s13,s14</linkS10bot>
+    </SPINECORELINKS>
+
+    <timers>
+        <LinkDiscovery>10</LinkDiscovery>
+        <SwitchDiscovery>10</SwitchDiscovery>
+    </timers>
+
+</PARAMS>
\ No newline at end of file
diff --git a/TestON/tests/CHOtest/CHOtest.py b/TestON/tests/CHOtest/CHOtest.py
new file mode 100644
index 0000000..20daf09
--- /dev/null
+++ b/TestON/tests/CHOtest/CHOtest.py
@@ -0,0 +1,2318 @@
+import sys
+import os
+import re
+import time
+import json
+import itertools
+
+
+class CHOtest:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):
+        """
+        Startup sequence:
+        apply cell <name>
+        git pull
+        mvn clean install
+        onos-package
+        onos-verify-cell
+        onos-uninstall
+        onos-install
+        onos-start-cli
+        """
+        import time
+
+        global intentState
+        main.threadID = 0
+        main.pingTimeout = 300
+        main.numCtrls = main.params[ 'CTRL' ][ 'numCtrl' ]
+        git_pull = main.params[ 'GIT' ][ 'autoPull' ]
+        git_branch = main.params[ 'GIT' ][ 'branch' ]
+        karafTimeout = main.params['CTRL']['karafCliTimeout']
+        main.newTopo = ""
+        main.CLIs = []
+        main.onosIPs = []
+
+        for i in range( 1, int(main.numCtrls) + 1 ):
+            main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+
+        main.case( "Set up test environment" )
+        main.log.report( "Set up test environment" )
+        main.log.report( "_______________________" )
+
+        main.step( "Apply Cell environment for ONOS" )
+        if ( main.onoscell ):
+            cellName = main.onoscell
+            cell_result = main.ONOSbench.setCell( cellName )
+            onosNodes = main.ONOSbench.getOnosIPfromCell()
+            main.onosIPs = onosNodes
+            utilities.assert_equals( expect=main.TRUE, actual=cell_result,
+                                 onpass="Test step PASS",
+                                 onfail="Test step FAIL" )
+        else:
+            main.log.error( "Please provide onoscell option at TestON CLI to run CHO tests" )
+            main.log.error( "Example: ~/TestON/bin/cli.py run OnosCHO onoscell <cellName>" )
+            main.clean()
+            main.exit()
+
+        main.step( "Git checkout and pull " + git_branch )
+        if git_pull == 'on':
+            checkout_result = main.ONOSbench.gitCheckout( git_branch )
+            pull_result = main.ONOSbench.gitPull()
+            cp_result = ( checkout_result and pull_result )
+        else:
+            checkout_result = main.TRUE
+            pull_result = main.TRUE
+            main.log.info( "Skipped git checkout and pull" )
+            cp_result = ( checkout_result and pull_result )
+        utilities.assert_equals( expect=main.TRUE, actual=cp_result,
+                                 onpass="Test step PASS",
+                                 onfail="Test step FAIL" )
+
+        main.step( "mvn clean & install" )
+        if git_pull == 'on':
+            mvn_result = main.ONOSbench.cleanInstall()
+            utilities.assert_equals( expect=main.TRUE, actual=mvn_result,
+                                 onpass="Test step PASS",
+                                 onfail="Test step FAIL" )
+        else:
+            mvn_result = main.TRUE
+            main.log.info("Skipped mvn clean install as git pull is disabled in params file")
+
+        main.ONOSbench.getVersion( report=True )
+
+        main.step( "Create ONOS package" )
+        packageResult = main.ONOSbench.onosPackage()
+        utilities.assert_equals( expect=main.TRUE, actual=packageResult,
+                                 onpass="Test step PASS",
+                                 onfail="Test step FAIL" )
+
+        main.step( "Uninstall ONOS package on all Nodes" )
+        uninstallResult = main.TRUE
+        for i in range( int( main.numCtrls ) ):
+            main.log.info( "Uninstalling package on ONOS Node IP: " + main.onosIPs[i] )
+            u_result = main.ONOSbench.onosUninstall( main.onosIPs[i] )
+            utilities.assert_equals( expect=main.TRUE, actual=u_result,
+                                     onpass="Test step PASS",
+                                     onfail="Test step FAIL" )
+            uninstallResult = ( uninstallResult and u_result )
+
+        main.step( "Install ONOS package on all Nodes" )
+        installResult = main.TRUE
+        for i in range( int( main.numCtrls ) ):
+            main.log.info( "Intsalling package on ONOS Node IP: " + main.onosIPs[i] )
+            i_result = main.ONOSbench.onosInstall( node=main.onosIPs[i] )
+            utilities.assert_equals( expect=main.TRUE, actual=i_result,
+                                     onpass="Test step PASS",
+                                     onfail="Test step FAIL" )
+            installResult = ( installResult and i_result )
+
+        main.step( "Verify ONOS nodes UP status" )
+        statusResult = main.TRUE
+        for i in range( int( main.numCtrls ) ):
+            main.log.info( "ONOS Node " + main.onosIPs[i] + " status:" )
+            onos_status = main.ONOSbench.onosStatus( node=main.onosIPs[i] )
+            utilities.assert_equals( expect=main.TRUE, actual=onos_status,
+                                     onpass="Test step PASS",
+                                     onfail="Test step FAIL" )
+            statusResult = ( statusResult and onos_status )
+        
+        main.step( "Start ONOS CLI on all nodes" )
+        cliResult = main.TRUE
+        main.log.step(" Start ONOS cli using thread ")
+        startCliResult  = main.TRUE
+        pool = []
+        time1 = time.time()
+        for i in range( int( main.numCtrls) ):
+            t = main.Thread( target=main.CLIs[i].startOnosCli,
+                             threadID=main.threadID,
+                             name="startOnosCli",
+                             args=[ main.onosIPs[i], karafTimeout ] )
+            pool.append(t)
+            t.start()
+            main.threadID = main.threadID + 1
+        for t in pool:
+            t.join()
+            startCliResult = startCliResult and t.result
+        time2 = time.time()
+        
+        if not startCliResult:
+                main.log.info("ONOS CLI did not start up properly")
+                main.cleanup()
+                main.exit()
+        else:
+            main.log.info("Successful CLI startup")
+            startCliResult = main.TRUE
+        case1Result = installResult and uninstallResult and statusResult and startCliResult
+        time.sleep(30)
+        main.log.info("Time for connecting to CLI: %2f seconds" %(time2-time1))
+        utilities.assert_equals( expect=main.TRUE, actual=case1Result,
+                                 onpass="Set up test environment PASS",
+                                 onfail="Set up test environment FAIL" )
+
+    def CASE20( self, main ):
+        """
+        This test script Loads a new Topology (Att) on CHO setup and balances all switches
+        """
+        import re
+        import time
+        import copy
+
+        main.numMNswitches = int ( main.params[ 'TOPO1' ][ 'numSwitches' ] )
+        main.numMNlinks = int ( main.params[ 'TOPO1' ][ 'numLinks' ] )
+        main.numMNhosts = int ( main.params[ 'TOPO1' ][ 'numHosts' ] )
+        main.pingTimeout = 300
+        main.log.report(
+            "Load Att topology and Balance all Mininet switches across controllers" )
+        main.log.report(
+            "________________________________________________________________________" )
+        main.case(
+            "Assign and Balance all Mininet switches across controllers" )
+        
+        main.step( "Stop any previous Mininet network topology" )
+        cliResult = main.TRUE
+        if main.newTopo == main.params['TOPO3']['topo']:
+            stopStatus = main.Mininet1.stopNet( fileName = "topoSpine" )
+
+        main.step( "Start Mininet with Att topology" )
+        main.newTopo = main.params['TOPO1']['topo']
+        startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
+        
+        main.step( "Assign switches to controllers" )
+        for i in range( 1, ( main.numMNswitches + 1 ) ):  # 1 to ( num of switches +1 )
+            main.Mininet1.assignSwController(
+                sw="s" + str( i ),
+                ip=main.onosIPs )
+
+        switch_mastership = main.TRUE
+        for i in range( 1, ( main.numMNswitches + 1 ) ):
+            response = main.Mininet1.getSwController( "s" + str( i ) )
+            print( "Response is " + str( response ) )
+            if re.search( "tcp:" + main.onosIPs[0], response ):
+                switch_mastership = switch_mastership and main.TRUE
+            else:
+                switch_mastership = main.FALSE
+
+        if switch_mastership == main.TRUE:
+            main.log.report( "Controller assignment successfull" )
+        else:
+            main.log.report( "Controller assignment failed" )
+
+        time.sleep(30) # waiting here to make sure topology converges across all nodes
+
+        main.step( "Balance devices across controllers" )
+        balanceResult = main.ONOScli1.balanceMasters()
+		# giving some breathing time for ONOS to complete re-balance
+        time.sleep( 5 )
+
+        topology_output = main.ONOScli1.topology()
+        topology_result = main.ONOSbench.getTopology( topology_output )
+        case2Result = ( switch_mastership and startStatus )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case2Result,
+            onpass="Starting new Att topology test PASS",
+            onfail="Starting new Att topology test FAIL" )
+
+    def CASE21( self, main ):
+        """
+        This test script Loads a new Topology (Chordal) on CHO setup and balances all switches
+        """
+        import re
+        import time
+        import copy
+
+        main.newTopo = main.params['TOPO2']['topo']
+        main.numMNswitches = int ( main.params[ 'TOPO2' ][ 'numSwitches' ] )
+        main.numMNlinks = int ( main.params[ 'TOPO2' ][ 'numLinks' ] )
+        main.numMNhosts = int ( main.params[ 'TOPO2' ][ 'numHosts' ] )
+        main.pingTimeout = 300
+        main.log.report(
+            "Load Chordal topology and Balance all Mininet switches across controllers" )
+        main.log.report(
+            "________________________________________________________________________" )
+        main.case(
+            "Assign and Balance all Mininet switches across controllers" )
+
+        main.step( "Stop any previous Mininet network topology" )
+        stopStatus = main.Mininet1.stopNet(fileName = "topoAtt" )
+
+        main.step( "Start Mininet with Chordal topology" )
+        startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
+
+        main.step( "Assign switches to controllers" )
+
+        for i in range( 1, ( main.numMNswitches + 1 ) ):  # 1 to ( num of switches +1 )
+            main.Mininet1.assignSwController(
+                sw="s" + str( i ),
+                ip=main.onosIPs )
+
+        switch_mastership = main.TRUE
+        for i in range( 1, ( main.numMNswitches + 1 ) ):
+            response = main.Mininet1.getSwController( "s" + str( i ) )
+            print( "Response is " + str( response ) )
+            if re.search( "tcp:" + main.onosIPs[0], response ):
+                switch_mastership = switch_mastership and main.TRUE
+            else:
+                switch_mastership = main.FALSE
+
+        if switch_mastership == main.TRUE:
+            main.log.report( "Controller assignment successfull" )
+        else:
+            main.log.report( "Controller assignment failed" )
+        
+        main.step( "Balance devices across controllers" )
+        balanceResult = main.ONOScli1.balanceMasters()
+		# giving some breathing time for ONOS to complete re-balance
+        time.sleep( 5 )
+
+        case21Result = switch_mastership
+        time.sleep(30)
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case21Result,
+            onpass="Starting new Chordal topology test PASS",
+            onfail="Starting new Chordal topology test FAIL" )
+        
+    def CASE22( self, main ):
+        """
+        This test script Loads a new Topology (Spine) on CHO setup and balances all switches
+        """
+        import re
+        import time
+        import copy
+
+        main.newTopo = main.params['TOPO3']['topo']
+        main.numMNswitches = int ( main.params[ 'TOPO3' ][ 'numSwitches' ] )
+        main.numMNlinks = int ( main.params[ 'TOPO3' ][ 'numLinks' ] )
+        main.numMNhosts = int ( main.params[ 'TOPO3' ][ 'numHosts' ] )
+        main.pingTimeout = 600
+        
+        main.log.report(
+            "Load Spine and Leaf topology and Balance all Mininet switches across controllers" )
+        main.log.report(
+            "________________________________________________________________________" )
+        main.case(
+            "Assign and Balance all Mininet switches across controllers" )
+        main.step( "Stop any previous Mininet network topology" )
+        stopStatus = main.Mininet1.stopNet(fileName = "topoChordal" )
+        main.step( "Start Mininet with Spine topology" )
+        startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
+        time.sleep(60)
+        main.step( "Assign switches to controllers" )
+
+        for i in range( 1, ( main.numMNswitches + 1 ) ):  # 1 to ( num of switches +1 )
+            main.Mininet1.assignSwController(
+                sw="s" + str( i ),
+                ip=main.onosIPs )
+
+        switch_mastership = main.TRUE
+        for i in range( 1, ( main.numMNswitches + 1 ) ):
+            response = main.Mininet1.getSwController( "s" + str( i ) )
+            print( "Response is " + str( response ) )
+            if re.search( "tcp:" + main.onosIPs[0], response ):
+                switch_mastership = switch_mastership and main.TRUE
+            else:
+                switch_mastership = main.FALSE
+        
+        if switch_mastership == main.TRUE:
+            main.log.report( "Controller assignment successfull" )
+        else:
+            main.log.report( "Controller assignment failed" )
+        time.sleep( 5 )
+
+        main.step( "Balance devices across controllers" )
+        for i in range( int( main.numCtrls ) ):
+            balanceResult = main.ONOScli1.balanceMasters()
+            # giving some breathing time for ONOS to complete re-balance
+            time.sleep( 3 )
+
+        case22Result = switch_mastership
+        time.sleep(60)
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case22Result,
+            onpass="Starting new Spine topology test PASS",
+            onfail="Starting new Spine topology test FAIL" )
+
+    def CASE3( self, main ):
+        """
+        This Test case will be extended to collect and store more data related
+        ONOS state.
+        """
+        import re
+        import copy
+        main.deviceDPIDs = []
+        main.hostMACs = []
+        main.deviceLinks = []
+        main.deviceActiveLinksCount = []
+        main.devicePortsEnabledCount = []
+        
+        main.log.report(
+            "Collect and Store topology details from ONOS before running any Tests" )
+        main.log.report(
+            "____________________________________________________________________" )
+        main.case( "Collect and Store Topology Details from ONOS" )
+        main.step( "Collect and store current number of switches and links" )
+        topology_output = main.ONOScli1.topology()
+        topology_result = main.ONOSbench.getTopology( topology_output )
+        numOnosDevices = topology_result[ 'devices' ]
+        numOnosLinks = topology_result[ 'links' ]
+        topoResult = main.TRUE
+
+        if ( ( main.numMNswitches == int(numOnosDevices) ) and ( main.numMNlinks == int(numOnosLinks) ) ):
+            main.step( "Store Device DPIDs" )
+            for i in range( 1, (main.numMNswitches+1) ):
+                main.deviceDPIDs.append( "of:00000000000000" + format( i, '02x' ) )
+            print "Device DPIDs in Store: \n", str( main.deviceDPIDs )
+
+            main.step( "Store Host MACs" )
+            for i in range( 1, ( main.numMNhosts + 1 ) ):
+                main.hostMACs.append( "00:00:00:00:00:" + format( i, '02x' ) + "/-1" )
+            print "Host MACs in Store: \n", str( main.hostMACs )
+            main.MACsDict = {}
+            print "Creating dictionary of DPID and HostMacs"
+            for i in range(len(main.hostMACs)):
+                main.MACsDict[main.deviceDPIDs[i]] = main.hostMACs[i].split('/')[0]
+            print main.MACsDict
+            main.step( "Collect and store all Devices Links" )
+            linksResult = main.ONOScli1.links( jsonFormat=False )
+            ansi_escape = re.compile( r'\x1b[^m]*m' )
+            linksResult = ansi_escape.sub( '', linksResult )
+            linksResult = linksResult.replace( " links", "" ).replace( "\r\r", "" )
+            linksResult = linksResult.splitlines()
+            main.deviceLinks = copy.copy( linksResult )
+            print "Device Links Stored: \n", str( main.deviceLinks )
+            # this will be asserted to check with the params provided count of
+            # links
+            print "Length of Links Store", len( main.deviceLinks )
+
+            main.step( "Collect and store each Device ports enabled Count" )
+            time1 = time.time()
+            for i in xrange(1,(main.numMNswitches + 1), int( main.numCtrls ) ):
+                pool = []
+                for cli in main.CLIs:
+                    if i >=  main.numMNswitches + 1:
+                        break
+                    dpid = "of:00000000000000" + format( i,'02x' )
+                    t = main.Thread(target = cli.getDevicePortsEnabledCount,threadID = main.threadID, name = "getDevicePortsEnabledCount",args = [dpid])
+                    t.start()
+                    pool.append(t)
+                    i = i + 1
+                    main.threadID = main.threadID + 1
+                for thread in pool:
+                    thread.join()
+                    portResult = thread.result
+                    main.devicePortsEnabledCount.append( portResult )
+            print "Device Enabled Port Counts Stored: \n", str( main.devicePortsEnabledCount )
+            time2 = time.time()
+            main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1))
+
+            main.step( "Collect and store each Device active links Count" )
+            time1 = time.time()
+            
+            for i in xrange( 1,( main.numMNswitches + 1 ), int( main.numCtrls) ):
+                pool = []
+                for cli in main.CLIs:
+                    if i >=  main.numMNswitches + 1:
+                        break
+                    dpid = "of:00000000000000" + format( i,'02x' )
+                    t = main.Thread( target = cli.getDeviceLinksActiveCount,
+                                     threadID = main.threadID,
+                                     name = "getDevicePortsEnabledCount",
+                                     args = [dpid])
+                    t.start()
+                    pool.append(t)
+                    i = i + 1
+                    main.threadID = main.threadID + 1
+                for thread in pool:
+                    thread.join()
+                    linkCountResult = thread.result
+                    main.deviceActiveLinksCount.append( linkCountResult )
+            print "Device Active Links Count Stored: \n", str( main.deviceActiveLinksCount )
+            time2 = time.time()
+            main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1))
+
+        else:
+            main.log.info("Devices (expected): %s, Links (expected): %s" % 
+                    ( str( main.numMNswitches ), str( main.numMNlinks ) ) )
+            main.log.info("Devices (actual): %s, Links (actual): %s" %
+                    ( numOnosDevices , numOnosLinks ) )
+            main.log.info("Topology does not match, exiting CHO test...")
+            topoResult = main.FALSE
+            # It's better exit here from running the test            
+            main.cleanup()
+            main.exit()
+
+        # just returning TRUE for now as this one just collects data
+        case3Result = topoResult
+        utilities.assert_equals( expect=main.TRUE, actual=case3Result,
+                                 onpass="Saving ONOS topology data test PASS",
+                                 onfail="Saving ONOS topology data test FAIL" )
+
+    def CASE40( self, main ):
+        """
+        Verify Reactive forwarding (Att Topology)
+        """
+        import re
+        import copy
+        import time
+        main.log.report( "Verify Reactive forwarding (Att Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding and Verify ping all" )
+        main.step( "Enable Reactive forwarding" )
+        installResult = main.TRUE
+        # Activate fwd app
+        appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+        appCheck = main.TRUE
+        pool = []
+        for cli in main.CLIs:
+            t = main.Thread( target=cli.appToIDCheck,
+                             name="appToIDCheck-" + str( i ),
+                             args=[] )
+            pool.append( t )
+            t.start()
+        for t in pool:
+            t.join()
+            appCheck = appCheck and t.result
+        utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+                                 onpass="App Ids seem to be correct",
+                                 onfail="Something is wrong with app Ids" )
+        if appCheck != main.TRUE:
+            main.log.warn( main.CLIs[0].apps() )
+            main.log.warn( main.CLIs[0].appIDs() )
+ 
+        time.sleep( 10 )
+
+        main.step( "Verify Pingall" )
+        ping_result = main.FALSE
+        time1 = time.time()
+        ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if ping_result == main.TRUE:
+            main.log.report( "Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "Pingall Test in Reactive mode failed" )
+
+        main.step( "Disable Reactive forwarding" )
+       
+        main.log.info( "Uninstall reactive forwarding app" )
+        appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        pool = []
+        for cli in main.CLIs:
+            t = main.Thread( target=cli.appToIDCheck,
+                             name="appToIDCheck-" + str( i ),
+                             args=[] )
+            pool.append( t )
+            t.start()
+
+        for t in pool:
+            t.join()
+            appCheck = appCheck and t.result
+        utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+                                 onpass="App Ids seem to be correct",
+                                 onfail="Something is wrong with app Ids" )
+        if appCheck != main.TRUE:
+            main.log.warn( main.CLIs[0].apps() )
+            main.log.warn( main.CLIs[0].appIDs() )
+
+        # Waiting for reative flows to be cleared.
+        time.sleep( 30 )
+        case40Result =  installResult and uninstallResult and ping_result
+        utilities.assert_equals( expect=main.TRUE, actual=case40Result,
+                                 onpass="Reactive Mode Pingall test PASS",
+                                 onfail="Reactive Mode Pingall test FAIL" )
+
+    def CASE41( self, main ):
+        """
+        Verify Reactive forwarding (Chordal Topology)
+        """
+        import re
+        import copy
+        import time
+        main.log.report( "Verify Reactive forwarding (Chordal Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding and Verify ping all" )
+        main.step( "Enable Reactive forwarding" )
+        installResult = main.TRUE
+        # Activate fwd app
+        appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+
+        appCheck = main.TRUE
+        pool = []
+        for cli in main.CLIs:
+            t = main.Thread( target=cli.appToIDCheck,
+                             name="appToIDCheck-" + str( i ),
+                             args=[] )
+            pool.append( t )
+            t.start()
+        for t in pool:
+            t.join()
+            appCheck = appCheck and t.result
+        utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+                                 onpass="App Ids seem to be correct",
+                                 onfail="Something is wrong with app Ids" )
+        if appCheck != main.TRUE:
+            main.log.warn( main.CLIs[0].apps() )
+            main.log.warn( main.CLIs[0].appIDs() )
+ 
+        time.sleep( 10 )
+
+        main.step( "Verify Pingall" )
+        ping_result = main.FALSE
+        time1 = time.time()
+        ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if ping_result == main.TRUE:
+            main.log.report( "Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "Pingall Test in Reactive mode failed" )
+
+        main.step( "Disable Reactive forwarding" )
+       
+        main.log.info( "Uninstall reactive forwarding app" )
+        appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        pool = []
+        for cli in main.CLIs:
+            t = main.Thread( target=cli.appToIDCheck,
+                             name="appToIDCheck-" + str( i ),
+                             args=[] )
+            pool.append( t )
+            t.start()
+
+        for t in pool:
+            t.join()
+            appCheck = appCheck and t.result
+        utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+                                 onpass="App Ids seem to be correct",
+                                 onfail="Something is wrong with app Ids" )
+        if appCheck != main.TRUE:
+            main.log.warn( main.CLIs[0].apps() )
+            main.log.warn( main.CLIs[0].appIDs() )
+
+        # Waiting for reative flows to be cleared.
+        time.sleep( 30 )
+        case41Result =  installResult and uninstallResult and ping_result
+        utilities.assert_equals( expect=main.TRUE, actual=case41Result,
+                                 onpass="Reactive Mode Pingall test PASS",
+                                 onfail="Reactive Mode Pingall test FAIL" )
+
+    def CASE42( self, main ):
+        """
+        Verify Reactive forwarding (Spine Topology)
+        """
+        import re
+        import copy
+        import time
+        main.log.report( "Verify Reactive forwarding (Spine Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding and Verify ping all" )
+        main.step( "Enable Reactive forwarding" )
+        installResult = main.TRUE
+        # Activate fwd app
+        appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+
+        appCheck = main.TRUE
+        pool = []
+        for cli in main.CLIs:
+            t = main.Thread( target=cli.appToIDCheck,
+                             name="appToIDCheck-" + str( i ),
+                             args=[] )
+            pool.append( t )
+            t.start()
+        for t in pool:
+            t.join()
+            appCheck = appCheck and t.result
+        utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+                                 onpass="App Ids seem to be correct",
+                                 onfail="Something is wrong with app Ids" )
+        if appCheck != main.TRUE:
+            main.log.warn( main.CLIs[0].apps() )
+            main.log.warn( main.CLIs[0].appIDs() )
+ 
+        time.sleep( 10 )
+
+        main.step( "Verify Pingall" )
+        ping_result = main.FALSE
+        time1 = time.time()
+        ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if ping_result == main.TRUE:
+            main.log.report( "Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "Pingall Test in Reactive mode failed" )
+
+        main.step( "Disable Reactive forwarding" )
+       
+        main.log.info( "Uninstall reactive forwarding app" )
+        appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        pool = []
+        for cli in main.CLIs:
+            t = main.Thread( target=cli.appToIDCheck,
+                             name="appToIDCheck-" + str( i ),
+                             args=[] )
+            pool.append( t )
+            t.start()
+
+        for t in pool:
+            t.join()
+            appCheck = appCheck and t.result
+        utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+                                 onpass="App Ids seem to be correct",
+                                 onfail="Something is wrong with app Ids" )
+        if appCheck != main.TRUE:
+            main.log.warn( main.CLIs[0].apps() )
+            main.log.warn( main.CLIs[0].appIDs() )
+
+        # Waiting for reative flows to be cleared.
+        time.sleep( 30 )
+        case42Result =  installResult and uninstallResult and ping_result
+        utilities.assert_equals( expect=main.TRUE, actual=case42Result,
+                                 onpass="Reactive Mode Pingall test PASS",
+                                 onfail="Reactive Mode Pingall test FAIL" )
+
+    def CASE5( self, main ):
+        """
+        Compare current ONOS topology with reference data
+        """
+        import re
+        
+        devicesDPIDTemp = []
+        hostMACsTemp = []
+        deviceLinksTemp = []
+        deviceActiveLinksCountTemp = []
+        devicePortsEnabledCountTemp = []
+
+        main.log.report(
+            "Compare ONOS topology with reference data in Stores" )
+        main.log.report( "__________________________________________________" )
+        main.case( "Compare ONOS topology with reference data" )
+
+        main.step( "Compare current Device ports enabled with reference" )
+        time1 = time.time()
+        for i in xrange( 1,(main.numMNswitches + 1), int( main.numCtrls ) ):
+            pool = []
+            for cli in main.CLIs:
+                if i >=  main.numMNswitches + 1:
+                    break
+                dpid = "of:00000000000000" + format( i,'02x' )
+                t = main.Thread(target = cli.getDevicePortsEnabledCount,
+                        threadID = main.threadID,
+                        name = "getDevicePortsEnabledCount",
+                        args = [dpid])
+                t.start()
+                pool.append(t)
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                portResult = thread.result
+                #portTemp = re.split( r'\t+', portResult )
+                #portCount = portTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
+                devicePortsEnabledCountTemp.append( portResult )
+
+        time2 = time.time()
+        main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1))
+        main.log.info (
+            "Device Enabled ports EXPECTED: %s" % 
+	     str( main.devicePortsEnabledCount ) )
+        main.log.info (
+            "Device Enabled ports ACTUAL: %s" % 
+            str( devicePortsEnabledCountTemp ) )
+        
+        if ( cmp( main.devicePortsEnabledCount,
+                  devicePortsEnabledCountTemp ) == 0 ):
+            stepResult1 = main.TRUE
+        else:
+            stepResult1 = main.FALSE
+
+        main.step( "Compare Device active links with reference" )
+        time1 = time.time()
+        for i in xrange( 1, ( main.numMNswitches + 1) , int( main.numCtrls ) ):
+            pool = []
+            for cli in main.CLIs:
+                if i >=  main.numMNswitches + 1:
+                    break
+                dpid = "of:00000000000000" + format( i,'02x' )
+                t = main.Thread(target = cli.getDeviceLinksActiveCount,
+                        threadID = main.threadID,
+                        name = "getDeviceLinksActiveCount",
+                        args = [dpid])
+                t.start()
+                pool.append(t)
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                linkCountResult = thread.result
+                #linkCountTemp = re.split( r'\t+', linkCountResult )
+                #linkCount = linkCountTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
+                deviceActiveLinksCountTemp.append( linkCountResult )
+
+        time2 = time.time()
+        main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1))
+        main.log.info (
+            "Device Active links EXPECTED: %s" %
+              str( main.deviceActiveLinksCount ) )
+        main.log.info (
+            "Device Active links ACTUAL: %s" % str( deviceActiveLinksCountTemp ) )
+        if ( cmp( main.deviceActiveLinksCount, deviceActiveLinksCountTemp ) == 0 ):
+            stepResult2 = main.TRUE
+        else:
+            stepResult2 = main.FALSE
+
+        """
+        place holder for comparing devices, hosts, paths and intents if required.
+        Links and ports data would be incorrect with out devices anyways.
+        """
+        case5Result = ( stepResult1 and stepResult2 )
+        utilities.assert_equals( expect=main.TRUE, actual=case5Result,
+                                 onpass="Compare Topology test PASS",
+                                 onfail="Compare Topology test FAIL" )
+
+    def CASE60( self ):
+        """
+        Install 300 host intents and verify ping all (Att Topology)
+        """
+        main.log.report( "Add 300 host intents and verify pingall (Att Topology)" )
+        main.log.report( "_______________________________________" )
+        import itertools
+        import time
+        main.case( "Install 300 host intents" )
+        main.step( "Add host Intents" )
+        intentResult = main.TRUE
+        hostCombos = list( itertools.combinations( main.hostMACs, 2 ) ) 
+        
+        intentIdList = []
+        time1 = time.time()
+        for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
+            pool = []
+            for cli in main.CLIs:
+                if i >= len( hostCombos ):
+                    break
+                t = main.Thread( target=cli.addHostIntent,
+                        threadID=main.threadID,
+                        name="addHostIntent",
+                        args=[hostCombos[i][0],hostCombos[i][1]])
+                pool.append(t)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
+
+        intentResult = main.TRUE
+        intentsJson = main.ONOScli1.intents()
+        getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+                intentsJson = intentsJson)
+        print "len of intent ID", str(len(intentIdList))
+        print "len of intent state results", str(len(getIntentStateResult))
+        print getIntentStateResult
+        # Takes awhile for all the onos to get the intents
+        time.sleep( 30 )
+        """intentState = main.TRUE
+        for i in getIntentStateResult:
+            if getIntentStateResult.get( 'state' ) != 'INSTALLED':
+        """
+
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        case60Result = ( intentResult and pingResult )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case60Result,
+            onpass="Install 300 Host Intents and Ping All test PASS",
+            onfail="Install 300 Host Intents and Ping All test FAIL" )
+
+    def CASE61( self ):
+        """
+        Install 600 host intents and verify ping all for Chordal Topology
+        """
+        main.log.report( "Add 600 host intents and verify pingall (Chordal Topo)" )
+        main.log.report( "_______________________________________" )
+        import itertools
+        
+        main.case( "Install 600 host intents" )
+        main.step( "Add host Intents" )
+        intentResult = main.TRUE
+        hostCombos = list( itertools.combinations( main.hostMACs, 2 ) ) 
+        
+        intentIdList = []
+        time1 = time.time()
+        
+        for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
+            pool = []
+            for cli in main.CLIs:
+                if i >= len( hostCombos ):
+                    break
+                t = main.Thread( target=cli.addHostIntent,
+                        threadID=main.threadID,
+                        name="addHostIntent",
+                        args=[hostCombos[i][0],hostCombos[i][1]])
+                pool.append(t)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
+        intentResult = main.TRUE
+        intentsJson = main.ONOScli1.intents()
+        getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+                intentsJson = intentsJson)
+        print getIntentStateResult
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        case14Result = ( intentResult and pingResult )
+        
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case14Result,
+            onpass="Install 300 Host Intents and Ping All test PASS",
+            onfail="Install 300 Host Intents and Ping All test FAIL" )
+
+    def CASE62( self ):
+        """
+        Install 2278 host intents and verify ping all for Spine Topology
+        """
+        main.log.report( "Add 2278 host intents and verify pingall (Spine Topo)" )
+        main.log.report( "_______________________________________" )
+        import itertools
+        
+        main.case( "Install 2278 host intents" )
+        main.step( "Add host Intents" )
+        intentResult = main.TRUE
+        hostCombos = list( itertools.combinations( main.hostMACs, 2 ) ) 
+        main.pingTimeout = 300
+        intentIdList = []
+        time1 = time.time()
+        for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
+            pool = []
+            for cli in main.CLIs:
+                if i >= len( hostCombos ):
+                    break
+                t = main.Thread( target=cli.addHostIntent,
+                        threadID=main.threadID,
+                        name="addHostIntent",
+                        args=[hostCombos[i][0],hostCombos[i][1]])
+                pool.append(t)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
+        intentResult = main.TRUE
+        intentsJson = main.ONOScli1.intents()
+        getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+                intentsJson = intentsJson)
+        print getIntentStateResult
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        case15Result = ( intentResult and pingResult )
+        
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case15Result,
+            onpass="Install 2278 Host Intents and Ping All test PASS",
+            onfail="Install 2278 Host Intents and Ping All test FAIL" )
+
+    def CASE70( self, main ):
+        """
+        Randomly bring some core links down and verify ping all ( Host Intents-Att Topo)
+        """
+        import random
+        main.randomLink1 = []
+        main.randomLink2 = []
+        main.randomLink3 = []
+        link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+        link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' )
+        link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+        link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' )
+        link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
+        link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
+        switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+
+        main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Att Topo)" )
+        main.log.report( "___________________________________________________________________________" )
+        main.case( "Host intents - Randomly bring some core links down and verify ping all" )
+        main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" )
+        if ( int( switchLinksToToggle ) ==
+             0 or int( switchLinksToToggle ) > 5 ):
+            main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" )
+            #main.cleanup()
+            #main.exit()
+        else:
+            main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" )
+
+        main.step( "Cut links on Core devices using user provided range" )
+        main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) )
+        main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) )
+        main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) )
+        for i in range( int( switchLinksToToggle ) ):
+            main.Mininet1.link(
+                END1=link1End1,
+                END2=main.randomLink1[ i ],
+                OPTION="down" )
+            time.sleep( link_sleep )
+            main.Mininet1.link(
+                END1=link2End1,
+                END2=main.randomLink2[ i ],
+                OPTION="down" )
+            time.sleep( link_sleep )
+            main.Mininet1.link(
+                END1=link3End1,
+                END2=main.randomLink3[ i ],
+                OPTION="down" )
+            time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkDown = main.ONOSbench.checkStatus(
+            topology_output, main.numMNswitches, str(
+                int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkDown,
+            onpass="Link Down discovered properly",
+            onfail="Link down was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkDown = main.FALSE
+        time1 = time.time()
+        pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult70 = linkDown and pingResultLinkDown
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult70,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+    def CASE80( self, main ):
+        """
+        Bring the core links up that are down and verify ping all ( Host Intents-Att Topo )
+        """
+        import random
+        link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+        link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+        link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
+
+        main.log.report(
+            "Bring the core links up that are down and verify ping all (Host Intents-Att Topo" )
+        main.log.report(
+            "__________________________________________________________________" )
+        main.case(
+            "Host intents - Bring the core links up that are down and verify ping all" )
+        main.step( "Bring randomly cut links on Core devices up" )
+        for i in range( int( switchLinksToToggle ) ):
+            main.Mininet1.link(
+                END1=link1End1,
+                END2=main.randomLink1[ i ],
+                OPTION="up" )
+            time.sleep( link_sleep )
+            main.Mininet1.link(
+                END1=link2End1,
+                END2=main.randomLink2[ i ],
+                OPTION="up" )
+            time.sleep( link_sleep )
+            main.Mininet1.link(
+                END1=link3End1,
+                END2=main.randomLink3[ i ],
+                OPTION="up" )
+            time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkUp = main.ONOSbench.checkStatus(
+            topology_output,
+            main.numMNswitches,
+            str( main.numMNlinks ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkUp,
+            onpass="Link up discovered properly",
+            onfail="Link up was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkUp = main.FALSE
+        time1 = time.time()
+        pingResultLinkUp = main.Mininet1.pingall( timeout=main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult80 = linkUp and pingResultLinkUp
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult80,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+
+    def CASE71( self, main ):
+        """
+        Randomly bring some core links down and verify ping all ( Point Intents-Att Topo)
+        """
+        import random
+        main.randomLink1 = []
+        main.randomLink2 = []
+        main.randomLink3 = []
+        link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+        link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' )
+        link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+        link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' )
+        link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
+        link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
+        switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+
+        main.log.report( "Randomly bring some core links down and verify ping all (Point Intents-Att Topo)" )
+        main.log.report( "___________________________________________________________________________" )
+        main.case( "Point intents - Randomly bring some core links down and verify ping all" )
+        main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" )
+        if ( int( switchLinksToToggle ) ==
+             0 or int( switchLinksToToggle ) > 5 ):
+            main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" )
+            #main.cleanup()
+            #main.exit()
+        else:
+            main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" )
+
+        main.step( "Cut links on Core devices using user provided range" )
+        main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) )
+        main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) )
+        main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) )
+        for i in range( int( switchLinksToToggle ) ):
+            main.Mininet1.link(
+                END1=link1End1,
+                END2=main.randomLink1[ i ],
+                OPTION="down" )
+            time.sleep( link_sleep )
+            main.Mininet1.link(
+                END1=link2End1,
+                END2=main.randomLink2[ i ],
+                OPTION="down" )
+            time.sleep( link_sleep )
+            main.Mininet1.link(
+                END1=link3End1,
+                END2=main.randomLink3[ i ],
+                OPTION="down" )
+            time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkDown = main.ONOSbench.checkStatus(
+            topology_output, main.numMNswitches, str(
+                int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkDown,
+            onpass="Link Down discovered properly",
+            onfail="Link down was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkDown = main.FALSE
+        time1 = time.time()
+        pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult71 = linkDown and pingResultLinkDown
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult71,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+    def CASE81( self, main ):
+        """
+        Bring the core links up that are down and verify ping all ( Point Intents-Att Topo )
+        """
+        import random
+        link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+        link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+        link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
+
+        main.log.report(
+            "Bring the core links up that are down and verify ping all ( Point Intents-Att Topo" )
+        main.log.report(
+            "__________________________________________________________________" )
+        main.case(
+            "Point intents - Bring the core links up that are down and verify ping all" )
+        main.step( "Bring randomly cut links on Core devices up" )
+        for i in range( int( switchLinksToToggle ) ):
+            main.Mininet1.link(
+                END1=link1End1,
+                END2=main.randomLink1[ i ],
+                OPTION="up" )
+            time.sleep( link_sleep )
+            main.Mininet1.link(
+                END1=link2End1,
+                END2=main.randomLink2[ i ],
+                OPTION="up" )
+            time.sleep( link_sleep )
+            main.Mininet1.link(
+                END1=link3End1,
+                END2=main.randomLink3[ i ],
+                OPTION="up" )
+            time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkUp = main.ONOSbench.checkStatus(
+            topology_output,
+            main.numMNswitches,
+            str( main.numMNlinks ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkUp,
+            onpass="Link up discovered properly",
+            onfail="Link up was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkUp = main.FALSE
+        time1 = time.time()
+        pingResultLinkUp = main.Mininet1.pingall(timeout = main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult81 = linkUp and pingResultLinkUp
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult81,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+
+    def CASE72( self, main ):
+        """
+        Randomly bring some links down and verify ping all ( Host Intents-Chordal Topo)
+        """
+        import random
+        import itertools 
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        
+        main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Chordal Topo)" )
+        main.log.report( "___________________________________________________________________________" )
+        main.case( "Host intents - Randomly bring some core links down and verify ping all" )
+        switches = []
+        switchesComb = []
+        for i in range( main.numMNswitches ):
+            switches.append('s%d'%(i+1))
+        switchesLinksComb = list(itertools.combinations(switches,2))
+        main.randomLinks = random.sample(switchesLinksComb, 5 )
+        print main.randomLinks
+        main.step( "Cut links on random devices" )
+        
+        for switch in main.randomLinks:
+            main.Mininet1.link(
+                END1=switch[0],
+                END2=switch[1],
+                OPTION="down")
+            time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkDown = main.ONOSbench.checkStatus(
+            topology_output, main.numMNswitches, str(
+                int( main.numMNlinks ) - 5 * 2 ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkDown,
+            onpass="Link Down discovered properly",
+            onfail="Link down was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkDown = main.FALSE
+        time1 = time.time()
+        pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult71 = pingResultLinkDown
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult71,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+    def CASE82( self, main ):
+        """
+        Bring the core links up that are down and verify ping all ( Host Intents Chordal Topo )
+        """
+        import random
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+       
+        main.log.report(
+            "Bring the core links up that are down and verify ping all (Host Intents-Chordal Topo" )
+        main.log.report(
+            "__________________________________________________________________" )
+        main.case(
+            "Host intents - Bring the core links up that are down and verify ping all" )
+        main.step( "Bring randomly cut links on devices up" )
+        
+        for switch in main.randomLinks:
+            main.Mininet1.link(
+                END1=switch[0],
+                END2=switch[1],
+                OPTION="up")
+            time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkUp = main.ONOSbench.checkStatus(
+            topology_output,
+            main.numMNswitches,
+            str( main.numMNlinks ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkUp,
+            onpass="Link up discovered properly",
+            onfail="Link up was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkUp = main.FALSE
+        time1 = time.time()
+        pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult82 = linkUp and pingResultLinkUp
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult82,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+
+    def CASE73( self, main ):
+        """
+        Randomly bring some links down and verify ping all ( Point Intents-Chordal Topo)
+        """
+        import random
+        import itertools 
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        
+        main.log.report( "Randomly bring some core links down and verify ping all ( Point Intents-Chordal Topo)" )
+        main.log.report( "___________________________________________________________________________" )
+        main.case( "Point intents - Randomly bring some core links down and verify ping all" )
+        switches = []
+        switchesComb = []
+        for i in range( main.numMNswitches ):
+            switches.append('s%d'%(i+1))
+        switchesLinksComb = list(itertools.combinations(switches,2))
+        main.randomLinks = random.sample(switchesLinksComb, 5 )
+        print main.randomLinks
+        main.step( "Cut links on random devices" )
+        
+        for switch in main.randomLinks:
+            main.Mininet1.link(
+                END1=switch[0],
+                END2=switch[1],
+                OPTION="down")
+            time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkDown = main.ONOSbench.checkStatus(
+            topology_output, main.numMNswitches, str(
+                int( main.numMNlinks ) - 5 * 2 ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkDown,
+            onpass="Link Down discovered properly",
+            onfail="Link down was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkDown = main.FALSE
+        time1 = time.time()
+        pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult73 = pingResultLinkDown
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult73,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+    def CASE83( self, main ):
+        """
+        Bring the core links up that are down and verify ping all ( Point Intents Chordal Topo )
+        """
+        import random
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+       
+        main.log.report(
+            "Bring the core links up that are down and verify ping all ( Point Intents-Chordal Topo" )
+        main.log.report(
+            "__________________________________________________________________" )
+        main.case(
+            "Point intents - Bring the core links up that are down and verify ping all" )
+        main.step( "Bring randomly cut links on devices up" )
+        
+        for switch in main.randomLinks:
+            main.Mininet1.link(
+                END1=switch[0],
+                END2=switch[1],
+                OPTION="up")
+            time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkUp = main.ONOSbench.checkStatus(
+            topology_output,
+            main.numMNswitches,
+            str( main.numMNlinks ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkUp,
+            onpass="Link up discovered properly",
+            onfail="Link up was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkUp = main.FALSE
+        time1 = time.time()
+        pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult83 = linkUp and pingResultLinkUp
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult83,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+
+    def CASE74( self, main ):
+        """
+        Randomly bring some core links down and verify ping all ( Host Intents-Spine Topo)
+        """
+        import random
+        main.randomLink1 = []
+        main.randomLink2 = []
+        main.randomLink3 = []
+        main.randomLink4 = []
+        link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
+        link1End2top = main.params[ 'SPINECORELINKS' ][ 'linkS9top' ].split( ',' )
+        link1End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS9bot' ].split( ',' )
+        link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
+        link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' )
+        link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' )
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.pingTimeout = 400
+        
+        main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
+        main.log.report( "___________________________________________________________________________" )
+        
+        linkIndex = range(4)
+        linkIndexS9 = random.sample(linkIndex,1)[0]
+        linkIndex.remove(linkIndexS9)
+        linkIndexS10 = random.sample(linkIndex,1)[0]
+        main.randomLink1 = link1End2top[linkIndexS9]
+        main.randomLink2 = link2End2top[linkIndexS10]
+        main.randomLink3 = random.sample(link1End2bot,1)[0]
+        main.randomLink4 = random.sample(link2End2bot,1)[0]
+
+        # Work around for link state propagation delay. Added some sleep time.
+        # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" )
+        # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" )
+        main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" )
+        time.sleep( link_sleep )
+        main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
+        time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkDown = main.ONOSbench.checkStatus(
+            topology_output, main.numMNswitches, str(
+                int( main.numMNlinks ) - 8 ))
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkDown,
+            onpass="Link Down discovered properly",
+            onfail="Link down was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkDown = main.FALSE
+        time1 = time.time()
+        pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult74 = linkDown and pingResultLinkDown
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult74,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+    def CASE84( self, main ):
+        """
+        Bring the core links up that are down and verify ping all ( Host Intents-Spine Topo )
+        """
+        import random
+        link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
+        link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
+        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.log.report(
+            "Bring the core links up that are down and verify ping all (Host Intents-Spine Topo" )
+        main.log.report(
+            "__________________________________________________________________" )
+        main.case(
+            "Host intents - Bring the core links up that are down and verify ping all" )
+
+        # Work around for link state propagation delay. Added some sleep time.
+        # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" )
+        # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" )
+        main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" )
+        time.sleep( link_sleep )
+        main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
+        time.sleep( link_sleep )
+
+        topology_output = main.ONOScli1.topology()
+        linkUp = main.ONOSbench.checkStatus(
+            topology_output,
+            main.numMNswitches,
+            str( main.numMNlinks ) )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=linkUp,
+            onpass="Link up discovered properly",
+            onfail="Link up was not discovered in " +
+            str( link_sleep ) +
+            " seconds" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResultLinkUp = main.FALSE
+        time1 = time.time()
+        pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult84 = linkUp and pingResultLinkUp
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult84,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+    
+    def CASE90( self ):
+        """
+        Install 600 point intents and verify ping all (Att Topology)
+        """
+        main.log.report( "Add 600 point intents and verify pingall (Att Topology)" )
+        main.log.report( "_______________________________________" )
+        import itertools
+        import time
+        main.case( "Install 600 point intents" )
+        main.step( "Add point Intents" )
+        intentResult = main.TRUE
+        deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) ) 
+        
+        intentIdList = []
+        time1 = time.time()
+        for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
+            pool = []
+            for cli in main.CLIs:
+                if i >= len( deviceCombos ):
+                    break
+                t = main.Thread( target=cli.addPointIntent,
+                        threadID=main.threadID,
+                        name="addPointIntent",
+                        args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4",main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
+                pool.append(t)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+        intentResult = main.TRUE
+        intentsJson = main.ONOScli1.intents()
+        getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+                intentsJson = intentsJson)
+        print getIntentStateResult
+        # Takes awhile for all the onos to get the intents
+        time.sleep(60)
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING tALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        case90Result = ( intentResult and pingResult )
+        
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case90Result,
+            onpass="Install 600 point Intents and Ping All test PASS",
+            onfail="Install 600 point Intents and Ping All test FAIL" )
+
+    def CASE91( self ):
+        """
+        Install 600 point intents and verify ping all (Chordal Topology)
+        """
+        main.log.report( "Add 600 point intents and verify pingall (Chordal Topology)" )
+        main.log.report( "_______________________________________" )
+        import itertools
+        import time
+        main.case( "Install 600 point intents" )
+        main.step( "Add point Intents" )
+        intentResult = main.TRUE
+        deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) ) 
+        
+        intentIdList = []
+        time1 = time.time()
+        for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
+            pool = []
+            for cli in main.CLIs:
+                if i >= len( deviceCombos ):
+                    break
+                t = main.Thread( target=cli.addPointIntent,
+                        threadID=main.threadID,
+                        name="addPointIntent",
+                        args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4","",main.MACsDict.get(deviceCombos[i][1])])
+                pool.append(t)
+                #time.sleep(1)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info( "Time for adding point intents: %2f seconds" %(time2-time1) )
+        intentResult = main.TRUE
+        intentsJson = main.ONOScli1.intents()
+        getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+                intentsJson = intentsJson)
+        print getIntentStateResult
+        # Takes awhile for all the onos to get the intents
+        time.sleep(30)
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        case91Result = ( intentResult and pingResult )
+        
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case91Result,
+            onpass="Install 600 point Intents and Ping All test PASS",
+            onfail="Install 600 point Intents and Ping All test FAIL" )
+    
+    def CASE92( self ):
+        """
+        Install 4556 point intents and verify ping all (Spine Topology)
+        """
+        main.log.report( "Add 4556 point intents and verify pingall (Spine Topology)" )
+        main.log.report( "_______________________________________" )
+        import itertools
+        import time
+        main.case( "Install 4556 point intents" )
+        main.step( "Add point Intents" )
+        intentResult = main.TRUE
+        main.pingTimeout = 600
+        for i in range(len(main.hostMACs)):
+            main.MACsDict[main.deviceDPIDs[i+10]] = main.hostMACs[i].split('/')[0]
+        print main.MACsDict
+        deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) )
+        intentIdList = []
+        time1 = time.time()
+        for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
+            pool = []
+            for cli in main.CLIs:
+                if i >= len( deviceCombos ):
+                    break
+                t = main.Thread( target=cli.addPointIntent,
+                        threadID=main.threadID,
+                        name="addPointIntent",
+                        args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4","",main.MACsDict.get(deviceCombos[i][1])])
+                pool.append(t)
+                #time.sleep(1)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+        intentResult = main.TRUE
+        intentsJson = main.ONOScli1.intents()
+        getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+                intentsJson = intentsJson)
+        #print getIntentStateResult
+        # Takes awhile for all the onos to get the intents
+        time.sleep(60)
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        case92Result = ( intentResult and pingResult )
+        
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case92Result,
+            onpass="Install 4556 point Intents and Ping All test PASS",
+            onfail="Install 4556 point Intents and Ping All test FAIL" )
+     
+    def CASE93( self ):
+        """
+        Install multi-single point intents and verify Ping all works
+        for att topology
+        """
+        import copy
+        import time
+        main.log.report( "Install multi-single point intents and verify Ping all" )
+        main.log.report( "___________________________________________" )
+        main.case( "Install multi-single point intents and Ping all" )
+        deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+        portIngressList = ['1']*(len(deviceDPIDsCopy) - 1)
+        intentIdList = []
+        print "MACsDict", main.MACsDict
+        time1 = time.time()
+        for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+            pool = []
+            for cli in main.CLIs:
+                egressDevice = deviceDPIDsCopy[i]
+                ingressDeviceList = copy.copy(deviceDPIDsCopy)
+                ingressDeviceList.remove(egressDevice)
+                if i >= len( deviceDPIDsCopy ):
+                    break
+                t = main.Thread( target=cli.addMultipointToSinglepointIntent,
+                        threadID=main.threadID,
+                        name="addMultipointToSinglepointIntent",
+                        args =[ingressDeviceList,egressDevice,portIngressList,'1','IPV4','',main.MACsDict.get(egressDevice)])
+                pool.append(t)
+                #time.sleep(1)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+        time.sleep(30)
+        print "getting all intents ID"
+        intentIdTemp = main.ONOScli1.getAllIntentsId()
+        print intentIdTemp
+        print len(intentIdList)
+        print intentIdList
+        checkIntentStateResult = main.TRUE
+        print "Checking intents state"
+        checkIntentStateResult = main.ONOScli1.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
+        checkIntentStateResult = main.ONOScli2.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
+        checkIntentStateResult = main.ONOScli3.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
+        checkIntentStateResult = main.ONOScli4.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
+        checkIntentStateResult = main.ONOScli5.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
+        
+        if checkIntentStateResult:
+            main.log.info( "All intents are installed correctly " )
+
+        print "Checking flows state "
+        checkFlowsState = main.ONOScli1.checkFlowsState()
+        time.sleep(50)
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        checkFlowsState = main.ONOScli1.checkFlowsState()
+        case93Result = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case93Result,
+            onpass="Install 25 multi to single point Intents and Ping All test PASS",
+            onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
+        
+    def CASE94( self ):
+        """
+        Install multi-single point intents and verify Ping all works
+        for Chordal topology
+        """
+        import copy
+        import time
+        main.log.report( "Install multi-single point intents and verify Ping all" )
+        main.log.report( "___________________________________________" )
+        main.case( "Install multi-single point intents and Ping all" )
+        deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+        portIngressList = ['1']*(len(deviceDPIDsCopy) - 1)
+        intentIdList = []
+        print "MACsDict", main.MACsDict
+        time1 = time.time()
+        for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+            pool = []
+            for cli in main.CLIs:
+                egressDevice = deviceDPIDsCopy[i]
+                ingressDeviceList = copy.copy(deviceDPIDsCopy)
+                ingressDeviceList.remove(egressDevice)
+                if i >= len( deviceDPIDsCopy ):
+                    break
+                t = main.Thread( target=cli.addMultipointToSinglepointIntent,
+                        threadID=main.threadID,
+                        name="addMultipointToSinglepointIntent",
+                        args =[ingressDeviceList,egressDevice,portIngressList,'1','IPV4','',main.MACsDict.get(egressDevice)])
+                pool.append(t)
+                #time.sleep(1)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) 
+        time.sleep(5)
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        case94Result = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case94Result,
+            onpass="Install 25 multi to single point Intents and Ping All test PASS",
+            onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
+    
+    #def CASE95 multi-single point intent for Spine
+
+    def CASE96( self ):
+        """
+        Install single-multi point intents and verify Ping all works
+        for att topology
+        """
+        import copy
+        main.log.report( "Install single-multi point intents and verify Ping all" )
+        main.log.report( "___________________________________________" )
+        main.case( "Install single-multi point intents and Ping all" )
+        deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+        portEgressList = ['1']*(len(deviceDPIDsCopy) - 1)
+        intentIdList = []
+        print "MACsDict", main.MACsDict
+        time1 = time.time()
+        for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+            pool = []
+            for cli in main.CLIs:
+                ingressDevice = deviceDPIDsCopy[i]
+                egressDeviceList = copy.copy(deviceDPIDsCopy)
+                egressDeviceList.remove(ingressDevice)
+                if i >= len( deviceDPIDsCopy ):
+                    break
+                t = main.Thread( target=cli.addSinglepointToMultipointIntent,
+                        threadID=main.threadID,
+                        name="addSinglepointToMultipointIntent",
+                        args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',main.MACsDict.get(ingressDevice)])
+                pool.append(t)
+                #time.sleep(1)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) 
+        time.sleep(5)
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        case96Result = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case96Result,
+            onpass="Install 25 single to multi point Intents and Ping All test PASS",
+            onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
+
+    def CASE97( self ):
+        """
+        Install single-multi point intents and verify Ping all works
+        for Chordal topology
+        """
+        import copy
+        main.log.report( "Install single-multi point intents and verify Ping all" )
+        main.log.report( "___________________________________________" )
+        main.case( "Install single-multi point intents and Ping all" )
+        deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+        portEgressList = ['1']*(len(deviceDPIDsCopy) - 1)
+        intentIdList = []
+        print "MACsDict", main.MACsDict
+        time1 = time.time()
+        for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+            pool = []
+            for cli in main.CLIs:
+                ingressDevice = deviceDPIDsCopy[i]
+                egressDeviceList = copy.copy(deviceDPIDsCopy)
+                egressDeviceList.remove(ingressDevice)
+                if i >= len( deviceDPIDsCopy ):
+                    break
+                t = main.Thread( target=cli.addSinglepointToMultipointIntent,
+                        threadID=main.threadID,
+                        name="addSinglepointToMultipointIntent",
+                        args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',main.MACsDict.get(ingressDevice),''])
+                pool.append(t)
+                #time.sleep(1)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) 
+        time.sleep(5)
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        case97Result = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case97Result,
+            onpass="Install 25 single to multi point Intents and Ping All test PASS",
+            onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
+
+    def CASE98( self ):
+        """
+        Install single-multi point intents and verify Ping all works
+        for Spine topology
+        """
+        import copy
+        main.log.report( "Install single-multi point intents and verify Ping all" )
+        main.log.report( "___________________________________________" )
+        main.case( "Install single-multi point intents and Ping all" )
+        deviceDPIDsCopy = copy.copy( main.deviceDPIDs )
+        deviceDPIDsCopy = deviceDPIDsCopy[ 10: ]
+        portEgressList = [ '1' ]*(len(deviceDPIDsCopy) - 1)
+        intentIdList = []
+        MACsDictCopy = {}
+        for i in range( len( deviceDPIDsCopy ) ):
+            MACsDictCopy[ deviceDPIDsCopy[ i ] ] = main.hostMACs[i].split( '/' )[ 0 ]
+
+        print "deviceDPIDsCopy", deviceDPIDsCopy
+        print ""
+        print "MACsDictCopy", MACsDictCopy
+        time1 = time.time()
+        for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+            pool = []
+            for cli in main.CLIs:
+                if i >= len( deviceDPIDsCopy ):
+                    break
+                ingressDevice = deviceDPIDsCopy[i]
+                egressDeviceList = copy.copy(deviceDPIDsCopy)
+                egressDeviceList.remove(ingressDevice)
+                t = main.Thread( target=cli.addSinglepointToMultipointIntent,
+                        threadID=main.threadID,
+                        name="addSinglepointToMultipointIntent",
+                        args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',MACsDictCopy.get(ingressDevice),''])
+                pool.append(t)
+                #time.sleep(1)
+                t.start()
+                i = i + 1
+                main.threadID = main.threadID + 1
+            for thread in pool:
+                thread.join()
+                intentIdList.append(thread.result)
+        time2 = time.time()
+        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) 
+        time.sleep(5)
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        case98Result = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=case98Result,
+            onpass="Install 25 single to multi point Intents and Ping All test PASS",
+            onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
+
+    def CASE10( self ):
+        import time
+        """
+         Remove all Intents
+        """
+        main.log.report( "Remove all intents that were installed previously" )
+        main.log.report( "______________________________________________" )
+        main.log.info( "Remove all intents" )
+        main.case( "Removing intents" )
+        main.step( "Obtain the intent id's first" )
+        intentsList = main.ONOScli1.getAllIntentIds()
+        ansi_escape = re.compile( r'\x1b[^m]*m' )
+        intentsList = ansi_escape.sub( '', intentsList )
+        intentsList = intentsList.replace(
+            " onos:intents | grep id=",
+            "" ).replace(
+            "id=",
+            "" ).replace(
+            "\r\r",
+             "" )
+        intentsList = intentsList.splitlines()
+        intentIdList = []
+        step1Result = main.TRUE
+        moreIntents = main.TRUE
+        removeIntentCount = 0
+        intentsCount = len(intentsList)
+        main.log.info ( "Current number of intents:  " + str(intentsCount) )
+        if ( len( intentsList ) > 1 ):
+            results = main.TRUE
+            main.log.info("Removing intent...")
+            while moreIntents:
+            # This is a work around only: cycle through intents removal for up to 5 times.
+                if removeIntentCount == 5:
+                    break
+                removeIntentCount = removeIntentCount + 1
+                intentsList1 = main.ONOScli1.getAllIntentIds()
+                if len( intentsList1 ) == 0:
+                    break
+                ansi_escape = re.compile( r'\x1b[^m]*m' )
+                intentsList1 = ansi_escape.sub( '', intentsList1 )
+                intentsList1 = intentsList1.replace(
+                    " onos:intents | grep id=",
+                    "" ).replace(
+                    " state=",
+                    "" ).replace(
+                    "\r\r",
+                    "" )
+                intentsList1 = intentsList1.splitlines()
+                main.log.info ( "Round %d intents to remove: " %(removeIntentCount) )
+                print intentsList1
+                intentIdList1 = []
+                if ( len( intentsList1 ) > 0 ):
+                    moreIntents = main.TRUE
+                    for i in range( len( intentsList1 ) ):
+                        intentsTemp1 = intentsList1[ i ].split( ',' )
+                        intentIdList1.append( intentsTemp1[ 0 ].split('=')[1] )
+                    main.log.info ( "Leftover Intent IDs: " + str(intentIdList1) )
+                    main.log.info ( "Length of Leftover Intents list: " + str(len(intentIdList1)) )
+                    time1 = time.time()
+                    for i in xrange( 0, len( intentIdList1 ), int(main.numCtrls) ):
+                        pool = []
+                        for cli in main.CLIs:
+                            if i >= len( intentIdList1 ):
+                                break
+                            t = main.Thread( target=cli.removeIntent,
+                                    threadID=main.threadID,
+                                    name="removeIntent",
+                                    args=[intentIdList1[i],'org.onosproject.cli',False,False])
+                            pool.append(t)
+                            t.start()
+                            i = i + 1
+                            main.threadID = main.threadID + 1
+                        for thread in pool:
+                            thread.join()
+                            intentIdList.append(thread.result)
+                        #time.sleep(2)
+                    time2 = time.time()
+                    main.log.info("Time for removing host intents: %2f seconds" %(time2-time1))
+                    time.sleep(10)
+                    main.log.info("Purging WITHDRAWN Intents")
+                    purgeResult  = main.ONOScli1.purgeWithdrawnIntents()
+                else:
+                    time.sleep(10)
+                    if len( main.ONOScli1.intents()):
+                        continue
+                    break
+                time.sleep(10)
+            else:
+                print "Removed %d intents" %(intentsCount)
+                step1Result = main.TRUE
+        else:
+            print "No Intent IDs found in Intents list: ", intentsList
+            step1Result = main.FALSE
+
+        print main.ONOScli1.intents()
+        caseResult10 = step1Result
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult10,
+                                 onpass="Intent removal test successful",
+                                 onfail="Intent removal test failed" )
+
+    def CASE12( self, main ):
+        """
+        Enable onos-app-ifwd, Verify Intent based Reactive forwarding through ping all and Disable it
+        """
+        import re
+        import copy
+        import time
+
+        threadID = 0
+
+        main.log.report( "Enable Intent based Reactive forwarding and Verify ping all" )
+        main.log.report( "_____________________________________________________" )
+        main.case( "Enable Intent based Reactive forwarding and Verify ping all" )
+        main.step( "Enable intent based Reactive forwarding" )
+        installResult = main.FALSE
+        feature = "onos-app-ifwd"
+
+        pool = []
+        time1 = time.time()
+        for cli,feature in main.CLIs:
+            t = main.Thread(target=cli,threadID=threadID,
+                    name="featureInstall",args=[feature])
+            pool.append(t)
+            t.start()
+            threadID = threadID + 1
+            
+        results = []
+        for thread in pool:
+            thread.join()
+            results.append(thread.result)
+        time2 = time.time()
+        
+        if( all(result == main.TRUE for result in results) == False):
+                main.log.info("Did not install onos-app-ifwd feature properly")
+                #main.cleanup()
+                #main.exit()
+        else:
+            main.log.info("Successful feature:install onos-app-ifwd")
+            installResult = main.TRUE
+        main.log.info("Time for feature:install onos-app-ifwd: %2f seconds" %(time2-time1))
+        
+        main.step( "Verify Pingall" )
+        ping_result = main.FALSE
+        time1 = time.time()
+        ping_result = main.Mininet1.pingall(timeout=600)
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+        
+        if ping_result == main.TRUE:
+            main.log.report( "Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "Pingall Test in Reactive mode failed" )
+
+        main.step( "Disable Intent based Reactive forwarding" )
+        uninstallResult = main.FALSE
+        
+        pool = []
+        time1 = time.time()
+        for cli,feature in main.CLIs:
+            t = main.Thread(target=cli,threadID=threadID,
+                    name="featureUninstall",args=[feature])
+            pool.append(t)
+            t.start()
+            threadID = threadID + 1
+            
+        results = []
+        for thread in pool:
+            thread.join()
+            results.append(thread.result)
+        time2 = time.time()
+        
+        if( all(result == main.TRUE for result in results) == False):
+                main.log.info("Did not uninstall onos-app-ifwd feature properly")
+                uninstallResult = main.FALSE
+                #main.cleanup()
+                #main.exit()
+        else:
+            main.log.info("Successful feature:uninstall onos-app-ifwd")
+            uninstallResult = main.TRUE
+        main.log.info("Time for feature:uninstall onos-app-ifwd: %2f seconds" %(time2-time1))
+
+        # Waiting for reative flows to be cleared.
+        time.sleep( 10 )
+
+        case11Result = installResult and ping_result and uninstallResult
+        utilities.assert_equals( expect=main.TRUE, actual=case11Result,
+                                 onpass="Intent based Reactive forwarding Pingall test PASS",
+                                 onfail="Intent based Reactive forwarding Pingall test FAIL" )
diff --git a/TestON/tests/CHOtest/CHOtest.topo b/TestON/tests/CHOtest/CHOtest.topo
new file mode 100644
index 0000000..8b596e7
--- /dev/null
+++ b/TestON/tests/CHOtest/CHOtest.topo
@@ -0,0 +1,52 @@
+<TOPOLOGY>
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>admin</user>
+            <password></password>
+			<type>OnosDriver</type>
+			<connect_order>1</connect_order>
+            <COMPONENTS>
+                <home>~/ONOS</home>
+            </COMPONENTS>
+        </ONOSbench>
+
+        <ONOScli1>
+            <host>localhost</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli1>
+
+        <ONOScli2>
+            <host>localhost</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli2>
+
+        <ONOScli3>
+            <host>localhost</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli3>
+
+        <Mininet1>
+            <host>OCN</host>
+            <user>admin</user>
+            <password></password>
+            <type>MininetCliDriver</type>
+            <connect_order>12</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </Mininet1>
+
+    </COMPONENT>
+</TOPOLOGY>
\ No newline at end of file
diff --git a/TestON/tests/CHOtest/Dependencies/topoAtt.py b/TestON/tests/CHOtest/Dependencies/topoAtt.py
new file mode 100755
index 0000000..0247458
--- /dev/null
+++ b/TestON/tests/CHOtest/Dependencies/topoAtt.py
@@ -0,0 +1,183 @@
+#!/usr/bin/python
+
+"""
+Custom topology for Mininet
+"""
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import RemoteController
+from mininet.node import Node
+from mininet.node import CPULimitedHost
+from mininet.link import TCLink
+from mininet.cli import CLI
+from mininet.log import setLogLevel
+from mininet.util import dumpNodeConnections
+from mininet.node import ( UserSwitch, OVSSwitch, OVSLegacyKernelSwitch, IVSSwitch )
+
+class attTopo( Topo ):
+
+    def __init__( self, **opts ):
+        "Create a topology."
+
+        # Initialize Topology
+        Topo.__init__( self, **opts )
+
+        # add nodes, switches first...
+        NY54 = self.addSwitch( 's1' )
+        CMBR = self.addSwitch( 's2' )
+        CHCG = self.addSwitch( 's3' )
+        CLEV = self.addSwitch( 's4' )
+        RLGH = self.addSwitch( 's5' )
+        ATLN = self.addSwitch( 's6' )
+        PHLA = self.addSwitch( 's7' )
+        WASH = self.addSwitch( 's8' )
+        NSVL = self.addSwitch( 's9' )
+        STLS = self.addSwitch( 's10' )
+        NWOR = self.addSwitch( 's11' )
+        HSTN = self.addSwitch( 's12' )
+        SNAN = self.addSwitch( 's13' )
+        DLLS = self.addSwitch( 's14' )
+        ORLD = self.addSwitch( 's15' )
+        DNVR = self.addSwitch( 's16' )
+        KSCY = self.addSwitch( 's17' )
+        SNFN = self.addSwitch( 's18' )
+        SCRM = self.addSwitch( 's19' )
+        PTLD = self.addSwitch( 's20' )
+        STTL = self.addSwitch( 's21' )
+        SLKC = self.addSwitch( 's22' )
+        LA03 = self.addSwitch( 's23' )
+        SNDG = self.addSwitch( 's24' )
+        PHNX = self.addSwitch( 's25' )
+
+        # ... and now hosts
+        NY54_host = self.addHost( 'h1' )
+        CMBR_host = self.addHost( 'h2' )
+        CHCG_host = self.addHost( 'h3' )
+        CLEV_host = self.addHost( 'h4' )
+        RLGH_host = self.addHost( 'h5' )
+        ATLN_host = self.addHost( 'h6' )
+        PHLA_host = self.addHost( 'h7' )
+        WASH_host = self.addHost( 'h8' )
+        NSVL_host = self.addHost( 'h9' )
+        STLS_host = self.addHost( 'h10' )
+        NWOR_host = self.addHost( 'h11' )
+        HSTN_host = self.addHost( 'h12' )
+        SNAN_host = self.addHost( 'h13' )
+        DLLS_host = self.addHost( 'h14' )
+        ORLD_host = self.addHost( 'h15' )
+        DNVR_host = self.addHost( 'h16' )
+        KSCY_host = self.addHost( 'h17' )
+        SNFN_host = self.addHost( 'h18' )
+        SCRM_host = self.addHost( 'h19' )
+        PTLD_host = self.addHost( 'h20' )
+        STTL_host = self.addHost( 'h21' )
+        SLKC_host = self.addHost( 'h22' )
+        LA03_host = self.addHost( 'h23' )
+        SNDG_host = self.addHost( 'h24' )
+        PHNX_host = self.addHost( 'h25' )
+
+        # add edges between switch and corresponding host
+        self.addLink( NY54 , NY54_host )
+        self.addLink( CMBR , CMBR_host )
+        self.addLink( CHCG , CHCG_host )
+        self.addLink( CLEV , CLEV_host )
+        self.addLink( RLGH , RLGH_host )
+        self.addLink( ATLN , ATLN_host )
+        self.addLink( PHLA , PHLA_host )
+        self.addLink( WASH , WASH_host )
+        self.addLink( NSVL , NSVL_host )
+        self.addLink( STLS , STLS_host )
+        self.addLink( NWOR , NWOR_host )
+        self.addLink( HSTN , HSTN_host )
+        self.addLink( SNAN , SNAN_host )
+        self.addLink( DLLS , DLLS_host )
+        self.addLink( ORLD , ORLD_host )
+        self.addLink( DNVR , DNVR_host )
+        self.addLink( KSCY , KSCY_host )
+        self.addLink( SNFN , SNFN_host )
+        self.addLink( SCRM , SCRM_host )
+        self.addLink( PTLD , PTLD_host )
+        self.addLink( STTL , STTL_host )
+        self.addLink( SLKC , SLKC_host )
+        self.addLink( LA03 , LA03_host )
+        self.addLink( SNDG , SNDG_host )
+        self.addLink( PHNX , PHNX_host )
+
+        # add edges between switches
+        self.addLink( NY54 , CMBR, bw=10, delay='0.979030824185ms')
+        self.addLink( NY54 , CHCG, bw=10, delay='0.806374975652ms')
+        self.addLink( NY54 , PHLA, bw=10, delay='0.686192970166ms')
+        self.addLink( NY54 , WASH, bw=10, delay='0.605826192092ms')
+        self.addLink( CMBR , PHLA, bw=10, delay='1.4018238197ms')
+        self.addLink( CHCG , CLEV, bw=10, delay='0.232315346482ms')
+        self.addLink( CHCG , PHLA, bw=10, delay='1.07297714274ms')
+        self.addLink( CHCG , STLS, bw=10, delay='1.12827896944ms')
+        self.addLink( CHCG , DNVR, bw=10, delay='1.35964770335ms')
+        self.addLink( CHCG , KSCY, bw=10, delay='1.5199778541ms')
+        self.addLink( CHCG , SNFN, bw=10, delay='0.620743405435ms')
+        self.addLink( CHCG , STTL, bw=10, delay='0.93027212534ms')
+        self.addLink( CHCG , SLKC, bw=10, delay='0.735621751348ms')
+        self.addLink( CLEV , NSVL, bw=10, delay='0.523419372248ms')
+        self.addLink( CLEV , STLS, bw=10, delay='1.00360290845ms')
+        self.addLink( CLEV , PHLA, bw=10, delay='0.882912133249ms')
+        self.addLink( RLGH , ATLN, bw=10, delay='1.1644489729ms')
+        self.addLink( RLGH , WASH, bw=10, delay='1.48176810502ms')
+        self.addLink( ATLN , WASH, bw=10, delay='0.557636936322ms')
+        self.addLink( ATLN , NSVL, bw=10, delay='1.32869749865ms')
+        self.addLink( ATLN , STLS, bw=10, delay='0.767705554748ms')
+        self.addLink( ATLN , DLLS, bw=10, delay='0.544782086448ms')
+        self.addLink( ATLN , ORLD, bw=10, delay='1.46119152532ms')
+        self.addLink( PHLA , WASH, bw=10, delay='0.372209320106ms')
+        self.addLink( NSVL , STLS, bw=10, delay='1.43250491305ms')
+        self.addLink( NSVL , DLLS, bw=10, delay='1.67698215288ms')
+        self.addLink( STLS , DLLS, bw=10, delay='0.256389964194ms')
+        self.addLink( STLS , KSCY, bw=10, delay='0.395511571791ms')
+        self.addLink( STLS , LA03, bw=10, delay='0.257085227363ms')
+        self.addLink( NWOR , HSTN, bw=10, delay='0.0952906633914ms')
+        self.addLink( NWOR , DLLS, bw=10, delay='1.60231329739ms')
+        self.addLink( NWOR , ORLD, bw=10, delay='0.692731063896ms')
+        self.addLink( HSTN , SNAN, bw=10, delay='0.284150653798ms')
+        self.addLink( HSTN , DLLS, bw=10, delay='1.65690128332ms')
+        self.addLink( HSTN , ORLD, bw=10, delay='0.731886304782ms')
+        self.addLink( SNAN , PHNX, bw=10, delay='1.34258627257ms')
+        self.addLink( SNAN , DLLS, bw=10, delay='1.50063532341ms')
+        self.addLink( DLLS , DNVR, bw=10, delay='0.251471593235ms')
+        self.addLink( DLLS , KSCY, bw=10, delay='0.18026026737ms')
+        self.addLink( DLLS , SNFN, bw=10, delay='0.74304274592ms')
+        self.addLink( DLLS , LA03, bw=10, delay='0.506439293357ms')
+        self.addLink( DNVR , KSCY, bw=10, delay='0.223328790403ms')
+        self.addLink( DNVR , SNFN, bw=10, delay='0.889017541903ms')
+        self.addLink( DNVR , SLKC, bw=10, delay='0.631898982721ms')
+        self.addLink( KSCY , SNFN, bw=10, delay='0.922778522233ms')
+        self.addLink( SNFN , SCRM, bw=10, delay='0.630352278097ms')
+        self.addLink( SNFN , PTLD, bw=10, delay='0.828572513655ms')
+        self.addLink( SNFN , STTL, bw=10, delay='1.54076081649ms')
+        self.addLink( SNFN , SLKC, bw=10, delay='0.621507502625ms')
+        self.addLink( SNFN , LA03, bw=10, delay='0.602936230151ms')
+        self.addLink( SCRM , SLKC, bw=10, delay='0.461350343644ms')
+        self.addLink( PTLD , STTL, bw=10, delay='1.17591515181ms')
+        self.addLink( SLKC , LA03, bw=10, delay='0.243225267023ms')
+        self.addLink( LA03 , SNDG, bw=10, delay='0.681264950821ms')
+        self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms')
+        self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms')
+        self.addLink( SNDG , PHNX, bw=10, delay='0.345064487693ms')
+
+topos = { 'att': ( lambda: attTopo() ) }
+
+# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
+def setupNetwork():
+    "Create network"
+    topo = attTopo()
+    #if controller_ip == '':
+        #controller_ip = '10.0.2.2';
+    #    controller_ip = '127.0.0.1';
+    network = Mininet(topo=topo, link=TCLink, autoSetMacs=True, controller=None)
+    network.start()
+    CLI( network )
+    network.stop()
+
+if __name__ == '__main__':
+    setLogLevel('info')
+    #setLogLevel('debug')
+    setupNetwork()
diff --git a/TestON/tests/CHOtest/Dependencies/topoChordal.py b/TestON/tests/CHOtest/Dependencies/topoChordal.py
new file mode 100755
index 0000000..38eb6a1
--- /dev/null
+++ b/TestON/tests/CHOtest/Dependencies/topoChordal.py
@@ -0,0 +1,422 @@
+#!/usr/bin/python
+"""
+"""
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import RemoteController
+from mininet.node import Node
+from mininet.node import CPULimitedHost
+from mininet.link import TCLink
+from mininet.cli import CLI
+from mininet.log import setLogLevel
+from mininet.util import dumpNodeConnections
+from mininet.node import ( UserSwitch, OVSSwitch, OVSLegacyKernelSwitch, IVSSwitch )
+
+class chordalTopo( Topo ):
+
+    def __init__( self, **opts ):
+        "Create a topology."
+
+        # Initialize Topology
+        Topo.__init__( self, **opts )
+
+        # add nodes, switches first...
+        s1 = self.addSwitch( 's1' )
+        s2 = self.addSwitch( 's2' )
+        s3 = self.addSwitch( 's3' )
+        s4 = self.addSwitch( 's4' )
+        s5 = self.addSwitch( 's5' )
+        s6 = self.addSwitch( 's6' )
+        s7 = self.addSwitch( 's7' )
+        s8 = self.addSwitch( 's8' )
+        s9 = self.addSwitch( 's9' )
+        s10 = self.addSwitch( 's10' )
+        s11 = self.addSwitch( 's11' )
+        s12 = self.addSwitch( 's12' )
+        s13 = self.addSwitch( 's13' )
+        s14 = self.addSwitch( 's14' )
+        s15 = self.addSwitch( 's15' )
+        s16 = self.addSwitch( 's16' )
+        s17 = self.addSwitch( 's17' )
+        s18 = self.addSwitch( 's18' )
+        s19 = self.addSwitch( 's19' )
+        s20 = self.addSwitch( 's20' )
+        s21 = self.addSwitch( 's21' )
+        s22 = self.addSwitch( 's22' )
+        s23 = self.addSwitch( 's23' )
+        s24 = self.addSwitch( 's24' )
+        s25 = self.addSwitch( 's25' )
+
+        # ... and now hosts
+        s1_host = self.addHost( 'h1' )
+        s2_host = self.addHost( 'h2' )
+        s3_host = self.addHost( 'h3' )
+        s4_host = self.addHost( 'h4' )
+        s5_host = self.addHost( 'h5' )
+        s6_host = self.addHost( 'h6' )
+        s7_host = self.addHost( 'h7' )
+        s8_host = self.addHost( 'h8' )
+        s9_host = self.addHost( 'h9' )
+        s10_host = self.addHost( 'h10' )
+        s11_host = self.addHost( 'h11' )
+        s12_host = self.addHost( 'h12' )
+        s13_host = self.addHost( 'h13' )
+        s14_host = self.addHost( 'h14' )
+        s15_host = self.addHost( 'h15' )
+        s16_host = self.addHost( 'h16' )
+        s17_host = self.addHost( 'h17' )
+        s18_host = self.addHost( 'h18' )
+        s19_host = self.addHost( 'h19' )
+        s20_host = self.addHost( 'h20' )
+        s21_host = self.addHost( 'h21' )
+        s22_host = self.addHost( 'h22' )
+        s23_host = self.addHost( 'h23' )
+        s24_host = self.addHost( 'h24' )
+        s25_host = self.addHost( 'h25' )
+
+        # add edges between switch and corresponding host
+        self.addLink( s1 , s1_host )
+        self.addLink( s2 , s2_host )
+        self.addLink( s3 , s3_host )
+        self.addLink( s4 , s4_host )
+        self.addLink( s5 , s5_host )
+        self.addLink( s6 , s6_host )
+        self.addLink( s7 , s7_host )
+        self.addLink( s8 , s8_host )
+        self.addLink( s9 , s9_host )
+        self.addLink( s10 , s10_host )
+        self.addLink( s11 , s11_host )
+        self.addLink( s12 , s12_host )
+        self.addLink( s13 , s13_host )
+        self.addLink( s14 , s14_host )
+        self.addLink( s15 , s15_host )
+        self.addLink( s16 , s16_host )
+        self.addLink( s17 , s17_host )
+        self.addLink( s18 , s18_host )
+        self.addLink( s19 , s19_host )
+        self.addLink( s20 , s20_host )
+        self.addLink( s21 , s21_host )
+        self.addLink( s22 , s22_host )
+        self.addLink( s23 , s23_host )
+        self.addLink( s24 , s24_host )
+        self.addLink( s25 , s25_host )
+        self.addLink(s1, s2)
+        self.addLink(s1, s3)
+        self.addLink(s1, s4)
+        self.addLink(s1, s5)
+        self.addLink(s1, s6)
+        self.addLink(s1, s7)
+        self.addLink(s1, s8)
+        self.addLink(s1, s9)
+        self.addLink(s1, s10)
+        self.addLink(s1, s11)
+        self.addLink(s1, s12)
+        self.addLink(s1, s13)
+        self.addLink(s1, s14)
+        self.addLink(s1, s15)
+        self.addLink(s1, s16)
+        self.addLink(s1, s17)
+        self.addLink(s1, s18)
+        self.addLink(s1, s19)
+        self.addLink(s1, s20)
+        self.addLink(s1, s21)
+        self.addLink(s1, s22)
+        self.addLink(s1, s23)
+        self.addLink(s1, s24)
+        self.addLink(s1, s25)
+        self.addLink(s2, s3)
+        self.addLink(s2, s4)
+        self.addLink(s2, s5)
+        self.addLink(s2, s6)
+        self.addLink(s2, s7)
+        self.addLink(s2, s8)
+        self.addLink(s2, s9)
+        self.addLink(s2, s10)
+        self.addLink(s2, s11)
+        self.addLink(s2, s12)
+        self.addLink(s2, s13)
+        self.addLink(s2, s14)
+        self.addLink(s2, s15)
+        self.addLink(s2, s16)
+        self.addLink(s2, s17)
+        self.addLink(s2, s18)
+        self.addLink(s2, s19)
+        self.addLink(s2, s20)
+        self.addLink(s2, s21)
+        self.addLink(s2, s22)
+        self.addLink(s2, s23)
+        self.addLink(s2, s24)
+        self.addLink(s2, s25)
+        self.addLink(s3, s4)
+        self.addLink(s3, s5)
+        self.addLink(s3, s6)
+        self.addLink(s3, s7)
+        self.addLink(s3, s8)
+        self.addLink(s3, s9)
+        self.addLink(s3, s10)
+        self.addLink(s3, s11)
+        self.addLink(s3, s12)
+        self.addLink(s3, s13)
+        self.addLink(s3, s14)
+        self.addLink(s3, s15)
+        self.addLink(s3, s16)
+        self.addLink(s3, s17)
+        self.addLink(s3, s18)
+        self.addLink(s3, s19)
+        self.addLink(s3, s20)
+        self.addLink(s3, s21)
+        self.addLink(s3, s22)
+        self.addLink(s3, s23)
+        self.addLink(s3, s24)
+        self.addLink(s3, s25)
+        self.addLink(s4, s5)
+        self.addLink(s4, s6)
+        self.addLink(s4, s7)
+        self.addLink(s4, s8)
+        self.addLink(s4, s9)
+        self.addLink(s4, s10)
+        self.addLink(s4, s11)
+        self.addLink(s4, s12)
+        self.addLink(s4, s13)
+        self.addLink(s4, s14)
+        self.addLink(s4, s15)
+        self.addLink(s4, s16)
+        self.addLink(s4, s17)
+        self.addLink(s4, s18)
+        self.addLink(s4, s19)
+        self.addLink(s4, s20)
+        self.addLink(s4, s21)
+        self.addLink(s4, s22)
+        self.addLink(s4, s23)
+        self.addLink(s4, s24)
+        self.addLink(s4, s25)
+        self.addLink(s5, s6)
+        self.addLink(s5, s7)
+        self.addLink(s5, s8)
+        self.addLink(s5, s9)
+        self.addLink(s5, s10)
+        self.addLink(s5, s11)
+        self.addLink(s5, s12)
+        self.addLink(s5, s13)
+        self.addLink(s5, s14)
+        self.addLink(s5, s15)
+        self.addLink(s5, s16)
+        self.addLink(s5, s17)
+        self.addLink(s5, s18)
+        self.addLink(s5, s19)
+        self.addLink(s5, s20)
+        self.addLink(s5, s21)
+        self.addLink(s5, s22)
+        self.addLink(s5, s23)
+        self.addLink(s5, s24)
+        self.addLink(s5, s25)
+        self.addLink(s6, s7)
+        self.addLink(s6, s8)
+        self.addLink(s6, s9)
+        self.addLink(s6, s10)
+        self.addLink(s6, s11)
+        self.addLink(s6, s12)
+        self.addLink(s6, s13)
+        self.addLink(s6, s14)
+        self.addLink(s6, s15)
+        self.addLink(s6, s16)
+        self.addLink(s6, s17)
+        self.addLink(s6, s18)
+        self.addLink(s6, s19)
+        self.addLink(s6, s20)
+        self.addLink(s6, s21)
+        self.addLink(s6, s22)
+        self.addLink(s6, s23)
+        self.addLink(s6, s24)
+        self.addLink(s6, s25)
+        self.addLink(s7, s8)
+        self.addLink(s7, s9)
+        self.addLink(s7, s10)
+        self.addLink(s7, s11)
+        self.addLink(s7, s12)
+        self.addLink(s7, s13)
+        self.addLink(s7, s14)
+        self.addLink(s7, s15)
+        self.addLink(s7, s16)
+        self.addLink(s7, s17)
+        self.addLink(s7, s18)
+        self.addLink(s7, s19)
+        self.addLink(s7, s20)
+        self.addLink(s7, s21)
+        self.addLink(s7, s22)
+        self.addLink(s7, s23)
+        self.addLink(s7, s24)
+        self.addLink(s7, s25)
+        self.addLink(s8, s9)
+        self.addLink(s8, s10)
+        self.addLink(s8, s11)
+        self.addLink(s8, s12)
+        self.addLink(s8, s13)
+        self.addLink(s8, s14)
+        self.addLink(s8, s15)
+        self.addLink(s8, s16)
+        self.addLink(s8, s17)
+        self.addLink(s8, s18)
+        self.addLink(s8, s19)
+        self.addLink(s8, s20)
+        self.addLink(s8, s21)
+        self.addLink(s8, s22)
+        self.addLink(s8, s23)
+        self.addLink(s8, s24)
+        self.addLink(s8, s25)
+        self.addLink(s9, s10)
+        self.addLink(s9, s11)
+        self.addLink(s9, s12)
+        self.addLink(s9, s13)
+        self.addLink(s9, s14)
+        self.addLink(s9, s15)
+        self.addLink(s9, s16)
+        self.addLink(s9, s17)
+        self.addLink(s9, s18)
+        self.addLink(s9, s19)
+        self.addLink(s9, s20)
+        self.addLink(s9, s21)
+        self.addLink(s9, s22)
+        self.addLink(s9, s23)
+        self.addLink(s9, s24)
+        self.addLink(s9, s25)
+        self.addLink(s10, s11)
+        self.addLink(s10, s12)
+        self.addLink(s10, s13)
+        self.addLink(s10, s14)
+        self.addLink(s10, s15)
+        self.addLink(s10, s16)
+        self.addLink(s10, s17)
+        self.addLink(s10, s18)
+        self.addLink(s10, s19)
+        self.addLink(s10, s20)
+        self.addLink(s10, s21)
+        self.addLink(s10, s22)
+        self.addLink(s10, s23)
+        self.addLink(s10, s24)
+        self.addLink(s10, s25)
+        self.addLink(s11, s12)
+        self.addLink(s11, s13)
+        self.addLink(s11, s14)
+        self.addLink(s11, s15)
+        self.addLink(s11, s16)
+        self.addLink(s11, s17)
+        self.addLink(s11, s18)
+        self.addLink(s11, s19)
+        self.addLink(s11, s20)
+        self.addLink(s11, s21)
+        self.addLink(s11, s22)
+        self.addLink(s11, s23)
+        self.addLink(s11, s24)
+        self.addLink(s11, s25)
+        self.addLink(s12, s13)
+        self.addLink(s12, s14)
+        self.addLink(s12, s15)
+        self.addLink(s12, s16)
+        self.addLink(s12, s17)
+        self.addLink(s12, s18)
+        self.addLink(s12, s19)
+        self.addLink(s12, s20)
+        self.addLink(s12, s21)
+        self.addLink(s12, s22)
+        self.addLink(s12, s23)
+        self.addLink(s12, s24)
+        self.addLink(s12, s25)
+        self.addLink(s13, s14)
+        self.addLink(s13, s15)
+        self.addLink(s13, s16)
+        self.addLink(s13, s17)
+        self.addLink(s13, s18)
+        self.addLink(s13, s19)
+        self.addLink(s13, s20)
+        self.addLink(s13, s21)
+        self.addLink(s13, s22)
+        self.addLink(s13, s23)
+        self.addLink(s13, s24)
+        self.addLink(s13, s25)
+        self.addLink(s14, s15)
+        self.addLink(s14, s16)
+        self.addLink(s14, s17)
+        self.addLink(s14, s18)
+        self.addLink(s14, s19)
+        self.addLink(s14, s20)
+        self.addLink(s14, s21)
+        self.addLink(s14, s22)
+        self.addLink(s14, s23)
+        self.addLink(s14, s24)
+        self.addLink(s14, s25)
+        self.addLink(s15, s16)
+        self.addLink(s15, s17)
+        self.addLink(s15, s18)
+        self.addLink(s15, s19)
+        self.addLink(s15, s20)
+        self.addLink(s15, s21)
+        self.addLink(s15, s22)
+        self.addLink(s15, s23)
+        self.addLink(s15, s24)
+        self.addLink(s15, s25)
+        self.addLink(s16, s17)
+        self.addLink(s16, s18)
+        self.addLink(s16, s19)
+        self.addLink(s16, s20)
+        self.addLink(s16, s21)
+        self.addLink(s16, s22)
+        self.addLink(s16, s23)
+        self.addLink(s16, s24)
+        self.addLink(s16, s25)
+        self.addLink(s17, s18)
+        self.addLink(s17, s19)
+        self.addLink(s17, s20)
+        self.addLink(s17, s21)
+        self.addLink(s17, s22)
+        self.addLink(s17, s23)
+        self.addLink(s17, s24)
+        self.addLink(s17, s25)
+        self.addLink(s18, s19)
+        self.addLink(s18, s20)
+        self.addLink(s18, s21)
+        self.addLink(s18, s22)
+        self.addLink(s18, s23)
+        self.addLink(s18, s24)
+        self.addLink(s18, s25)
+        self.addLink(s19, s20)
+        self.addLink(s19, s21)
+        self.addLink(s19, s22)
+        self.addLink(s19, s23)
+        self.addLink(s19, s24)
+        self.addLink(s19, s25)
+        self.addLink(s20, s21)
+        self.addLink(s20, s22)
+        self.addLink(s20, s23)
+        self.addLink(s20, s24)
+        self.addLink(s20, s25)
+        self.addLink(s21, s22)
+        self.addLink(s21, s23)
+        self.addLink(s21, s24)
+        self.addLink(s21, s25)
+        self.addLink(s22, s23)
+        self.addLink(s22, s24)
+        self.addLink(s22, s25)
+        self.addLink(s23, s24)
+        self.addLink(s23, s25)
+        self.addLink(s24, s25)
+
+topos = { 'chordal': ( lambda: chordalTopo() ) }
+
+# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
+def setupNetwork():
+    "Create network"
+    topo = chordalTopo()
+    #if controller_ip == '':
+        #controller_ip = '10.0.2.2';
+    #    controller_ip = '127.0.0.1';
+    network = Mininet(topo=topo, switch=OVSSwitch,autoSetMacs=True, controller=None)
+    network.start()
+    CLI( network )
+    network.stop()
+
+if __name__ == '__main__':
+    setLogLevel('info')
+    #setLogLevel('debug')
+    setupNetwork()
diff --git a/TestON/tests/CHOtest/Dependencies/topoSpine.py b/TestON/tests/CHOtest/Dependencies/topoSpine.py
new file mode 100755
index 0000000..56fe745
--- /dev/null
+++ b/TestON/tests/CHOtest/Dependencies/topoSpine.py
@@ -0,0 +1,436 @@
+#!/usr/bin/python
+
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import Controller, RemoteController, OVSController
+from mininet.node import CPULimitedHost, Host, Node
+from mininet.cli import CLI
+from mininet.log import setLogLevel, info
+from mininet.link import TCLink, Intf
+from subprocess import call
+from mininet.log import setLogLevel
+from mininet.util import dumpNodeConnections
+from mininet.node import ( UserSwitch, OVSSwitch, OVSLegacyKernelSwitch, IVSSwitch )
+
+class spineTopo( Topo ):
+
+    def __init__( self, **opts ):
+        "Create a topology."
+
+        # Initialize Topology
+        Topo.__init__( self, **opts )
+    
+	# add nodes, Leaf switches
+	s1 = self.addSwitch( 's1' )
+	s2 = self.addSwitch( 's2' )
+	s3 = self.addSwitch( 's3' )
+	s4 = self.addSwitch( 's4' )
+	s5 = self.addSwitch( 's5' )
+	s6 = self.addSwitch( 's6' )
+	s7 = self.addSwitch( 's7' )
+	s8 = self.addSwitch( 's8' )
+	s9 = self.addSwitch( 's9' )
+	s10 = self.addSwitch( 's10' )
+	s11 = self.addSwitch( 's11' )
+	s12 = self.addSwitch( 's12' )
+	s13 = self.addSwitch( 's13' )
+	s14 = self.addSwitch( 's14' )
+
+	# add nodes, Spine switches first...
+	s15 = self.addSwitch( 's15' )
+	s16 = self.addSwitch( 's16' )
+	s17 = self.addSwitch( 's17' )
+	s18 = self.addSwitch( 's18' )
+	s19 = self.addSwitch( 's19' )
+	s20 = self.addSwitch( 's20' )
+	s21 = self.addSwitch( 's21' )
+	s22 = self.addSwitch( 's22' )
+	s23 = self.addSwitch( 's23' )
+	s24 = self.addSwitch( 's24' )
+	s25 = self.addSwitch( 's25' )
+	s26 = self.addSwitch( 's26' )
+	s27 = self.addSwitch( 's27' )
+	s28 = self.addSwitch( 's28' )
+	s29 = self.addSwitch( 's29' )
+	s30 = self.addSwitch( 's30' )
+	s31 = self.addSwitch( 's31' )
+	s32 = self.addSwitch( 's32' )
+	s33 = self.addSwitch( 's33' )
+	s34 = self.addSwitch( 's34' )
+	s35 = self.addSwitch( 's35' )
+	s36 = self.addSwitch( 's36' )
+	s37 = self.addSwitch( 's37' )
+	s38 = self.addSwitch( 's38' )
+	s39 = self.addSwitch( 's39' )
+	s40 = self.addSwitch( 's40' )
+	s41 = self.addSwitch( 's41' )
+	s42 = self.addSwitch( 's42' )
+	s43 = self.addSwitch( 's43' )
+	s44 = self.addSwitch( 's44' )
+	s45 = self.addSwitch( 's45' )
+	s46 = self.addSwitch( 's46' )
+	s47 = self.addSwitch( 's47' )
+	s48 = self.addSwitch( 's48' )
+	s49 = self.addSwitch( 's49' )
+	s50 = self.addSwitch( 's50' )
+	s51 = self.addSwitch( 's51' )
+	s52 = self.addSwitch( 's52' )
+	s53 = self.addSwitch( 's53' )
+	s54 = self.addSwitch( 's54' )
+	s55 = self.addSwitch( 's55' )
+	s56 = self.addSwitch( 's56' )
+	s57 = self.addSwitch( 's57' )
+	s58 = self.addSwitch( 's58' )
+	s59 = self.addSwitch( 's59' )
+	s60 = self.addSwitch( 's60' )
+	s61 = self.addSwitch( 's61' )
+	s62 = self.addSwitch( 's62' )
+	s63 = self.addSwitch( 's63' )
+	s64 = self.addSwitch( 's64' )
+	s65 = self.addSwitch( 's65' )
+	s66 = self.addSwitch( 's66' )
+	s67 = self.addSwitch( 's67' )
+	s68 = self.addSwitch( 's68' )
+	s69 = self.addSwitch( 's69' )
+	s70 = self.addSwitch( 's70' )
+	s71 = self.addSwitch( 's71' )
+	s72 = self.addSwitch( 's72' )
+	s73 = self.addSwitch( 's73' )
+	s74 = self.addSwitch( 's74' )
+	s75 = self.addSwitch( 's75' )
+	s76 = self.addSwitch( 's76' )
+	s77 = self.addSwitch( 's77' )
+	s78 = self.addSwitch( 's78' )
+
+	# ... and now hosts
+	#s1_host = self.addHost( 'h1' )
+	#s2_host = self.addHost( 'h2' )
+	#s3_host = self.addHost( 'h3' )
+	#s4_host = self.addHost( 'h4' )
+	#s5_host = self.addHost( 'h5' )
+	#s6_host = self.addHost( 'h6' )
+	#s7_host = self.addHost( 'h7' )
+	#s8_host = self.addHost( 'h8' )
+	#s9_host = self.addHost( 'h9' )
+	#s10_host = self.addHost( 'h10' )
+	s11_host = self.addHost( 'h11' )
+	s12_host = self.addHost( 'h12' )
+	s13_host = self.addHost( 'h13' )
+	s14_host = self.addHost( 'h14' )
+	s15_host = self.addHost( 'h15' )
+	s16_host = self.addHost( 'h16' )
+	s17_host = self.addHost( 'h17' )
+	s18_host = self.addHost( 'h18' )
+	s19_host = self.addHost( 'h19' )
+	s20_host = self.addHost( 'h20' )
+	s21_host = self.addHost( 'h21' )
+	s22_host = self.addHost( 'h22' )
+	s23_host = self.addHost( 'h23' )
+	s24_host = self.addHost( 'h24' )
+	s25_host = self.addHost( 'h25' )
+	s26_host = self.addHost( 'h26' )
+	s27_host = self.addHost( 'h27' )
+	s28_host = self.addHost( 'h28' )
+	s29_host = self.addHost( 'h29' )
+	s30_host = self.addHost( 'h30' )
+	s31_host = self.addHost( 'h31' )
+	s32_host = self.addHost( 'h32' )
+	s33_host = self.addHost( 'h33' )
+	s34_host = self.addHost( 'h34' )
+	s35_host = self.addHost( 'h35' )
+	s36_host = self.addHost( 'h36' )
+	s37_host = self.addHost( 'h37' )
+	s38_host = self.addHost( 'h38' )
+	s39_host = self.addHost( 'h39' )
+	s40_host = self.addHost( 'h40' )
+	s41_host = self.addHost( 'h41' )
+	s42_host = self.addHost( 'h42' )
+	s43_host = self.addHost( 'h43' )
+	s44_host = self.addHost( 'h44' )
+	s45_host = self.addHost( 'h45' )
+	s46_host = self.addHost( 'h46' )
+	s47_host = self.addHost( 'h47' )
+	s48_host = self.addHost( 'h48' )
+	s49_host = self.addHost( 'h49' )
+	s50_host = self.addHost( 'h50' )
+	s51_host = self.addHost( 'h51' )
+	s52_host = self.addHost( 'h52' )
+	s53_host = self.addHost( 'h53' )
+	s54_host = self.addHost( 'h54' )
+	s55_host = self.addHost( 'h55' )
+	s56_host = self.addHost( 'h56' )
+	s57_host = self.addHost( 'h57' )
+	s58_host = self.addHost( 'h58' )
+	s59_host = self.addHost( 'h59' )
+	s60_host = self.addHost( 'h60' )
+	s61_host = self.addHost( 'h61' )
+	s62_host = self.addHost( 'h62' )
+	s63_host = self.addHost( 'h63' )
+	s64_host = self.addHost( 'h64' )
+	s65_host = self.addHost( 'h65' )
+	s66_host = self.addHost( 'h66' )
+	s67_host = self.addHost( 'h67' )
+	s68_host = self.addHost( 'h68' )
+	s69_host = self.addHost( 'h69' )
+	s70_host = self.addHost( 'h70' )
+	s71_host = self.addHost( 'h71' )
+	s72_host = self.addHost( 'h72' )
+	s73_host = self.addHost( 'h73' )
+	s74_host = self.addHost( 'h74' )
+	s75_host = self.addHost( 'h75' )
+	s76_host = self.addHost( 'h76' )
+	s77_host = self.addHost( 'h77' )
+	s78_host = self.addHost( 'h78' )
+
+	# add edges between switch and corresponding host
+	#self.addLink( s1 , s1_host )
+	#self.addLink( s2 , s2_host )
+	#self.addLink( s3 , s3_host )
+	#self.addLink( s4 , s4_host )
+	#self.addLink( s5 , s5_host )
+	#self.addLink( s6 , s6_host )
+	#self.addLink( s7 , s7_host )
+	#self.addLink( s8 , s8_host )
+	#self.addLink( s9 , s9_host )
+	#self.addLink( s10 , s10_host )
+	self.addLink( s11 , s11_host )
+	self.addLink( s12 , s12_host )
+	self.addLink( s13 , s13_host )
+	self.addLink( s14 , s14_host )
+	self.addLink( s15 , s15_host )
+	self.addLink( s16 , s16_host )
+	self.addLink( s17 , s17_host )
+	self.addLink( s18 , s18_host )
+	self.addLink( s19 , s19_host )
+	self.addLink( s20 , s20_host )
+	self.addLink( s21 , s21_host )
+	self.addLink( s22 , s22_host )
+	self.addLink( s23 , s23_host )
+	self.addLink( s24 , s24_host )
+	self.addLink( s25 , s25_host )
+	self.addLink( s26 , s26_host )
+	self.addLink( s27 , s27_host )
+	self.addLink( s28 , s28_host )
+	self.addLink( s29 , s29_host )
+	self.addLink( s30 , s30_host )
+	self.addLink( s31 , s31_host )
+	self.addLink( s32 , s32_host )
+	self.addLink( s33 , s33_host )
+	self.addLink( s34 , s34_host )
+	self.addLink( s35 , s35_host )
+	self.addLink( s36 , s36_host )
+	self.addLink( s37 , s37_host )
+	self.addLink( s38 , s38_host )
+	self.addLink( s39 , s39_host )
+	self.addLink( s40 , s40_host )
+	self.addLink( s41 , s41_host )
+	self.addLink( s42 , s42_host )
+	self.addLink( s43 , s43_host )
+	self.addLink( s44 , s44_host )
+	self.addLink( s45 , s45_host )
+	self.addLink( s46 , s46_host )
+	self.addLink( s47 , s47_host )
+	self.addLink( s48 , s48_host )
+	self.addLink( s49 , s49_host )
+	self.addLink( s50 , s50_host )
+	self.addLink( s51 , s51_host )
+	self.addLink( s52 , s52_host )
+	self.addLink( s53 , s53_host )
+	self.addLink( s54 , s54_host )
+	self.addLink( s55 , s55_host )
+	self.addLink( s56 , s56_host )
+	self.addLink( s57 , s57_host )
+	self.addLink( s58 , s58_host )
+	self.addLink( s59 , s59_host )
+	self.addLink( s60 , s60_host )
+	self.addLink( s61 , s61_host )
+	self.addLink( s62 , s62_host )
+	self.addLink( s63 , s63_host )
+	self.addLink( s64 , s64_host )
+	self.addLink( s65 , s65_host )
+	self.addLink( s66 , s66_host )
+	self.addLink( s67 , s67_host )
+	self.addLink( s68 , s68_host )
+	self.addLink( s69 , s69_host )
+	self.addLink( s70 , s70_host )
+	self.addLink( s71 , s71_host )
+	self.addLink( s72 , s72_host )
+	self.addLink( s73 , s73_host )
+	self.addLink( s74 , s74_host )
+	self.addLink( s75 , s75_host )
+	self.addLink( s76 , s76_host )
+	self.addLink( s77 , s77_host )
+	self.addLink( s78 , s78_host )
+
+	#info( '*** Add Leaf links\n')
+	self.addLink(s1, s9)
+	self.addLink(s2, s10)
+	self.addLink(s3, s9)
+	self.addLink(s4, s10)
+	self.addLink(s5, s9)
+	self.addLink(s6, s10)
+	self.addLink(s7, s9)
+	self.addLink(s8, s10)
+	self.addLink(s9, s11)
+	self.addLink(s9, s12)
+	self.addLink(s10, s13)
+	self.addLink(s10, s14)
+	self.addLink(s11, s12)
+	self.addLink(s13, s14)
+
+	#info( '*** Add Spine-1 links\n')
+	self.addLink(s15, s1)
+	self.addLink(s15, s2)
+	self.addLink(s16, s1)
+	self.addLink(s16, s2)
+	self.addLink(s17, s1)
+	self.addLink(s17, s2)
+	self.addLink(s18, s1)
+	self.addLink(s18, s2)
+	self.addLink(s19, s1)
+	self.addLink(s19, s2)
+	self.addLink(s20, s1)
+	self.addLink(s20, s2)
+	self.addLink(s21, s1)
+	self.addLink(s21, s2)
+	self.addLink(s22, s1)
+	self.addLink(s22, s2)
+	self.addLink(s23, s1)
+	self.addLink(s23, s2)
+	self.addLink(s24, s1)
+	self.addLink(s24, s2)
+	self.addLink(s25, s1)
+	self.addLink(s25, s2)
+	self.addLink(s26, s1)
+	self.addLink(s26, s2)
+	self.addLink(s27, s1)
+	self.addLink(s27, s2)
+	self.addLink(s28, s1)
+	self.addLink(s28, s2)
+	self.addLink(s29, s1)
+	self.addLink(s29, s2)
+	self.addLink(s30, s1)
+	self.addLink(s30, s2)
+
+	#info( '*** Add Spine-2 links\n')
+	self.addLink(s31, s3)
+	self.addLink(s31, s4)
+	self.addLink(s32, s3)
+	self.addLink(s32, s4)
+	self.addLink(s33, s3)
+	self.addLink(s33, s4)
+	self.addLink(s34, s3)
+	self.addLink(s34, s4)
+	self.addLink(s35, s3)
+	self.addLink(s35, s4)
+	self.addLink(s36, s3)
+	self.addLink(s36, s4)
+	self.addLink(s37, s3)
+	self.addLink(s37, s4)
+	self.addLink(s38, s3)
+	self.addLink(s38, s4)
+	self.addLink(s39, s3)
+	self.addLink(s39, s4)
+	self.addLink(s40, s3)
+	self.addLink(s40, s4)
+	self.addLink(s41, s3)
+	self.addLink(s41, s4)
+	self.addLink(s42, s3)
+	self.addLink(s42, s4)
+	self.addLink(s43, s3)
+	self.addLink(s43, s4)
+	self.addLink(s44, s3)
+	self.addLink(s44, s4)
+	self.addLink(s45, s3)
+	self.addLink(s45, s4)
+	self.addLink(s46, s3)
+	self.addLink(s46, s4)
+
+	#info( '*** Add Spine-3 links\n')
+	self.addLink(s47, s5)
+	self.addLink(s47, s6)
+	self.addLink(s48, s5)
+	self.addLink(s48, s6)
+	self.addLink(s49, s5)
+	self.addLink(s49, s6)
+	self.addLink(s50, s5)
+	self.addLink(s50, s6)
+	self.addLink(s51, s5)
+	self.addLink(s51, s6)
+	self.addLink(s52, s5)
+	self.addLink(s52, s6)
+	self.addLink(s53, s5)
+	self.addLink(s53, s6)
+	self.addLink(s54, s5)
+	self.addLink(s54, s6)
+	self.addLink(s55, s5)
+	self.addLink(s55, s6)
+	self.addLink(s56, s5)
+	self.addLink(s56, s6)
+	self.addLink(s57, s5)
+	self.addLink(s57, s6)
+	self.addLink(s58, s5)
+	self.addLink(s58, s6)
+	self.addLink(s59, s5)
+	self.addLink(s59, s6)
+	self.addLink(s60, s5)
+	self.addLink(s60, s6)
+	self.addLink(s61, s5)
+	self.addLink(s61, s6)
+	self.addLink(s62, s5)
+	self.addLink(s62, s6)
+
+	#info( '*** Add Spine-4 links\n')
+	self.addLink(s63, s7)
+	self.addLink(s63, s8)
+	self.addLink(s64, s7)
+	self.addLink(s64, s8)
+	self.addLink(s65, s7)
+	self.addLink(s65, s8)
+	self.addLink(s66, s7)
+	self.addLink(s66, s8)
+	self.addLink(s67, s7)
+	self.addLink(s67, s8)
+	self.addLink(s68, s7)
+	self.addLink(s68, s8)
+	self.addLink(s69, s7)
+	self.addLink(s69, s8)
+	self.addLink(s70, s7)
+	self.addLink(s70, s8)
+	self.addLink(s71, s7)
+	self.addLink(s71, s8)
+	self.addLink(s72, s7)
+	self.addLink(s72, s8)
+	self.addLink(s73, s7)
+	self.addLink(s73, s8)
+	self.addLink(s74, s7)
+	self.addLink(s74, s8)
+	self.addLink(s75, s7)
+	self.addLink(s75, s8)
+	self.addLink(s76, s7)
+	self.addLink(s76, s8)
+	self.addLink(s77, s7)
+	self.addLink(s77, s8)
+	self.addLink(s78, s7)
+	self.addLink(s78, s8)
+
+topos = { 'spine': ( lambda: spineTopo() ) }
+
+# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
+def setupNetwork():
+    "Create network"
+    topo = spineTopo()
+    #if controller_ip == '':
+        #controller_ip = '10.0.2.2';
+    #    controller_ip = '127.0.0.1';
+    network = Mininet(topo=topo, switch=OVSSwitch, link=TCLink, autoSetMacs = True, controller=None)
+    network.start()
+    CLI( network )
+    network.stop()
+
+if __name__ == '__main__':
+    setLogLevel('info')
+    #setLogLevel('debug')
+    setupNetwork()
+
diff --git a/TestON/tests/CHOtest/README b/TestON/tests/CHOtest/README
new file mode 100644
index 0000000..4b92d14
--- /dev/null
+++ b/TestON/tests/CHOtest/README
@@ -0,0 +1 @@
+#This README file be updated soon
diff --git a/TestON/tests/CHOtest/__init__.py b/TestON/tests/CHOtest/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/CHOtest/__init__.py
