diff --git a/TestON/tests/CHO/CHOtest/CHOtest.params b/TestON/tests/CHO/CHOtest/CHOtest.params
new file mode 100644
index 0000000..45d0fef
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/CHOtest.params
@@ -0,0 +1,116 @@
+<PARAMS>
+    # 1,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*10,200,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*10,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*10
+    # 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
+    # 14X. IPv6 Reative forwarding | host discovery
+    # 5. ONOS Topology verification
+    # 6X. host intents
+    # 16X. IPv6 ping across host intents
+    # 7X. Bring random links down( Unique for each topology)
+    # 17X. IPv6 ping after link down
+    # 8X. Bring random links back up
+    # 18X. IPv6 ping after link backs up
+    # 9X. Point,Multi-single,Single-Multi Intents
+    # 19X. IPv6 ping across Point,Multi-single,Single-Multi Intents
+
+    <testcases>
+    1,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*20,200,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*20,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*20
+    </testcases>
+
+    <DEPENDENCY>
+        <path>/tests/CHOtest/dependencies/</path>
+        <wrapper>CHOtestFunctions</wrapper>
+    </DEPENDENCY>
+
+    <GIT>
+        #autoPull 'on' or 'off'
+        <autoPull>off</autoPull>
+        <branch>master</branch>
+    </GIT>
+
+    <CTRL>
+        <numCtrl>3</numCtrl>
+        <karafCliTimeout>7200000</karafCliTimeout>
+    </CTRL>
+
+    <TOPO1>
+        <topo>topoAttIpv6.py</topo>
+        <numSwitches>25</numSwitches>
+        <numHosts>25</numHosts>
+        <numLinks>112</numLinks>
+        <numPaths>1</numPaths>
+    </TOPO1>
+
+    <TOPO2>
+        <topo>topoChordalIpv6.py</topo>
+        <numSwitches>25</numSwitches>
+        <numHosts>25</numHosts>
+        <numLinks>600</numLinks>
+        <numPaths>1</numPaths>
+    </TOPO2>
+
+    <TOPO3>
+        <topo>topoSpineIpv6.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>
+        <IntentPurgeDelay>15</IntentPurgeDelay>
+        <CheckIntentDelay>15</CheckIntentDelay>
+        <topoCheckDelay>15</topoCheckDelay>
+        <pingSleep>15</pingSleep>
+        <pingTimeoutSmallTopo>180</pingTimeoutSmallTopo>
+        <pingTimeoutLargeTopo>300</pingTimeoutLargeTopo>
+        <remHostDelay>60</remHostDelay>
+        <remDevDelay>60</remDevDelay>
+    </timers>
+
+    <TEST>
+        <pauseTest>off</pauseTest>
+        <email>off</email>
+        <intentChecks>10</intentChecks>
+        <linkChecks>3</linkChecks>
+        <topoChecks>3</topoChecks>
+        <numPings>3</numPings>
+    </TEST>
+
+</PARAMS>
diff --git a/TestON/tests/CHO/CHOtest/CHOtest.py b/TestON/tests/CHO/CHOtest/CHOtest.py
new file mode 100644
index 0000000..a1fb04f
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/CHOtest.py
@@ -0,0 +1,3814 @@
+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
+        import re
+        import imp
+
+        global intentState
+        main.threadID = 0
+        main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
+        main.dependencyPath = main.testOnDirectory + \
+                              main.params[ 'DEPENDENCY' ][ 'path' ]
+        wrapperFile = main.params[ 'DEPENDENCY' ][ 'wrapper' ]
+        main.numCtrls = main.params[ 'CTRL' ][ 'numCtrl' ]
+        git_pull = main.params[ 'GIT' ][ 'autoPull' ]
+        git_branch = main.params[ 'GIT' ][ 'branch' ]
+        karafTimeout = main.params['CTRL']['karafCliTimeout']
+        main.linkSleep = int( main.params['timers']['LinkDiscovery'] )
+        main.checkIntentsDelay = int( main.params['timers']['CheckIntentDelay'] )
+        main.pingSleep = int( main.params['timers']['pingSleep'] )
+        main.topoCheckDelay = int( main.params['timers']['topoCheckDelay'] )
+        main.pingTimeoutSmallTopo = int( main.params['timers']['pingTimeoutSmallTopo'] )
+        main.pingTimeoutLargeTopo = int( main.params['timers']['pingTimeoutLargeTopo'] )
+        main.remHostDelay = int( main.params['timers']['remHostDelay'] )
+        main.remDevDelay = int( main.params['timers']['remDevDelay'] )
+        main.failSwitch = main.params['TEST']['pauseTest']
+        main.emailOnStop = main.params['TEST']['email']
+        main.intentCheck = int( main.params['TEST']['intentChecks'] )
+        main.linkCheck = int( main.params['TEST']['linkChecks'] )
+        main.topoCheck = int( main.params['TEST']['topoChecks'] )
+        main.numPings = int( main.params['TEST']['numPings'] )
+        main.newTopo = ""
+        main.CLIs = []
+
+        main.failSwitch = True if main.failSwitch == "on" else False
+        main.emailOnStop = True if main.emailOnStop == "on" else False
+
+        for i in range( 1, int(main.numCtrls) + 1 ):
+            main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+
+        main.CHOtestFunctions = imp.load_source( wrapperFile,
+                                                 main.dependencyPath +
+                                                 wrapperFile +
+                                                 ".py" )
+
+        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 )
+            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.cleanup()
+            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( "Installing 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
+
+        main.step( "Set IPv6 cfg parameters for Neighbor Discovery" )
+        time.sleep(30)
+        cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.proxyarp.ProxyArp", "ipv6NeighborDiscovery", "true" )
+        cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "ipv6NeighborDiscovery", "true" )
+        cfgResult = cfgResult1 and cfgResult2
+        utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
+                                 onpass="ipv6NeighborDiscovery cfg is set to true",
+                                 onfail="Failed to cfg set ipv6NeighborDiscovery" )
+
+        case1Result = installResult and uninstallResult and statusResult and startCliResult and cfgResult
+        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.prefix = 0
+        main.numMNswitches = int ( main.params[ 'TOPO1' ][ 'numSwitches' ] )
+        main.numMNlinks = int ( main.params[ 'TOPO1' ][ 'numLinks' ] )
+        main.numMNhosts = int ( main.params[ 'TOPO1' ][ 'numHosts' ] )
+        main.pingTimeout = main.pingTimeoutSmallTopo
+
+        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( "Start Mininet with Att topology" )
+        main.newTopo = main.params['TOPO1']['topo']
+        mininetDir = main.Mininet1.home + "/custom/"
+        topoPath = main.testDir + "/" + main.TEST  + "/dependencies/" + main.newTopo
+        main.ONOSbench.secureCopy(main.Mininet1.user_name, main.Mininet1.ip_address, topoPath, mininetDir, direction="to")
+        topoPath = mininetDir + main.newTopo
+        startStatus = main.Mininet1.startNet(topoFile = topoPath)
+
+        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.prefix = 1
+        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 = main.pingTimeoutSmallTopo
+
+        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("Start Mininet with Chordal topology")
+        mininetDir = main.Mininet1.home + "/custom/"
+        topoPath = main.testDir + "/" + main.TEST  + "/dependencies/" + main.newTopo
+        main.ONOSbench.secureCopy(main.Mininet1.user_name, main.Mininet1.ip_address, topoPath, mininetDir, direction="to")
+        topoPath = mininetDir + main.newTopo
+        startStatus = main.Mininet1.startNet(topoFile = topoPath)
+
+        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 )
+
+        caseResult = switch_mastership
+        time.sleep(30)
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            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.prefix = 2
+        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 = main.pingTimeoutLargeTopo
+
+        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("Start Mininet with Spine topology")
+        mininetDir = main.Mininet1.home + "/custom/"
+        topoPath = main.testDir + "/" + main.TEST  + "/dependencies/" + main.newTopo
+        main.ONOSbench.secureCopy(main.Mininet1.user_name, main.Mininet1.ip_address, topoPath, mininetDir, direction="to")
+        topoPath = mininetDir + main.newTopo
+        startStatus = main.Mininet1.startNet(topoFile = topoPath)
+
+        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 )
+
+        caseResult = switch_mastership
+        time.sleep(60)
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            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
+
+        for check in range(main.topoCheck):
+            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))
+
+                # Exit out of the topo check loop
+                break
+
+            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, trying again...")
+                topoResult = main.FALSE
+                time.sleep(main.topoCheckDelay)
+
+        # 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 CASE200( self, main ):
+
+        import time
+        main.log.report( "Clean up ONOS" )
+        main.log.case( "Stop topology and remove hosts and devices" )
+
+        main.step( "Stop Topology" )
+        stopStatus = main.Mininet1.stopNet()
+        utilities.assert_equals( expect=main.TRUE, actual=stopStatus,
+                                 onpass="Stopped mininet",
+                                 onfail="Failed to stop mininet" )
+
+
+        main.log.info( "Constructing host id list" )
+        hosts = []
+        for i in range( main.numMNhosts ):
+            hosts.append( "h" + str(i+1) )
+
+        main.step( "Getting host ids" )
+        hostList = main.CLIs[0].getHostsId( hosts )
+        hostIdResult = True if hostList else False
+        utilities.assert_equals( expect=True, actual=hostIdResult,
+                                 onpass="Successfully obtained the host ids.",
+                                 onfail="Failed to obtain the host ids" )
+
+        main.step( "Removing hosts" )
+        hostResult = main.CLIs[0].removeHost( hostList )
+        utilities.assert_equals( expect=main.TRUE, actual=hostResult,
+                                 onpass="Successfully removed hosts",
+                                 onfail="Failed remove hosts" )
+
+        time.sleep( main.remHostDelay )
+
+        main.log.info( "Constructing device uri list" )
+        deviceList = []
+        for i in range( main.numMNswitches ):
+            deviceList.append( "of:00000000000000" + format( i+1, "02x" ) )
+
+        main.step( "Removing devices" )
+        deviceResult = main.CLIs[0].removeDevice( deviceList )
+        utilities.assert_equals( expect=main.TRUE, actual=deviceResult,
+                                 onpass="Successfully removed devices",
+                                 onfail="Failed remove devices" )
+
+        time.sleep( main.remDevDelay )
+
+        main.log.info( "Summary\n{}".format( main.CLIs[0].summary( jsonFormat=False ) ) )
+
+
+    def CASE40( self, main ):
+        """
+        Verify Reactive forwarding
+        """
+        import time
+        main.log.report( "Verify Reactive forwarding" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding, verify pingall, and disable reactive forwarding" )
+
+        main.step( "Enable Reactive forwarding" )
+        appResult = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully install fwd app",
+                                 onfail="Failed to install fwd app" )
+
+
+        main.step( "Verify Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else:
+                break
+
+        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="Reactive Mode IPv4 Pingall test PASS",
+                                 onfail="Reactive Mode IPv4 Pingall test FAIL" )
+
+        if not pingResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+        main.step( "Disable Reactive forwarding" )
+        appResult =  main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully deactivated fwd app",
+                                 onfail="Failed to deactivate fwd app" )
+
+    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 Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if not pingResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+        if pingResult == main.TRUE:
+            main.log.report( "IPv4 Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "IPv4 Pingall Test in Reactive mode failed" )
+
+        caseResult =  appCheck and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Reactive Mode IPv4 Pingall test PASS",
+                                 onfail="Reactive Mode IPv4 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 Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if not pingResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+        if pingResult == main.TRUE:
+            main.log.report( "IPv4 Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "IPv4 Pingall Test in Reactive mode failed" )
+
+        caseResult =  appCheck and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Reactive Mode IPv4 Pingall test PASS",
+                                 onfail="Reactive Mode IPv4 Pingall test FAIL" )
+
+    def CASE47( self, main ):
+        """
+        Verify reactive forwarding in ATT topology, use a different ping method than CASE40
+        """
+        import time
+        main.log.report( "Verify Reactive forwarding (ATT Topology) " )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding, verify ping, and disable reactive forwarding" )
+
+        main.step( "Enable Reactive forwarding" )
+        appResult = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully install fwd app",
+                                 onfail="Failed to install fwd app" )
+
+        numHosts = int( main.params['TOPO1']['numHosts'] )
+
+        for i in range(numHosts):
+            src = "h1"
+            dest = "h" + str(i+1)
+            main.Mininet1.handle.sendline( src + " ping " + dest + " -c 3 -i 1 -W 1" )
+            main.Mininet1.handle.expect( "mininet>" )
+            main.log.info( main.Mininet1.handle.before )
+
+        hosts = main.CLIs[0].hosts( jsonFormat=False )
+
+        main.log.info( hosts )
+
+        main.step( "Disable Reactive forwarding" )
+        appResult =  main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully deactivated fwd app",
+                                 onfail="Failed to deactivate fwd app" )
+
+    def CASE48( self, main ):
+        """
+        Verify reactive forwarding in Chordal topology, use a different ping method than CASE41
+        """
+        import time
+        main.log.report( "Verify Reactive forwarding (Chordal Topology) " )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding, verify ping, and disable reactive forwarding" )
+
+        main.step( "Enable Reactive forwarding" )
+        appResult = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully install fwd app",
+                                 onfail="Failed to install fwd app" )
+
+        numHosts = int( main.params['TOPO2']['numHosts'] )
+
+        for i in range(numHosts):
+            src = "h1"
+            dest = "h" + str(i+1)
+            main.Mininet1.handle.sendline( src + " ping " + dest + " -c 3 -i 1 -W 1" )
+            main.Mininet1.handle.expect( "mininet>" )
+            main.log.info( main.Mininet1.handle.before )
+
+        hosts = main.CLIs[0].hosts( jsonFormat=False )
+
+        main.log.info( hosts )
+
+        main.step( "Disable Reactive forwarding" )
+        appResult =  main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully deactivated fwd app",
+                                 onfail="Failed to deactivate fwd app" )
+
+    def CASE49( self, main ):
+        """
+        Verify reactive forwarding in Spine-leaf topology, use a different ping method than CASE42
+        """
+        import time
+        main.log.report( "Verify Reactive forwarding (Spine-leaf Topology) " )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding, verify ping, and disable reactive forwarding" )
+
+        main.step( "Enable Reactive forwarding" )
+        appResult = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully install fwd app",
+                                 onfail="Failed to install fwd app" )
+
+        numHosts = int( main.params['TOPO3']['numHosts'] )
+
+        for i in range(11, numHosts+10):
+            src = "h11"
+            dest = "h" + str(i+1)
+            main.Mininet1.handle.sendline( src + " ping " + dest + " -c 3 -i 1 -W 1" )
+            main.Mininet1.handle.expect( "mininet>" )
+            main.log.info( main.Mininet1.handle.before )
+
+        hosts = main.CLIs[0].hosts( jsonFormat=False )
+
+        main.log.info( hosts )
+
+        main.step( "Disable Reactive forwarding" )
+        appResult =  main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully deactivated fwd app",
+                                 onfail="Failed to deactivate fwd app" )
+
+    def CASE140( self, main ):
+        """
+        Verify IPv6 Reactive forwarding (Att Topology)
+        """
+        import re
+        import copy
+        import time
+        main.log.report( "Verify IPv6 Reactive forwarding (Att Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable IPv6 Reactive forwarding and Verify ping all" )
+        hostList = [ ('h'+ str(x + 1)) for x in range (main.numMNhosts) ]
+
+        main.step( "Set IPv6 cfg parameters for Reactive forwarding" )
+        cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" )
+        cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" )
+        cfgResult = cfgResult1 and cfgResult2
+        utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
+                                 onpass="Reactive mode ipv6Fowarding cfg is set to true",
+                                 onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
+
+        main.step( "Verify IPv6 Pingall" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout)
+        if not pingResult:
+            main.log.warn("First pingall failed. Trying again..")
+            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for IPv6 Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if pingResult == main.TRUE:
+            main.log.report( "IPv6 Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "IPv6 Pingall Test in Reactive mode failed" )
+
+
+        caseResult =  appCheck and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Reactive Mode IPv6 Pingall test PASS",
+                                 onfail="Reactive Mode IPv6 Pingall test FAIL" )
+
+    def CASE141( self, main ):
+        """
+        Verify IPv6 Reactive forwarding (Chordal Topology)
+        """
+        import re
+        import copy
+        import time
+        main.log.report( "Verify IPv6 Reactive forwarding (Chordal Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable IPv6 Reactive forwarding and Verify ping all" )
+        hostList = [ ('h'+ str(x + 1)) for x in range (main.numMNhosts) ]
+
+        main.step( "Set IPv6 cfg parameters for Reactive forwarding" )
+        cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" )
+        cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" )
+        cfgResult = cfgResult1 and cfgResult2
+        utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
+                                 onpass="Reactive mode ipv6Fowarding cfg is set to true",
+                                 onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
+
+        main.step( "Verify IPv6 Pingall" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout)
+        if not pingResult:
+            main.log.warn("First pingall failed. Trying again..")
+            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for IPv6 Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if pingResult == main.TRUE:
+            main.log.report( "IPv6 Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "IPv6 Pingall Test in Reactive mode failed" )
+
+        main.step( "Disable Reactive forwarding" )
+
+        main.log.info( "Uninstall reactive forwarding app" )
+        appCheck = main.TRUE
+        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 )
+        caseResult =  appCheck and cfgResult and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Reactive Mode IPv6 Pingall test PASS",
+                                 onfail="Reactive Mode IPv6 Pingall test FAIL" )
+
+    def CASE142( self, main ):
+        """
+        Verify IPv6 Reactive forwarding (Spine Topology)
+        """
+        import re
+        import copy
+        import time
+        main.log.report( "Verify IPv6 Reactive forwarding (Spine Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable IPv6 Reactive forwarding and Verify ping all" )
+        # Spine topology do not have hosts h1-h10
+        hostList = [ ('h'+ str(x + 11)) for x in range (main.numMNhosts) ]
+        main.step( "Set IPv6 cfg parameters for Reactive forwarding" )
+        cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" )
+        cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" )
+        cfgResult = cfgResult1 and cfgResult2
+        utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
+                                 onpass="Reactive mode ipv6Fowarding cfg is set to true",
+                                 onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
+
+        main.step( "Verify IPv6 Pingall" )
+        pingResult = main.FALSE
+        time1 = time.time()
+        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout)
+        if not pingResult:
+            main.log.warn("First pingall failed. Trying again...")
+            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for IPv6 Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if pingResult == main.TRUE:
+            main.log.report( "IPv6 Pingall Test in Reactive mode successful" )
+        else:
+            main.log.report( "IPv6 Pingall Test in Reactive mode failed" )
+
+        main.step( "Disable Reactive forwarding" )
+
+        main.log.info( "Uninstall reactive forwarding app" )
+        appCheck = main.TRUE
+        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 )
+        caseResult =  appCheck and cfgResult and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Reactive Mode IPv6 Pingall test PASS",
+                                 onfail="Reactive Mode IPv6 Pingall test FAIL" )
+
+    def CASE147( self, main ):
+        """
+        Verify IPv6 reactive forwarding in ATT topology, use a different ping method than CASE140
+        """
+        import time
+        main.log.report( "Verify IPv6 Reactive forwarding (ATT Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding, verify ping6, and disable reactive forwarding" )
+
+        main.step( "Enable IPv4 Reactive forwarding" )
+        appResult = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully install fwd app",
+                                 onfail="Failed to install fwd app" )
+
+        main.step( "Set IPv6 cfg parameters for Reactive forwarding" )
+        cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" )
+        cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" )
+        cfgResult = cfgResult1 and cfgResult2
+        utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
+                                 onpass="Reactive mode ipv6Fowarding cfg is set to true",
+                                 onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
+
+        main.step( "Discover hosts using ping" )
+        numHosts = int( main.params['TOPO1']['numHosts'] )
+        for i in range(numHosts):
+            src = "h1"
+            dest = "1000::" + str(i+1)
+            main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
+            main.Mininet1.handle.expect( "mininet>" )
+            main.log.info( main.Mininet1.handle.before )
+        hosts = main.CLIs[0].hosts( jsonFormat=False )
+        main.log.info( hosts )
+
+        main.step( "Disable Reactive forwarding" )
+        main.log.info( "Uninstall IPv6 reactive forwarding app" )
+        appCheck = main.TRUE
+        appResults = 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 )
+
+        main.step( "Disable IPv4 Reactive forwarding" )
+        appResult =  main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully deactivated IPv4 fwd app",
+                                 onfail="Failed to deactivate IPv4 fwd app" )
+
+    def CASE148( self, main ):
+        """
+        Verify reactive forwarding in Chordal topology, use a different ping method than CASE141
+        """
+        import time
+        main.log.report( "Verify IPv6 Reactive forwarding (Chordal Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding, verify ping6, and disable reactive forwarding" )
+
+        main.step( "Enable IPv4 Reactive forwarding" )
+        appResult = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully install fwd app",
+                                 onfail="Failed to install fwd app" )
+
+        main.step( "Set IPv6 cfg parameters for Reactive forwarding" )
+        cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" )
+        cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" )
+        cfgResult = cfgResult1 and cfgResult2
+        utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
+                                 onpass="Reactive mode ipv6Fowarding cfg is set to true",
+                                 onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
+
+        main.step( "Discover hosts using ping" )
+        numHosts = int( main.params['TOPO2']['numHosts'] )
+        for i in range(numHosts):
+            src = "h1"
+            dest = "1000::" + str(i+1)
+            main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
+            main.Mininet1.handle.expect( "mininet>" )
+            main.log.info( main.Mininet1.handle.before )
+        hosts = main.CLIs[0].hosts( jsonFormat=False )
+        main.log.info( hosts )
+
+        main.step( "Disable Reactive forwarding" )
+        main.log.info( "Uninstall IPv6 reactive forwarding app" )
+        appCheck = main.TRUE
+        appResults = 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 )
+
+        main.step( "Disable IPv4 Reactive forwarding" )
+        appResult =  main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully deactivated IPv4 fwd app",
+                                 onfail="Failed to deactivate IPv4 fwd app" )
+
+    def CASE149( self, main ):
+        """
+        Verify reactive forwarding in Spine-leaf topology, use a different ping method than CASE142
+        """
+        import time
+        main.log.report( "Verify IPv6 Reactive forwarding (Spine-leaf Topology)" )
+        main.log.report( "______________________________________________" )
+        main.case( "Enable Reactive forwarding, verify ping6, and disable reactive forwarding" )
+
+        main.step( "Enable IPv4 Reactive forwarding" )
+        appResult = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully install fwd app",
+                                 onfail="Failed to install fwd app" )
+
+        main.step( "Set IPv6 cfg parameters for Reactive forwarding" )
+        cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" )
+        cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" )
+        cfgResult = cfgResult1 and cfgResult2
+        utilities.assert_equals( expect=main.TRUE, actual=cfgResult,
+                                 onpass="Reactive mode ipv6Fowarding cfg is set to true",
+                                 onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
+
+        main.step( "Discover hosts using ping" )
+        numHosts = int( main.params['TOPO3']['numHosts'] )
+        for i in range(11, numHosts+10):
+            src = "h11"
+            dest = "1000::" + str(i+1)
+            main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
+            main.Mininet1.handle.expect( "mininet>" )
+            main.log.info( main.Mininet1.handle.before )
+        hosts = main.CLIs[0].hosts( jsonFormat=False )
+        main.log.info( hosts )
+
+        main.step( "Disable Reactive forwarding" )
+        main.log.info( "Uninstall IPv6 reactive forwarding app" )
+        appCheck = main.TRUE
+        appResults = 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 )
+
+        main.step( "Disable IPv4 Reactive forwarding" )
+        appResult =  main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
+        utilities.assert_equals( expect=main.TRUE, actual=appResult,
+                                 onpass="Successfully deactivated IPv4 fwd app",
+                                 onfail="Failed to deactivate IPv4 fwd app" )
+
+    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" )
+
+        for check in range(main.topoCheck):
+            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.
+            """
+            caseResult = ( stepResult1 and stepResult2 )
+
+            if caseResult:
+                break
+            else:
+                time.sleep( main.topoCheckDelay )
+                main.log.warn( "Topology check failed. Trying again..." )
+
+
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 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( "_______________________________________" )
+        main.case( "Install 300 host intents" )
+
+        main.step( "Add host Intents" )
+        intentIdList = main.CHOtestFunctions.installHostIntents()
+        main.intentIds = list(intentIdList)
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = ( intentState and pingResult )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="Install 300 Host Intents and Ping All test PASS",
+            onfail="Install 300 Host Intents and Ping All test FAIL" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE61( self ):
+        """
+        Install 300 host intents and verify ping all for Chordal Topology
+        """
+        main.log.report( "Add 300 host intents and verify pingall (Chordal Topo)" )
+        main.log.report( "_______________________________________" )
+        main.case( "Install 300 host intents" )
+
+        main.step( "Add host Intents" )
+        intentIdList = main.CHOtestFunctions.installHostIntents()
+        main.intentIds = list(intentIdList)
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = ( intentState and pingResult )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=caseResult,
+                                 onpass="Install 300 Host Intents and Ping All test PASS",
+                                 onfail="Install 300 Host Intents and Ping All test FAIL" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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( "_______________________________________" )
+        main.case( "Install 2278 host intents" )
+
+        main.step( "Add host Intents" )
+        intentIdList = main.CHOtestFunctions.installHostIntents()
+        main.intentIds = list(intentIdList)
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = ( intentState and pingResult )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=caseResult,
+                                 onpass="Install 2278 Host Intents and Ping All test PASS",
+                                 onfail="Install 2278 Host Intents and Ping All test FAIL" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE160( self ):
+        """
+        Verify IPv6 ping across 300 host intents (Att Topology)
+        """
+        main.log.report( "Verify IPv6 ping across 300 host intents (Att Topology)" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all 300 host intents" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 300 host intents test PASS",
+            onfail="IPv6 Ping across 300 host intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE161( self ):
+        """
+        Verify IPv6 ping across 300 host intents (Chordal Topology)
+        """
+        main.log.report( "Verify IPv6 ping across 300 host intents (Chordal Topology)" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all 300 host intents" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 300 host intents test PASS",
+            onfail="IPv6 Ping across 300 host intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE162( self ):
+        """
+        Verify IPv6 ping across 2278 host intents (Spine Topology)
+        """
+        main.log.report( "Verify IPv6 ping across 2278 host intents (Spine Topology)" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all 2278 host intents" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 2278 host intents test PASS",
+            onfail="IPv6 Ping across 2278 host intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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' ]
+
+        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( main.linkSleep )
+            main.Mininet1.link(
+                END1=link2End1,
+                END2=main.randomLink2[ i ],
+                OPTION="down" )
+            time.sleep( main.linkSleep )
+            main.Mininet1.link(
+                END1=link3End1,
+                END2=main.randomLink3[ i ],
+                OPTION="down" )
+            time.sleep( main.linkSleep )
+
+        main.step("Verify link down is discoverd by onos")
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down",
+                                                          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( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkDown and pingResult and intentState
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=caseResult,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+        # Printing what exactly failed
+        if not linkDown:
+            main.log.debug( "Link down was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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' ]
+        main.linkSleep = 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( main.linkSleep )
+            main.Mininet1.link(
+                END1=link2End1,
+                END2=main.randomLink2[ i ],
+                OPTION="up" )
+            time.sleep( main.linkSleep )
+            main.Mininet1.link(
+                END1=link3End1,
+                END2=main.randomLink3[ i ],
+                OPTION="up" )
+            time.sleep( main.linkSleep )
+
+        main.step("Verify link up is discoverd by onos")
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up",
+                                                        int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkUp and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+        # Printing what exactly failed
+        if not linkUp:
+            main.log.debug( "Link up was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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' ]
+        main.linkSleep = 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( main.linkSleep )
+            main.Mininet1.link(
+                END1=link2End1,
+                END2=main.randomLink2[ i ],
+                OPTION="down" )
+            time.sleep( main.linkSleep )
+            main.Mininet1.link(
+                END1=link3End1,
+                END2=main.randomLink3[ i ],
+                OPTION="down" )
+            time.sleep( main.linkSleep )
+
+        main.step("Verify link down is discoverd by onos")
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down",
+                                                          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( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkDown and pingResult and intentState
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+        # Printing what exactly failed
+        if not linkDown:
+            main.log.debug( "Link down was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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' ]
+        main.linkSleep = 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( main.linkSleep )
+            main.Mininet1.link(
+                END1=link2End1,
+                END2=main.randomLink2[ i ],
+                OPTION="up" )
+            time.sleep( main.linkSleep )
+            main.Mininet1.link(
+                END1=link3End1,
+                END2=main.randomLink3[ i ],
+                OPTION="up" )
+            time.sleep( main.linkSleep )
+
+        main.step("Verify link up is discoverd by onos")
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkUp and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+        # Printing what exactly failed
+        if not linkUp:
+            main.log.debug( "Link up was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE72( self, main ):
+        """
+        Randomly bring some links down and verify ping all ( Host Intents-Chordal Topo)
+        """
+        import random
+        import itertools
+        main.linkSleep = 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( main.linkSleep )
+
+        main.step("Verify link down is discoverd by onos")
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down", 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( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkDown and pingResult and intentState
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+        # Printing what exactly failed
+        if not linkDown:
+            main.log.debug( "Link down was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE82( self, main ):
+        """
+        Bring the core links up that are down and verify ping all ( Host Intents Chordal Topo )
+        """
+        import random
+        main.linkSleep = 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( main.linkSleep )
+
+        main.step("Verify link up is discoverd by onos")
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkUp and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+        # Printing what exactly failed
+        if not linkUp:
+            main.log.debug( "Link up was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE73( self, main ):
+        """
+        Randomly bring some links down and verify ping all ( Point Intents-Chordal Topo)
+        """
+        import random
+        import itertools
+        main.linkSleep = 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( main.linkSleep )
+
+        main.step("Verify link down is discoverd by onos")
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down", 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( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkDown and pingResult and intentState
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+        # Printing what exactly failed
+        if not linkDown:
+            main.log.debug( "Link down was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE83( self, main ):
+        """
+        Bring the core links up that are down and verify ping all ( Point Intents Chordal Topo )
+        """
+        import random
+        main.linkSleep = 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( main.linkSleep )
+
+        main.step("Verify link up is discoverd by onos")
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkUp and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+        # Printing what exactly failed
+        if not linkUp:
+            main.log.debug( "Link up was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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( ',' )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+
+        main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
+        main.log.report( "___________________________________________________________________________" )
+        main.log.case( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
+
+        main.step( "Bring some core links down" )
+        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( main.linkSleep )
+        main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
+        time.sleep( main.linkSleep )
+
+        main.step( "Verify link down is discoverd by onos" )
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 4 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkDown,
+                                 onpass="Link down discovered properly",
+                                 onfail="Link down was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step( "Verify intents are installed" )
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkDown and pingResult and intentState
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+        # Printing what exactly failed
+        if not linkDown:
+            main.log.debug( "Link down was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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' ]
+        main.linkSleep = 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" )
+
+        main.step( "Bring up the core links that are down" )
+        # 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( main.linkSleep )
+        main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
+        time.sleep( main.linkSleep )
+
+        main.step("Verify link up is discoverd by onos")
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkUp and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+        # Printing what exactly failed
+        if not linkUp:
+            main.log.debug( "Link up was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE75( self, main ):
+        """
+        Randomly bring some core links down and verify ping all ( Point 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( ',' )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+
+        main.log.report( "Bring some core links down and verify ping all (Point Intents-Spine Topo)" )
+        main.log.report( "___________________________________________________________________________" )
+        main.case( "Bring some core links down and verify ping all (Point Intents-Spine Topo)" )
+
+        main.step( "Bring some core links down" )
+        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( main.linkSleep )
+        main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
+        time.sleep( main.linkSleep )
+
+        main.step("Verify link down is discoverd by onos")
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 4 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkDown,
+                                 onpass="Link down discovered properly",
+                                 onfail="Link down was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkDown and pingResult and intentState
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Random Link cut Test PASS",
+                                 onfail="Random Link cut Test FAIL" )
+
+        # Printing what exactly failed
+        if not linkDown:
+            main.log.debug( "Link down was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE85( self, main ):
+        """
+        Bring the core links up that are down and verify ping all ( Point Intents-Spine Topo )
+        """
+        import random
+        link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
+        link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.log.report(
+            "Bring the core links up that are down and verify ping all (Point Intents-Spine Topo" )
+        main.log.report(
+            "__________________________________________________________________" )
+        main.case(
+            "Point intents - Bring the core links up that are down and verify ping all" )
+
+        main.step( "Bring up the core links that are down" )
+        # 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( main.linkSleep )
+        main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
+        time.sleep( main.linkSleep )
+
+        main.step("Verify link up is discoverd by onos")
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = linkUp and pingResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Link Up Test PASS",
+                                 onfail="Link Up Test FAIL" )
+        # Printing what exactly failed
+        if not linkUp:
+            main.log.debug( "Link up was not discovered correctly" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not intentState:
+            main.log.debug( "Intents are not all installed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE170( self ):
+        """
+        IPv6 ping all with some core links down( Host Intents-Att Topo)
+        """
+        main.log.report( "IPv6 ping all with some core links down( Host Intents-Att Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with some core links down( Host Intents-Att Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 300 host intents test PASS",
+            onfail="IPv6 Ping across 300 host intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE180( self ):
+        """
+        IPv6 ping all with after core links back up( Host Intents-Att Topo)
+        """
+        main.log.report( "IPv6 ping all with after core links back up( Host Intents-Att Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with after core links back up( Host Intents-Att Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 300 host intents test PASS",
+            onfail="IPv6 Ping across 300 host intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE171( self ):
+        """
+        IPv6 ping all with some core links down( Point Intents-Att Topo)
+        """
+        main.log.report( "IPv6 ping all with some core links down( Point Intents-Att Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with some core links down( Point Intents-Att Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 600 point intents test PASS",
+            onfail="IPv6 Ping across 600 point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE181( self ):
+        """
+        IPv6 ping all with after core links back up( Point Intents-Att Topo)
+        """
+        main.log.report( "IPv6 ping all with after core links back up( Point Intents-Att Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with after core links back up( Point Intents-Att Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 600 Point intents test PASS",
+            onfail="IPv6 Ping across 600 Point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE172( self ):
+        """
+        IPv6 ping all with some core links down( Host Intents-Chordal Topo)
+        """
+        main.log.report( "IPv6 ping all with some core links down( Host Intents-Chordal Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with some core links down( Host Intents-Chordal Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 300 host intents test PASS",
+            onfail="IPv6 Ping across 300 host intents test FAIL" )
+
+    def CASE182( self ):
+        """
+        IPv6 ping all with after core links back up( Host Intents-Chordal Topo)
+        """
+        main.log.report( "IPv6 ping all with after core links back up( Host Intents-Chordal Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with after core links back up( Host Intents-Chordal Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 300 host intents test PASS",
+            onfail="IPv6 Ping across 300 host intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE173( self ):
+        """
+        IPv6 ping all with some core links down( Point Intents-Chordal Topo)
+        """
+        main.log.report( "IPv6 ping all with some core links down( Point Intents-Chordal Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with some core links down( Point Intents-Chordal Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 600 point intents test PASS",
+            onfail="IPv6 Ping across 600 point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE183( self ):
+        """
+        IPv6 ping all with after core links back up( Point Intents-Chordal Topo)
+        """
+        main.log.report( "IPv6 ping all with after core links back up( Point Intents-Chordal Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with after core links back up( Point Intents-Chordal Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 600 Point intents test PASS",
+            onfail="IPv6 Ping across 600 Point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE174( self ):
+        """
+        IPv6 ping all with some core links down( Host Intents-Spine Topo)
+        """
+        main.log.report( "IPv6 ping all with some core links down( Host Intents-Spine Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with some core links down( Host Intents-Spine Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 2278 host intents test PASS",
+            onfail="IPv6 Ping across 2278 host intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE184( self ):
+        """
+        IPv6 ping all with after core links back up( Host Intents-Spine Topo)
+        """
+        main.log.report( "IPv6 ping all with after core links back up( Host Intents-Spine Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with after core links back up( Host Intents-Spine Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 2278 host intents test PASS",
+            onfail="IPv6 Ping across 2278 host intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE175( self ):
+        """
+        IPv6 ping all with some core links down( Point Intents-Spine Topo)
+        """
+        main.log.report( "IPv6 ping all with some core links down( Point Intents-Spine Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with some core links down( Point Intents-Spine Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 4556 point intents test PASS",
+            onfail="IPv6 Ping across 4556 point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE185( self ):
+        """
+        IPv6 ping all with after core links back up( Point Intents-Spine Topo)
+        """
+        main.log.report( "IPv6 ping all with after core links back up( Point Intents-Spine Topo )" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all with after core links back up( Point Intents-Spine Topo )" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 4556 Point intents test PASS",
+            onfail="IPv6 Ping across 4556 Point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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( "_______________________________________" )
+        main.case( "Install 600 point intents" )
+
+        main.step( "Add point Intents" )
+        intentIdList = main.CHOtestFunctions.installPointIntents()
+        main.intentIds = list(intentIdList)
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = ( intentState and pingResult )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="Install 600 point Intents and Ping All test PASS",
+            onfail="Install 600 point Intents and Ping All test FAIL" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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( "_______________________________________" )
+        main.case( "Install 600 point intents" )
+
+        main.step( "Add point Intents" )
+        intentIdList = main.CHOtestFunctions.installPointIntents()
+        main.intentIds = list(intentIdList)
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = ( intentState and pingResult )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="Install 600 point Intents and Ping All test PASS",
+            onfail="Install 600 point Intents and Ping All test FAIL" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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( "_______________________________________" )
+        main.case( "Install 4556 point intents" )
+
+        main.step( "Add point Intents" )
+        intentIdList = main.CHOtestFunctions.installPointIntents()
+        main.intentIds = list(intentIdList)
+
+        main.step("Verify intents are installed")
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step( "Verify Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = ( intentState and pingResult )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="Install 4556 point Intents and Ping All test PASS",
+            onfail="Install 4556 point Intents and Ping All test FAIL" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE93( self ):
+        """
+        Install multi-single point intents and verify Ping all works
+        for att topology
+        """
+        import copy
+        import time
+        from collections import Counter
+        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 = []
+        main.log.info( "MACsDict" + str(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','','',main.MACsDict.get(egressDevice)])
+                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))
+
+        main.step("Verify intents are installed")
+        # Giving onos multiple chances to install intents
+        for i in range( main.intentCheck ):
+            if i != 0:
+                main.log.warn( "Verification failed. Retrying..." )
+            main.log.info("Waiting for onos to install intents...")
+            time.sleep( main.checkIntentsDelay )
+
+            intentState = main.TRUE
+            for e in range(int(main.numCtrls)):
+                main.log.info( "Checking intents on CLI %s" % (e+1) )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
+            if intentState:
+                break
+        if not intentState:
+            #Dumping intent summary
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step("Verify flows are all added")
+
+        for i in range( main.flowCheck ):
+            if i != 0:
+                main.log.warn( "verification failed. Retrying..." )
+            main.log.info( "Waiting for onos to add flows..." )
+            time.sleep( main.checkFlowsDelay )
+
+            flowState = main.TRUE
+            for cli in main.CLIs:
+                flowState = cli.checkFlowState()
+                if not flowState:
+                    main.log.warn( "Not all flows added" )
+            if flowState:
+                break
+        else:
+            #Dumping summary
+            main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=flowState,
+                                 onpass="FLOWS INSTALLED",
+                                 onfail="SOME FLOWS NOT ADDED" )
+
+        main.step( "Verify Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        caseResult = ( checkFlowsState and pingResult and intentState )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            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" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not checkFlowsState:
+            main.log.debug( "Flows failed to add completely" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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 = []
+        main.log.info( "MACsDict" + str(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','','',main.MACsDict.get(egressDevice)])
+                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))
+
+        main.step("Verify intents are installed")
+        # Giving onos multiple chances to install intents
+        for i in range( main.intentCheck ):
+            if i != 0:
+                main.log.warn( "Verification failed. Retrying..." )
+            main.log.info("Waiting for onos to install intents...")
+            time.sleep( main.checkIntentsDelay )
+
+            intentState = main.TRUE
+            for e in range(int(main.numCtrls)):
+                main.log.info( "Checking intents on CLI %s" % (e+1) )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
+            if intentState:
+                break
+        if not intentState:
+            #Dumping intent summary
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step("Verify flows are all added")
+
+        for i in range( main.flowCheck ):
+            if i != 0:
+                main.log.warn( "verification failed. Retrying..." )
+            main.log.info( "Waiting for onos to add flows..." )
+            time.sleep( main.checkFlowsDelay )
+
+            flowState = main.TRUE
+            for cli in main.CLIs:
+                flowState = cli.checkFlowState()
+                if not flowState:
+                    main.log.warn( "Not all flows added" )
+            if flowState:
+                break
+        else:
+            #Dumping summary
+            main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=flowState,
+                                 onpass="FLOWS INSTALLED",
+                                 onfail="SOME FLOWS NOT ADDED" )
+
+        main.step( "Verify Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        caseResult = ( checkFlowsState and pingResult and intentState )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            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" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not checkFlowsState:
+            main.log.debug( "Flows failed to add completely" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE95( self ):
+        """
+        Install multi-single point intents and verify Ping all works
+        for Spine 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 = []
+        main.log.info( "MACsDict" + str(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','','',main.MACsDict.get(egressDevice)])
+                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))
+
+        main.step("Verify intents are installed")
+        # Giving onos multiple chances to install intents
+        for i in range( main.intentCheck ):
+            if i != 0:
+                main.log.warn( "Verification failed. Retrying..." )
+            main.log.info("Waiting for onos to install intents...")
+            time.sleep( main.checkIntentsDelay )
+
+            intentState = main.TRUE
+            for e in range(int(main.numCtrls)):
+                main.log.info( "Checking intents on CLI %s" % (e+1) )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
+            if intentState:
+                break
+        if not intentState:
+            #Dumping intent summary
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step("Verify flows are all added")
+
+        for i in range( main.flowCheck ):
+            if i != 0:
+                main.log.warn( "verification failed. Retrying..." )
+            main.log.info( "Waiting for onos to add flows..." )
+            time.sleep( main.checkFlowsDelay )
+
+            flowState = main.TRUE
+            for cli in main.CLIs:
+                flowState = cli.checkFlowState()
+                if not flowState:
+                    main.log.warn( "Not all flows added" )
+            if flowState:
+                break
+        else:
+            #Dumping summary
+            main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=flowState,
+                                 onpass="FLOWS INSTALLED",
+                                 onfail="SOME FLOWS NOT ADDED" )
+
+        main.step( "Verify Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        caseResult = ( checkFlowsState and pingResult and intentState )
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            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" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not checkFlowsState:
+            main.log.debug( "Flows failed to add completely" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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 = []
+        main.log.info( "MACsDict" + str(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,'',main.MACsDict.get(ingressDevice)])
+                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))
+
+        main.step("Verify intents are installed")
+        # Giving onos multiple chances to install intents
+        for i in range( main.intentCheck ):
+            if i != 0:
+                main.log.warn( "Verification failed. Retrying..." )
+            main.log.info("Waiting for onos to install intents...")
+            time.sleep( main.checkIntentsDelay )
+
+            intentState = main.TRUE
+            for e in range(int(main.numCtrls)):
+                main.log.info( "Checking intents on CLI %s" % (e+1) )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
+            if intentState:
+                break
+        if not intentState:
+            #Dumping intent summary
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step("Verify flows are all added")
+
+        for i in range( main.flowCheck ):
+            if i != 0:
+                main.log.warn( "verification failed. Retrying..." )
+            main.log.info( "Waiting for onos to add flows..." )
+            time.sleep( main.checkFlowsDelay )
+
+            flowState = main.TRUE
+            for cli in main.CLIs:
+                flowState = cli.checkFlowState()
+                if not flowState:
+                    main.log.warn( "Not all flows added" )
+            if flowState:
+                break
+        else:
+            #Dumping summary
+            main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=flowState,
+                                 onpass="FLOWS INSTALLED",
+                                 onfail="SOME FLOWS NOT ADDED" )
+
+        main.step( "Verify Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        caseResult = ( pingResult and intentState and flowState)
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            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" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not checkFlowsState:
+            main.log.debug( "Flows failed to add completely" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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 = []
+        main.log.info( "MACsDict" + str(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,'',main.MACsDict.get(ingressDevice),''])
+                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))
+
+        main.step("Verify intents are installed")
+        # Giving onos multiple chances to install intents
+        for i in range( main.intentCheck ):
+            if i != 0:
+                main.log.warn( "Verification failed. Retrying..." )
+            main.log.info("Waiting for onos to install intents...")
+            time.sleep( main.checkIntentsDelay )
+
+            intentState = main.TRUE
+            for e in range(int(main.numCtrls)):
+                main.log.info( "Checking intents on CLI %s" % (e+1) )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
+            if intentState:
+                break
+        if not intentState:
+            #Dumping intent summary
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step("Verify flows are all added")
+
+        for i in range( main.flowCheck ):
+            if i != 0:
+                main.log.warn( "verification failed. Retrying..." )
+            main.log.info( "Waiting for onos to add flows..." )
+            time.sleep( main.checkFlowsDelay )
+
+            flowState = main.TRUE
+            for cli in main.CLIs:
+                flowState = cli.checkFlowState()
+                if not flowState:
+                    main.log.warn( "Not all flows added" )
+            if flowState:
+                break
+        else:
+            #Dumping summary
+            main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=flowState,
+                                 onpass="FLOWS INSTALLED",
+                                 onfail="SOME FLOWS NOT ADDED" )
+
+        main.step( "Verify Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        caseResult = ( pingResult and intentState and flowState)
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            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" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not checkFlowsState:
+            main.log.debug( "Flows failed to add completely" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    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 ]
+
+        main.log.info( "deviceDPIDsCopy" + str(deviceDPIDsCopy) )
+        main.log.info( "MACsDictCopy" +  str(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,'',MACsDictCopy.get(ingressDevice),''])
+                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))
+
+        main.step("Verify intents are installed")
+        # Giving onos multiple chances to install intents
+        for i in range( main.intentCheck ):
+            if i != 0:
+                main.log.warn( "Verification failed. Retrying..." )
+            main.log.info("Waiting for onos to install intents...")
+            time.sleep( main.checkIntentsDelay )
+
+            intentState = main.TRUE
+            for e in range(int(main.numCtrls)):
+                main.log.info( "Checking intents on CLI %s" % (e+1) )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
+            if intentState:
+                break
+        if not intentState:
+            #Dumping intent summary
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+                                 onpass="INTENTS INSTALLED",
+                                 onfail="SOME INTENTS NOT INSTALLED" )
+
+        main.step("Verify flows are all added")
+
+        for i in range( main.flowCheck ):
+            if i != 0:
+                main.log.warn( "verification failed. Retrying..." )
+            main.log.info( "Waiting for onos to add flows..." )
+            time.sleep( main.checkFlowsDelay )
+
+            flowState = main.TRUE
+            for cli in main.CLIs:
+                flowState = cli.checkFlowState()
+                if not flowState:
+                    main.log.warn( "Not all flows added" )
+            if flowState:
+                break
+        else:
+            #Dumping summary
+            main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) )
+
+        utilities.assert_equals( expect=main.TRUE, actual=flowState,
+                                 onpass="FLOWS INSTALLED",
+                                 onfail="SOME FLOWS NOT ADDED" )
+
+        main.step( "Verify Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        caseResult = ( pingResult and intentState and flowState)
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            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" )
+
+        if not intentState:
+            main.log.debug( "Intents failed to install completely" )
+        if not pingResult:
+            main.log.debug( "Pingall failed" )
+        if not checkFlowsState:
+            main.log.debug( "Flows failed to add completely" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE190( self ):
+        """
+        Verify IPv6 ping across 600 Point intents (Att Topology)
+        """
+        main.log.report( "Verify IPv6 ping across 600 Point intents (Att Topology)" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all 600 Point intents" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 600 Point intents test PASS",
+            onfail="IPv6 Ping across 600 Point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE191( self ):
+        """
+        Verify IPv6 ping across 600 Point intents (Chordal Topology)
+        """
+        main.log.report( "Verify IPv6 ping across 600 Point intents (Chordal Topology)" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all 600 Point intents" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 600 Point intents test PASS",
+            onfail="IPv6 Ping across 600 Point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE192( self ):
+        """
+        Verify IPv6 ping across 4556 Point intents (Spine Topology)
+        """
+        main.log.report( "Verify IPv6 ping across 4556 Point intents (Spine Topology)" )
+        main.log.report( "_________________________________________________" )
+        main.case( "IPv6 ping all 4556 Point intents" )
+
+        main.step( "Verify IPv6 Ping across all hosts" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
+                                 onpass="PING ALL PASS",
+                                 onfail="PING ALL FAIL" )
+
+        caseResult = pingResult
+        utilities.assert_equals(
+            expect=main.TRUE,
+            actual=caseResult,
+            onpass="IPv6 Ping across 4556 Point intents test PASS",
+            onfail="IPv6 Ping across 4556 Point intents test FAIL" )
+
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
+    def CASE10( self ):
+        import time
+        import re
+        """
+         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" )
+        purgeDelay = int( main.params[ "timers" ][ "IntentPurgeDelay" ] )
+        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) )
+
+        main.step( "Remove all installed intents" )
+        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( purgeDelay )
+                    main.log.info("Purging WITHDRAWN Intents")
+                    purgeResult  = main.ONOScli1.purgeWithdrawnIntents()
+                else:
+                    time.sleep(10)
+                    if len( main.ONOScli1.intents()):
+                        continue
+                    break
+                time.sleep( purgeDelay )
+            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()
+
+        main.log.info( main.ONOScli1.summary( jsonFormat=False ) )
+        caseResult = step1Result
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 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 Ping across all hosts" )
+        for i in range(main.numPings):
+            time1 = time.time()
+            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+            if not pingResult:
+                main.log.warn("First pingall failed. Retrying...")
+                time.sleep(main.pingSleep)
+            else: break
+
+        time2 = time.time()
+        timeDiff = round( ( time2 - time1 ), 2 )
+        main.log.report(
+            "Time taken for Ping All: " +
+            str( timeDiff ) +
+            " seconds" )
+
+        if pingResult == 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 )
+
+        caseResult = installResult and pingResult and uninstallResult
+        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+                                 onpass="Intent based Reactive forwarding Pingall test PASS",
+                                 onfail="Intent based Reactive forwarding Pingall test FAIL" )
diff --git a/TestON/tests/CHO/CHOtest/CHOtest.topo b/TestON/tests/CHO/CHOtest/CHOtest.topo
new file mode 100644
index 0000000..01801e7
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/CHOtest.topo
@@ -0,0 +1,50 @@
+<TOPOLOGY>
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOSbench>
+
+        <ONOScli1>
+            <host>localhost</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli1>
+
+        <ONOScli2>
+            <host>localhost</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli2>
+
+        <ONOScli3>
+            <host>localhost</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli3>
+
+        <Mininet1>
+            <host>OCN</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>MininetCliDriver</type>
+            <connect_order>12</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </Mininet1>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/CHO/CHOtest/README b/TestON/tests/CHO/CHOtest/README
new file mode 100644
index 0000000..1e8720a
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/README
@@ -0,0 +1,40 @@
+CHO TEST
+
+Summary:
+        This is a long-term regression test that is aimed to run
+        for weeks at a time. It's goal is to find memory leaks or bugs that
+        otherwise cannot be easily seen with short-term tests. The following
+        is an overview of the steps that are performed in this test.
+        Steps:
+        - Discover IPv4 and IPv6 hosts
+        - Add host intents
+        - Ping all hosts
+        - Bring links down
+        - Ping all hosts
+        - Bring links back up
+        - Ping all hosts
+        - remove intents
+
+        These steps are iterated over and over again. The number of iterations can
+        be found in the params file.
+
+Topology:
+        Att topology - 25 switches and 25 hosts and its structure is designed to simulate
+                        a real world configuration,
+        Chordal topology - 25 swithces and 25 hosts and because of its chordal graph structure,
+                            it's particulary useful in testing the rerouting capability of ONOS.
+        Leaf-spine topology - 78 switches and 68 hosts and designed to simulate modern data centers.
+
+Pre-requisites:
+        To run out-of-the box this test requires 3 NODES. The cell file
+        must be passed through the startup test command, e.g.,
+
+            ./cli.py run CHOtest onoscell <cell name>.
+
+        Passwordless login must be set from TestStation "sdn" root user.
+        This test relies on the topology files to start Mininet located in
+        the dependencies folder. Be sure to check that each topology file can
+        be loaded properly by Mininet by using this command:
+
+            sudo ~/<dependencies path>/<topology name>
+
diff --git a/TestON/tests/CHO/CHOtest/__init__.py b/TestON/tests/CHO/CHOtest/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/__init__.py
diff --git a/TestON/tests/CHO/CHOtest/dependencies/CHOtestFunctions.py b/TestON/tests/CHO/CHOtest/dependencies/CHOtestFunctions.py
new file mode 100644
index 0000000..7441a5b
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/dependencies/CHOtestFunctions.py
@@ -0,0 +1,152 @@
+"""
+Wrapper functions for CHOtest
+Author: you@onlab.us
+"""
+
+def __init__( self ):
+    self.default = ''
+
+def installHostIntents():
+    """
+    Install one host intent for each combination of hosts in the topology
+    """
+    import itertools
+    import time
+
+    hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+    intentIdList = []
+    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 )
+
+    return intentIdList
+
+def installPointIntents():
+    """
+    Install one point intent for each permutation of devices in the topology
+    """
+    import itertools
+    import time
+
+    if main.prefix == 2:
+        # Spine-leaf topology is a special case
+        for i in range( len( main.hostMACs ) ):
+            main.MACsDict[ main.deviceDPIDs[ i+10 ] ] = main.hostMACs[ i ].split('/')[0]
+        deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) )
+    else:
+        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, '',
+                                    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 taken for adding point intents: %2f seconds" %( time2 - time1 ) )
+
+    return intentIdList
+
+def checkIntents():
+    """
+    Check if all the intents are in INSTALLED state
+    """
+    import time
+
+    intentResult = main.TRUE
+    for i in range( main.intentCheck ):
+        if i != 0:
+            main.log.warn( "Verification failed. Retrying..." )
+        main.log.info("Waiting for onos to install intents...")
+        time.sleep( main.checkIntentsDelay )
+
+        intentResult = main.TRUE
+        for e in range(int(main.numCtrls)):
+            main.log.info( "Checking intents on CLI %s" % (e+1) )
+            intentResultIndividual = main.CLIs[e].checkIntentState( intentsId=main.intentIds )
+            if not intentResultIndividual:
+                main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+            intentResult = intentResult and intentResultIndividual
+        if intentResult:
+            break
+    if not intentResult:
+        main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+    return intentResult
+
+def checkPingall( protocol="IPv4" ):
+    """
+    Verify ping across all hosts
+    """
+    import time
+
+    pingResult = main.TRUE
+    for i in range( main.numPings ):
+        if i != 0:
+            main.log.warn( "Pingall failed. Retrying..." )
+            main.log.info( "Giving ONOS some time...")
+            time.sleep( main.pingSleep )
+
+        pingResult = main.Mininet1.pingall( protocol=protocol, timeout=main.pingTimeout )
+        if pingResult:
+            break
+
+    return pingResult
+
+def checkLinkEvents( linkEvent, linkNum ):
+    """
+    Verify link down/up events are correctly discovered by ONOS
+    linkNum: the correct link number after link down/up
+    """
+    import time
+
+    linkResult = main.TRUE
+    for i in range( main.linkCheck ):
+        if i != 0:
+            main.log.warn( "Verification failed. Retrying..." )
+            main.log.info( "Giving ONOS some time..." )
+            time.sleep( main.linkSleep )
+
+        linkResult = main.TRUE
+        for e in range( int( main.numCtrls ) ):
+            main.log.info( "Checking link number on ONOS%s" % (e+1) )
+            topology_output = main.CLIs[e].topology()
+            linkResultIndividual = main.ONOSbench.checkStatus( topology_output,
+                                                               main.numMNswitches,
+                                                               str( linkNum ) )
+            if not linkResultIndividual:
+                main.log.warn( "Link %s not discovered by ONOS%s" % ( linkEvent, (e+1) ) )
+            linkResult = linkResult and linkResultIndividual
+        if linkResult:
+            break
+
+    return linkResult
diff --git a/TestON/tests/CHO/CHOtest/dependencies/topoAtt.py b/TestON/tests/CHO/CHOtest/dependencies/topoAtt.py
new file mode 100755
index 0000000..4291f8b
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/dependencies/topoAtt.py
@@ -0,0 +1,182 @@
+#!/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, 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( 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/CHO/CHOtest/dependencies/topoAttIpv6.py b/TestON/tests/CHO/CHOtest/dependencies/topoAttIpv6.py
new file mode 100755
index 0000000..f9a103c
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/dependencies/topoAttIpv6.py
@@ -0,0 +1,188 @@
+#!/usr/bin/python
+
+"""
+Custom topology for Mininet
+"""
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import Host, 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, IVSSwitch )
+
+class dualStackHost( Host ):
+    def config( self, v6Addr='1000:1/64', **params ):
+        r = super( Host, self ).config( **params )
+        intf = self.defaultIntf()
+        self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+        return r
+
+class attTopo( Topo ):
+
+    def __init__( self, **opts ):
+        "Create a topology."
+
+        # Initialize Topology
+        Topo.__init__( self, **opts )
+
+        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', ip='10.1.0.1/24', cls=dualStackHost, v6Addr='1000::1/64' )
+        CMBR_host = self.addHost( 'h2', ip='10.1.0.2/24', cls=dualStackHost, v6Addr='1000::2/64' )
+        CHCG_host = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='1000::3/64' )
+        CLEV_host = self.addHost( 'h4', ip='10.1.0.4/24', cls=dualStackHost, v6Addr='1000::4/64' )
+        RLGH_host = self.addHost( 'h5', ip='10.1.0.5/24', cls=dualStackHost, v6Addr='1000::5/64' )
+        ATLN_host = self.addHost( 'h6', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='1000::6/64' )
+        PHLA_host = self.addHost( 'h7', ip='10.1.0.7/24', cls=dualStackHost, v6Addr='1000::7/64' )
+        WASH_host = self.addHost( 'h8', ip='10.1.0.8/24', cls=dualStackHost, v6Addr='1000::8/64' )
+        NSVL_host = self.addHost( 'h9', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='1000::9/64' )
+        STLS_host = self.addHost( 'h10', ip='10.1.0.10/24', cls=dualStackHost, v6Addr='1000::10/64' )
+        NWOR_host = self.addHost( 'h11', ip='10.1.0.11/24', cls=dualStackHost, v6Addr='1000::11/64' )
+        HSTN_host = self.addHost( 'h12', ip='10.1.0.12/24', cls=dualStackHost, v6Addr='1000::12/64' )
+        SNAN_host = self.addHost( 'h13', ip='10.1.0.13/24', cls=dualStackHost, v6Addr='1000::13/64' )
+        DLLS_host = self.addHost( 'h14', ip='10.1.0.14/24', cls=dualStackHost, v6Addr='1000::14/64' )
+        ORLD_host = self.addHost( 'h15', ip='10.1.0.15/24', cls=dualStackHost, v6Addr='1000::15/64' )
+        DNVR_host = self.addHost( 'h16', ip='10.1.0.16/24', cls=dualStackHost, v6Addr='1000::16/64' )
+        KSCY_host = self.addHost( 'h17', ip='10.1.0.17/24', cls=dualStackHost, v6Addr='1000::17/64' )
+        SNFN_host = self.addHost( 'h18', ip='10.1.0.18/24', cls=dualStackHost, v6Addr='1000::18/64' )
+        SCRM_host = self.addHost( 'h19', ip='10.1.0.19/24', cls=dualStackHost, v6Addr='1000::19/64' )
+        PTLD_host = self.addHost( 'h20', ip='10.1.0.20/24', cls=dualStackHost, v6Addr='1000::20/64' )
+        STTL_host = self.addHost( 'h21', ip='10.1.0.21/24', cls=dualStackHost, v6Addr='1000::21/64' )
+        SLKC_host = self.addHost( 'h22', ip='10.1.0.22/24', cls=dualStackHost, v6Addr='1000::22/64' )
+        LA03_host = self.addHost( 'h23', ip='10.1.0.23/24', cls=dualStackHost, v6Addr='1000::23/64' )
+        SNDG_host = self.addHost( 'h24', ip='10.1.0.24/24', cls=dualStackHost, v6Addr='1000::24/64' )
+        PHNX_host = self.addHost( 'h25', ip='10.1.0.25/24', cls=dualStackHost, v6Addr='1000::25/64' )
+
+        # 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( 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/CHO/CHOtest/dependencies/topoChordal.py b/TestON/tests/CHO/CHOtest/dependencies/topoChordal.py
new file mode 100755
index 0000000..542c3ed
--- /dev/null
+++ b/TestON/tests/CHO/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, 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/CHO/CHOtest/dependencies/topoChordalIpv6.py b/TestON/tests/CHO/CHOtest/dependencies/topoChordalIpv6.py
new file mode 100755
index 0000000..cb065c2
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/dependencies/topoChordalIpv6.py
@@ -0,0 +1,428 @@
+#!/usr/bin/python
+"""
+"""
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import Host, 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, IVSSwitch )
+
+class dualStackHost( Host ):
+    def config( self, v6Addr='1000:1/64', **params ):
+        r = super( Host, self ).config( **params )
+        intf = self.defaultIntf()
+        self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+        return r
+
+class chordalTopo( Topo ):
+
+    def __init__( self, **opts ):
+        "Create a topology."
+
+        # Initialize Topology
+        Topo.__init__( self, **opts )
+
+        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', ip='10.1.0.1/24', cls=dualStackHost, v6Addr='1000::1/64' )
+        s2_host = self.addHost( 'h2', ip='10.1.0.2/24', cls=dualStackHost, v6Addr='1000::2/64' )
+        s3_host = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='1000::3/64' )
+        s4_host = self.addHost( 'h4', ip='10.1.0.4/24', cls=dualStackHost, v6Addr='1000::4/64' )
+        s5_host = self.addHost( 'h5', ip='10.1.0.5/24', cls=dualStackHost, v6Addr='1000::5/64' )
+        s6_host = self.addHost( 'h6', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='1000::6/64' )
+        s7_host = self.addHost( 'h7', ip='10.1.0.7/24', cls=dualStackHost, v6Addr='1000::7/64' )
+        s8_host = self.addHost( 'h8', ip='10.1.0.8/24', cls=dualStackHost, v6Addr='1000::8/64' )
+        s9_host = self.addHost( 'h9', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='1000::9/64' )
+        s10_host = self.addHost( 'h10', ip='10.1.0.10/24', cls=dualStackHost, v6Addr='1000::10/64' )
+        s11_host = self.addHost( 'h11', ip='10.1.0.11/24', cls=dualStackHost, v6Addr='1000::11/64' )
+        s12_host = self.addHost( 'h12', ip='10.1.0.12/24', cls=dualStackHost, v6Addr='1000::12/64' )
+        s13_host = self.addHost( 'h13', ip='10.1.0.13/24', cls=dualStackHost, v6Addr='1000::13/64' )
+        s14_host = self.addHost( 'h14', ip='10.1.0.14/24', cls=dualStackHost, v6Addr='1000::14/64' )
+        s15_host = self.addHost( 'h15', ip='10.1.0.15/24', cls=dualStackHost, v6Addr='1000::15/64' )
+        s16_host = self.addHost( 'h16', ip='10.1.0.16/24', cls=dualStackHost, v6Addr='1000::16/64' )
+        s17_host = self.addHost( 'h17', ip='10.1.0.17/24', cls=dualStackHost, v6Addr='1000::17/64' )
+        s18_host = self.addHost( 'h18', ip='10.1.0.18/24', cls=dualStackHost, v6Addr='1000::18/64' )
+        s19_host = self.addHost( 'h19', ip='10.1.0.19/24', cls=dualStackHost, v6Addr='1000::19/64' )
+        s20_host = self.addHost( 'h20', ip='10.1.0.20/24', cls=dualStackHost, v6Addr='1000::20/64' )
+        s21_host = self.addHost( 'h21', ip='10.1.0.21/24', cls=dualStackHost, v6Addr='1000::21/64' )
+        s22_host = self.addHost( 'h22', ip='10.1.0.22/24', cls=dualStackHost, v6Addr='1000::22/64' )
+        s23_host = self.addHost( 'h23', ip='10.1.0.23/24', cls=dualStackHost, v6Addr='1000::23/64' )
+        s24_host = self.addHost( 'h24', ip='10.1.0.24/24', cls=dualStackHost, v6Addr='1000::24/64' )
+        s25_host = self.addHost( 'h25', ip='10.1.0.25/24', cls=dualStackHost, v6Addr='1000::25/64' )
+
+        # 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/CHO/CHOtest/dependencies/topoSpine.py b/TestON/tests/CHO/CHOtest/dependencies/topoSpine.py
new file mode 100755
index 0000000..5787d93
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/dependencies/topoSpine.py
@@ -0,0 +1,434 @@
+#!/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.util import dumpNodeConnections
+from mininet.node import ( UserSwitch, OVSSwitch, 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/CHO/CHOtest/dependencies/topoSpineIpv6.py b/TestON/tests/CHO/CHOtest/dependencies/topoSpineIpv6.py
new file mode 100755
index 0000000..7db4fa1
--- /dev/null
+++ b/TestON/tests/CHO/CHOtest/dependencies/topoSpineIpv6.py
@@ -0,0 +1,441 @@
+#!/usr/bin/python
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import Host, 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, IVSSwitch )
+
+class dualStackHost( Host ):
+    def config( self, v6Addr='1000:1/64', **params ):
+        r = super( Host, self ).config( **params )
+        intf = self.defaultIntf()
+        self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+        return r
+
+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', ip='10.1.0.1/24', cls=dualStackHost, v6Addr='1000::1/64' )
+        # s2_host = self.addHost( 'h2', ip='10.1.0.2/24', cls=dualStackHost, v6Addr='1000::2/64' )
+        # s3_host = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='1000::3/64' )
+        # s4_host = self.addHost( 'h4', ip='10.1.0.4/24', cls=dualStackHost, v6Addr='1000::4/64' )
+        # s5_host = self.addHost( 'h5', ip='10.1.0.5/24', cls=dualStackHost, v6Addr='1000::5/64' )
+        # s6_host = self.addHost( 'h6', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='1000::6/64' )
+        # s7_host = self.addHost( 'h7', ip='10.1.0.7/24', cls=dualStackHost, v6Addr='1000::7/64' )
+        # s8_host = self.addHost( 'h8', ip='10.1.0.8/24', cls=dualStackHost, v6Addr='1000::8/64' )
+        # s9_host = self.addHost( 'h9', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='1000::9/64' )
+        # s10_host = self.addHost( 'h10', ip='10.1.0.10/24', cls=dualStackHost, v6Addr='1000::10/64' )
+        s11_host = self.addHost( 'h11', ip='10.1.0.11/24', cls=dualStackHost, v6Addr='1000::11/64' )
+        s12_host = self.addHost( 'h12', ip='10.1.0.12/24', cls=dualStackHost, v6Addr='1000::12/64' )
+        s13_host = self.addHost( 'h13', ip='10.1.0.13/24', cls=dualStackHost, v6Addr='1000::13/64' )
+        s14_host = self.addHost( 'h14', ip='10.1.0.14/24', cls=dualStackHost, v6Addr='1000::14/64' )
+        s15_host = self.addHost( 'h15', ip='10.1.0.15/24', cls=dualStackHost, v6Addr='1000::15/64' )
+        s16_host = self.addHost( 'h16', ip='10.1.0.16/24', cls=dualStackHost, v6Addr='1000::16/64' )
+        s17_host = self.addHost( 'h17', ip='10.1.0.17/24', cls=dualStackHost, v6Addr='1000::17/64' )
+        s18_host = self.addHost( 'h18', ip='10.1.0.18/24', cls=dualStackHost, v6Addr='1000::18/64' )
+        s19_host = self.addHost( 'h19', ip='10.1.0.19/24', cls=dualStackHost, v6Addr='1000::19/64' )
+        s20_host = self.addHost( 'h20', ip='10.1.0.20/24', cls=dualStackHost, v6Addr='1000::20/64' )
+        s21_host = self.addHost( 'h21', ip='10.1.0.21/24', cls=dualStackHost, v6Addr='1000::21/64' )
+        s22_host = self.addHost( 'h22', ip='10.1.0.22/24', cls=dualStackHost, v6Addr='1000::22/64' )
+        s23_host = self.addHost( 'h23', ip='10.1.0.23/24', cls=dualStackHost, v6Addr='1000::23/64' )
+        s24_host = self.addHost( 'h24', ip='10.1.0.24/24', cls=dualStackHost, v6Addr='1000::24/64' )
+        s25_host = self.addHost( 'h25', ip='10.1.0.25/24', cls=dualStackHost, v6Addr='1000::25/64' )
+        s26_host = self.addHost( 'h26', ip='10.1.0.26/24', cls=dualStackHost, v6Addr='1000::26/64' )
+        s27_host = self.addHost( 'h27', ip='10.1.0.27/24', cls=dualStackHost, v6Addr='1000::27/64' )
+        s28_host = self.addHost( 'h28', ip='10.1.0.28/24', cls=dualStackHost, v6Addr='1000::28/64' )
+        s29_host = self.addHost( 'h29', ip='10.1.0.29/24', cls=dualStackHost, v6Addr='1000::29/64' )
+        s30_host = self.addHost( 'h30', ip='10.1.0.30/24', cls=dualStackHost, v6Addr='1000::30/64' )
+        s31_host = self.addHost( 'h31', ip='10.1.0.31/24', cls=dualStackHost, v6Addr='1000::31/64' )
+        s32_host = self.addHost( 'h32', ip='10.1.0.32/24', cls=dualStackHost, v6Addr='1000::32/64' )
+        s33_host = self.addHost( 'h33', ip='10.1.0.33/24', cls=dualStackHost, v6Addr='1000::33/64' )
+        s34_host = self.addHost( 'h34', ip='10.1.0.34/24', cls=dualStackHost, v6Addr='1000::34/64' )
+        s35_host = self.addHost( 'h35', ip='10.1.0.35/24', cls=dualStackHost, v6Addr='1000::35/64' )
+        s36_host = self.addHost( 'h36', ip='10.1.0.36/24', cls=dualStackHost, v6Addr='1000::36/64' )
+        s37_host = self.addHost( 'h37', ip='10.1.0.37/24', cls=dualStackHost, v6Addr='1000::37/64' )
+        s38_host = self.addHost( 'h38', ip='10.1.0.38/24', cls=dualStackHost, v6Addr='1000::38/64' )
+        s39_host = self.addHost( 'h39', ip='10.1.0.39/24', cls=dualStackHost, v6Addr='1000::39/64' )
+        s40_host = self.addHost( 'h40', ip='10.1.0.40/24', cls=dualStackHost, v6Addr='1000::40/64' )
+        s41_host = self.addHost( 'h41', ip='10.1.0.41/24', cls=dualStackHost, v6Addr='1000::41/64' )
+        s42_host = self.addHost( 'h42', ip='10.1.0.42/24', cls=dualStackHost, v6Addr='1000::42/64' )
+        s43_host = self.addHost( 'h43', ip='10.1.0.43/24', cls=dualStackHost, v6Addr='1000::43/64' )
+        s44_host = self.addHost( 'h44', ip='10.1.0.44/24', cls=dualStackHost, v6Addr='1000::44/64' )
+        s45_host = self.addHost( 'h45', ip='10.1.0.45/24', cls=dualStackHost, v6Addr='1000::45/64' )
+        s46_host = self.addHost( 'h46', ip='10.1.0.46/24', cls=dualStackHost, v6Addr='1000::46/64' )
+        s47_host = self.addHost( 'h47', ip='10.1.0.47/24', cls=dualStackHost, v6Addr='1000::47/64' )
+        s48_host = self.addHost( 'h48', ip='10.1.0.48/24', cls=dualStackHost, v6Addr='1000::48/64' )
+        s49_host = self.addHost( 'h49', ip='10.1.0.49/24', cls=dualStackHost, v6Addr='1000::49/64' )
+        s50_host = self.addHost( 'h50', ip='10.1.0.50/24', cls=dualStackHost, v6Addr='1000::50/64' )
+        s51_host = self.addHost( 'h51', ip='10.1.0.51/24', cls=dualStackHost, v6Addr='1000::51/64' )
+        s52_host = self.addHost( 'h52', ip='10.1.0.52/24', cls=dualStackHost, v6Addr='1000::52/64' )
+        s53_host = self.addHost( 'h53', ip='10.1.0.53/24', cls=dualStackHost, v6Addr='1000::53/64' )
+        s54_host = self.addHost( 'h54', ip='10.1.0.54/24', cls=dualStackHost, v6Addr='1000::54/64' )
+        s55_host = self.addHost( 'h55', ip='10.1.0.55/24', cls=dualStackHost, v6Addr='1000::55/64' )
+        s56_host = self.addHost( 'h56', ip='10.1.0.56/24', cls=dualStackHost, v6Addr='1000::56/64' )
+        s57_host = self.addHost( 'h57', ip='10.1.0.57/24', cls=dualStackHost, v6Addr='1000::57/64' )
+        s58_host = self.addHost( 'h58', ip='10.1.0.58/24', cls=dualStackHost, v6Addr='1000::58/64' )
+        s59_host = self.addHost( 'h59', ip='10.1.0.59/24', cls=dualStackHost, v6Addr='1000::59/64' )
+        s60_host = self.addHost( 'h60', ip='10.1.0.60/24', cls=dualStackHost, v6Addr='1000::60/64' )
+        s61_host = self.addHost( 'h61', ip='10.1.0.61/24', cls=dualStackHost, v6Addr='1000::61/64' )
+        s62_host = self.addHost( 'h62', ip='10.1.0.62/24', cls=dualStackHost, v6Addr='1000::62/64' )
+        s63_host = self.addHost( 'h63', ip='10.1.0.63/24', cls=dualStackHost, v6Addr='1000::63/64' )
+        s64_host = self.addHost( 'h64', ip='10.1.0.64/24', cls=dualStackHost, v6Addr='1000::64/64' )
+        s65_host = self.addHost( 'h65', ip='10.1.0.65/24', cls=dualStackHost, v6Addr='1000::65/64' )
+        s66_host = self.addHost( 'h66', ip='10.1.0.66/24', cls=dualStackHost, v6Addr='1000::66/64' )
+        s67_host = self.addHost( 'h67', ip='10.1.0.67/24', cls=dualStackHost, v6Addr='1000::67/64' )
+        s68_host = self.addHost( 'h68', ip='10.1.0.68/24', cls=dualStackHost, v6Addr='1000::68/64' )
+        s69_host = self.addHost( 'h69', ip='10.1.0.69/24', cls=dualStackHost, v6Addr='1000::69/64' )
+        s70_host = self.addHost( 'h70', ip='10.1.0.70/24', cls=dualStackHost, v6Addr='1000::70/64' )
+        s71_host = self.addHost( 'h71', ip='10.1.0.71/24', cls=dualStackHost, v6Addr='1000::71/64' )
+        s72_host = self.addHost( 'h72', ip='10.1.0.72/24', cls=dualStackHost, v6Addr='1000::72/64' )
+        s73_host = self.addHost( 'h73', ip='10.1.0.73/24', cls=dualStackHost, v6Addr='1000::73/64' )
+        s74_host = self.addHost( 'h74', ip='10.1.0.74/24', cls=dualStackHost, v6Addr='1000::74/64' )
+        s75_host = self.addHost( 'h75', ip='10.1.0.75/24', cls=dualStackHost, v6Addr='1000::75/64' )
+        s76_host = self.addHost( 'h76', ip='10.1.0.76/24', cls=dualStackHost, v6Addr='1000::76/64' )
+        s77_host = self.addHost( 'h77', ip='10.1.0.77/24', cls=dualStackHost, v6Addr='1000::77/64' )
+        s78_host = self.addHost( 'h78', ip='10.1.0.78/24', cls=dualStackHost, v6Addr='1000::78/64' )
+
+        # 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/CHO/__init__.py b/TestON/tests/CHO/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/CHO/__init__.py
diff --git a/TestON/tests/CHO/dependencies/__init__.py b/TestON/tests/CHO/dependencies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/CHO/dependencies/__init__.py
