diff --git a/TestON/drivers/common/api/controller/onosrestdriver.py b/TestON/drivers/common/api/controller/onosrestdriver.py
index 3ed6ab3..da3c994 100644
--- a/TestON/drivers/common/api/controller/onosrestdriver.py
+++ b/TestON/drivers/common/api/controller/onosrestdriver.py
@@ -1193,6 +1193,7 @@
             The ip and port option are for the requests input's ip and port
             of the ONOS node
         """
+
         try:
             flowJson = { "priority":100,
                            "isPermanent":"true",
@@ -1323,13 +1324,18 @@
         try:
             tempFlows = json.loads( self.flows( ip=ip, port=port ) )
             returnValue = main.TRUE
+            numPending = 0
             for flow in tempFlows:
                 if flow.get( 'state' ) != 'ADDED':
-                    main.log.info( self.name + ": flow Id: " +
-                                   str( flow.get( 'groupId' ) ) +
+                    '''
+                    main.log.debug( self.name + ": flow Id: " +
+                                   str( flow.get( 'id' ) ) +
                                    " | state:" +
                                    str( flow.get( 'state' ) ) )
+                    '''
                     returnValue = main.FALSE
+                    numPending += 1
+            main.log.info("Number of non-ADDED flows are: " + str(numPending))
             return returnValue
         except ( AttributeError, TypeError ):
             main.log.exception( self.name + ": Object not as expected" )
@@ -1339,6 +1345,407 @@
             main.cleanup()
             main.exit()
 
+    def addFlow( self,
+                 deviceId,
+                 appId=0,
+                 ingressPort="",
+                 egressPort="",
+                 ethType="",
+                 ethSrc="",
+                 ethDst="",
+                 vlan="",
+                 ipProto="",
+                 ipSrc=(),
+                 ipDst=(),
+                 tcpSrc="",
+                 tcpDst="",
+                 udpDst="",
+                 udpSrc="",
+                 mpls="",
+                 ip="DEFAULT",
+                 port="DEFAULT",
+                 debug=False ):
+
+        """
+        Description:
+            Creates a single flow in the specified device
+        Required:
+            * deviceId: id of the device
+        Optional:
+            * ingressPort: port ingress device
+            * egressPort: port  of egress device
+            * ethType: specify ethType
+            * ethSrc: specify ethSrc ( i.e. src mac addr )
+            * ethDst: specify ethDst ( i.e. dst mac addr )
+            * ipProto: specify ip protocol
+            * ipSrc: specify ip source address with mask eg. ip#/24
+                as a tuple (type, ip#)
+            * ipDst: specify ip destination address eg. ip#/24
+                as a tuple (type, ip#)
+            * tcpSrc: specify tcp source port
+            * tcpDst: specify tcp destination port
+        Returns:
+            Returns main.TRUE for successful requests; Returns main.FALSE
+            if error on requests;
+            Returns None for exceptions
+        NOTE:
+            The ip and port option are for the requests input's ip and port
+            of the ONOS node
+        """
+        try:
+            flowJson = { "priority":100,
+                           "isPermanent":"true",
+                           "timeout":0,
+                           "deviceId":deviceId,
+                           "treatment":{"instructions":[]},
+                           "selector": {"criteria":[]}}
+            if appId:
+                flowJson[ "appId" ] = appId
+            if egressPort:
+                flowJson[ 'treatment' ][ 'instructions' ].append( {
+                                                        "type":"OUTPUT",
+                                                        "port":egressPort } )
+            if ingressPort:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"IN_PORT",
+                                                        "port":ingressPort } )
+            if ethType:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"ETH_TYPE",
+                                                        "ethType":ethType } )
+            if ethSrc:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"ETH_SRC",
+                                                        "mac":ethSrc } )
+            if ethDst:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"ETH_DST",
+                                                        "mac":ethDst } )
+            if vlan:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"VLAN_VID",
+                                                        "vlanId":vlan } )
+            if mpls:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"MPLS_LABEL",
+                                                        "label":mpls } )
+            if ipSrc:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":ipSrc[0],
+                                                        "ip":ipSrc[1] } )
+            if ipDst:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":ipDst[0],
+                                                        "ip":ipDst[1] } )
+            if tcpSrc:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"TCP_SRC",
+                                                        "tcpPort": tcpSrc } )
+            if tcpDst:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"TCP_DST",
+                                                        "tcpPort": tcpDst } )
+            if udpSrc:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"UDP_SRC",
+                                                        "udpPort": udpSrc } )
+            if udpDst:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"UDP_DST",
+                                                        "udpPort": udpDst } )
+            if ipProto:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"IP_PROTO",
+                                                        "protocol": ipProto } )
+
+            return self.sendFlow( deviceId=deviceId, flowJson=flowJson, debug=debug )
+
+        except ( AttributeError, TypeError ):
+            main.log.exception( self.name + ": Object not as expected" )
+            return None
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanup()
+            main.exit()
+
+    def removeFlow( self, deviceId, flowId,
+                       ip="DEFAULT", port="DEFAULT" ):
+        """
+        Description:
+            Remove specific device flow
+        Required:
+            str deviceId - id of the device
+            str flowId - id of the flow
+        Return:
+            Returns main.TRUE if successfully deletes flows, otherwise
+            Returns main.FALSE, Returns None on error
+        """
+        try:
+            output = None
+            if ip == "DEFAULT":
+                main.log.warn( "No ip given, reverting to ip from topo file" )
+                ip = self.ip_address
+            if port == "DEFAULT":
+                main.log.warn( "No port given, reverting to port " +
+                               "from topo file" )
+                port = self.port
+            # NOTE: REST url requires the intent id to be in decimal form
+            query = "/" + str( deviceId ) + "/" + str( int( flowId ) )
+            response = self.send( ip,
+                                  port,
+                                  method="DELETE",
+                                  url="/flows" + query )
+            if response:
+                if 200 <= response[ 0 ] <= 299:
+                    return main.TRUE
+                else:
+                    main.log.error( "Error with REST request, response was: " +
+                                    str( response ) )
+                    return main.FALSE
+        except ( AttributeError, TypeError ):
+            main.log.exception( self.name + ": Object not as expected" )
+            return None
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanup()
+            main.exit()
+
+    def createFlowBatch( self,
+                      numSw = 1,
+                      batchSizePerSw = 1,
+                      batchIndex = 1,
+                      deviceIdpreFix = "of:",
+                      appId=0,
+                      deviceID="",
+                      ingressPort="",
+                      egressPort="",
+                      ethType="",
+                      ethSrc="",
+                      ethDst="",
+                      vlan="",
+                      ipProto="",
+                      ipSrc=(),
+                      ipDst=(),
+                      tcpSrc="",
+                      tcpDst="",
+                      udpDst="",
+                      udpSrc="",
+                      mpls="",
+                      ip="DEFAULT",
+                      port="DEFAULT",
+                      debug=False ):
+        """
+        Description:
+            Creates a single flow in the specified device
+        Required:
+            * deviceId: id of the device
+        Optional:
+            * ingressPort: port ingress device
+            * egressPort: port  of egress device
+            * ethType: specify ethType
+            * ethSrc: specify ethSrc ( i.e. src mac addr )
+            * ethDst: specify ethDst ( i.e. dst mac addr )
+            * ipProto: specify ip protocol
+            * ipSrc: specify ip source address with mask eg. ip#/24
+                as a tuple (type, ip#)
+            * ipDst: specify ip destination address eg. ip#/24
+                as a tuple (type, ip#)
+            * tcpSrc: specify tcp source port
+            * tcpDst: specify tcp destination port
+        Returns:
+            Returns main.TRUE for successful requests; Returns main.FALSE
+            if error on requests;
+            Returns None for exceptions
+        NOTE:
+            The ip and port option are for the requests input's ip and port
+            of the ONOS node
+        """
+        from pprint import pprint
+
+        flowJsonList = []
+        flowJsonBatch = {"flows":flowJsonList}
+
+        for dev in range(1, numSw + 1):
+            for size in range(1, batchSizePerSw +1):
+
+                flowJson = { "priority":100,
+                           "deviceId":"",
+                           "isPermanent":"true",
+                           "timeout":0,
+                           "treatment":{"instructions":[]},
+                           "selector": {"criteria":[]}}
+
+                deviceId = deviceIdpreFix + "{0:0{1}x}".format(dev,16)
+                #print deviceId
+                flowJson['deviceId'] = deviceId
+
+                # ethSrc starts with "0"; ethDst starts with "1"
+                # 3 Hex digit of device number; 4 digits of batch index number; 4 digits of batch size
+                ethS = "{0:0{1}x}".format(dev,4) + "{0:0{1}x}".format(batchIndex,4) + "{0:0{1}x}".format(size,4)
+                ethSrc = ':'.join(ethS[i:i+2] for i in range(0,len(ethS),2))
+                ethD = "1" + "{0:0{1}x}".format(dev,3) + "{0:0{1}x}".format(batchIndex,4) + "{0:0{1}x}".format(size,4)
+                ethDst = ':'.join(ethD[i:i+2] for i in range(0,len(ethD),2))
+
+                if appId:
+                    flowJson[ "appId" ] = appId
+
+                if egressPort:
+                    flowJson[ 'treatment' ][ 'instructions' ].append( {
+                                                        "type":"OUTPUT",
+                                                        "port":egressPort } )
+                if ingressPort:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"IN_PORT",
+                                                        "port":ingressPort } )
+                if ethType:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"ETH_TYPE",
+                                                        "ethType":ethType } )
+                if ethSrc:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"ETH_SRC",
+                                                        "mac":ethSrc } )
+                if ethDst:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"ETH_DST",
+                                                        "mac":ethDst } )
+                if vlan:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"VLAN_VID",
+                                                        "vlanId":vlan } )
+                if mpls:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"MPLS_LABEL",
+                                                        "label":mpls } )
+                if ipSrc:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":ipSrc[0],
+                                                        "ip":ipSrc[1] } )
+                if ipDst:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":ipDst[0],
+                                                        "ip":ipDst[1] } )
+                if tcpSrc:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"TCP_SRC",
+                                                        "tcpPort": tcpSrc } )
+                if tcpDst:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"TCP_DST",
+                                                        "tcpPort": tcpDst } )
+                if udpSrc:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"UDP_SRC",
+                                                        "udpPort": udpSrc } )
+                if udpDst:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"UDP_DST",
+                                                        "udpPort": udpDst } )
+                if ipProto:
+                    flowJson[ 'selector' ][ 'criteria' ].append( {
+                                                        "type":"IP_PROTO",
+                                                        "protocol": ipProto } )
+                #pprint(flowJson)
+                flowJsonList.append(flowJson)
+
+        flowJsonBatch['flows'] = flowJsonList
+        #pprint(flowJsonBatch)
+
+        return flowJsonBatch
+
+    def sendFlowBatch( self, batch={}, ip="DEFAULT", port="DEFAULT", debug=False ):
+        """
+        Description:
+            Sends a single flow to the specified device. This function exists
+            so you can bypass the addFLow driver and send your own custom flow.
+        Required:
+            * The flow in json
+            * the device id to add the flow to
+        Returns:
+            Returns main.TRUE for successful requests; Returns main.FALSE
+            if error on requests;
+            Returns None for exceptions
+        NOTE:
+            The ip and port option are for the requests input's ip and port
+            of the ONOS node
+        """
+        import time
+
+        try:
+            if debug: main.log.debug( "Adding flow: " + self.pprint( batch ) )
+            output = None
+            if ip == "DEFAULT":
+                main.log.warn( "No ip given, reverting to ip from topo file" )
+                ip = self.ip_address
+            if port == "DEFAULT":
+                main.log.warn( "No port given, reverting to port " +
+                               "from topo file" )
+                port = self.port
+            url = "/flows/"
+            response = self.send( ip,
+                                  port,
+                                  method="POST",
+                                  url=url,
+                                  data=json.dumps( batch ) )
+            #main.log.info("Post response is: ", str(response[0]))
+            if response[0] == 200:
+                main.log.info( self.name + ": Successfully POST flow" )
+                return main.TRUE
+            else:
+                main.log.error( "Error with REST request, response was: " +
+                                    str( response ) )
+                return main.FALSE
+        except NotImplementedError as e:
+            raise e  # Inform the caller
+        except ( AttributeError, TypeError ):
+            main.log.exception( self.name + ": Object not as expected" )
+            return None
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanup()
+            main.exit()
+
+    def removeFlowBatch( self, batch={},
+                       ip="DEFAULT", port="DEFAULT" ):
+        """
+        Description:
+            Remove a batch of flows
+        Required:
+            flow batch
+        Return:
+            Returns main.TRUE if successfully deletes flows, otherwise
+            Returns main.FALSE, Returns None on error
+        """
+        try:
+            output = None
+            if ip == "DEFAULT":
+                main.log.warn( "No ip given, reverting to ip from topo file" )
+                ip = self.ip_address
+            if port == "DEFAULT":
+                main.log.warn( "No port given, reverting to port " +
+                               "from topo file" )
+                port = self.port
+            # NOTE: REST url requires the intent id to be in decimal form
+
+            response = self.send( ip,
+                                  port,
+                                  method="DELETE",
+                                  url="/flows/" + batch )
+            if response:
+                if 200 <= response[ 0 ] <= 299:
+                    return main.TRUE
+                else:
+                    main.log.error( "Error with REST request, response was: " +
+                                    str( response ) )
+                    return main.FALSE
+        except ( AttributeError, TypeError ):
+            main.log.exception( self.name + ": Object not as expected" )
+            return None
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanup()
+            main.exit()
+
     def getNetCfg( self, ip="DEFAULT", port="DEFAULT",
                    subjectClass=None, subjectKey=None, configKey=None ):
         """
diff --git a/TestON/tests/CHOtest/CHOtest.params b/TestON/tests/CHOtest/CHOtest.params
deleted file mode 100644
index 2098689..0000000
--- a/TestON/tests/CHOtest/CHOtest.params
+++ /dev/null
@@ -1,116 +0,0 @@
-<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/CHOtest/CHOtest.py b/TestON/tests/CHOtest/CHOtest.py
deleted file mode 100644
index 5c9d673..0000000
--- a/TestON/tests/CHOtest/CHOtest.py
+++ /dev/null
@@ -1,3814 +0,0 @@
-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/CHOtest/CHOtest.topo b/TestON/tests/CHOtest/CHOtest.topo
deleted file mode 100644
index 8053e31..0000000
--- a/TestON/tests/CHOtest/CHOtest.topo
+++ /dev/null
@@ -1,50 +0,0 @@
-<TOPOLOGY>
-    <COMPONENT>
-
-        <ONOSbench>
-            <host>localhost</host>
-            <user>admin</user>
-            <password></password>
-            <type>OnosDriver</type>
-            <connect_order>1</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOSbench>
-
-        <ONOScli1>
-            <host>localhost</host>
-            <user>admin</user>
-            <password></password>
-            <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli1>
-
-        <ONOScli2>
-            <host>localhost</host>
-            <user>admin</user>
-            <password></password>
-            <type>OnosCliDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli2>
-
-        <ONOScli3>
-            <host>localhost</host>
-            <user>admin</user>
-            <password></password>
-            <type>OnosCliDriver</type>
-            <connect_order>4</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli3>
-
-        <Mininet1>
-            <host>OCN</host>
-            <user>admin</user>
-            <password></password>
-            <type>MininetCliDriver</type>
-            <connect_order>12</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </Mininet1>
-
-    </COMPONENT>
-</TOPOLOGY>
\ No newline at end of file
diff --git a/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py b/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py
deleted file mode 100644
index 7441a5b..0000000
--- a/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py
+++ /dev/null
@@ -1,152 +0,0 @@
-"""
-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/CHOtest/Dependencies/topoAtt.py b/TestON/tests/CHOtest/Dependencies/topoAtt.py
deleted file mode 100755
index 4291f8b..0000000
--- a/TestON/tests/CHOtest/Dependencies/topoAtt.py
+++ /dev/null
@@ -1,182 +0,0 @@
-#!/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/CHOtest/Dependencies/topoAttIpv6.py b/TestON/tests/CHOtest/Dependencies/topoAttIpv6.py
deleted file mode 100755
index f9a103c..0000000
--- a/TestON/tests/CHOtest/Dependencies/topoAttIpv6.py
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/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/CHOtest/Dependencies/topoChordal.py b/TestON/tests/CHOtest/Dependencies/topoChordal.py
deleted file mode 100755
index 542c3ed..0000000
--- a/TestON/tests/CHOtest/Dependencies/topoChordal.py
+++ /dev/null
@@ -1,422 +0,0 @@
-#!/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/CHOtest/Dependencies/topoChordalIpv6.py b/TestON/tests/CHOtest/Dependencies/topoChordalIpv6.py
deleted file mode 100755
index cb065c2..0000000
--- a/TestON/tests/CHOtest/Dependencies/topoChordalIpv6.py
+++ /dev/null
@@ -1,428 +0,0 @@
-#!/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/CHOtest/Dependencies/topoSpine.py b/TestON/tests/CHOtest/Dependencies/topoSpine.py
deleted file mode 100755
index 5787d93..0000000
--- a/TestON/tests/CHOtest/Dependencies/topoSpine.py
+++ /dev/null
@@ -1,434 +0,0 @@
-#!/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/CHOtest/Dependencies/topoSpineIpv6.py b/TestON/tests/CHOtest/Dependencies/topoSpineIpv6.py
deleted file mode 100755
index 7db4fa1..0000000
--- a/TestON/tests/CHOtest/Dependencies/topoSpineIpv6.py
+++ /dev/null
@@ -1,441 +0,0 @@
-#!/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/CHOtest/README b/TestON/tests/CHOtest/README
deleted file mode 100644
index ab402f7..0000000
--- a/TestON/tests/CHOtest/README
+++ /dev/null
@@ -1,40 +0,0 @@
-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 "admin" root user.
-        This test relies on the topology files to start Mininet located in
-        the Dependency folder. Be sure to check that each topology file can
-        be loaded properly by Mininet by using this command:
-
-            sudo ~/<Dependency path>/<topology name>
-
diff --git a/TestON/tests/COMPflow/COMPflow.params b/TestON/tests/COMPflow/COMPflow.params
new file mode 100755
index 0000000..ac85ea6
--- /dev/null
+++ b/TestON/tests/COMPflow/COMPflow.params
@@ -0,0 +1,63 @@
+
+<PARAMS>
+    # CASE - Descritpion
+    # 1,2,10,1000,1100,2000,1200,2000,100
+    # 1 - Variable initialization and optional pull and build ONOS package
+    # 2 - install ONOS
+    # 8 - Compare topology
+    # 9 - Report logs
+    # 10 - Start mininet and verify topology
+
+
+    <testcases>1,10,100,1000,100,110</testcases>
+
+    <SCALE>
+        <max>1</max>
+    </SCALE>
+
+    <DEBUG>on</DEBUG>
+
+    <DEPENDENCY>
+        <path>/tests/COMPflow/Dependency/</path>
+        <wrapper1>startUp</wrapper1>
+        <wrapper2>topo</wrapper2>
+        <topology>topo-flow.py</topology>
+    </DEPENDENCY>
+
+    <ENV>
+        <cellName>productionCell</cellName>
+        <cellApps>drivers,openflow-base</cellApps>
+    </ENV>
+
+    <GIT>
+        <pull>False</pull>
+        <branch>master</branch>
+    </GIT>
+
+    <CTRL>
+        <port>6653</port>
+    </CTRL>
+
+    <CASE10>
+        <numSw>15</numSw>
+        <mnArgs> --topo linear,15 --switch ovsk,protocols=OpenFlow13 --controller remote</mnArgs>
+    </CASE10>
+
+    <CASE1000>
+        <flowsPerSw>14</flowsPerSw>
+        <batches>500</batches>
+    </CASE1000>
+
+    <TEST>
+        <batchSize>200</batchSize>
+        <numThrd>1</numThrd>
+    </TEST>
+
+    <SLEEP>
+        <startup>15</startup>
+        <startMN>5</startMN>
+        <addFlow>10</addFlow>
+        <delFlow>10</delFlow>
+    </SLEEP>
+
+</PARAMS>
diff --git a/TestON/tests/COMPflow/COMPflow.py b/TestON/tests/COMPflow/COMPflow.py
new file mode 100644
index 0000000..37b5256
--- /dev/null
+++ b/TestON/tests/COMPflow/COMPflow.py
@@ -0,0 +1,334 @@
+class COMPflow:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):
+        import time
+        import os
+        import imp
+
+        """
+        - Construct tests variables
+        - GIT ( optional )
+            - Checkout ONOS master branch
+            - Pull latest ONOS code
+        - Building ONOS ( optional )
+            - Install ONOS package
+            - Build ONOS package
+        """
+
+        main.case( "Constructing test variables and building ONOS package" )
+        main.step( "Constructing test variables" )
+        stepResult = main.FALSE
+
+        # Test variables
+        main.testOnDirectory = os.path.dirname( os.getcwd ( ) )
+        main.cellName = main.params[ 'ENV' ][ 'cellName' ]
+        main.apps = main.params[ 'ENV' ][ 'cellApps' ]
+        gitBranch = main.params[ 'GIT' ][ 'branch' ]
+        gitPull = main.params[ 'GIT' ][ 'pull' ]
+        main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
+        main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
+        main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
+        main.startMNSleep = int( main.params[ 'SLEEP' ][ 'startMN' ] )
+        main.addFlowSleep = int( main.params[ 'SLEEP' ][ 'addFlow' ] )
+        main.delFlowSleep = int( main.params[ 'SLEEP' ][ 'delFlow' ] )
+        main.debug = main.params['DEBUG']
+        #main.swDPID = main.params[ 'TEST' ][ 'swDPID' ]
+        main.cellData = {} # for creating cell file
+        main.CLIs = []
+        main.ONOSip = []
+
+        main.debug = True if "on" in main.debug else False
+
+        main.ONOSip = main.ONOSbench.getOnosIps()
+
+        # Assigning ONOS cli handles to a list
+        for i in range( 1,  main.maxNodes + 1 ):
+            main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+
+
+        if main.CLIs:
+            stepResult = main.TRUE
+        else:
+            main.log.error( "Did not properly created list of ONOS CLI handle" )
+            stepResult = main.FALSE
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully construct " +
+                                        "test variables ",
+                                 onfail="Failed to construct test variables" )
+
+        if gitPull == 'True':
+            main.step( "Building ONOS in " + gitBranch + " branch" )
+            onosBuildResult = main.startUp.onosBuild( main, gitBranch )
+            stepResult = onosBuildResult
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=stepResult,
+                                     onpass="Successfully compiled " +
+                                            "latest ONOS",
+                                     onfail="Failed to compile " +
+                                            "latest ONOS" )
+        else:
+            main.log.warn( "Did not pull new code so skipping mvn " +
+                           "clean install" )
+
+    def CASE2( self, main ):
+        """
+        - Set up cell
+            - Create cell file
+            - Set cell file
+            - Verify cell file
+        - Kill ONOS process
+        - Uninstall ONOS cluster
+        - Verify ONOS start up
+        - Install ONOS cluster
+        - Connect to cli
+        """
+
+        main.numCtrls = int( main.maxNodes )
+
+        main.case( "Starting up " + str( main.numCtrls ) +
+                   " node(s) ONOS cluster" )
+
+        #kill off all onos processes
+        main.log.info( "Safety check, killing all ONOS processes" +
+                       " before initiating environment setup" )
+
+        for i in range( main.maxNodes ):
+            main.ONOSbench.onosDie( main.ONOSip[ i ] )
+
+        print "NODE COUNT = ", main.numCtrls
+
+        tempOnosIp = []
+        for i in range( main.numCtrls ):
+            tempOnosIp.append( main.ONOSip[i] )
+
+        main.ONOSbench.createCellFile( main.ONOSbench.ip_address, "temp", main.Mininet1.ip_address, main.apps, tempOnosIp )
+
+        main.step( "Apply cell to environment" )
+        cellResult = main.ONOSbench.setCell( "temp" )
+        verifyResult = main.ONOSbench.verifyCell()
+        stepResult = cellResult and verifyResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully applied cell to " + \
+                                        "environment",
+                                 onfail="Failed to apply cell to environment " )
+
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage(opTimeout=30)
+        stepResult = packageResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully created ONOS package",
+                                 onfail="Failed to create ONOS package" )
+
+        time.sleep( main.startUpSleep )
+        main.step( "Uninstalling ONOS package" )
+        onosUninstallResult = main.TRUE
+        for i in range( main.numCtrls ):
+            onosUninstallResult = onosUninstallResult and \
+                    main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
+        stepResult = onosUninstallResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully uninstalled ONOS package",
+                                 onfail="Failed to uninstall ONOS package" )
+
+        time.sleep( main.startUpSleep )
+        main.step( "Installing ONOS package" )
+        onosInstallResult = main.TRUE
+        for i in range( main.numCtrls ):
+            onosInstallResult = onosInstallResult and \
+                    main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
+        stepResult = onosInstallResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully installed ONOS package",
+                                 onfail="Failed to install ONOS package" )
+
+        time.sleep( main.startUpSleep )
+        main.step( "Starting ONOS service" )
+        stopResult = main.TRUE
+        startResult = main.TRUE
+        onosIsUp = main.TRUE
+
+        for i in range( main.numCtrls ):
+            onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
+        if onosIsUp == main.TRUE:
+            main.log.report( "ONOS instance is up and ready" )
+        else:
+            main.log.report( "ONOS instance may not be up, stop and " +
+                             "start ONOS again " )
+            for i in range( main.numCtrls ):
+                stopResult = stopResult and \
+                        main.ONOSbench.onosStop( main.ONOSip[ i ] )
+            for i in range( main.numCtrls ):
+                startResult = startResult and \
+                        main.ONOSbench.onosStart( main.ONOSip[ i ] )
+        stepResult = onosIsUp and stopResult and startResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="ONOS service is ready",
+                                 onfail="ONOS service did not start properly" )
+
+        main.step( "Start ONOS cli" )
+        cliResult = main.TRUE
+        for i in range( main.numCtrls ):
+            cliResult = cliResult and \
+                        main.CLIs[ i ].startOnosCli( main.ONOSip[ i ], onosStartTimeout=30 )
+        stepResult = cliResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully start ONOS cli",
+                                 onfail="Failed to start ONOS cli" )
+
+    def CASE10( self, main ):
+        '''
+            Start Mininet
+        '''
+        import json
+
+        main.numSw = int(main.params['CASE10']['numSw'])
+        main.case( "Setup mininet and compare ONOS topology view to Mininet topology" )
+        main.caseExplanation = "Start mininet with custom topology and compare topology " +\
+                "elements between Mininet and ONOS"
+
+        main.step( "Setup Mininet Linear Topology with " + str(main.numSw) + " switches" )
+        stepResult = main.Mininet1.startNet( args = main.params['CASE10']['mnArgs'] )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully loaded topology",
+                                 onfail="Failed to load topology" )
+
+        main.step( "Assign switches to controller" )
+        for i in range(1, main.numSw + 1):
+            main.Mininet1.assignSwController( "s" + str(i), main.ONOSip[0] )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully assigned switch to controller",
+                                 onfail="Failed to assign switch to controller" )
+
+        time.sleep( main.startMNSleep )
+
+
+
+
+    def CASE1000( self, main ):
+        '''
+            create JSON object with batched flows
+        '''
+        import numpy
+        import time
+
+        main.case( "Create a json object for the batched flows" )
+
+        main.step( "Parse batch information" )
+        main.flowsPerSw = int(main.params['CASE1000']['flowsPerSw'])
+        main.log.info("Number of flows in a batch is:" + str(main.flowsPerSw * main.numSw))
+
+        main.flowJsonBatchList = []
+        postTimes = []
+
+        main.step("Creating a full list of batches")
+        for index in range(1, int(main.params['CASE1000']['batches']) + 1):
+            flowJsonBatch = main.ONOSrest.createFlowBatch( numSw = main.numSw,
+                                                           batchSizePerSw = main.flowsPerSw,
+                                                           batchIndex = index,
+                                                           ingressPort = 2,
+                                                           egressPort = 3)
+            main.flowJsonBatchList.append(flowJsonBatch)
+
+        main.step("Using REST API /flows/{} to post flow batch")
+        tStartPost = time.time()
+        for item in main.flowJsonBatchList:
+            ts = time.time()
+            resp = main.ONOSrest.sendFlowBatch(batch = item )
+            teBatch = time.time() - ts
+            postTimes.append(teBatch)
+            main.log.info("Batch Rest Post Elapse time is: " + str(teBatch))
+
+        tLastPostEnd = time.time()
+
+        main.step("Check to ensure all flows are in added state.")
+        resp = main.FALSE
+        while resp != main.TRUE:
+            resp = main.ONOSrest.checkFlowsState()
+            time.sleep(0.5)
+        tAllAdded = time.time()
+
+        numFlows = int(main.params['CASE1000']['batches']) *\
+                                                    int(main.params['CASE1000']['flowsPerSw']) *\
+                                                    int(main.params['CASE10']['numSw'])
+        main.log.info("Total number of flows: " + str (numFlows) )
+        main.log.info("Sum of each POST elapse time: " + str(numpy.sum(postTimes)) )
+        main.log.info("Total POST elapse time: " + str(tLastPostEnd-tStartPost))
+
+        duration = tAllAdded - tLastPostEnd
+        main.log.info("Elapse time from end of last REST POST to Flows in ADDED state: " +\
+                      str(duration))
+        main.log.info("Rate of Batch Flow add is (flows/sec): " + str( numFlows / duration))
+
+    def CASE2000(self, main):
+        import time
+        import numpy
+
+        rmTimes = []
+
+        main.case("Remove flow timing")
+
+        tStartRemove = time.time()
+        for item in main.flowJsonBatchList:
+            ts = time.time()
+            resp = main.ONOSrest.removeFlowBatch(batch = item )
+            teBatch = time.time() - ts
+            rmTimes.append(teBatch)
+            main.log.info("Batch Rest Remove Elapse time is: " + str(teBatch))
+
+        tLastRemoveEnd = time.time()
+
+        main.step("Check to ensure all flows are in added state.")
+        resp = main.FALSE
+        while resp != main.TRUE:
+            resp = main.ONOSrest.checkFlowsState()
+            time.sleep(0.5)
+        tAllRemoved = time.time()
+
+        main.log.info("Total number of flows: " + str (int(main.params['CASE1000']['batches']) *\
+                                                    int(main.params['CASE1000']['flowsPerSw']) *\
+                                                    int(main.params['CASE10']['numSw'])) )
+        main.log.info("Sum of each DELETE elapse time: " + str(numpy.sum(rmTimes)) )
+        main.log.info("Total POST elapse time: " + str(tLastRemoveEnd-tStartRemove))
+
+        main.log.info("Elapse time from end of last REST POST to Flows in ADDED state: " +\
+                      str(tAllRemoved - tLastRemoveEnd))
+
+    def CASE100(self,main):
+        from pprint import pprint
+
+        main.case( "Check to ensure onos flows." )
+
+        resp = main.ONOSrest.checkFlowsState()
+        pprint(resp)
+
+
+    def CASE110( self, main ):
+        '''
+        Report errors/warnings/exceptions
+        '''
+        main.log.info("Error report: \n" )
+        main.ONOSbench.logReport( main.ONOSip[ 0 ],
+                                  [ "INFO",
+                                    "FOLLOWER",
+                                    "WARN",
+                                    "flow",
+                                    "ERROR",
+                                    "Except" ],
+                                  "s" )
+        main.stop()
+
diff --git a/TestON/tests/COMPflow/COMPflow.topo b/TestON/tests/COMPflow/COMPflow.topo
new file mode 100755
index 0000000..e72bf1b
--- /dev/null
+++ b/TestON/tests/COMPflow/COMPflow.topo
@@ -0,0 +1,45 @@
+<TOPOLOGY>
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+            </COMPONENTS>
+        </ONOSbench>
+
+        <ONOScli1>
+            <host>OC1</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS>
+            </COMPONENTS>
+        </ONOScli1>
+
+        <Mininet1>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>MininetCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </Mininet1>
+
+        <ONOSrest>
+            <host>OC1</host>
+            <port>8181</port>
+            <user>onos</user>
+            <password>rocks</password>
+            <type>OnosRestDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS>
+            </COMPONENTS>
+        </ONOSrest>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/COMPflow/Dependency/FlowBatch.py b/TestON/tests/COMPflow/Dependency/FlowBatch.py
new file mode 100644
index 0000000..ac749d5
--- /dev/null
+++ b/TestON/tests/COMPflow/Dependency/FlowBatch.py
@@ -0,0 +1,6 @@
+class FlowBatch():
+
+    batchSize = 0
+    batchJson = {}
+
+    def createBatchJson(main, batchSize):
diff --git a/TestON/tests/COMPflow/Dependency/mplsClass.py b/TestON/tests/COMPflow/Dependency/mplsClass.py
new file mode 100644
index 0000000..30b27e8
--- /dev/null
+++ b/TestON/tests/COMPflow/Dependency/mplsClass.py
@@ -0,0 +1,10 @@
+import scapy
+
+class MPLS(Packet):
+        name = "MPLS"
+        fields_desc =  [
+                BitField("label", 3, 20),
+                BitField("experimental_bits", 0, 3),
+                BitField("bottom_of_label_stack", 1, 1), # Now we're at the bottom
+                ByteField("TTL", 255)
+        ]
diff --git a/TestON/tests/COMPflow/Dependency/startUp.py b/TestON/tests/COMPflow/Dependency/startUp.py
new file mode 100644
index 0000000..bf2a2b6
--- /dev/null
+++ b/TestON/tests/COMPflow/Dependency/startUp.py
@@ -0,0 +1,38 @@
+"""
+    This wrapper function is use for starting up onos instance
+"""
+
+import time
+import os
+import json
+
+def onosBuild( main, gitBranch ):
+    """
+        This includes pulling ONOS and building it using maven install
+    """
+
+    buildResult = main.FALSE
+
+    # Git checkout a branch of ONOS
+    checkOutResult = main.ONOSbench.gitCheckout( gitBranch )
+    # Does the git pull on the branch that was checked out
+    if not checkOutResult:
+        main.log.warn( "Failed to checked out " + gitBranch +
+                                           " branch")
+    else:
+        main.log.info( "Successfully checked out " + gitBranch +
+                                           " branch")
+    gitPullResult = main.ONOSbench.gitPull()
+    if gitPullResult == main.ERROR:
+        main.log.error( "Error pulling git branch" )
+    else:
+        main.log.info( "Successfully pulled " + gitBranch + " branch" )
+
+    # Maven clean install
+    buildResult = main.ONOSbench.cleanInstall()
+
+    return buildResult
+
+
+
+
diff --git a/TestON/tests/COMPflow/README b/TestON/tests/COMPflow/README
new file mode 100644
index 0000000..018e42d
--- /dev/null
+++ b/TestON/tests/COMPflow/README
@@ -0,0 +1,49 @@
+FUNCflow test suite
+
+Summary:
+        This test suite consists of basic flow-rule based functionality testing.
+        The main goal of this test suite is to verify that the flow subsytem is
+        compiling flows correctly. We verify each flow by utilizing Scapy, a
+        Python library for generating and sending packets. The following is an
+        overview of the test.
+        Steps:
+            - Discover hosts
+            - add specific flow
+            - verify flow
+            - remove flow
+
+        Each repetion of the steps tests a specific selector. Here is a list
+        of the selectors that are being tested:
+        Selectors:
+            - MAC
+            - IPv4
+            - VLAN
+            - MPLS
+            - TCP
+            - UDP
+
+        We verify the selectors by sending a tailor made packet through the
+        two hosts. If the packet was recieved, then the flow was compiled
+        correctly.
+
+Topology:
+        The topology consists of one switch with four hosts connected to it.
+        Two hosts are regular IPv4 hosts, while the other two are hosts with
+        vlan interfaces to test the vlan selector.
+
+Required:
+        This test requires Mininet topology file topo-flow.py located in the
+        dependency folder. The topology consistes of VLAN hosts, so you will
+        need to install the VLAN module. You will also need to install the
+        Python module, Scapy.
+
+VLAN configuration:
+        Execute command:
+            $ sudo apt-get install vlan
+        Configuration:
+            $ sudo modprobe 8021q
+        NOTE:To make this configuration permanent
+            $ sudo su -c 'echo "8021q" >> /etc/modules'
+
+Scapy install:
+    sudo apt-get install Scapy
diff --git a/TestON/tests/CHOtest/__init__.py b/TestON/tests/COMPflow/__init__.py
similarity index 100%
rename from TestON/tests/CHOtest/__init__.py
rename to TestON/tests/COMPflow/__init__.py
