diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
index c3a7346..848e4cc 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
@@ -15,18 +15,19 @@
     # 50. Set FlowObjective to True
     # 51. Set FlowObjective to False
     # 60. Rebalance devices across controllers
+    # 70. Randomly generate events
     # 90. Sleep for some time
     # 100. Do something else
     # Sample sequence: 0,1,2,3,[10,30,21,31,10,32,21,33,50,10,30,21,31,10,32,21,33,51,40,60,10,30,21,31,10,32,21,33,50,10,30,21,31,10,32,21,33,51,41,60]*500,100
     <testcases>
-        0,1,2,3,10,[30,21,31,32,21,33,50,30,21,31,32,21,33,51]*500,100
+        0,1,2,3,70,[30,21,31,32,21,33]*500,100
     </testcases>
 
     <TEST>
         <topo>1</topo>
         <IPv6>on</IPv6>
         <numCtrl>3</numCtrl>
-        <pauseTest>on</pauseTest>
+        <pauseTest>off</pauseTest>
         <caseSleep>0</caseSleep>
         <setIPv6CfgSleep>5</setIPv6CfgSleep>
         <loadTopoSleep>5</loadTopoSleep>
@@ -382,6 +383,14 @@
         <linkDownUpInterval>1</linkDownUpInterval>
     </CASE21>
 
+    <CASE70>
+        <sleepSec>2</sleepSec>
+        <addHostIntentWeight>3</addHostIntentWeight>
+        <addPointIntentWeight>3</addPointIntentWeight>
+        <linkDownWeight>3</linkDownWeight>
+        <deviceDownWeight>2</deviceDownWeight>
+    </CASE70>
+
     <CASE90>
         <sleepSec>60</sleepSec>
     </CASE90>
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index 7b07758..11459b3 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -762,6 +762,104 @@
                                  onfail="Balance masters test failed" )
         time.sleep( main.caseSleep )
 
+    def CASE70( self, main ):
+        """
+        Randomly generate events
+        """
+        import time
+        import random
+        from tests.CHOTestMonkey.dependencies.events.Event import EventType
+        from tests.CHOTestMonkey.dependencies.EventScheduler import EventScheduleMethod
+
+        main.log.report( "Randomly generate events" )
+        main.log.report( "__________________________________________________" )
+        main.case( "Randomly generate events" )
+        main.step( "Randomly generate events" )
+        main.caseResult = main.TRUE
+        sleepSec = int( main.params[ 'CASE70' ][ 'sleepSec' ] )
+        hostIntentNum = 0
+        pointIntentNum = 0
+        downDeviceNum = 0
+        downLinkNum = 0
+        upControllers = [ 1, 2, 3 ]
+        while True:
+            events = []
+            for i in range( int( main.params[ 'CASE70' ][ 'addHostIntentWeight' ] ) ):
+                events.append( 'add-host-intent' )
+            for i in range( int( main.params[ 'CASE70' ][ 'addPointIntentWeight' ] ) ):
+                events.append( 'add-point-intent' )
+            for i in range( int( main.params[ 'CASE70' ][ 'linkDownWeight' ] ) ):
+                events.append( 'link-down' )
+            for i in range( int( main.params[ 'CASE70' ][ 'deviceDownWeight' ] ) ):
+                events.append( 'device-down' )
+            for i in range( int( pow( hostIntentNum, 1.5 ) / 100 ) ):
+                events.append( 'del-host-intent' )
+            for i in range( int( pow( pointIntentNum/2, 1.5 ) / 100 ) ):
+                events.append( 'del-point-intent' )
+            for i in range( pow( 2, downLinkNum ) - 1 ):
+                events.append( 'link-up' )
+            for i in range( pow( 5, downDeviceNum ) - 1 ):
+                events.append( 'device-up' )
+            main.log.debug( events )
+            event = random.sample( events, 1 )[ 0 ]
+            if event == 'add-host-intent':
+                n = random.randint( 5, 50 )
+                for i in range( n ):
+                    cliIndex = random.sample( upControllers, 1 )[ 0 ]
+                    main.eventGenerator.triggerEvent( EventType().APP_INTENT_HOST_ADD, EventScheduleMethod().RUN_NON_BLOCK, 'random', 'random', cliIndex )
+                    hostIntentNum += 1
+                main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
+            elif event == 'del-host-intent':
+                n = random.randint( 5, hostIntentNum )
+                for i in range( n ):
+                    cliIndex = random.sample( upControllers, 1 )[ 0 ]
+                    main.eventGenerator.triggerEvent( EventType().APP_INTENT_HOST_DEL, EventScheduleMethod().RUN_NON_BLOCK, 'random', 'random', cliIndex )
+                    hostIntentNum -= 1
+                main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
+            elif event == 'add-point-intent':
+                n = random.randint( 5, 50 )
+                for i in range( n ):
+                    cliIndex = random.sample( upControllers, 1 )[ 0 ]
+                    main.eventGenerator.triggerEvent( EventType().APP_INTENT_POINT_ADD, EventScheduleMethod().RUN_NON_BLOCK, 'random', 'random', cliIndex, 'bidirectional' )
+                    pointIntentNum += 1
+                main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
+            elif event == 'del-point-intent':
+                n = random.randint( 5, pointIntentNum )
+                for i in range( n ):
+                    cliIndex = random.sample( upControllers, 1 )[ 0 ]
+                    main.eventGenerator.triggerEvent( EventType().APP_INTENT_POINT_DEL, EventScheduleMethod().RUN_NON_BLOCK, 'random', 'random', cliIndex, 'bidirectional' )
+                    pointIntentNum -= 1
+                main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
+            elif event == 'link-down':
+                main.eventGenerator.triggerEvent( EventType().NETWORK_LINK_DOWN, EventScheduleMethod().RUN_BLOCK, 'random', 'random' )
+                downLinkNum += 1
+            elif event == 'link-up':
+                main.eventGenerator.triggerEvent( EventType().NETWORK_LINK_UP, EventScheduleMethod().RUN_BLOCK, 'random', 'random' )
+                downLinkNum -= 1
+            elif event == 'device-down':
+                main.eventGenerator.triggerEvent( EventType().NETWORK_DEVICE_DOWN, EventScheduleMethod().RUN_BLOCK, 'random' )
+                downDeviceNum += 1
+            elif event == 'device-up':
+                main.eventGenerator.triggerEvent( EventType().NETWORK_DEVICE_UP, EventScheduleMethod().RUN_BLOCK, 'random' )
+                downDeviceNum -= 1
+            else:
+                pass
+            main.eventGenerator.triggerEvent( EventType().CHECK_TOPO, EventScheduleMethod().RUN_NON_BLOCK )
+            main.eventGenerator.triggerEvent( EventType().CHECK_ONOS, EventScheduleMethod().RUN_NON_BLOCK )
+            main.eventGenerator.triggerEvent( EventType().CHECK_TRAFFIC, EventScheduleMethod().RUN_NON_BLOCK )
+            main.eventGenerator.triggerEvent( EventType().CHECK_FLOW, EventScheduleMethod().RUN_NON_BLOCK )
+            main.eventGenerator.triggerEvent( EventType().CHECK_INTENT, EventScheduleMethod().RUN_NON_BLOCK )
+            main.eventGenerator.triggerEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
+            with main.eventScheduler.idleCondition:
+                while not main.eventScheduler.isIdle():
+                    main.eventScheduler.idleCondition.wait()
+            #time.sleep( sleepSec )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=main.caseResult,
+                                 onpass="Randomly generate events test passed",
+                                 onfail="Randomly generate events test failed" )
+        time.sleep( main.caseSleep )
+
     def CASE90( self, main ):
         """
         Sleep for some time
diff --git a/TestON/tests/CHOTestMonkey/dependencies/cli.py b/TestON/tests/CHOTestMonkey/dependencies/cli.py
index d1a8448..a3fb18e 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/cli.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/cli.py
@@ -64,26 +64,28 @@
             if cmdList[ 0 ] in commandMap.keys():
                 num = paramNum[ cmdList[ 0 ] ]
                 name = commandMap[ cmdList[ 0 ] ]
+                '''
                 if len( cmdList ) < num + 1:
                     print 'not enough arguments'
                 elif len( cmdList ) > num + 1:
                     print 'Too many arguments'
                 else:
-                    result = triggerEvent( debugMode, name, 'RUN_BLOCK', cmdList[ 1: ] )
-                    if result == 10:
-                        pass
-                    elif result == 11:
-                        print "Scheduler busy...Try later or use debugging mode by entering \'debug\'"
-                    elif result == 20:
-                        print "Unknown message to server"
-                    elif result == 21:
-                        print "Unknown event type to server"
-                    elif result == 22:
-                        print "Unknown schedule method to server"
-                    elif result == 23:
-                        print "Not enough argument"
-                    else:
-                        print "Unknown response from server"
+                '''
+                result = triggerEvent( debugMode, name, 'RUN_BLOCK', cmdList[ 1: ] )
+                if result == 10:
+                    pass
+                elif result == 11:
+                    print "Scheduler busy...Try later or use debugging mode by entering \'debug\'"
+                elif result == 20:
+                    print "Unknown message to server"
+                elif result == 21:
+                    print "Unknown event type to server"
+                elif result == 22:
+                    print "Unknown schedule method to server"
+                elif result == 23:
+                    print "Not enough argument"
+                else:
+                    print "Unknown response from server"
             else:
                 print 'Unknown command'
 
diff --git a/TestON/tests/CHOTestMonkey/dependencies/elements/NetworkElement.py b/TestON/tests/CHOTestMonkey/dependencies/elements/NetworkElement.py
index b3618dd..31a4084 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/elements/NetworkElement.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/elements/NetworkElement.py
@@ -37,7 +37,7 @@
         self.outgoingLinks = []
 
     def __str__( self ):
-        return "name: " + self.name + ", dpid: " + self.dpid
+        return "name: " + self.name + ", dpid: " + self.dpid + ", status: " + self.status
 
 class Host( NetworkElement ):
     def __init__( self, index, name, id, mac, device, devicePort, vlan, ipAddresses ):
@@ -53,7 +53,7 @@
         self.handle = None
 
     def __str__( self ):
-        return "name: " + self.name + ", mac: " + self.mac + ", device: " + self.device.dpid + ", ipAddresses: " + str( self.ipAddresses )
+        return "name: " + self.name + ", mac: " + self.mac + ", device: " + self.device.dpid + ", ipAddresses: " + str( self.ipAddresses ) + ", status: " + self.status
 
     def setHandle( self, handle ):
         self.handle = handle
@@ -71,7 +71,7 @@
         self.portB = portB
 
     def __str__( self ):
-        return self.deviceA.dpid + "/" + self.portA + " - " + self.deviceB.dpid + "/" + self.portB
+        return self.deviceA.dpid + "/" + self.portA + " - " + self.deviceB.dpid + "/" + self.portB + ", status: " + self.status
 
     def setBackwardLink( self, link ):
         self.backwardLink = link
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
index de5fd48..8113b09 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
@@ -11,6 +11,47 @@
         # The index of the ONOS CLI that is going to run the command
         self.CLIIndex = 0
 
+    def getRandomCorrespondent( self, hostA, connected=True ):
+        import random
+        if connected:
+            candidates = hostA.correspondents
+        else:
+            candidates = [ host for host in main.hosts if host not in hostA.correspondents and host != hostA ]
+        if len( candidates ) == 0:
+            return None
+        hostB = random.sample( candidates, 1 )[0]
+        return hostB
+
+    def getRandomHostPair( self, connected=True ):
+        import random
+        candidateDict = {}
+        with main.variableLock:
+            for host in main.hosts:
+                correspondent = self.getRandomCorrespondent( host, connected=connected )
+                if correspondent != None:
+                    candidateDict[ host ] = correspondent
+            if candidateDict == {}:
+                return None
+            hostA = random.sample( candidateDict.keys(), 1 )[0]
+            hostB = candidateDict[ hostA ]
+            return [ hostA, hostB ]
+
+    def getIntentsByType( self, intentType ):
+        intents = []
+        with main.variableLock:
+            for intent in main.intents:
+                if intent.type == intentType:
+                    intents.append( intent )
+        return intents
+
+    def getRandomIntentByType( self, intentType ):
+        import random
+        intents = self.getIntentsByType( intentType )
+        if len( intents ) == 0:
+            return None
+        intent = random.sample( intents, 1 )[ 0 ]
+        return intent
+
 class HostIntentEvent( IntentEvent ):
     def __init__( self ):
         IntentEvent.__init__( self )
@@ -30,10 +71,25 @@
                 elif len( args ) > 3:
                     main.log.warn( "%s - Too many arguments: %s" % ( self.typeString, args ) )
                     return EventStates().ABORT
+                if args[ 0 ] == 'random' or args[ 1 ] == 'random':
+                    if self.typeIndex == EventType().APP_INTENT_HOST_ADD:
+                        hostPairRandom = self.getRandomHostPair( connected=False )
+                        if hostPairRandom == None:
+                            main.log.warn( "All host pairs are connected, aborting event" )
+                            return EventStates().ABORT
+                        self.hostA = hostPairRandom[ 0 ]
+                        self.hostB = hostPairRandom[ 1 ]
+                    elif self.typeIndex == EventType().APP_INTENT_HOST_DEL:
+                        intent = self.getRandomIntentByType( 'INTENT_HOST' )
+                        if intent == None:
+                            main.log.warn( "No host intent for deletion, aborting event" )
+                            return EventStates().ABORT
+                        self.hostA = intent.hostA
+                        self.hostB = intent.hostB
+                elif args[ 0 ] == args[ 1 ]:
+                    main.log.warn( "%s - invalid argument: %s, %s" % ( self.typeString, args[ 0 ], args[ 1 ] ) )
+                    return EventStates().ABORT
                 else:
-                    if args[ 0 ] == args[ 1 ]:
-                        main.log.warn( "%s - invalid argument: %s" % ( self.typeString, index ) )
-                        return EventStates().ABORT
                     for host in main.hosts:
                         if host.name == args[ 0 ]:
                             self.hostA = host
@@ -47,15 +103,15 @@
                     if self.hostB == None:
                         main.log.warn( "Host %s does not exist: " % ( args[ 1 ] ) )
                         return EventStates().ABORT
-                    index = int( args[ 2 ] )
-                    if index < 1 or index > int( main.numCtrls ):
-                        main.log.warn( "%s - invalid argument: %s" % ( self.typeString, index ) )
-                        return EventStates().ABORT
-                    if not main.controllers[ index - 1 ].isUp():
-                        main.log.warn( self.typeString + " - invalid argument: onos %s is down" % ( controller.index ) )
-                        return EventStates().ABORT
-                    self.CLIIndex = index
-                    return self.startHostIntentEvent()
+                index = int( args[ 2 ] )
+                if index < 1 or index > int( main.numCtrls ):
+                    main.log.warn( "%s - invalid argument: %s" % ( self.typeString, index ) )
+                    return EventStates().ABORT
+                if not main.controllers[ index - 1 ].isUp():
+                    main.log.warn( self.typeString + " - invalid argument: onos %s is down" % ( controller.index ) )
+                    return EventStates().ABORT
+                self.CLIIndex = index
+                return self.startHostIntentEvent()
 
 class AddHostIntent( HostIntentEvent ):
     """
@@ -67,30 +123,36 @@
         self.typeIndex= int( main.params[ 'EVENT' ][ self.__class__.__name__ ][ 'typeIndex' ] )
 
     def startHostIntentEvent( self ):
-        assert self.hostA != None and self.hostB != None
-        # Check whether there already exists some intent for the host pair
-        # For now we should avoid installing overlapping intents
-        for intent in main.intents:
-            if not intent.type == 'INTENT_HOST':
-                continue
-            if intent.hostA == self.hostA and intent.hostB == self.hostB or\
-            intent.hostB == self.hostA and intent.hostA == self.hostB:
-                main.log.warn( self.typeString + " - find an exiting intent for the host pair, abort installation" )
-                return EventStates().ABORT
-        controller = main.controllers[ self.CLIIndex - 1 ]
-        with controller.CLILock:
-            id = controller.CLI.addHostIntent( self.hostA.id, self.hostB.id )
-        if id == None:
-            main.log.warn( self.typeString + " - add host intent failed" )
-            return EventStates().FAIL
-        with main.variableLock:
-            newHostIntent = HostIntent( id, self.hostA, self.hostB )
-            main.intents.append( newHostIntent )
-            # Update host connectivity status
-            # TODO: should we check whether hostA and hostB are already correspondents?
-            self.hostB.correspondents.append( self.hostA )
-            self.hostA.correspondents.append( self.hostB )
-        return EventStates().PASS
+        try:
+            assert self.hostA != None and self.hostB != None
+            # Check whether there already exists some intent for the host pair
+            # For now we should avoid installing overlapping intents
+            for intent in main.intents:
+                if not intent.type == 'INTENT_HOST':
+                    continue
+                if intent.hostA == self.hostA and intent.hostB == self.hostB or\
+                intent.hostB == self.hostA and intent.hostA == self.hostB:
+                    main.log.warn( self.typeString + " - find an exiting intent for the host pair, abort installation" )
+                    return EventStates().ABORT
+            controller = main.controllers[ self.CLIIndex - 1 ]
+            with controller.CLILock:
+                id = controller.CLI.addHostIntent( self.hostA.id, self.hostB.id )
+            if id == None:
+                main.log.warn( self.typeString + " - add host intent failed" )
+                return EventStates().FAIL
+            with main.variableLock:
+                newHostIntent = HostIntent( id, self.hostA, self.hostB )
+                if self.hostA.isDown() or self.hostA.isRemoved() or self.hostB.isDown() or self.hostB.isRemoved():
+                    newHostIntent.setFailed()
+                main.intents.append( newHostIntent )
+                # Update host connectivity status
+                # TODO: should we check whether hostA and hostB are already correspondents?
+                self.hostB.correspondents.append( self.hostA )
+                self.hostA.correspondents.append( self.hostB )
+            return EventStates().PASS
+        except Exception:
+            main.log.warn( "Caught exception, aborting event" )
+            return EventStates().ABORT
 
 class DelHostIntent( HostIntentEvent ):
     """
@@ -102,30 +164,34 @@
         self.typeIndex= int( main.params[ 'EVENT' ][ self.__class__.__name__ ][ 'typeIndex' ] )
 
     def startHostIntentEvent( self ):
-        assert self.hostA != None and self.hostB != None
-        targetIntent = None
-        for intent in main.intents:
-            if not intent.type == 'INTENT_HOST':
-                continue
-            if intent.hostA == self.hostA and intent.hostB == self.hostB or\
-            intent.hostB == self.hostA and intent.hostA == self.hostB:
-                targetIntent = intent
-                break
-        if targetIntent == None:
-            main.log.warn( self.typeString + " - intent does not exist" )
-            return EventStates().FAIL
-        controller = main.controllers[ self.CLIIndex - 1 ]
-        with controller.CLILock:
-            result = controller.CLI.removeIntent( targetIntent.id, purge=True )
-        if result == None or result == main.FALSE:
-            main.log.warn( self.typeString + " - delete host intent failed" )
-            return EventStates().FAIL
-        with main.variableLock:
-            main.intents.remove( targetIntent )
-            # Update host connectivity status
-            self.hostB.correspondents.remove( self.hostA )
-            self.hostA.correspondents.remove( self.hostB )
-        return EventStates().PASS
+        try:
+            assert self.hostA != None and self.hostB != None
+            targetIntent = None
+            for intent in main.intents:
+                if not intent.type == 'INTENT_HOST':
+                    continue
+                if intent.hostA == self.hostA and intent.hostB == self.hostB or\
+                intent.hostB == self.hostA and intent.hostA == self.hostB:
+                    targetIntent = intent
+                    break
+            if targetIntent == None:
+                main.log.warn( self.typeString + " - intent does not exist" )
+                return EventStates().FAIL
+            controller = main.controllers[ self.CLIIndex - 1 ]
+            with controller.CLILock:
+                result = controller.CLI.removeIntent( targetIntent.id, purge=True )
+            if result == None or result == main.FALSE:
+                main.log.warn( self.typeString + " - delete host intent failed" )
+                return EventStates().FAIL
+            with main.variableLock:
+                main.intents.remove( targetIntent )
+                # Update host connectivity status
+                self.hostB.correspondents.remove( self.hostA )
+                self.hostA.correspondents.remove( self.hostB )
+            return EventStates().PASS
+        except Exception:
+            main.log.warn( "Caught exception, aborting event" )
+            return EventStates().ABORT
 
 class PointIntentEvent( IntentEvent ):
     def __init__( self ):
@@ -143,9 +209,27 @@
                 if len( args ) < 3:
                     main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
                     return EventStates().ABORT
-                elif len( args ) > 3:
+                elif len( args ) > 4:
                     main.log.warn( "%s - Too many arguments: %s" % ( self.typeString, args ) )
                     return EventStates().ABORT
+                if args[ 0 ] == 'random' or args[ 1 ] == 'random':
+                    if self.typeIndex == EventType().APP_INTENT_POINT_ADD:
+                        hostPairRandom = self.getRandomHostPair( connected=False )
+                        if hostPairRandom == None:
+                            main.log.warn( "All host pairs are connected, aborting event" )
+                            return EventStates().ABORT
+                        self.deviceA = hostPairRandom[ 0 ].device
+                        self.deviceB = hostPairRandom[ 1 ].device
+                    elif self.typeIndex == EventType().APP_INTENT_POINT_DEL:
+                        intent = self.getRandomIntentByType( 'INTENT_POINT' )
+                        if intent == None:
+                            main.log.warn( "No point intent for deletion, aborting event" )
+                            return EventStates().ABORT
+                        self.deviceA = intent.deviceA
+                        self.deviceB = intent.deviceB
+                elif args[ 0 ] == args[ 1 ]:
+                    main.log.warn( "%s - invalid argument: %s" % ( self.typeString, args[ 0 ], args[ 1 ] ) )
+                    return EventStates().ABORT
                 else:
                     for device in main.devices:
                         if device.name == args[ 0 ]:
@@ -160,14 +244,24 @@
                     if self.deviceB == None:
                         main.log.warn( "Device %s does not exist: " % ( args[ 1 ] ) )
                         return EventStates().ABORT
-                    index = int( args[ 2 ] )
-                    if index < 1 or index > int( main.numCtrls ):
-                        main.log.warn( "%s - invalid argument: %s" % ( self.typeString, index ) )
-                        return EventStates().ABORT
-                    if not main.controllers[ index - 1 ].isUp():
-                        main.log.warn( self.typeString + " - invalid argument: onos %s is down" % ( controller.index ) )
-                        return EventStates().ABORT
-                    self.CLIIndex = index
+                index = int( args[ 2 ] )
+                if index < 1 or index > int( main.numCtrls ):
+                    main.log.warn( "%s - invalid argument: %s" % ( self.typeString, index ) )
+                    return EventStates().ABORT
+                if not main.controllers[ index - 1 ].isUp():
+                    main.log.warn( self.typeString + " - invalid argument: onos %s is down" % ( controller.index ) )
+                    return EventStates().ABORT
+                self.CLIIndex = index
+                if len( args ) == 4 and args[ 3 ] == 'bidirectional':
+                    # Install point intents for both directions
+                    resultA = self.startPointIntentEvent()
+                    [ self.deviceA, self.deviceB ] = [ self.deviceB, self.deviceA ]
+                    resultB = self.startPointIntentEvent()
+                    if resultA == EventStates().PASS and resultB == EventStates().PASS:
+                        return EventStates().PASS
+                    else:
+                        return EventStates().FAIL
+                else:
                     return self.startPointIntentEvent()
 
 class AddPointIntent( PointIntentEvent ):
@@ -180,39 +274,45 @@
         self.typeIndex= int( main.params[ 'EVENT' ][ self.__class__.__name__ ][ 'typeIndex' ] )
 
     def startPointIntentEvent( self ):
-        assert self.deviceA != None and self.deviceB != None
-        controller = main.controllers[ self.CLIIndex - 1 ]
-        # TODO: the following check only work when we use default port number for point intents
-        # Check whether there already exists some intent for the device pair
-        # For now we should avoid installing overlapping intents
-        for intent in main.intents:
-            if not intent.type == 'INTENT_POINT':
-                continue
-            if intent.deviceA == self.deviceA and intent.deviceB == self.deviceB:
-                main.log.warn( self.typeString + " - find an exiting intent for the device pair, abort installation" )
-                return EventStates().ABORT
-        controller = main.controllers[ self.CLIIndex - 1 ]
-        with controller.CLILock:
-            # TODO: handle the case that multiple hosts attach to one device
-            srcMAC = ""
-            dstMAC = ""
-            if len( self.deviceA.hosts ) > 0:
-                srcMAC = self.deviceA.hosts[ 0 ].mac
-            if len( self.deviceB.hosts ) > 0:
-                dstMAC = self.deviceB.hosts[ 0 ].mac
-            id = controller.CLI.addPointIntent( self.deviceA.dpid, self.deviceB.dpid,
-                                                1, 1, '', srcMAC, dstMAC )
-        if id == None:
-            main.log.warn( self.typeString + " - add point intent failed" )
-            return EventStates().FAIL
-        with main.variableLock:
-            newPointIntent = PointIntent( id, self.deviceA, self.deviceB )
-            main.intents.append( newPointIntent )
-            # Update host connectivity status
-            for hostA in self.deviceA.hosts:
-                for hostB in self.deviceB.hosts:
-                    hostA.correspondents.append( hostB )
-        return EventStates().PASS
+        try:
+            assert self.deviceA != None and self.deviceB != None
+            controller = main.controllers[ self.CLIIndex - 1 ]
+            # TODO: the following check only work when we use default port number for point intents
+            # Check whether there already exists some intent for the device pair
+            # For now we should avoid installing overlapping intents
+            for intent in main.intents:
+                if not intent.type == 'INTENT_POINT':
+                    continue
+                if intent.deviceA == self.deviceA and intent.deviceB == self.deviceB:
+                    main.log.warn( self.typeString + " - find an exiting intent for the device pair, abort installation" )
+                    return EventStates().ABORT
+            controller = main.controllers[ self.CLIIndex - 1 ]
+            with controller.CLILock:
+                # TODO: handle the case that multiple hosts attach to one device
+                srcMAC = ""
+                dstMAC = ""
+                if len( self.deviceA.hosts ) > 0:
+                    srcMAC = self.deviceA.hosts[ 0 ].mac
+                if len( self.deviceB.hosts ) > 0:
+                    dstMAC = self.deviceB.hosts[ 0 ].mac
+                id = controller.CLI.addPointIntent( self.deviceA.dpid, self.deviceB.dpid,
+                                                    1, 1, '', srcMAC, dstMAC )
+            if id == None:
+                main.log.warn( self.typeString + " - add point intent failed" )
+                return EventStates().FAIL
+            with main.variableLock:
+                newPointIntent = PointIntent( id, self.deviceA, self.deviceB )
+                if self.deviceA.isDown() or self.deviceB.isDown() or self.deviceA.isRemoved() or self.deviceB.isRemoved():
+                    newPointIntent.setFailed()
+                main.intents.append( newPointIntent )
+                # Update host connectivity status
+                for hostA in self.deviceA.hosts:
+                    for hostB in self.deviceB.hosts:
+                        hostA.correspondents.append( hostB )
+            return EventStates().PASS
+        except Exception:
+            main.log.warn( "Caught exception, aborting event" )
+            return EventStates().ABORT
 
 class DelPointIntent( PointIntentEvent ):
     """
@@ -224,27 +324,31 @@
         self.typeIndex= int( main.params[ 'EVENT' ][ self.__class__.__name__ ][ 'typeIndex' ] )
 
     def startPointIntentEvent( self ):
-        assert self.deviceA != None and self.deviceB != None
-        targetIntent = None
-        for intent in main.intents:
-            if not intent.type == 'INTENT_POINT':
-                continue
-            if intent.deviceA == self.deviceA and intent.deviceB == self.deviceB:
-                targetIntent = intent
-                break
-        if targetIntent == None:
-            main.log.warn( self.typeString + " - intent does not exist" )
-            return EventStates().FAIL
-        controller = main.controllers[ self.CLIIndex - 1 ]
-        with controller.CLILock:
-            result = controller.CLI.removeIntent( targetIntent.id, purge=True )
-        if result == None or result == main.FALSE:
-            main.log.warn( self.typeString + " - delete host intent failed" )
-            return EventStates().FAIL
-        with main.variableLock:
-            main.intents.remove( targetIntent )
-            # Update host connectivity status
-            for hostA in self.deviceA.hosts:
-                for hostB in self.deviceB.hosts:
-                    hostA.correspondents.remove( hostB )
-        return EventStates().PASS
+        try:
+            assert self.deviceA != None and self.deviceB != None
+            targetIntent = None
+            for intent in main.intents:
+                if not intent.type == 'INTENT_POINT':
+                    continue
+                if intent.deviceA == self.deviceA and intent.deviceB == self.deviceB:
+                    targetIntent = intent
+                    break
+            if targetIntent == None:
+                main.log.warn( self.typeString + " - intent does not exist" )
+                return EventStates().FAIL
+            controller = main.controllers[ self.CLIIndex - 1 ]
+            with controller.CLILock:
+                result = controller.CLI.removeIntent( targetIntent.id, purge=True )
+            if result == None or result == main.FALSE:
+                main.log.warn( self.typeString + " - delete point intent failed" )
+                return EventStates().FAIL
+            with main.variableLock:
+                main.intents.remove( targetIntent )
+                # Update host connectivity status
+                for hostA in self.deviceA.hosts:
+                    for hostB in self.deviceB.hosts:
+                        hostA.correspondents.remove( hostB )
+            return EventStates().PASS
+        except Exception:
+            main.log.warn( "Caught exception, aborting event" )
+            return EventStates().ABORT
diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.params b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.params
index 373f007..0976c40 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.params
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.params
@@ -14,8 +14,9 @@
     # 24 - Remove NetCfgs
     # 25 - Move network-cfg.json to onos directory for prebuild configurations
     # 26 - Check that prebuild configurations are correct
+    # 27 - Posting network configurations to the top level web resource
 
-    <testcases>1,25,2,20,11,26,21,22,23,24</testcases>
+    <testcases>1,25,2,20,11,27,26,21,22,23,24</testcases>
 
     <DEPENDENCY>
         <path>/tests/FUNC/FUNCnetCfg/dependencies/</path>
@@ -40,5 +41,6 @@
     <MININET>
         <switch>6</switch>
     </MININET>
-
+    <RETRY>5</RETRY>
+    <RetrySleep>2</RetrySleep>
 </PARAMS>
diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
index 0f8812a..e311bf9 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
@@ -48,7 +48,8 @@
             main.hostsData = {}
             main.nodes = []
             main.ONOSip = []
-
+            main.retrytimes = main.params[ 'RETRY' ]
+            main.retrysleep = main.params[ 'RetrySleep' ]
             main.ONOSip = main.ONOSbench.getOnosIps()
 
             # Assigning ONOS cli handles to a list
@@ -431,6 +432,7 @@
                 main.log.error( "ONOS NetCfg doesn't match what was sent" )
                 main.log.debug( "ONOS config: {}".format( onosCfg ) )
                 main.log.debug( "Sent config: {}".format( sentCfg ) )
+                utilities.retry( f=main.ONOSrest1.getNetCfg, retValue=False, attempts=main.retrytimes, sleep=main.retrysleep )
         utilities.assert_equals( expect=True,
                                  actual=s1Result,
                                  onpass="Net Cfg added for device s1",
@@ -460,6 +462,7 @@
                 main.log.error( "ONOS NetCfg doesn't match what was sent" )
                 main.log.debug( "ONOS config: {}".format( onosCfg ) )
                 main.log.debug( "Sent config: {}".format( sentCfg ) )
+                utilities.retry( f=main.ONOSrest1.getNetCfg, retValue=False, attempts=main.retrytimes, sleep=main.retrysleep )
         utilities.assert_equals( expect=True,
                                  actual=s3Result,
                                  onpass="Net Cfg added for device s3",
@@ -499,7 +502,6 @@
                                  onpass="Only allowed devices are in ONOS",
                                  onfail="ONOS devices doesn't match the list" +
                                         " of allowed devices" )
-
         main.step( "Check device annotations" )
         keys = [ 'name', 'owner', 'rackAddress' ]
         try:
@@ -560,6 +562,7 @@
                 main.log.error( "ONOS NetCfg doesn't match what was sent" )
                 main.log.debug( "ONOS config: {}".format( onosCfg ) )
                 main.log.debug( "Sent config: {}".format( sentCfg ) )
+                utilities.retry( f=main.ONOSrest2.getNetCfg, retValue=False, attempts=main.retrytimes, sleep=main.retrysleep )
         utilities.assert_equals( expect=True,
                                  actual=s2Result,
                                  onpass="Net Cfg added for device s2",
@@ -571,14 +574,14 @@
                    "owner": "John",
                    "allowed": False }
         main.s4Json = s4Json
-        setS4Disallow = main.ONOSrest4.setNetCfg( s4Json,
+        setS4Disallow = main.ONOSrest3.setNetCfg( s4Json,
                                                   subjectClass="devices",
                                                   subjectKey="of:0000000000000004",
                                                   configKey="basic" )
         s4Result = False
         if setS4Disallow:
             # Check what we set is what is in ONOS
-            getS4 = main.ONOSrest4.getNetCfg( subjectClass="devices",
+            getS4 = main.ONOSrest3.getNetCfg( subjectClass="devices",
                                               subjectKey="of:0000000000000004",
                                               configKey="basic" )
             onosCfg = pprint( getS4 )
@@ -589,10 +592,12 @@
                 main.log.error( "ONOS NetCfg doesn't match what was sent" )
                 main.log.debug( "ONOS config: {}".format( onosCfg ) )
                 main.log.debug( "Sent config: {}".format( sentCfg ) )
+                main.step( "Retrying main.ONOSrest3.getNetCfg" )
+                utilities.retry( f=main.ONOSrest3.getNetCfg, retValue=False, attempts=main.retrytimes, sleep=main.retrysleep )
         utilities.assert_equals( expect=True,
                                  actual=s4Result,
                                  onpass="Net Cfg added for device s4",
-                                 onfail="Net Cfg for device s3 not correctly set" )
+                                 onfail="Net Cfg for device s4 not correctly set" )
 
         main.netCfg.compareCfg( main, main.gossipTime )
 
@@ -719,7 +724,7 @@
             del s4Json['allowed']
         except KeyError:
             main.log.exception( "Key not found" )
-        setS4 = main.ONOSrest4.setNetCfg( s4Json,
+        setS4 = main.ONOSrest3.setNetCfg( s4Json,
                                           subjectClass="devices",
                                           subjectKey="of:0000000000000004",
                                           configKey="basic" )
@@ -794,10 +799,10 @@
         import json
         main.case( "Check to see if the pre-startup configurations were set, then remove their allowed status" )
         main.step( "Checking configurations for Switches 5 and 6" )
-        main.step( "ONOS should only show devices S1, S2, S4, S5, and S6" )
+        main.step( "ONOS should only show devices S1, S2, S4, and S5" ) #and S6
         devices = main.ONOSrest1.devices()
         main.log.debug( main.ONOSrest1.pprint( devices ) )
-        allowedDevices = [ "of:{}".format( str( i ).zfill( 16 ) ) for i in [ 1, 2, 4, 5, 6 ] ]
+        allowedDevices = [ "of:{}".format( str( i ).zfill( 16 ) ) for i in [ 1, 2, 4, 5 ] ] #6
         main.log.debug( allowedDevices )
         onosDevices = []
         try:
@@ -826,4 +831,61 @@
         setS1 = main.ONOSrest1.setNetCfg( s6Json,
                                           subjectClass="devices",
                                           subjectKey="of:0000000000000006",
-                                          configKey="basic" )
\ No newline at end of file
+                                          configKey="basic" )
+
+    def CASE27( self, main ):
+        """
+        1) A = get /network/configuration
+        2) Post A
+        3) Compare A with ONOS
+        4) Modify A so S6 is disallowed
+        5) Check
+
+        """
+        import json
+        pprint = main.nodes[0].pprint
+        main.case( "Posting network configurations to the top level web resource" )
+        main.step( "Get json object from Net Cfg" )
+        getinfo = main.ONOSrest1.getNetCfg( )
+        main.log.debug( getinfo )
+        main.step( "Posting json object to Net Cfg" )
+        postinfo = main.ONOSrest1.setNetCfg( json.loads( getinfo ) )
+        main.step( "Compare device with ONOS" )
+        main.netCfg.compareCfg( main )
+        main.step ( "ONOS should only show devices S1, S2, S4, S5 and S6" )
+        devices = main.ONOSrest1.devices( )
+        main.log.debug( main.ONOSrest1.pprint( devices ) )
+        allowedDevices = [ "of:{}".format( str( i ).zfill( 16 ) ) for i in [ 1, 2, 4, 5, 6 ] ]
+        onosDevices = []
+        try:
+            for sw in json.loads( devices ):
+                onosDevices.append( str( sw.get( 'id' ) ) )
+            onosDevices.sort( )
+            failMsg = "ONOS devices doesn't match the list of allowed devices. \n"
+            failMsg += "Expected devices: {}\nActual devices: {}".format( allowedDevices, onosDevices )
+        except( TypeError, ValueError ):
+            main.log.error( "Problem loading devices" )
+        utilities.assert_equals( expect=allowedDevices, actual=onosDevices,
+                                 onpass="Only allowed devices are in ONOS", onfail=failMsg )
+
+        main.step( "Modify json object so S6 is disallowed" )
+        main.s6Json = { "allowed": False }
+        s6Json = main.s6Json
+        setS6Disallow = main.ONOSrest1.setNetCfg( s6Json, subjectClass="devices",
+                                                  subjectKey="of:0000000000000006", configKey="basic" )
+        s6Result = False
+        if setS6Disallow:
+            getS6 = main.ONOSrest1.getNetCfg( subjectClass="devices",
+                                              subjectKey="of:0000000000000006", configKey="basic" )
+            onosCfg = pprint( getS6 )
+            sentCfg = pprint( s6Json )
+            if onosCfg == sentCfg:
+                s6Result = True
+            else:
+                main.log.error( "ONOS NetCfg doesn't match what was sent" )
+                main.log.debug( "ONOS config: {}".format( onosCfg ) )
+                main.log.debug( "Sent config: {}".format( sentCfg ) )
+                utilities.retry( f=main.ONOSrest1.getNetCfg, retValue=False, attempts=main.retrytimes, sleep=main.retrysleep )
+        utilities.assert_equals( expect=True, actual=s6Result,
+                                 onpass="Net Cfg added for devices s6",
+                                 onfail="Net Cfg for device s6 not correctly set" )
diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.topo b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.topo
index e1e06eb..4204c78 100755
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.topo
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.topo
@@ -44,50 +44,6 @@
             </COMPONENTS>
         </ONOSrest3>
 
-        <ONOSrest4>
-            <host>OC4</host>
-            <port>8181</port>
-            <user>onos</user>
-            <password>rocks</password>
-            <type>OnosRestDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </ONOSrest4>
-
-        <ONOSrest5>
-            <host>OC5</host>
-            <port>8181</port>
-            <user>onos</user>
-            <password>rocks</password>
-            <type>OnosRestDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </ONOSrest5>
-
-        <ONOSrest6>
-            <host>OC6</host>
-            <port>8181</port>
-            <user>onos</user>
-            <password>rocks</password>
-            <type>OnosRestDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </ONOSrest6>
-
-        <ONOSrest7>
-            <host>OC7</host>
-            <port>8181</port>
-            <user>onos</user>
-            <password>rocks</password>
-            <type>OnosRestDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </ONOSrest7>
-
         <Mininet1>
             <host>OCN</host>
             <user>sdn</user>
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
index c7c156c..7c7953a 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
@@ -60,8 +60,12 @@
         <neighbors>0,a</neighbors>           #a == all nodes (-1)
         <flowRuleBUEnabled>true</flowRuleBUEnabled>
         <skipReleaseResourcesOnWithdrawal>true</skipReleaseResourcesOnWithdrawal>
+        <flowObj>False</flowObj>
     </TEST>
-
+    <DATABASE>
+        <dbName>/tmp/IntentEventTPDB</dbName>
+        <dbFlowObj>/tmp/IntentEventTPflowObjDB</dbFlowObj>
+    </DATABASE>
     <METRICS>
         <intents_rate>intents-events-metrics|grep "Intent Installed Events"|cut -d ' ' -f7</intents_rate>
         <intents_withdrawn>intents-events-metrics|grep "Intent Withdrawn Events"|cut -d ' ' -f7</intents_withdrawn>
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
index 2caa008..a5944ac 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
@@ -41,8 +41,17 @@
         numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
         flowRuleBU = main.params[ 'TEST' ][ 'flowRuleBUEnabled' ]
         skipRelRsrc = main.params[ 'TEST'][ 'skipReleaseResourcesOnWithdrawal']
+
         homeDir = os.path.expanduser('~')
 
+        main.flowObj = main.params['TEST']['flowObj']
+        if main.flowObj == "True":
+            main.flowObj = True
+            main.dbFileName = main.params['DATABASE']['dbFlowObj']
+        else:
+            main.flowObj = False
+            main.dbFileName = main.params['DATABASE']['dbName']
+
         main.exceptions = [0]*11
         main.warnings = [0]*11
         main.errors = [0]*11
@@ -86,7 +95,7 @@
             commit = (commit.split(" "))[1]
 
             main.step("Creating results file")
-            resultsDB = open("/tmp/IntentEventTPDB", "w+")
+            resultsDB = open(main.dbFileName, "w+")
             resultsDB.close()
 
         # -- END OF INIT SECTION --#
@@ -159,6 +168,19 @@
 
         main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
         main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.net.intent.impl.IntentManager", "skipReleaseResourcesOnWithdrawal " + skipRelRsrc)
+        if main.flowObj:
+            main.step("Set Intent Compiler use Flow Object")
+            stepResult = utilities.retry(main.ONOSbench.onosCfgSet,
+                                         main.FALSE,
+                                         args=[ONOSIp[0],
+                                               "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
+                                               "useFlowObjectives true"],
+                                         sleep=3,
+                                         attempts=3)
+            utilities.assert_equals(expect=main.TRUE,
+                                    actual=stepResult,
+                                    onpass="Successfully set Intent compiler use Flow object",
+                                    onfail="Failed to set up")
         devices = int(clusterCount)*10
 
         main.step("Setting up null provider")
@@ -307,7 +329,7 @@
             main.ONOSbench.handle.expect(":~")
             main.log.info("Stopping intentperf" )
 
-            with open("/tmp/IntentEventTPDB", "a") as resultsDB:
+            with open(main.dbFileName, "a") as resultsDB:
                 for node in groupResult:
                     resultString = "'" + commit + "',"
                     resultString += "'1gig',"
diff --git a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/README b/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/README
deleted file mode 100644
index 30a2549..0000000
--- a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/README
+++ /dev/null
@@ -1,28 +0,0 @@
-INTENT EVENT THROUGHPUT
-
-Summary: This is a performance test suite to test the intent
-    throughput capabilities of ONOS with various controller cluster sizes.
-
-Pre-requisites: To run out-of-the box this test requires 7 NODES. OC1->OC7
-    must be set before initiating the test. Passwordless login must be set
-    from TestStation "sdn" root user.
-
-***If you wish to run this test with less than 7 nodes the following
-    alterations must be made:
-
-NOTE: Only scale sizes 1,3,5 and 7 will be functional
-
-Modifying .params file:
--- Remove any values in the comma separated list in the
-    <scale> tag that are above your desired cluster size.
-
--- Remove one instance of “1,2” from the <testcases>
-    tag for each value you removed from <scale> (case 1 and 2 are each
-    called once for each scale value)
-
--- Change the value in the <max> tag to your desired scale size (1,3, or 5)
-
-Modifying .topo file:
--- Change the <ONOSbench/COMPONENTS/nodes> tag to your desired scale size
-
--- Remove all unneeded <ONOS#cli> tags and their contents
diff --git a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params b/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params
deleted file mode 100644
index 729e3ef..0000000
--- a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params
+++ /dev/null
@@ -1,71 +0,0 @@
-<PARAMS>
-
-    <testcases>1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2</testcases>
-
-    <debugMode></debugMode>  #nothing means false
-
-    <ENV>
-    <cellName>intentTP</cellName>
-    <cellApps>drivers,null,intentperf</cellApps>
-    </ENV>
-
-    <SCALE>1,3,3,5,5,7,7</SCALE>
-    <max>7</max>
-
-    <GIT>
-        <autopull>off</autopull>
-        <checkout>master</checkout>
-    </GIT>
-
-    <CTRL>
-        <USER>sdn</USER>
-
-        <ip1>OC1</ip1>
-        <port1>6653</port1>
-
-        <ip2>OC2</ip2>
-        <port2>6653</port2>
-
-        <ip3>OC3</ip3>
-        <port3>6653</port3>
-
-        <ip4>OC4</ip4>
-        <port4>6653</port4>
-
-        <ip5>OC5</ip5>
-        <port5>6653</port5>
-
-        <ip6>OC6</ip6>
-        <port6>6653</port6>
-
-         <ip7>OC7</ip7>
-        <port7>6653</port7>
-    </CTRL>
-
-    <MN><ip1>OCN</ip1></MN>
-
-    <BENCH>
-        <user>sdn</user>
-        <ip1>OCN</ip1>
-    </BENCH>
-
-    <TEST>
-        <loadFrom>1,1,1,1,1,1,1</loadFrom>                                     #generate load on server, 1 = generator on
-        <numSwitches>10,10,10,10,10,10,10</numSwitches>
-        <skipCleanInstall>yes</skipCleanInstall>
-        <duration>400</duration>
-        <log_interval>10</log_interval>
-        <numKeys>40000</numKeys>
-        <cyclePeriod>1000</cyclePeriod>
-        <neighbors>0,a</neighbors>           #a == all nodes (-1)
-        <flowRuleBUEnabled>true</flowRuleBUEnabled>
-        <skipReleaseResourcesOnWithdrawal>true</skipReleaseResourcesOnWithdrawal>
-    </TEST>
-
-    <METRICS>
-        <intents_rate>intents-events-metrics|grep "Intent Installed Events"|cut -d ' ' -f7</intents_rate>
-        <intents_withdrawn>intents-events-metrics|grep "Intent Withdrawn Events"|cut -d ' ' -f7</intents_withdrawn>
-        <intents_failed>intents-events-metrics|grep "Intent Failed Events"|cut -d ' ' -f7</intents_failed>
-    </METRICS>
-
-</PARAMS>
diff --git a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py b/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
deleted file mode 100644
index 1a6e3ab..0000000
--- a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
+++ /dev/null
@@ -1,335 +0,0 @@
-# ScaleOutTemplate
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
-
-import sys
-import os.path
-import time
-
-
-class SCPFintentEventTpWithFlowObj:
-
-    def __init__( self ):
-        self.default = ''
-
-    def CASE1( self, main ):
-        import sys
-        import os.path
-        import time
-
-        global init
-        try:
-            if type(init) is not bool:
-                init = False
-        except NameError:
-            init = False
-
-        #Load values from params file
-        checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
-        gitPull = main.params[ 'GIT' ][ 'autopull' ]
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-        Apps = main.params[ 'ENV' ][ 'cellApps' ]
-        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
-        BENCHUser = main.params[ 'BENCH' ][ 'user' ]
-        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
-        maxNodes = int(main.params[ 'max' ])
-        main.maxNodes = maxNodes
-        skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-        numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
-        flowRuleBU = main.params[ 'TEST' ][ 'flowRuleBUEnabled' ]
-        skipRelRsrc = main.params[ 'TEST'][ 'skipReleaseResourcesOnWithdrawal']
-        homeDir = os.path.expanduser('~')
-
-        main.exceptions = [0]*11
-        main.warnings = [0]*11
-        main.errors = [0]*11
-
-        # -- INIT SECTION, ONLY RUNS ONCE -- #
-        if init == False:
-            init = True
-            global clusterCount             #number of nodes running
-            global ONOSIp                   #list of ONOS IP addresses
-            global scale
-            global commit
-
-            clusterCount = 0
-            ONOSIp = main.ONOSbench.getOnosIps()
-            print ONOSIp
-            print main.ONOSbench.onosIps.values()
-
-            scale = (main.params[ 'SCALE' ]).split(",")
-            clusterCount = int(scale[0])
-
-            #Populate ONOSIp with ips from params
-            ONOSIp.extend(main.ONOSbench.getOnosIps())
-
-            #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
-            if skipMvn != "yes":
-                mvnResult = main.ONOSbench.cleanInstall()
-
-            #git
-            main.step( "Git checkout and pull " + checkoutBranch )
-            if gitPull == 'on':
-                checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
-                pullResult = main.ONOSbench.gitPull()
-
-            else:
-                checkoutResult = main.TRUE
-                pullResult = main.TRUE
-                main.log.info( "Skipped git checkout and pull" )
-
-            main.step("Grabbing commit number")
-            commit = main.ONOSbench.getVersion()
-            commit = (commit.split(" "))[1]
-
-            main.step("Creating results file")
-            # Create results file with flow object
-            flowObjResultsDB = open("/tmp/IntentEventTPflowObjDB", "w+")
-            flowObjResultsDB.close()
-
-        # -- END OF INIT SECTION --#
-
-        main.step("Adjusting scale")
-        print str(scale)
-        print str(ONOSIp)
-        clusterCount = int(scale[0])
-        scale.remove(scale[0])
-
-        MN1Ip = ONOSIp[len(ONOSIp) -1]
-        BENCHIp = ONOSIp[len(ONOSIp) -2]
-
-        #kill off all onos processes
-        main.step("Safety check, killing all ONOS processes")
-        main.step("before initiating environment setup")
-        for node in range(maxNodes):
-            main.ONOSbench.onosDie(ONOSIp[node])
-
-        MN1Ip = ONOSIp[len(ONOSIp) -1]
-        BENCHIp = ONOSIp[len(ONOSIp) -2]
-
-        #Uninstall everywhere
-        main.step( "Cleaning Enviornment..." )
-        for i in range(maxNodes):
-            main.log.info(" Uninstalling ONOS " + str(i) )
-            main.ONOSbench.onosUninstall( ONOSIp[i] )
-        main.log.info("Sleep 10 second for uninstall to settle...")
-        time.sleep(10)
-        main.ONOSbench.handle.sendline(" ")
-        main.ONOSbench.handle.expect(":~")
-
-        #construct the cell file
-        main.log.info("Creating cell file")
-        cellIp = []
-        for node in range (clusterCount):
-            cellIp.append(ONOSIp[node])
-
-        main.ONOSbench.createCellFile("localhost",cellName,MN1Ip,str(Apps), cellIp)
-
-        main.step( "Set Cell" )
-        main.ONOSbench.setCell(cellName)
-
-        myDistribution = []
-        for node in range (clusterCount):
-            myDistribution.append(numSwitches[node])
-
-        main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
-
-        main.step( "verify cells" )
-        verifyCellResult = main.ONOSbench.verifyCell()
-
-        main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
-        for node in range(clusterCount):
-            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
-            main.ONOSbench.onosInstall( ONOSIp[node])
-
-        for node in range(clusterCount):
-            for i in range( 2 ):
-                isup = main.ONOSbench.isup( ONOSIp[node] )
-                if isup:
-                    main.log.info("ONOS " + str(node) + " is up\n")
-                    break
-            if not isup:
-                main.log.report( "ONOS " + str(node) + " didn't start!" )
-        main.log.info("Startup sequence complete")
-
-        time.sleep(20)
-
-        main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
-        main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.net.intent.impl.IntentManager", "skipReleaseResourcesOnWithdrawal " + skipRelRsrc)
-        devices = int(clusterCount)*10
-
-        main.step("Setting up null provider")
-        for i in range(3):
-            main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "deviceCount " + str(devices))
-            main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
-            main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "enabled true")
-            time.sleep(5)
-
-            main.ONOSbench.handle.sendline("onos $OC1 summary")
-            main.ONOSbench.handle.expect(":~")
-
-            before = main.ONOSbench.handle.before
-            if ("devices=" + str(devices)) in before:
-                break
-
-        main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
-        main.ONOSbench.handle.expect(":~")
-        print main.ONOSbench.handle.before
-
-        for i in range(3):
-            passed = main.ONOSbench.verifySummary( ONOSIp[0] )
-            if passed:
-                main.log.info("Clusters have converged")
-                break
-            else:
-                main.log.error("Clusters have not converged, retying...")
-            time.sleep(3)
-
-        main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
-
-    def CASE2( self, main ):
-        import time
-        import json
-        import string
-        import csv
-        import numpy
-        import os.path
-
-        global currentNeighbors
-        neighbors = []
-
-        try:
-            currentNeighbors
-        except:
-            currentNeighbors = "0"
-            neighbors = ['0']
-        else:
-            if currentNeighbors == "r":      #reset
-                currentNeighbors = "a"
-                neighbors = ['0']
-            else:
-                currentNeighbors = "r"
-                neighbors = ['a']
-
-        if clusterCount == 1:
-            currentNeighbors = "r"
-
-        main.log.info("Cluster Count = " + str(clusterCount))
-
-        intentsRate = main.params['METRICS']['intents_rate']
-        intentsWithdrawn = main.params[ 'METRICS' ][ 'intents_withdrawn' ]
-        intentsFailed  = main.params[ 'METRICS' ][ 'intents_failed' ]
-        testDuration = main.params[ 'TEST' ][ 'duration' ]
-        logInterval = main.params[ 'TEST' ][ 'log_interval' ]
-        debug = main.params[ 'debugMode' ]
-        numKeys = main.params[ 'TEST' ][ 'numKeys' ]
-        cyclePeriod = main.params[ 'TEST' ][ 'cyclePeriod' ]
-        #neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
-        metricList = [intentsRate, intentsWithdrawn, intentsFailed]
-
-        for n in range(0, len(neighbors)):
-            if neighbors[n] == 'a':
-                neighbors[n] = str(clusterCount -1)
-                if int(clusterCount) == 1:
-                    neighbors = neighbors.pop()
-
-        for n in neighbors:
-            main.log.info("Run with " + n + " neighbors")
-            time.sleep(5)
-            main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numKeys " + numKeys )
-            main.ONOSbench.handle.expect(":~")
-            main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numNeighbors " + n )
-            main.ONOSbench.handle.expect(":~")
-            main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller cyclePeriod " + cyclePeriod )
-            main.ONOSbench.handle.expect(":~")
-
-            cmd = "onos $OC1 intent-perf-start"
-            main.ONOSbench.handle.sendline(cmd)
-            main.ONOSbench.handle.expect(":~")
-            main.log.info("Starting ONOS (all nodes)  intent-perf from $OC1" )
-
-            main.log.info( "Starting test loop for " + str(testDuration) + " seconds...\n" )
-            stop = time.time() + float( testDuration )
-
-            while time.time() < stop:
-                time.sleep( float( logInterval ) )
-                groupResult = []
-                for node in range (1, clusterCount + 1):
-                    groupResult.append(0)
-
-                    cmd = " onos-ssh $OC" + str(node) +  """ cat /opt/onos/log/karaf.log | grep "Throughput:" | tail -1  """
-                    main.log.info("COMMAND: " + str(cmd))
-
-                    x = 0
-                    while True:
-                        main.ONOSbench.handle.sendline(cmd)
-                        time.sleep(6)
-                        main.ONOSbench.handle.expect(":~")
-                        raw = main.ONOSbench.handle.before
-                        if "OVERALL=" in raw:
-                            break
-                        x += 1
-                        if x > 10:
-                            main.log.error("Expected output not being recieved... continuing")
-                            break
-                        time.sleep(2)
-
-                    raw = raw.splitlines()
-                    splitResults = []
-                    for line in raw:
-                        splitResults.extend(line.split(" "))
-
-                    myResult = "--"
-                    for field in splitResults:
-                        if "OVERALL" in field:
-                            myResult = field
-
-                    if myResult == "--":
-                        main.log.error("Parsing/Pexpect error\n" + str(splitResults))
-
-                    myResult = myResult.replace(";", "")
-                    myResult = myResult.replace("OVERALL=","")
-                    myResult = float(myResult)
-                    groupResult[len(groupResult) -1] = myResult
-
-                    main.log.info("Node " + str(node) + " overall rate: " + str(myResult))
-
-                clusterTotal = str(numpy.sum(groupResult))
-                main.log.report("Results from this round of polling: " + str(groupResult))
-                main.log.report("Cluster Total: " + clusterTotal + "\n")
-
-            cmd = "onos $OC1 intent-perf-stop"
-            main.ONOSbench.handle.sendline(cmd)
-            main.ONOSbench.handle.expect(":~")
-            main.log.info("Stopping intentperf" )
-
-            with open("/tmp/IntentEventTPflowObjDB", "a") as resultsDB:
-                for node in groupResult:
-                    resultString = "'" + commit + "',"
-                    resultString += "'1gig',"
-                    resultString += str(clusterCount) + ","
-                    resultString += "'baremetal" + str(int(groupResult.index(node)) + 1) + "',"
-                    resultString += n + ","
-                    resultString += str(node) + ","
-                    resultString += str(0) + "\n" #no stddev
-                    resultsDB.write(resultString)
-            resultsDB.close()
-            main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
-
-    def CASE3( self, main ):
-        main.step("Set Intent Compiler use Flow Object")
-        stepResult = utilities.retry( main.ONOSbench.onosCfgSet,
-                                      main.FALSE,
-                                      args=[ ONOSIp[0],
-                                        "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
-                                        "useFlowObjectives true" ],
-                                      sleep=3,
-                                      attempts=3 )
-        utilities.assert_equals( expect = main.TRUE,
-                                  actual = stepResult,
-                                  onpass = "Successfully set Intent compiler use Flow object",
-                                  onfail = "Failed to set up" )
diff --git a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo b/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo
deleted file mode 100644
index 915d033..0000000
--- a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo
+++ /dev/null
@@ -1,147 +0,0 @@
-<TOPOLOGY>
-
-    <COMPONENT>
-
-        <ONOSbench>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>1</connect_order>
-            <COMPONENTS>
-                <home>~/onos</home>
-                <nodes>7</nodes> 
-            </COMPONENTS>
-        </ONOSbench>
-
-        <ONOS1cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS1cli>
-
-        <ONOS2cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS2cli>
-
-        <ONOS3cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>4</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS3cli>
-
-        <ONOS4cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>5</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS4cli>
-
-        <ONOS5cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>6</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS5cli>
-
-        <ONOS6cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>7</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS6cli>
-
-        <ONOS7cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>8</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS7cli>
-
-        <ONOS1>
-            <host>OC1</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>9</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS1>
-
-        <ONOS2>
-            <host>OC2</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>10</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS2>
-
-        <ONOS3>
-            <host>OC3</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>11</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS3>
-
-        <ONOS4>
-            <host>OC4</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>12</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS4>
-
-    
-        <ONOS5>
-            <host>OC5</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>13</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS5>
-
-        <ONOS6>
-            <host>OC6</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>14</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS6>
-
-        <ONOS7>
-            <host>OC7</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>15</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS7>
-
-    </COMPONENT>
-
-</TOPOLOGY>
- 
diff --git a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/__init__.py b/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/SCPF/SCPFintentEventTpWithFlowObj/__init__.py
+++ /dev/null
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.params b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.params
index fe61b9a..8843c2f 100644
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.params
+++ b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.params
@@ -18,7 +18,8 @@
         <ingress>null:0000000000000001/6</ingress>
         <egress>null:0000000000000007/5</egress>
         <debug>False</debug>
-    </TEST>
+        <flowObj>False</flowObj>
+     </TEST>
 
     <GIT>
         <gitPull>off</gitPull>
@@ -26,7 +27,8 @@
     </GIT>
 
     <DATABASE>
-        <file>/tmp/IntentInstallWithdrawLatDB</file>
+        <dbName>/tmp/IntentInstallWithdrawLatDB</dbName>
+        <dbFlowObj>/tmp/IntentInstallWithdrawLatDBWFO</dbFlowObj>
     </DATABASE>
     <ATTEMPTS>
         <verify>3</verify>
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
index ef50ab3..3e84aad 100644
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
+++ b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
@@ -62,7 +62,6 @@
         main.maxNodes = int(main.params['max'])
         main.cellName = main.params['ENV']['cellName']
         main.scale = (main.params['SCALE']).split(",")
-        main.dbFileName = main.params['DATABASE']['file']
         main.timeout = int(main.params['SLEEP']['timeout'])
         main.startUpSleep = int(main.params['SLEEP']['startup'])
         main.installSleep = int(main.params['SLEEP']['install'])
@@ -74,6 +73,15 @@
         main.ingress = main.params['TEST']['ingress']
         main.egress = main.params['TEST']['egress']
         main.debug = main.params['TEST']['debug']
+        main.flowObj = main.params['TEST']['flowObj']
+
+        if main.flowObj == "True":
+            main.flowObj = True
+            main.dbFileName = main.params['DATABASE']['dbFlowObj']
+        else:
+            main.flowObj = False
+            main.dbFileName = main.params['DATABASE']['dbName']
+
         for i in range(0, len(main.intentsList)):
             main.intentsList[i] = int(main.intentsList[i])
         # Create DataBase file
@@ -191,6 +199,9 @@
         main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "topoShape", value="linear")
         main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
         main.CLIs[0].setCfg("org.onosproject.net.intent.impl.IntentManager", "skipReleaseResourcesOnWithdrawal", value="true")
+        if main.flowObj:
+            main.CLIs[0].setCfg("org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
+                                "useFlowObjectives", value="true")
         time.sleep(main.startUpSleep)
 
         # balanceMasters
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params b/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params
deleted file mode 100644
index 6eeed39..0000000
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params
+++ /dev/null
@@ -1,82 +0,0 @@
-<PARAMS>
-
-    <testcases>0,1,2,1,2,1,2,1,2</testcases>
-
-    <SCALE>1,3,5,7</SCALE>
-    <max>7</max>
-
-    <ENV>
-        <cellName>IntentInstallWithdrawCell</cellName>
-        <cellApps>drivers,null</cellApps>
-    </ENV>
-
-    <TEST>
-        <skipCleanInstall>yes</skipCleanInstall>
-        <warmUp>5</warmUp>
-        <sampleSize>20</sampleSize>
-        <intents>1,100</intents>                       #list format, will be split on ','
-        <ingress>null:0000000000000001/6</ingress>
-        <egress>null:0000000000000007/5</egress>
-        <debug>False</debug>
-    </TEST>
-
-    <GIT>
-        <gitPull>off</gitPull>
-        <gitBranch>master</gitBranch>
-    </GIT>
-
-    <DATABASE>
-        <file>/tmp/IntentInstallWithdrawLatDBWFO</file>
-    </DATABASE>
-    <ATTEMPTS>
-        <verify>3</verify>
-    </ATTEMPTS>
-
-    <SLEEP>
-        <startup>10</startup>
-        <install>10</install>
-        <verify>3</verify>
-        <reroute>3</reroute>
-        # timeout for pexpect
-        <timeout>300</timeout>
-    </SLEEP>
-
-    <CTRL>
-        <USER>sdn</USER>
-
-        <ip1>OC1</ip1>
-        <port1>6653</port1>
-
-        <ip2>OC2</ip2>
-        <port2>6653</port2>
-
-        <ip3>OC3</ip3>
-        <port3>6653</port3>
-
-        <ip4>OC4</ip4>
-        <port4>6653</port4>
-
-        <ip5>OC5</ip5>
-        <port5>6653</port5>
-
-        <ip6>OC6</ip6>
-        <port6>6653</port6>
-
-        <ip7>OC7</ip7>
-        <port7>6653</port7>
-
-    </CTRL>
-
-    <MN>
-        <ip1>OCN</ip1>
-    </MN>
-
-    <BENCH>
-        <user>sdn</user>
-        <ip1>localhost</ip1>
-    </BENCH>
-
-    <JSON>
-    </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py b/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py
deleted file mode 100644
index 37da138..0000000
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py
+++ /dev/null
@@ -1,324 +0,0 @@
-"""
-SCPFintentInstallWithdrawLatWithFlowObj:
-    - Test the latency of intent installed and withdrawn
-    - Use Push-test-intents command to push intents
-    - Use Null provider with 7 devices and linear topology
-    - Always push intents between 1/6 and 7/5
-    - The batch size is defined in parm file. (default 1,100)
-    - org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator useFlowObjectives set
-     to true
-    yunpeng@onlab.us
-"""
-
-import sys
-import os.path
-
-
-class SCPFintentInstallWithdrawLatWithFlowObj:
-    def __init__( self ):
-        self.default = ''
-
-    def CASE0( self, main ):
-        '''
-        - GIT
-        - BUILDING ONOS
-            Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
-            This step is usually skipped. Because in a Jenkins driven automated
-            test env. We want Jenkins jobs to pull&build for flexibility to handle
-            different versions of ONOS.
-        - Construct tests variables
-        '''
-        gitPull = main.params['GIT']['gitPull']
-        gitBranch = main.params['GIT']['gitBranch']
-
-        main.case("Pull onos branch and build onos on Teststation.")
-
-        if gitPull == 'True':
-            main.step("Git Checkout ONOS branch: " + gitBranch)
-            stepResult = main.ONOSbench.gitCheckout(branch=gitBranch)
-            utilities.assert_equals(expect=main.TRUE,
-                                    actual=stepResult,
-                                    onpass="Successfully checkout onos branch.",
-                                    onfail="Failed to checkout onos branch. Exiting test...")
-            if not stepResult: main.exit()
-
-            main.step("Git Pull on ONOS branch:" + gitBranch)
-            stepResult = main.ONOSbench.gitPull()
-            utilities.assert_equals(expect=main.TRUE,
-                                    actual=stepResult,
-                                    onpass="Successfully pull onos. ",
-                                    onfail="Failed to pull onos. Exiting test ...")
-            if not stepResult: main.exit()
-
-            main.step("Building ONOS branch: " + gitBranch)
-            stepResult = main.ONOSbench.cleanInstall(skipTest=True)
-            utilities.assert_equals(expect=main.TRUE,
-                                    actual=stepResult,
-                                    onpass="Successfully build onos.",
-                                    onfail="Failed to build onos. Exiting test...")
-            if not stepResult: main.exit()
-
-        else:
-            main.log.warn("Skipped pulling onos and Skipped building ONOS")
-
-        main.apps = main.params['ENV']['cellApps']
-        main.BENCHUser = main.params['BENCH']['user']
-        main.BENCHIp = main.params['BENCH']['ip1']
-        main.MN1Ip = main.params['MN']['ip1']
-        main.maxNodes = int(main.params['max'])
-        main.cellName = main.params['ENV']['cellName']
-        main.scale = (main.params['SCALE']).split(",")
-        main.dbFileName = main.params['DATABASE']['file']
-        main.timeout = int(main.params['SLEEP']['timeout'])
-        main.startUpSleep = int(main.params['SLEEP']['startup'])
-        main.installSleep = int(main.params['SLEEP']['install'])
-        main.verifySleep = int(main.params['SLEEP']['verify'])
-        main.verifyAttempts = int(main.params['ATTEMPTS']['verify'])
-        main.sampleSize = int(main.params['TEST']['sampleSize'])
-        main.warmUp = int(main.params['TEST']['warmUp'])
-        main.intentsList = (main.params['TEST']['intents']).split(",")
-        main.ingress = main.params['TEST']['ingress']
-        main.egress = main.params['TEST']['egress']
-        main.debug = main.params['TEST']['debug']
-        for i in range(0, len(main.intentsList)):
-            main.intentsList[i] = int(main.intentsList[i])
-        # Create DataBase file
-        main.log.info("Create Database file " + main.dbFileName)
-        resultsDB = open(main.dbFileName, "w+")
-        resultsDB.close()
-
-    def CASE1( self, main ):
-        # Clean up test environment and set up
-        import time
-        main.log.info("Get ONOS cluster IP")
-        print(main.scale)
-        main.numCtrls = int(main.scale[0])
-        main.ONOSip = []
-        main.maxNumBatch = 0
-        main.AllONOSip = main.ONOSbench.getOnosIps()
-        for i in range(main.numCtrls):
-            main.ONOSip.append(main.AllONOSip[i])
-        main.log.info(main.ONOSip)
-        main.CLIs = []
-        main.log.info("Creating list of ONOS cli handles")
-        for i in range(main.numCtrls):
-            main.CLIs.append(getattr(main, 'ONOS%scli' % (i + 1)))
-
-        if not main.CLIs:
-            main.log.error("Failed to create the list of ONOS cli handles")
-            main.cleanup()
-            main.exit()
-
-        main.commit = main.ONOSbench.getVersion(report=True)
-        main.commit = main.commit.split(" ")[1]
-        main.log.info("Starting up %s node(s) ONOS cluster" % main.numCtrls)
-        main.log.info("Safety check, killing all ONOS processes" +
-                      " before initiating environment setup")
-
-        for i in range(main.numCtrls):
-            main.ONOSbench.onosDie(main.ONOSip[i])
-
-        main.log.info("NODE COUNT = %s" % main.numCtrls)
-        main.ONOSbench.createCellFile(main.ONOSbench.ip_address,
-                                      main.cellName,
-                                      main.MN1Ip,
-                                      main.apps,
-                                      main.ONOSip)
-        main.step("Apply cell to environment")
-        cellResult = main.ONOSbench.setCell(main.cellName)
-        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()
-        stepResult = packageResult
-        utilities.assert_equals(expect=main.TRUE,
-                                actual=stepResult,
-                                onpass="Successfully created ONOS package",
-                                onfail="Failed to create ONOS package")
-
-        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.ONOSip[i])
-            u_result = main.ONOSbench.onosUninstall(main.ONOSip[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.ONOSip[i])
-            i_result = main.ONOSbench.onosInstall(node=main.ONOSip[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.ONOSip[i] + " status:")
-            onos_status = main.ONOSbench.onosStatus(node=main.ONOSip[i])
-            utilities.assert_equals(expect=main.TRUE, actual=onos_status,
-                                    onpass="Test step PASS",
-                                    onfail="Test step FAIL")
-            statusResult = (statusResult and onos_status)
-        time.sleep(2)
-        main.step("Start ONOS CLI on all nodes")
-        cliResult = main.TRUE
-        main.step(" Start ONOS cli using thread ")
-        startCliResult = main.TRUE
-        pool = []
-        main.threadID = 0
-        for i in range(int(main.numCtrls)):
-            t = main.Thread(target=main.CLIs[i].startOnosCli,
-                            threadID=main.threadID,
-                            name="startOnosCli",
-                            args=[main.ONOSip[i]],
-                            kwargs={"onosStartTimeout": main.timeout})
-            pool.append(t)
-            t.start()
-            main.threadID = main.threadID + 1
-        for t in pool:
-            t.join()
-            startCliResult = startCliResult and t.result
-        time.sleep(main.startUpSleep)
-
-        # configure apps
-        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=7)
-        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "topoShape", value="linear")
-        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
-        main.CLIs[0].setCfg("org.onosproject.net.intent.impl.IntentManager",
-        "skipReleaseResourcesOnWithdrawal", value="true")
-        main.CLIs[0].setCfg("org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
-                            "useFlowObjectives", value="true")
-        time.sleep(main.startUpSleep)
-
-        # balanceMasters
-        main.CLIs[0].balanceMasters()
-        time.sleep(main.startUpSleep)
-
-    def CASE2( self, main ):
-        import time
-        import numpy
-        import json
-        print(main.intentsList)
-        for batchSize in main.intentsList:
-            main.log.report("Intent Batch size: {}".format(batchSize))
-            main.installLatList = []
-            main.withdrawLatList = []
-            validrun = 0
-            invalidrun = 0
-            # we use two variables to control the iteration
-            while validrun <= main.warmUp + main.sampleSize and invalidrun < 20:
-                if validrun >= main.warmUp:
-                    main.log.info("================================================")
-                    main.log.info("Starting test iteration " + str(validrun - main.warmUp))
-                    main.log.info("Total test iteration: " + str(invalidrun + validrun))
-                    main.log.info("================================================")
-                else:
-                    main.log.info("====================Warm Up=====================")
-
-                # push intents
-                installResult = main.CLIs[0].pushTestIntents(main.ingress, main.egress, batchSize,
-                                                             offset=1, options="-i", timeout=main.timeout,
-                                                             getResponse=True)
-                if type(installResult) is str:
-                    if "Failure" in installResult:
-                        main.log.error("Install Intents failure, ignore this iteration.")
-                        if validrun < main.warmUp:
-                            validrun += 1
-                            continue
-                        else:
-                            invalidrun += 1
-                            continue
-
-                    try:
-                        latency = int(installResult.split()[5])
-                        main.log.info(installResult)
-                    except:
-                        main.log.error("Failed to get latency, ignore this iteration.")
-                        main.log.error("Response from ONOS:")
-                        print(installResult)
-                        if validrun < main.warmUp:
-                            validrun += 1
-                            continue
-                        else:
-                            invalidrun += 1
-                            continue
-
-                    if validrun >= main.warmUp:
-                        main.installLatList.append(latency)
-                else:
-                    invalidrun += 1
-                    continue
-                time.sleep(2)
-                # Withdraw Intents
-                withdrawResult = main.CLIs[0].pushTestIntents(main.ingress, main.egress, batchSize,
-                                                              offset=1, options="-w", timeout=main.timeout,
-                                                              getResponse=True)
-
-                if type(withdrawResult) is str:
-                    if "Failure" in withdrawResult:
-                        main.log.error("withdraw Intents failure, ignore this iteration.")
-                        if validrun < main.warmUp:
-                            validrun += 1
-                            continue
-                        else:
-                            invalidrun += 1
-                            continue
-
-                    try:
-                        latency = int(withdrawResult.split()[5])
-                        main.log.info(withdrawResult)
-                    except:
-                        main.log.error("Failed to get latency, ignore this iteration.")
-                        main.log.error("Response from ONOS:")
-                        print(withdrawResult)
-                        if validrun < main.warmUp:
-                            validrun += 1
-                            continue
-                        else:
-                            invalidrun += 1
-                            continue
-
-                    if validrun >= main.warmUp:
-                        main.withdrawLatList.append(latency)
-                else:
-                    invalidrun += 1
-                    continue
-                time.sleep(2)
-                main.CLIs[0].purgeWithdrawnIntents()
-                validrun += 1
-            installave = numpy.average(main.installLatList)
-            installstd = numpy.std(main.installLatList)
-            withdrawave = numpy.average(main.withdrawLatList)
-            withdrawstd = numpy.std(main.withdrawLatList)
-            # log report
-            main.log.report("----------------------------------------------------")
-            main.log.report("Scale: " + str(main.numCtrls))
-            main.log.report("Intent batch: " + str(batchSize))
-            main.log.report("Install average: {}    std: {}".format(installave, installstd))
-            main.log.report("Withdraw average: {}   std: {}".format(withdrawave, withdrawstd))
-            # write result to database file
-            if not (numpy.isnan(installave) or numpy.isnan(installstd) or \
-                    numpy.isnan(withdrawstd) or numpy.isnan(withdrawave)):
-                databaseString = "'" + main.commit + "',"
-                databaseString += str(main.numCtrls) + ","
-                databaseString += str(batchSize) + ","
-                databaseString += str(installave) + ","
-                databaseString += str(installstd) + ","
-                databaseString += str(withdrawave) + ","
-                databaseString += str(withdrawstd) + "\n"
-                resultsDB = open(main.dbFileName, "a")
-                resultsDB.write(databaseString)
-                resultsDB.close()
-        del main.scale[0]
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo b/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo
deleted file mode 100644
index 915d033..0000000
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo
+++ /dev/null
@@ -1,147 +0,0 @@
-<TOPOLOGY>
-
-    <COMPONENT>
-
-        <ONOSbench>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>1</connect_order>
-            <COMPONENTS>
-                <home>~/onos</home>
-                <nodes>7</nodes> 
-            </COMPONENTS>
-        </ONOSbench>
-
-        <ONOS1cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS1cli>
-
-        <ONOS2cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS2cli>
-
-        <ONOS3cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>4</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS3cli>
-
-        <ONOS4cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>5</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS4cli>
-
-        <ONOS5cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>6</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS5cli>
-
-        <ONOS6cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>7</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS6cli>
-
-        <ONOS7cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>8</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS7cli>
-
-        <ONOS1>
-            <host>OC1</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>9</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS1>
-
-        <ONOS2>
-            <host>OC2</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>10</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS2>
-
-        <ONOS3>
-            <host>OC3</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>11</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS3>
-
-        <ONOS4>
-            <host>OC4</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>12</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS4>
-
-    
-        <ONOS5>
-            <host>OC5</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>13</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS5>
-
-        <ONOS6>
-            <host>OC6</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>14</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS6>
-
-        <ONOS7>
-            <host>OC7</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>15</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS7>
-
-    </COMPONENT>
-
-</TOPOLOGY>
- 
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py b/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py
+++ /dev/null
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
index 6d684cc..7dbda89 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
@@ -18,9 +18,11 @@
         <ingress>null:0000000000000001/0</ingress>
         <egress>null:0000000000000007/0</egress>
         <debug>False</debug>
+        <flowObj>False</flowObj>
     </TEST>
     <DATABASE>
-        <file>/tmp/IntentRerouteLatDB</file>
+        <dbName>/tmp/IntentRerouteLatDB</dbName>
+        <dbFlowObj>/tmp/IntentRerouteLatDBWithFlowObj</dbFlowObj>
     </DATABASE>
 
     <GIT>
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index 4a63f18..b282ebf 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -69,7 +69,6 @@
         main.skipMvn = main.params['TEST']['skipCleanInstall']
         main.cellName = main.params['ENV']['cellName']
         main.scale = (main.params['SCALE']).split(",")
-        main.dbFileName = main.params['DATABASE']['file']
         main.timeout = int(main.params['SLEEP']['timeout'])
         main.startUpSleep = int(main.params['SLEEP']['startup'])
         main.installSleep = int(main.params['SLEEP']['install'])
@@ -82,6 +81,15 @@
         main.ingress = main.params['TEST']['ingress']
         main.egress = main.params['TEST']['egress']
         main.debug = main.params['TEST']['debug']
+        main.flowObj = main.params['TEST']['flowObj']
+
+        if main.flowObj == "True":
+            main.flowObj = True
+            main.dbFileName = main.params['DATABASE']['dbFlowObj']
+        else:
+            main.flowObj = False
+            main.dbFileName = main.params['DATABASE']['dbName']
+
         for i in range(0, len(main.intentsList)):
             main.intentsList[i] = int(main.intentsList[i])
             # Create DataBase file
@@ -202,7 +210,9 @@
         main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "topoShape", value="reroute")
         main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
         main.CLIs[0].setCfg("org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled", value="false")
-
+        if main.flowObj:
+            main.CLIs[0].setCfg("org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
+                                "useFlowObjectives", value="true")
         time.sleep(main.startUpSleep)
 
         # Balance Master
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/README b/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/README
deleted file mode 100644
index 26b551b..0000000
--- a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/README
+++ /dev/null
@@ -1,29 +0,0 @@
-INTENT REROUTE LATENCY
-
-Summary: This is a performance test designed to benchmark the
-    intent reroute speed of ONOS at various controller cluster sizes.
-
-Pre-requisites: To run out-of-the box this test requires 7 NODES.
-    OC1->OC7 must be set before initiating the test. Passwordless login
-    must be set from TestStation "sdn" root user.
-
-***If you wish to run this test with less than 7 nodes the
-    following alterations must be made:
-
-NOTE: Only scale sizes 1,3,5 and 7 will be functional
-
-Modifying .params file:
--- Remove any values in the comma separated list in
-    the <scale> tag that are above your desired cluster size.
-
--- Remove one instance of “1,2” from the <testcases> tag for
-    each value you removed from <scale> (case1 and 2 are each
-    called once for each scale value)
-
--- Change the value in the <max> tag to your desired scale size (1,3,5)
-
-Modifying .topo file:
--- Change the <ONOSbench/COMPONENTS/nodes> tag to
-    your desired scale size
-
--- Remove all unneeded <ONOS#cli> tags and their contents
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params b/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params
deleted file mode 100644
index 237dc5d..0000000
--- a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params
+++ /dev/null
@@ -1,83 +0,0 @@
-<PARAMS>
-
-    <testcases>0,1,2,1,2,1,2,1,2</testcases>
-
-    <SCALE>1,3,5,7</SCALE>
-    <max>7</max>
-
-    <ENV>
-        <cellName>intentRerouteCell</cellName>
-        <cellApps>drivers,null,intentperf,metrics</cellApps>
-    </ENV>
-
-    <TEST>
-        <skipCleanInstall>yes</skipCleanInstall>
-        <warmUp>5</warmUp>
-        <sampleSize>20</sampleSize>
-        <intents>1,100</intents>                       #list format, will be split on ','
-        <ingress>null:0000000000000001/0</ingress>
-        <egress>null:0000000000000007/0</egress>
-        <debug>False</debug>
-    </TEST>
-    <DATABASE>
-        <file>/tmp/IntentRerouteLatDBWithFlowObj</file>
-    </DATABASE>
-
-    <GIT>
-        <gitPull>False</gitPull>
-        <gitBranch>master</gitBranch>
-    </GIT>
-
-    <ATTEMPTS>
-        <verify>3</verify>
-    </ATTEMPTS>
-
-    <SLEEP>
-        <startup>10</startup>
-        <install>10</install>
-        <setmaster>5</setmaster>
-        <verify>5</verify>
-        <reroute>3</reroute>
-        # timeout for pexpect
-        <timeout>300</timeout>
-    </SLEEP>
-
-    <CTRL>
-        <USER>sdn</USER>
-
-        <ip1>OC1</ip1>
-        <port1>6653</port1>
-
-        <ip2>OC2</ip2>
-        <port2>6653</port2>
-
-        <ip3>OC3</ip3>
-        <port3>6653</port3>
-
-        <ip4>OC4</ip4>
-        <port4>6653</port4>
-
-        <ip5>OC5</ip5>
-        <port5>6653</port5>
-
-        <ip6>OC6</ip6>
-        <port6>6653</port6>
-
-        <ip7>OC7</ip7>
-        <port7>6653</port7>
-
-    </CTRL>
-
-    <MN>
-        <ip1>OCN</ip1>
-    </MN>
-
-    <BENCH>
-        <user>sdn</user>
-        <ip1>localhost</ip1>
-    </BENCH>
-
-    <JSON>
-    </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py b/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
deleted file mode 100644
index bc6ff0d..0000000
--- a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
+++ /dev/null
@@ -1,441 +0,0 @@
-# SCPFintentRerouteLatWithFlowObj
-"""
-SCPFintentRerouteLat
-    - Test Intent Reroute Latency
-    - Test Algorithm:
-        1. Start Null Provider reroute Topology
-        2. Using Push-test-intents to push batch size intents from switch 1 to switch 7
-        3. Cut the link between switch 3 and switch 4 (the path will reroute to switch 8)
-        4. Get the topology time stamp
-        5. Get Intent reroute(Installed) time stamp from each nodes
-        6. Use the latest intent time stamp subtract topology time stamp
-    - This test will run 5 warm up by default, warm up iteration can be setup in Param file
-    - The intent batch size will default set to 1 and 100, also can be set in Param file
-    - The unit of the latency result is milliseconds
-    - Ues flowObject set to True
-"""
-
-class SCPFintentRerouteLatWithFlowObj:
-    def __init__(self):
-        self.default = ''
-
-    def CASE0( self, main ):
-        '''
-        - GIT
-        - BUILDING ONOS
-            Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
-            This step is usually skipped. Because in a Jenkins driven automated
-            test env. We want Jenkins jobs to pull&build for flexibility to handle
-            different versions of ONOS.
-        - Construct tests variables
-        '''
-        gitPull = main.params['GIT']['gitPull']
-        gitBranch = main.params['GIT']['gitBranch']
-
-        main.case("Pull onos branch and build onos on Teststation.")
-
-        if gitPull == 'True':
-            main.step("Git Checkout ONOS branch: " + gitBranch)
-            stepResult = main.ONOSbench.gitCheckout(branch=gitBranch)
-            utilities.assert_equals(expect=main.TRUE,
-                                    actual=stepResult,
-                                    onpass="Successfully checkout onos branch.",
-                                    onfail="Failed to checkout onos branch. Exiting test...")
-            if not stepResult: main.exit()
-
-            main.step("Git Pull on ONOS branch:" + gitBranch)
-            stepResult = main.ONOSbench.gitPull()
-            utilities.assert_equals(expect=main.TRUE,
-                                    actual=stepResult,
-                                    onpass="Successfully pull onos. ",
-                                    onfail="Failed to pull onos. Exiting test ...")
-            if not stepResult: main.exit()
-
-            main.step("Building ONOS branch: " + gitBranch)
-            stepResult = main.ONOSbench.cleanInstall(skipTest=True)
-            utilities.assert_equals(expect=main.TRUE,
-                                    actual=stepResult,
-                                    onpass="Successfully build onos.",
-                                    onfail="Failed to build onos. Exiting test...")
-            if not stepResult: main.exit()
-
-        else:
-            main.log.warn("Skipped pulling onos and Skipped building ONOS")
-
-        main.apps = main.params['ENV']['cellApps']
-        main.BENCHUser = main.params['BENCH']['user']
-        main.BENCHIp = main.params['BENCH']['ip1']
-        main.MN1Ip = main.params['MN']['ip1']
-        main.maxNodes = int(main.params['max'])
-        main.skipMvn = main.params['TEST']['skipCleanInstall']
-        main.cellName = main.params['ENV']['cellName']
-        main.scale = (main.params['SCALE']).split(",")
-        main.dbFileName = main.params['DATABASE']['file']
-        main.timeout = int(main.params['SLEEP']['timeout'])
-        main.startUpSleep = int(main.params['SLEEP']['startup'])
-        main.installSleep = int(main.params['SLEEP']['install'])
-        main.setMasterSleep = int(main.params['SLEEP']['setmaster'])
-        main.verifySleep = int(main.params['SLEEP']['verify'])
-        main.verifyAttempts = int(main.params['ATTEMPTS']['verify'])
-        main.sampleSize = int(main.params['TEST']['sampleSize'])
-        main.warmUp = int(main.params['TEST']['warmUp'])
-        main.intentsList = (main.params['TEST']['intents']).split(",")
-        main.ingress = main.params['TEST']['ingress']
-        main.egress = main.params['TEST']['egress']
-        main.debug = main.params['TEST']['debug']
-        for i in range(0, len(main.intentsList)):
-            main.intentsList[i] = int(main.intentsList[i])
-            # Create DataBase file
-        main.log.info("Create Database file " + main.dbFileName)
-        resultsDB = open(main.dbFileName, "w+")
-        resultsDB.close()
-
-    def CASE1( self, main ):
-        '''
-            clean up test environment and set up
-        '''
-        import time
-
-        main.log.info("Get ONOS cluster IP")
-        print(main.scale)
-        main.numCtrls = int(main.scale[0])
-        main.ONOSip = []
-        main.maxNumBatch = 0
-        main.AllONOSip = main.ONOSbench.getOnosIps()
-        for i in range(main.numCtrls):
-            main.ONOSip.append(main.AllONOSip[i])
-        main.log.info(main.ONOSip)
-        main.CLIs = []
-        main.log.info("Creating list of ONOS cli handles")
-        for i in range(main.numCtrls):
-            main.CLIs.append(getattr(main, 'ONOS%scli' % (i + 1)))
-
-        if not main.CLIs:
-            main.log.error("Failed to create the list of ONOS cli handles")
-            main.cleanup()
-            main.exit()
-
-        main.commit = main.ONOSbench.getVersion(report=True)
-        main.commit = main.commit.split(" ")[1]
-        main.log.info("Starting up %s node(s) ONOS cluster" % main.numCtrls)
-        main.log.info("Safety check, killing all ONOS processes" +
-                      " before initiating environment setup")
-
-        for i in range(main.numCtrls):
-            main.ONOSbench.onosDie(main.ONOSip[i])
-
-        main.log.info("NODE COUNT = %s" % main.numCtrls)
-        main.ONOSbench.createCellFile(main.ONOSbench.ip_address,
-                                      main.cellName,
-                                      main.MN1Ip,
-                                      main.apps,
-                                      main.ONOSip)
-        main.step("Apply cell to environment")
-        cellResult = main.ONOSbench.setCell(main.cellName)
-        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()
-        stepResult = packageResult
-        utilities.assert_equals(expect=main.TRUE,
-                                actual=stepResult,
-                                onpass="Successfully created ONOS package",
-                                onfail="Failed to create ONOS package")
-
-        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.ONOSip[i])
-            u_result = main.ONOSbench.onosUninstall(main.ONOSip[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.ONOSip[i])
-            i_result = main.ONOSbench.onosInstall(node=main.ONOSip[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.ONOSip[i] + " status:")
-            onos_status = main.ONOSbench.onosStatus(node=main.ONOSip[i])
-            utilities.assert_equals(expect=main.TRUE, actual=onos_status,
-                                    onpass="Test step PASS",
-                                    onfail="Test step FAIL")
-            statusResult = (statusResult and onos_status)
-        time.sleep(2)
-        main.step("Start ONOS CLI on all nodes")
-        cliResult = main.TRUE
-        main.step(" Start ONOS cli using thread ")
-        startCliResult = main.TRUE
-        pool = []
-        main.threadID = 0
-        for i in range(int(main.numCtrls)):
-            t = main.Thread(target=main.CLIs[i].startOnosCli,
-                            threadID=main.threadID,
-                            name="startOnosCli",
-                            args=[main.ONOSip[i]],
-                            kwargs={"onosStartTimeout": main.timeout})
-            pool.append(t)
-            t.start()
-            main.threadID = main.threadID + 1
-        for t in pool:
-            t.join()
-            startCliResult = startCliResult and t.result
-        time.sleep(main.startUpSleep)
-
-        # configure apps
-        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
-        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "topoShape", value="reroute")
-        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
-        main.CLIs[0].setCfg("org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled", value="false")
-        main.CLIs[0].setCfg("org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
-                            "useFlowObjectives", value="true")
-
-        time.sleep(main.startUpSleep)
-
-        # Balance Master
-        main.CLIs[0].balanceMasters()
-        if len(main.ONOSip) > 1:
-            main.CLIs[0].deviceRole("null:0000000000000003", main.ONOSip[0])
-            main.CLIs[0].deviceRole("null:0000000000000004", main.ONOSip[0])
-        time.sleep( main.setMasterSleep )
-
-    def CASE2( self, main ):
-        import time
-        import numpy
-        import datetime
-        import json
-        # from scipy import stats
-
-        ts = time.time()
-        print(main.intentsList)
-        for batchSize in main.intentsList:
-            main.log.report("Intent Batch size: " + str(batchSize) + "\n      ")
-            main.LatencyList = []
-            validRun = 0
-            invalidRun = 0
-            while validRun <= main.warmUp + main.sampleSize and invalidRun <= 20:
-                if validRun >= main.warmUp:
-                    main.log.info("================================================")
-                    main.log.info("Starting test iteration: {} ".format(validRun - main.warmUp))
-                    main.log.info("Total iteration: {}".format(validRun + invalidRun))
-                    main.log.info("================================================")
-                else:
-                    main.log.info("====================Warm Up=====================")
-
-                # push intents
-                main.CLIs[0].pushTestIntents(main.ingress, main.egress, batchSize,
-                                             offset=1, options="-i", timeout=main.timeout)
-
-                # check links and flows
-                k = 0
-                verify = main.FALSE
-                linkCheck = 0
-                flowsCheck = 0
-                while k <= main.verifyAttempts:
-                    time.sleep(main.verifySleep)
-                    summary = json.loads(main.CLIs[0].summary(timeout=main.timeout))
-                    linkCheck = summary.get("links")
-                    flowsCheck = summary.get("flows")
-                    if linkCheck == 16 and flowsCheck == batchSize * 7:
-                        main.log.info("links: {}, flows: {} ".format(linkCheck, flowsCheck))
-                        verify = main.TRUE
-                        break
-                    k += 1
-                if not verify:
-                    main.log.warn("Links or flows number are not match!")
-                    main.log.warn("links: {}, flows: {} ".format(linkCheck, flowsCheck))
-                    # bring back topology
-                    main.log.info("Bring back topology...")
-                    main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
-                    time.sleep(1)
-                    main.CLIs[0].purgeWithdrawnIntents()
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
-                    if validRun >= main.warmUp:
-                        invalidRun += 1
-                        continue
-                    else:
-                        validRun += 1
-                        continue
-
-                # Bring link down
-                main.CLIs[0].link("0000000000000004/1", "0000000000000003/2", "down",
-                                  timeout=main.timeout, showResponse=False)
-                verify = main.FALSE
-                k = 0
-                topoManagerLog = ""
-                while k <= main.verifyAttempts:
-                    time.sleep(main.verifySleep)
-                    summary = json.loads(main.CLIs[0].summary(timeout=main.timeout))
-                    linkCheck = summary.get("links")
-                    flowsCheck = summary.get("flows")
-                    if linkCheck == 14:
-                        main.log.info("links: {}, flows: {} ".format(linkCheck, flowsCheck))
-                        verify = main.TRUE
-                        break
-                    k += 1
-                if not verify:
-                    main.log.warn("Links number are not match in TopologyManager log!")
-                    main.log.warn(topoManagerLog)
-                    # bring back topology
-                    main.log.info("Bring back topology...")
-                    main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
-                    time.sleep(1)
-                    main.CLIs[0].purgeWithdrawnIntents()
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
-                    if validRun >= main.warmUp:
-                        invalidRun += 1
-                        continue
-                    else:
-                        validRun += 1
-                        continue
-
-                try:
-                    # expect twice to clean the pexpect buffer
-                    main.ONOSbench.handle.sendline("")
-                    main.ONOSbench.handle.expect("\$")
-                    main.ONOSbench.handle.expect("\$")
-                    # send line by using bench, can't use driver because pexpect buffer problem
-                    cmd = "onos-ssh $OC1 cat /opt/onos/log/karaf.log | grep TopologyManager| tail -1"
-                    main.ONOSbench.handle.sendline(cmd)
-                    time.sleep(1)
-                    main.ONOSbench.handle.expect(":~")
-                    topoManagerLog = main.ONOSbench.handle.before
-                    topoManagerLogTemp = topoManagerLog.splitlines()
-                    # To make sure we get correct topology log
-                    for lines in topoManagerLogTemp:
-                        if "creationTime" in lines:
-                            topoManagerLog = lines
-                    main.log.info("Topology Manager log:")
-                    print(topoManagerLog)
-                    cutTimestamp = float(topoManagerLog.split("creationTime=")[1].split(",")[0])
-                except:
-                    main.log.error("Topology Log is not correct!")
-                    print(topoManagerLog)
-                    # bring back topology
-                    main.log.info("Bring back topology...")
-                    verify = main.FALSE
-                    main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
-                    time.sleep(1)
-                    main.CLIs[0].purgeWithdrawnIntents()
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
-                    if validRun >= main.warmUp:
-                        invalidRun += 1
-                    else:
-                        validRun += 1
-                    # If we got wrong Topology log, we should skip this iteration, and continue for next one
-                    continue
-
-                installedTemp = []
-                time.sleep(10)
-                for cli in main.CLIs:
-                    tempJson = json.loads(cli.intentsEventsMetrics())
-                    Installedtime = tempJson.get('intentInstalledTimestamp').get('value')
-                    installedTemp.append(float(Installedtime))
-                for i in range(0, len(installedTemp)):
-                    main.log.info("ONOS Node {} Installed Time stemp: {}".format((i + 1), installedTemp[i]))
-                maxInstallTime = float(max(installedTemp))
-                if validRun >= main.warmUp and verify:
-                    main.log.info("Installed time stemp: {0:f}".format(maxInstallTime))
-                    main.log.info("CutTimestamp: {0:f}".format(cutTimestamp))
-                    # Both timeStemps are milliseconds
-                    main.log.info("Latency: {0:f}".format(float(maxInstallTime - cutTimestamp)))
-                    if float(maxInstallTime - cutTimestamp) < 0:
-                        main.log.info("Latency less than 0!")
-                        # bring back topology
-                        main.log.info("Bring back topology...")
-                        verify = main.FALSE
-                        main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
-                        time.sleep(1)
-                        main.CLIs[0].purgeWithdrawnIntents()
-                        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
-                        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
-                        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
-                        main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
-                        if validRun >= main.warmUp:
-                            invalidRun += 1
-                        else:
-                            validRun += 1
-                        continue
-                    main.LatencyList.append(float(maxInstallTime - cutTimestamp))
-                # We get valid latency, validRun + 1
-                validRun += 1
-
-                # Verify Summary after we bring up link, and withdrawn intents
-                main.CLIs[0].link("0000000000000004/1", "0000000000000003/2", "up",
-                                  timeout=main.timeout)
-                k = 0
-                verify = main.FALSE
-                linkCheck = 0
-                flowsCheck = 0
-                while k <= main.verifyAttempts:
-                    time.sleep(main.verifySleep)
-                    main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
-                    time.sleep(1)
-                    main.CLIs[0].purgeWithdrawnIntents()
-                    summary = json.loads(main.CLIs[0].summary())
-                    linkCheck = summary.get("links")
-                    flowsCheck = summary.get("flows")
-                    intentCheck = summary.get("intents")
-                    if linkCheck == 16 and flowsCheck == 0 and intentCheck == 0:
-                        main.log.info("links: {}, flows: {}, intents: {} ".format(linkCheck, flowsCheck, intentCheck))
-                        verify = main.TRUE
-                        break
-                    k += 1
-                if not verify:
-                    main.log.error("links, flows, or intents are not correct!")
-                    main.log.info("links: {}, flows: {}, intents: {} ".format(linkCheck, flowsCheck, intentCheck))
-                    # bring back topology
-                    main.log.info("Bring back topology...")
-                    main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
-                    time.sleep(1)
-                    main.CLIs[0].purgeWithdrawnIntents()
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
-                    main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
-                    continue
-
-            aveLatency = 0
-            stdLatency = 0
-            aveLatency = numpy.average(main.LatencyList)
-            stdLatency = numpy.std(main.LatencyList)
-            main.log.report("Scale: " + str(main.numCtrls) + "  \tIntent batch: " + str(batchSize))
-            main.log.report("Latency average:................" + str(aveLatency))
-            main.log.report("Latency standard deviation:....." + str(stdLatency))
-            main.log.report("________________________________________________________")
-
-            if not (numpy.isnan(aveLatency) or numpy.isnan(stdLatency)):
-                # check if got NaN for result
-                resultsDB = open(main.dbFileName, "a")
-                resultsDB.write("'" + main.commit + "',")
-                resultsDB.write(str(main.numCtrls) + ",")
-                resultsDB.write(str(batchSize) + ",")
-                resultsDB.write(str(aveLatency) + ",")
-                resultsDB.write(str(stdLatency) + "\n")
-                resultsDB.close()
-        del main.scale[0]
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo b/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo
deleted file mode 100644
index 915d033..0000000
--- a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo
+++ /dev/null
@@ -1,147 +0,0 @@
-<TOPOLOGY>
-
-    <COMPONENT>
-
-        <ONOSbench>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>1</connect_order>
-            <COMPONENTS>
-                <home>~/onos</home>
-                <nodes>7</nodes> 
-            </COMPONENTS>
-        </ONOSbench>
-
-        <ONOS1cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS1cli>
-
-        <ONOS2cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS2cli>
-
-        <ONOS3cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>4</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS3cli>
-
-        <ONOS4cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>5</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS4cli>
-
-        <ONOS5cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>6</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS5cli>
-
-        <ONOS6cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>7</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS6cli>
-
-        <ONOS7cli>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>8</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS7cli>
-
-        <ONOS1>
-            <host>OC1</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>9</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS1>
-
-        <ONOS2>
-            <host>OC2</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>10</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS2>
-
-        <ONOS3>
-            <host>OC3</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>11</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS3>
-
-        <ONOS4>
-            <host>OC4</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>12</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS4>
-
-    
-        <ONOS5>
-            <host>OC5</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>13</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS5>
-
-        <ONOS6>
-            <host>OC6</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>14</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS6>
-
-        <ONOS7>
-            <host>OC7</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>15</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS7>
-
-    </COMPONENT>
-
-</TOPOLOGY>
- 
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/__init__.py b/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/SCPF/SCPFintentRerouteLatWithFlowObj/__init__.py
+++ /dev/null
diff --git a/TestON/tests/SCPF/SCPFmaxIntents/README b/TestON/tests/SCPF/SCPFmaxIntents/README
deleted file mode 100644
index cb53df8..0000000
--- a/TestON/tests/SCPF/SCPFmaxIntents/README
+++ /dev/null
@@ -1,6 +0,0 @@
-Summary:
-        This is a performance test suit, designed to test the upper limits
-        of onos and ovsdb with respect to installing intents and rerouting flows.
-NOTE:
-        This test is largely based on the hardware used to run onos and mininet.
-        Therefore, results will very test station to test station.
diff --git a/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.params b/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.params
deleted file mode 100755
index 56ad4d8..0000000
--- a/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.params
+++ /dev/null
@@ -1,103 +0,0 @@
-<PARAMS>
-
-    # 1-init
-    # 2-setup
-    # 10-null provider setup
-    # 11-mininet setup
-    # 20-pushing intents, and rerouting intents if reroute is true
-    # 1,2,10,20,2,11,20,100
-    <testcases>1,2,10,20</testcases>
-
-    <reroute>False</reroute>
-
-    <SCALE>
-        <size>1</size>
-        <max>1</max>
-    </SCALE>
-
-    <DEPENDENCY>
-        <path>/tests/SCPFmaxIntents/dependencies/</path>
-        <wrapper1>startUp</wrapper1>
-        <wrapper2>maxIntentFunctions</wrapper2>
-        <topology>rerouteTopo.py</topology>
-    </DEPENDENCY>
-
-    <ENV>
-        <cellName>productionCell</cellName>
-        <cellApps>drivers</cellApps>
-    </ENV>
-
-    <GIT>
-        <pull>False</pull>
-        <branch>master</branch>
-    </GIT>
-
-    <CTRL>
-        <port>6653</port>
-    </CTRL>
-
-    <SLEEP>
-        <startup>3</startup>
-        <install>1</install>
-        <verify>5</verify>
-        <reroute>3</reroute>
-        # timeout for pexpect
-        <timeout>120</timeout>
-    </SLEEP>
-
-    <ATTEMPTS>
-        <verify>3</verify>
-        <push>3</push>
-    </ATTEMPTS>
-
-    <DATABASE>
-        <file>/tmp/MaxIntentDB</file>
-        <nic>1gig</nic>
-        <node>baremetal</node>
-    </DATABASE>
-
-    <LINK>
-        <ingress>0000000000000001/9</ingress>
-        <egress>0000000000000002/9</egress>
-    </LINK>
-
-    # CASE10
-    <NULL>
-        # CASE20
-        <PUSH>
-            <batch_size>1000</batch_size>
-            <min_intents>100000</min_intents>
-            <max_intents>1000000</max_intents>
-            <check_interval>100000</check_interval>
-        </PUSH>
-
-        # if reroute is true
-        <REROUTE>
-            <batch_size>1000</batch_size>
-            <min_intents>10000</min_intents>
-            <max_intents>10000</max_intents>
-            <check_interval>10000</check_interval>
-        </REROUTE>
-    </NULL>
-
-    # CASE11
-    <OVS>
-        # CASE20
-        <PUSH>
-            <batch_size>1000</batch_size>
-            <min_intents>10000</min_intents>
-            <max_intents>500000</max_intents>
-            <check_interval>10000</check_interval>
-        </PUSH>
-
-        # if reroute is true
-        <REROUTE>
-            <batch_size>1000</batch_size>
-            <min_intents>10000</min_intents>
-            <max_intents>500000</max_intents>
-            <check_interval>10000</check_interval>
-        </REROUTE>
-    </OVS>
-
-
-</PARAMS>
diff --git a/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.py b/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.py
deleted file mode 100644
index 4bca4da..0000000
--- a/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.py
+++ /dev/null
@@ -1,517 +0,0 @@
-
-# This is a performance scale intent that test onos to see how many intents can
-# be installed and rerouted using the null provider and mininet.
-'''
-This test will not test on reroute and OVS!!!
-If you need test on reroute or OVS, change the params file
-
-Test information:
-    - BatchSize: 1000
-    - Minimum intents: 10,000
-    - Maximum Intents: 1,000,000
-    - Check Interval: 10,000
-    - Link:
-        - ingress: 0000000000000001/9
-        - egress: 0000000000000002/9
-    - Timeout: 120 Seconds
-'''
-
-class SCPFmaxIntents:
-
-    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
-        - Set up cell
-            - Create cell file
-            - Set cell file
-            - Verify cell file
-        - Kill ONOS process
-        """
-
-        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.dependencyPath = main.testOnDirectory + \
-                main.params['DEPENDENCY']['path']
-        main.cellName = main.params[ 'ENV' ][ 'cellName' ]
-        main.apps = main.params[ 'ENV' ][ 'cellApps' ]
-        main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
-        main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
-        main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
-        main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
-        main.timeout = int(main.params['SLEEP']['timeout'])
-        main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
-        main.installSleep = int( main.params[ 'SLEEP' ][ 'install' ] )
-        main.verifySleep = int( main.params[ 'SLEEP' ][ 'verify' ] )
-        main.rerouteSleep = int ( main.params['SLEEP']['reroute'] )
-        main.verifyAttempts = int( main.params['ATTEMPTS']['verify'] )
-        main.ingress = main.params['LINK']['ingress']
-        main.egress = main.params['LINK']['egress']
-        main.dbFileName = main.params['DATABASE']['file']
-        main.cellData = {} # for creating cell file
-        main.reroute = main.params['reroute']
-        if main.reroute == "True":
-            main.reroute = True
-        else:
-            main.reroute = False
-        main.CLIs = []
-        main.ONOSip = []
-        main.maxNumBatch = 0
-        main.ONOSip = main.ONOSbench.getOnosIps()
-        main.log.info(main.ONOSip)
-        main.setupSkipped = False
-
-        wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
-        wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
-        gitBranch = main.params[ 'GIT' ][ 'branch' ]
-        gitPull = main.params[ 'GIT' ][ 'pull' ]
-        nic = main.params['DATABASE']['nic']
-        node = main.params['DATABASE']['node']
-        nic = main.params['DATABASE']['nic']
-        node = main.params['DATABASE']['node']
-
-        # main.scale[ 0 ] determines the current number of ONOS controller
-        main.numCtrls = int( main.scale[ 0 ] )
-
-        main.log.info("Creating list of ONOS cli handles")
-        for i in range(main.maxNodes):
-            main.CLIs.append( getattr( main, 'ONOScli' + str( i+1 )))
-
-        if not main.CLIs:
-            main.log.error("Failed to create the list of ONOS cli handles")
-            main.cleanup()
-            main.exit()
-
-        main.log.info("Loading wrapper files")
-        main.startUp = imp.load_source( wrapperFile1,
-                                        main.dependencyPath +
-                                        wrapperFile1 +
-                                        ".py" )
-
-        main.intentFunctions = imp.load_source( wrapperFile2,
-                                               main.dependencyPath +
-                                               wrapperFile2 +
-                                               ".py" )
-
-        copyResult = main.ONOSbench.copyMininetFile( main.topology,
-                                                    main.dependencyPath,
-                                                    main.Mininet1.user_name,
-                                                    main.Mininet1.ip_address )
-
-        commit = main.ONOSbench.getVersion(report=True)
-        commit = commit.split(" ")[1]
-
-        if gitPull == 'True':
-            if not main.startUp.onosBuild( main, gitBranch ):
-                main.log.error("Failed to build ONOS")
-                main.cleanup()
-                main.exit()
-        else:
-            main.log.warn( "Did not pull new code so skipping mvn " +
-                           "clean install" )
-
-        main.log.info( "Starting up %s node(s) ONOS cluster" % main.numCtrls)
-        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 ] )
-
-        main.log.info( "NODE COUNT = %s" % 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()
-        stepResult = packageResult
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully created ONOS package",
-                                 onfail="Failed to create ONOS package" )
-
-        main.log.info("Creating DB file")
-        with open(main.dbFileName, "w+") as dbFile:
-            temp = "'" + commit + "',"
-            temp += "'" + nic + "',"
-            temp += str(main.numCtrls) + ","
-            temp += "'" + node + "1" + "'"
-            temp += ",0"
-            temp += ",0"
-            temp += ",0"
-            temp += ",0"
-            dbFile.write(temp)
-
-    def CASE2( self, main ):
-        """
-        - Uninstall ONOS cluster
-        - Verify ONOS start up
-        - Install ONOS cluster
-        - Connect to cli
-        """
-
-        main.step( "Installing ONOS with -f" )
-        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( "Start ONOS cli" )
-        cliResult = main.TRUE
-        for i in range( main.numCtrls ):
-            cliResult = cliResult and \
-                        main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
-        stepResult = cliResult
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully start ONOS cli",
-                                 onfail="Failed to start ONOS cli" )
-
-        time.sleep( main.startUpSleep )
-
-    def CASE10( self, main ):
-        """
-            Setting up null-provider
-        """
-        import json
-        # Activate apps
-        main.step("Activating null-provider")
-        appStatus = utilities.retry( main.CLIs[0].activateApp,
-                                     main.FALSE,
-                                     ['org.onosproject.null'],
-                                     sleep=main.verifySleep,
-                                     attempts=main.verifyAttempts )
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=appStatus,
-                                 onpass="Successfully activated null-provider",
-                                 onfail="Failed activate null-provider" )
-
-        # Setup the null-provider
-        main.step("Configuring null-provider")
-        cfgStatus = utilities.retry( main.ONOSbench.onosCfgSet,
-                                     main.FALSE,
-                                     [ main.ONOSip[0],
-                                      'org.onosproject.provider.nil.NullProviders', 'deviceCount 3'],
-                                     sleep=main.verifySleep,
-                                     attempts = main.verifyAttempts )
-        cfgStatus = cfgStatus and utilities.retry( main.ONOSbench.onosCfgSet,
-                                                   main.FALSE,
-                                                   [ main.ONOSip[0],
-                                                     'org.onosproject.provider.nil.NullProviders', 'topoShape reroute'],
-                                                   sleep=main.verifySleep,
-                                                   attempts = main.verifyAttempts )
-
-        cfgStatus = cfgStatus and utilities.retry( main.ONOSbench.onosCfgSet,
-                                                   main.FALSE,
-                                                   [ main.ONOSip[0],
-                                                     'org.onosproject.provider.nil.NullProviders', 'enabled true'],
-                                                   sleep=main.verifySleep,
-                                                   attempts = main.verifyAttempts )
-
-
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=cfgStatus,
-                                 onpass="Successfully configured null-provider",
-                                 onfail="Failed to configure null-provider" )
-
-        # give onos some time to settle
-        time.sleep(main.startUpSleep)
-
-        main.log.info("Setting default flows to zero")
-        main.defaultFlows = 0
-
-        main.step("Check status of null-provider setup")
-        caseResult = appStatus and cfgStatus
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=caseResult,
-                                 onpass="Setting up null-provider was successfull",
-                                 onfail="Failed to setup null-provider" )
-
-        # This tells the following cases if we are using the null-provider or ovs
-        main.switchType = "null:"
-
-        # If the null-provider setup was unsuccessfull, then there is no point to
-        # run the subsequent cases
-        if not caseResult:
-            main.setupSkipped = True
-
-    def CASE11( self, main ):
-        '''
-            Setting up mininet
-        '''
-        import json
-        import time
-
-        time.sleep(main.startUpSleep)
-
-        main.step("Activating openflow")
-        appStatus = main.CLIs[0].activateApp('org.onosproject.openflow')
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=appStatus,
-                                 onpass="Successfully activated openflow",
-                                 onfail="Failed activate openflow" )
-
-        time.sleep(main.startUpSleep)
-
-        main.step('Starting mininet topology')
-        mnStatus = main.Mininet1.startNet(topoFile='~/mininet/custom/rerouteTopo.py')
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=mnStatus,
-                                 onpass="Successfully started Mininet",
-                                 onfail="Failed to activate Mininet" )
-
-        main.step("Assinging masters to switches")
-        switches = main.Mininet1.getSwitches()
-        swStatus = main.Mininet1.assignSwController( sw=switches.keys(), ip=main.ONOSip )
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=swStatus,
-                                 onpass="Successfully assigned switches to masters",
-                                 onfail="Failed assign switches to masters" )
-
-        time.sleep(main.startUpSleep)
-
-        main.log.info("Getting default flows")
-        jsonSum = json.loads(main.CLIs[0].summary())
-        main.defaultFlows = jsonSum["flows"]
-
-        main.step("Check status of Mininet setup")
-        caseResult = appStatus and mnStatus and swStatus
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=caseResult,
-                                 onpass="Successfully setup Mininet",
-                                 onfail="Failed setup Mininet" )
-
-        # This tells the following cases if we are using the null-provider or ovs
-        main.switchType = "of:"
-
-        if not caseResult:
-            main.setupSkipped = True
-
-    def CASE20( self, main ):
-        '''
-            Pushing intents
-        '''
-
-        if main.reroute:
-            if main.switchType == "of:":
-                main.minIntents = int(main.params['OVS']['REROUTE']['min_intents'])
-                main.maxIntents = int(main.params['OVS']['REROUTE']['max_intents'])
-                main.checkInterval = int(main.params['OVS']['REROUTE']['check_interval'])
-                main.batchSize = int(main.params['OVS']['REROUTE']['batch_size'])
-            else:
-                main.minIntents = int(main.params['NULL']['REROUTE']['min_intents'])
-                main.maxIntents = int(main.params['NULL']['REROUTE']['max_intents'])
-                main.checkInterval = int(main.params['NULL']['REROUTE']['check_interval'])
-                main.batchSize = int(main.params['NULL']['REROUTE']['batch_size'])
-        else:
-            if main.switchType == "of:":
-                main.minIntents = int(main.params['OVS']['PUSH']['min_intents'])
-                main.maxIntents = int(main.params['OVS']['PUSH']['max_intents'])
-                main.checkInterval = int(main.params['OVS']['PUSH']['check_interval'])
-                main.batchSize = int(main.params['OVS']['PUSH']['batch_size'])
-            else:
-                main.minIntents = int(main.params['NULL']['PUSH']['min_intents'])
-                main.maxIntents = int(main.params['NULL']['PUSH']['max_intents'])
-                main.checkInterval = int(main.params['NULL']['PUSH']['check_interval'])
-                main.batchSize = int(main.params['NULL']['PUSH']['batch_size'])
-
-        # check if the case needs to be skipped
-        if main.setupSkipped:
-            main.setupSkipped = False
-            main.skipCase()
-
-        # the index where the next intents will be installed
-        offset = 0
-        # keeps track of how many intents have been installed
-        currIntents = 0
-        # keeps track of how many flows have been installed
-        currFlows = main.defaultFlows
-        # limit for the number of intents that can be installed
-        limit = main.maxIntents / main.batchSize
-
-        main.step( "Pushing intents" )
-        for i in range(limit):
-            pushResult = main.ONOScli1.pushTestIntents( main.switchType +  main.ingress,
-                                                        main.switchType +  main.egress,
-                                                        main.batchSize,
-                                                        offset = offset,
-                                                        options = "-i",
-                                                        timeout = main.timeout )
-            if pushResult == None:
-                main.log.info( "Timeout!" )
-                main.skipCase()
-            time.sleep(1)
-
-            # Update offset
-            offset += main.batchSize
-
-            if offset >= main.minIntents and offset % main.checkInterval == 0:
-                intentVerify = utilities.retry( main.ONOScli1.checkIntentSummary,
-                                                main.FALSE,
-                                                [main.timeout],
-                                                sleep=main.verifySleep,
-                                                attempts=main.verifyAttempts )
-
-                flowVerify = utilities.retry( main.ONOScli1.checkFlowsState,
-                                              main.FALSE,
-                                              [False,main.timeout],
-                                              sleep=main.verifySleep,
-                                              attempts=main.verifyAttempts )
-
-                if not intentVerify:
-                    main.log.error( "Failed to install intents" )
-                    break
-
-                if main.reroute:
-                    main.step( "Reroute" )
-                    # tear down a link
-                    main.log.info("Tearing down link")
-                    if main.switchType == "of:":
-                        downlink = main.Mininet1.link( END1 = "s1", END2 = "s3", OPTION = "down" )
-                    else:
-                        downlink = main.ONOScli1.link( main.ingress, main.egress, "down")
-
-                    if downlink:
-                        main.log.info( "Successfully tear down link" )
-                    else:
-                        main.log.warn( "Failed to tear down link" )
-
-                    time.sleep(main.rerouteSleep)
-
-                    # Verifying intents
-                    main.step( "Checking intents and flows" )
-                    intentVerify = utilities.retry( main.ONOScli1.checkIntentSummary,
-                                                    main.FALSE,
-                                                    [main.timeout],
-                                                    sleep=main.verifySleep,
-                                                    attempts=main.verifyAttempts )
-                    # Verfying flows
-                    flowVerify = utilities.retry( main.ONOScli1.checkFlowsState,
-                                                  main.FALSE,
-                                                  [False, main.timeout],
-                                                  sleep = main.verifySleep,
-                                                  attempts = main.verifyAttempts )
-
-                    if not intentVerify:
-                        main.log.error( "Failed to install intents" )
-                    # Bring link back up
-                    main.log.info("Bringing link back up")
-                    if main.switchType == "of:":
-                        uplink = main.Mininet1.link( END1 = "s1", END2 = "s3", OPTION = "up" )
-                    else:
-                        uplink = main.ONOScli1.link( main.ingress, main.egress, "up" )
-
-                    if uplink:
-                        main.log.info( "Successfully bring link back up" )
-                    else:
-                        main.log.warn( "Failed to bring link back up" )
-
-                    time.sleep(main.rerouteSleep)
-
-                    # Verifying intents
-                    main.step( "Checking intents and flows" )
-                    intentVerify = utilities.retry( main.ONOScli1.checkIntentSummary,
-                                                    main.FALSE,
-                                                    [main.timeout],
-                                                    sleep=main.verifySleep,
-                                                    attempts=main.verifyAttempts )
-                    # Verfying flows
-                    flowVerify = utilities.retry( main.ONOScli1.checkFlowsState,
-                                                  main.FALSE,
-                                                  [False, main.timeout],
-                                                  sleep = main.verifySleep,
-                                                  attempts = main.verifyAttempts )
-
-                    if not intentVerify:
-                        main.log.error( "Failed to install intents" )
-
-                    rerouteResult = downlink and uplink
-                    utilities.assert_equals( expect = main.TRUE,
-                                             actual = rerouteResult,
-                                             onpass = "Successfully reroute",
-                                             onfail = "Failed to reroute" )
-
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = intentVerify,
-                                 onpass = "Successfully pushed and verified intents",
-                                 onfail = "Failed to push and verify intents" )
-        currIntents = main.ONOScli1.getTotalIntentsNum()
-        currFlows = 0
-        # Get current flows from REST API
-        temp = json.loads( main.ONOSrest1.flows() )
-        for t in temp:
-            if t.get("state") == "ADDED":
-                currFlows = currFlows + 1
-        main.log.info( "Total Intents Installed: {}".format( currIntents ) )
-        main.log.info( "Total Flows ADDED: {}".format( currFlows ) )
-
-        main.log.info("Writing results to DB file")
-        with open(main.dbFileName, "a") as dbFile:
-            temp = "," + str(currIntents)
-            temp += "," + str(currFlows)
-            temp += ",0"
-            temp += ",0\n"
-            dbFile.write(temp)
-
-        if main.switchType == "of:":
-            main.step( "Stopping mininet" )
-            stepResult = main.Mininet1.stopNet()
-            utilities.assert_equals( expect = main.TRUE,
-                                     actual = stepResult,
-                                     oppass = "Successfully stop Mininet",
-                                     opfail = "Failed stop Mininet" )
-
-
-    def CASE100( 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" )
diff --git a/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.topo b/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.topo
deleted file mode 100755
index cdd16f1..0000000
--- a/TestON/tests/SCPF/SCPFmaxIntents/SCPFmaxIntents.topo
+++ /dev/null
@@ -1,46 +0,0 @@
-<TOPOLOGY>
-    <COMPONENT>
-
-        <ONOSbench>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>1</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </ONOSbench>
-
-        <ONOScli1>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </ONOScli1>
-
-        <ONOSrest1>
-            <host>OC1</host>
-            <port>8181</port>
-            <user>onos</user>
-            <password>rocks</password>
-            <type>OnosRestDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </ONOSrest1>
-
-        <Mininet1>
-            <host>OCN</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>MininetCliDriver</type>
-            <connect_order>5</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </Mininet1>
-
-    </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/SCPF/SCPFmaxIntents/__init__.py b/TestON/tests/SCPF/SCPFmaxIntents/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/SCPF/SCPFmaxIntents/__init__.py
+++ /dev/null
diff --git a/TestON/tests/SCPF/SCPFmaxIntents/dependencies/maxIntentFunctions.py b/TestON/tests/SCPF/SCPFmaxIntents/dependencies/maxIntentFunctions.py
deleted file mode 100644
index 268279c..0000000
--- a/TestON/tests/SCPF/SCPFmaxIntents/dependencies/maxIntentFunctions.py
+++ /dev/null
@@ -1,114 +0,0 @@
-'''
-    Wrapper functions for maxIntent
-'''
-
-import json
-import time
-import pexpect
-
-def __init__( self ):
-    self.default = ""
-
-def getIntents( main, state="INSTALLED", sleep=1, timeout=120 ):
-    intents = 0
-    try:
-        cmd = "intents | grep " + state + " | wc -l"
-        main.log.info("Sending: " + cmd)
-        main.CLIs[0].handle.sendline(cmd)
-
-        time.sleep(sleep)
-
-        main.CLIs[0].handle.expect("onos>", timeout=timeout)
-        raw = main.CLIs[0].handle.before
-        intents = int(main.CLIs[0].handle.before.split()[7])
-        main.log.info(state + " intents: " + str(intents))
-    except pexpect.TIMEOUT:
-        main.log.exception("Timeout exception caught in getIntent")
-    return intents
-
-def getFlows( main, state="ADDED", sleep=1, timeout=120 ):
-    flows = 0
-    try:
-        cmd = "flows | grep " + state + " | wc -l"
-        main.log.info("Sending: " + cmd)
-        main.CLIs[0].handle.sendline(cmd)
-
-        time.sleep(sleep)
-
-        main.CLIs[0].handle.expect("onos>", timeout=timeout)
-        raw = main.CLIs[0].handle.before
-        flows = int(main.CLIs[0].handle.before.split()[7])
-        main.log.info(state + " flows: " + str(flows))
-    except pexpect.TIMEOUT:
-        main.log.exception("Timeout exception caught in getFlows")
-    return flows
-
-
-def pushIntents( main,
-                 switch,
-                 ingress,
-                 egress,
-                 batch,
-                 offset,
-                 sleep=1,
-                 options="",
-                 timeout=120):
-    '''
-        Pushes intents using the push-test-intents cli command.
-    '''
-    try:
-        cmd = "push-test-intents " + options + " " + switch + ingress + " " +\
-                switch + egress + " " + str(batch) + " " + str(offset)
-        main.log.info("Installing " + str(offset+batch) + " intents")
-        main.log.debug("Sending: " + cmd)
-        main.CLIs[0].handle.sendline(cmd)
-        time.sleep(sleep)
-        main.CLIs[0].handle.expect("onos>", timeout=timeout)
-
-        raw = main.CLIs[0].handle.before
-        if "Failure:" not in raw and "GC" not in raw:
-            return main.TRUE
-    except pexpect.TIMEOUT:
-        main.log.exception("Timeout exception caught in pushIntents")
-    return main.FALSE
-
-def verifyFlows( main, expectedFlows, state="ADDED", sleep=1, numcheck=10, timeout=120):
-    '''
-        This function returns main.TRUE if the number of expected flows are in
-        the specified state
-
-        @params
-            expectedFlows: the flows you expect to see in the specified state
-            state: the state of the flow to check for
-            sleep: how long it should sleep for each check
-            numcheck: how many times it should check
-            timeout: the timeout for pexpect
-    '''
-    cmd = "flows | grep " + state + " | wc -l"
-    for i in range(numcheck):
-        flows = getFlows( main, state, sleep, timeout )
-        if expectedFlows == flows:
-            return main.TRUE
-
-    return main.FALSE
-
-def verifyIntents( main, expectedIntents, state="INSTALLED", sleep=1, numcheck=10, timeout=120):
-    '''
-        This function returns main.TRUE if the number of expected intents are in
-        the specified state
-
-        @params
-            expectedFlows: the intents you expect to see in the specified state
-            state: the state of the intent to check for
-            sleep: how long it should sleep for each check
-            numcheck: how many times it should check
-            timeout: the timeout for pexpect
-    '''
-    cmd = "intents | grep " + state + " | wc -l"
-    for i in range(numcheck):
-        intents = getIntents( main, state, sleep, timeout )
-        if expectedIntents == intents:
-            return main.TRUE
-        time.sleep(sleep)
-
-    return main.FALSE
diff --git a/TestON/tests/SCPF/SCPFmaxIntents/dependencies/rerouteTopo.py b/TestON/tests/SCPF/SCPFmaxIntents/dependencies/rerouteTopo.py
deleted file mode 100755
index a2fe9fe..0000000
--- a/TestON/tests/SCPF/SCPFmaxIntents/dependencies/rerouteTopo.py
+++ /dev/null
@@ -1,53 +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.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 MyTopo( Topo ):
-
-    def __init__( self ):
-        # Initialize topology
-        Topo.__init__( self )
-
-        host1 = self.addHost('h1', ip='10.1.0.1/24')
-        host2 = self.addHost('h2', ip='10.1.0.2/24')
-        host3 = self.addHost('h3', ip='10.1.0.3/24')
-
-        s1 = self.addSwitch( 's1' )
-        s2 = self.addSwitch( 's2' )
-        s3 = self.addSwitch( 's3' )
-
-        self.addLink(s1, host1)
-        self.addLink(s2, host2)
-        self.addLink(s3, host3)
-
-        self.addLink(s1,s2)
-        self.addLink(s1,s3)
-        self.addLink(s2,s3)
-
-        topos = { 'mytopo': ( lambda: MyTopo() ) }
-
-# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
-
-def setupNetwork():
-    "Create network"
-    topo = MyTopo()
-    network = Mininet(topo=topo, autoSetMacs=True, controller=None)
-    network.start()
-    CLI( network )
-    network.stop()
-
-if __name__ == '__main__':
-    setLogLevel('info')
-    #setLogLevel('debug')
-    setupNetwork()
diff --git a/TestON/tests/SCPF/SCPFmaxIntents/dependencies/startUp.py b/TestON/tests/SCPF/SCPFmaxIntents/dependencies/startUp.py
deleted file mode 100644
index bf2a2b6..0000000
--- a/TestON/tests/SCPF/SCPFmaxIntents/dependencies/startUp.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""
-    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/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.params b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.params
index cb75b01..8510204 100644
--- a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.params
+++ b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.params
@@ -22,7 +22,9 @@
         <cellName>productionCell</cellName>
         <cellApps>drivers,openflow</cellApps>
     </ENV>
-
+    <TEST>
+        <flowObj>False</flowObj>
+    </TEST>
     <GIT>
         <pull>False</pull>
         <branch>master</branch>
@@ -47,7 +49,8 @@
     </ATTEMPTS>
 
     <DATABASE>
-        <file>/tmp/ScalingMaxIntentDB</file>
+        <dbName>/tmp/ScalingMaxIntentDB</dbName>
+        <dbFlowObj>/tmp/ScalingMaxIntentDBWFO</dbFlowObj>
         <nic>1gig</nic>
         <node>baremetal</node>
     </DATABASE>
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
index 5420010..c688207 100644
--- a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
+++ b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
@@ -43,9 +43,15 @@
         main.verifyAttempts = int( main.params['ATTEMPTS']['verify'] )
         main.ingress = main.params['LINK']['ingress']
         main.egress = main.params['LINK']['egress']
-        main.dbFileName = main.params['DATABASE']['file']
         main.cellData = {} # for creating cell file
         main.reroute = main.params['reroute']
+        main.flowObj = main.params['TEST']['flowObj']
+        if main.flowObj == "True":
+            main.flowObj = True
+            main.dbFileName = main.params['DATABASE']['dbFlowObj']
+        else:
+            main.flowObj = False
+            main.dbFileName = main.params['DATABASE']['dbName']
         main.threadID = 0
 
         if main.reroute == "True":
@@ -312,6 +318,9 @@
             main.CLIs[0].deviceRemove( d )
 
         time.sleep(main.startUpSleep)
+        if main.flowObj:
+            main.CLIs[0].setCfg("org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
+                                "useFlowObjectives", value="true")
         main.step('Starting mininet topology')
         mnStatus = main.Mininet1.startNet(topoFile='~/mininet/custom/rerouteTopo.py')
         utilities.assert_equals( expect=main.TRUE,
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/README b/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/README
deleted file mode 100644
index 0c16859..0000000
--- a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/README
+++ /dev/null
@@ -1,11 +0,0 @@
-Summary:
-        This is a performance test suit, designed to test the upper limits
-        of onos and ovsdb with respect to installing intents.
-        In this test, CASE10 set up null provoder, CASE 11 set up ovs. Start from
-        1 node, and scale to 7 nodes.
-        We push intents to every node by using Thread, and when the intents number
-        reach to the minimun number, we will verify intents and flows. If intents are
-        not installed correctly, test will stop pushing and finish this case.
-NOTE:
-        This test is largely based on the hardware used to run onos and mininet.
-        Therefore, results will very test station to test station.
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params b/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params
deleted file mode 100644
index 8083e7a..0000000
--- a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params
+++ /dev/null
@@ -1,99 +0,0 @@
-<PARAMS>
-
-    # 0-init
-    # 1-setup
-    # 2-Install
-    # 10-null provider setup
-    # 20-pushing intents, and rerouting intents if reroute is true
-    # 0,1,2,10,20,1,2,10,20,1,2,10,20
-   <testcases>0,1,2,11,20,1,2,11,20,1,2,11,20,1,2,11,20</testcases>
-
-    <reroute>False</reroute>
-
-    <SCALE>1,3,5,7</SCALE>
-
-    <DEPENDENCY>
-        <path>/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/dependencies/</path>
-        <wrapper1>startUp</wrapper1>
-        <topology>rerouteTopo.py</topology>
-    </DEPENDENCY>
-
-    <ENV>
-        <cellName>productionCell</cellName>
-        <cellApps>drivers,openflow</cellApps>
-    </ENV>
-
-    <GIT>
-        <pull>False</pull>
-        <branch>master</branch>
-    </GIT>
-
-    <CTRL>
-        <port>6653</port>
-    </CTRL>
-
-    <SLEEP>
-        <startup>10</startup>
-        <install>10</install>
-        <verify>15</verify>
-        <reroute>3</reroute>
-        # timeout for pexpect
-        <timeout>300</timeout>
-    </SLEEP>
-
-    <ATTEMPTS>
-        <verify>3</verify>
-        <push>3</push>
-    </ATTEMPTS>
-
-    <DATABASE>
-        <file>/tmp/ScalingMaxIntentDBWFO</file>
-        <nic>1gig</nic>
-        <node>baremetal</node>
-    </DATABASE>
-
-    <LINK>
-        <ingress>0000000000000001/5</ingress>
-        <egress>0000000000000007/5</egress>
-    </LINK>
-
-    # CASE10
-    <NULL>
-        # CASE20
-        <PUSH>
-            <batch_size>1000</batch_size>
-            <min_intents>10000</min_intents>
-            <max_intents>70000</max_intents>
-            <check_interval>10000</check_interval>
-        </PUSH>
-
-        # if reroute is true
-        <REROUTE>
-            <batch_size>1000</batch_size>
-            <min_intents>10000</min_intents>
-            <max_intents>1000000</max_intents>
-            <check_interval>100000</check_interval>
-        </REROUTE>
-    </NULL>
-
-    # CASE11
-    <OVS>
-        # CASE20
-        <PUSH>
-            <batch_size>1000</batch_size>
-            <min_intents>10000</min_intents>
-            <max_intents>500000</max_intents>
-            <check_interval>10000</check_interval>
-        </PUSH>
-
-        # if reroute is true
-        <REROUTE>
-            <batch_size>1000</batch_size>
-            <min_intents>10000</min_intents>
-            <max_intents>500000</max_intents>
-            <check_interval>10000</check_interval>
-        </REROUTE>
-    </OVS>
-
-
-</PARAMS>
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py b/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py
deleted file mode 100644
index 6177b1a..0000000
--- a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py
+++ /dev/null
@@ -1,516 +0,0 @@
-import sys
-import json
-import time
-import os
-'''
-SCPFscalingMaxIntents
-Push test Intents to onos
-CASE10: set up Null Provider
-CASE11: set up Open Flows
-Scale up when reach the Limited
-Start from 1 nodes, 8 devices. Then Scale up to 3,5,7 nodes
-Recommand batch size: 100, check interval: 100
-'''
-class SCPFscalingMaxIntentsWithFlowObj:
-    def __init__( self ):
-        self.default = ''
-
-    def CASE0( self, main):
-        import sys
-        import json
-        import time
-        import os
-        import imp
-
-        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.dependencyPath = main.testOnDirectory + \
-                main.params['DEPENDENCY']['path']
-        main.cellName = main.params[ 'ENV' ][ 'cellName' ]
-        main.apps = main.params[ 'ENV' ][ 'cellApps' ]
-        main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
-        main.scale = ( main.params[ 'SCALE' ] ).split( "," )
-        main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
-        main.timeout = int(main.params['SLEEP']['timeout'])
-        main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
-        main.installSleep = int( main.params[ 'SLEEP' ][ 'install' ] )
-        main.verifySleep = int( main.params[ 'SLEEP' ][ 'verify' ] )
-        main.rerouteSleep = int ( main.params['SLEEP']['reroute'] )
-        main.verifyAttempts = int( main.params['ATTEMPTS']['verify'] )
-        main.ingress = main.params['LINK']['ingress']
-        main.egress = main.params['LINK']['egress']
-        main.dbFileName = main.params['DATABASE']['file']
-        main.cellData = {} # for creating cell file
-        main.reroute = main.params['reroute']
-        main.threadID = 0
-
-        if main.reroute == "True":
-            main.reroute = True
-        else:
-            main.reroute = False
-
-        main.CLIs = []
-        main.setupSkipped = False
-
-        wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
-        gitBranch = main.params[ 'GIT' ][ 'branch' ]
-        gitPull = main.params[ 'GIT' ][ 'pull' ]
-        nic = main.params['DATABASE']['nic']
-        node = main.params['DATABASE']['node']
-        nic = main.params['DATABASE']['nic']
-        node = main.params['DATABASE']['node']
-        stepResult = main.TRUE
-
-        main.log.info("Cresting DB file")
-        with open(main.dbFileName, "w+") as dbFile:
-            dbFile.write("")
-
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="environment set up successfull",
-                                 onfail="environment set up Failed" )
-
-    def CASE1( self ):
-        # main.scale[ 0 ] determines the current number of ONOS controller
-        main.CLIs = []
-        main.numCtrls = int( main.scale[ 0 ] )
-        main.ONOSip = []
-        main.maxNumBatch = 0
-        main.AllONOSip = main.ONOSbench.getOnosIps()
-        for i in range(main.numCtrls):
-            main.ONOSip.append(main.AllONOSip[i])
-        main.log.info(main.ONOSip)
-
-        main.log.info( "Creating list of ONOS cli handles" )
-        for i in range(main.numCtrls):
-            main.CLIs.append( getattr( main, 'ONOScli%s' % (i+1) ) )
-
-        main.log.info(main.CLIs)
-        if not main.CLIs:
-            main.log.error( "Failed to create the list of ONOS cli handles" )
-            main.cleanup()
-            main.exit()
-
-        main.log.info( "Loading wrapper files" )
-        main.startUp = imp.load_source( wrapperFile1,
-                                        main.dependencyPath +
-                                        wrapperFile1 +
-                                        ".py" )
-
-        copyResult = main.ONOSbench.copyMininetFile( main.topology,
-                                                     main.dependencyPath,
-                                                     main.Mininet1.user_name,
-                                                     main.Mininet1.ip_address )
-
-        commit = main.ONOSbench.getVersion(report=True)
-        commit = commit.split(" ")[1]
-
-        if gitPull == 'True':
-            if not main.startUp.onosBuild( main, gitBranch ):
-                main.log.error( "Failed to build ONOS" )
-                main.cleanup()
-                main.exit()
-        else:
-            main.log.warn( "Did not pull new code so skipping mvn " +
-                           "clean install" )
-        with open(main.dbFileName, "a") as dbFile:
-            temp = "'" + commit + "',"
-            temp += "'" + nic + "',"
-            dbFile.write(temp)
-
-    def CASE2( self, main ):
-        """
-        - Uninstall ONOS cluster
-        - Verify ONOS start up
-        - Install ONOS cluster
-        - Connect to cli
-        """
-        main.log.info( "Starting up %s node(s) ONOS cluster" % main.numCtrls)
-        main.log.info( "Safety check, killing all ONOS processes" +
-                       " before initiating environment setup" )
-
-        for i in range( main.numCtrls ):
-            main.ONOSbench.onosDie( main.ONOSip[ i ] )
-
-        main.log.info( "NODE COUNT = %s" % 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()
-        stepResult = packageResult
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully created ONOS package",
-                                 onfail="Failed to create ONOS package" )
-
-        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.ONOSip[i] )
-            u_result = main.ONOSbench.onosUninstall( main.ONOSip[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.ONOSip[i] )
-            i_result = main.ONOSbench.onosInstall( node=main.ONOSip[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.ONOSip[i] + " status:" )
-            onos_status = main.ONOSbench.onosStatus( node=main.ONOSip[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.step(" Start ONOS cli using thread ")
-        startCliResult  = main.TRUE
-        pool = []
-
-        for i in range( int( main.numCtrls) ):
-            t = main.Thread( target=main.CLIs[i].startOnosCli,
-                             threadID=main.threadID,
-                             name="startOnosCli",
-                             args=[ main.ONOSip[i] ],
-                             kwargs = {"onosStartTimeout":main.timeout} )
-            pool.append(t)
-            t.start()
-            main.threadID = main.threadID + 1
-        for t in pool:
-            t.join()
-            startCliResult = startCliResult and t.result
-        time.sleep( main.startUpSleep )
-
-    def CASE10( self, main ):
-        """
-            Setting up null-provider
-        """
-        import json
-        # Activate apps
-        main.step("Activating null-provider")
-        appStatus = utilities.retry( main.CLIs[0].activateApp,
-                                     main.FALSE,
-                                     ['org.onosproject.null'],
-                                     sleep=main.verifySleep,
-                                     attempts=main.verifyAttempts )
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=appStatus,
-                                 onpass="Successfully activated null-provider",
-                                 onfail="Failed activate null-provider" )
-
-        # Setup the null-provider
-        main.step("Configuring null-provider")
-        cfgStatus = utilities.retry( main.ONOSbench.onosCfgSet,
-                                    main.FALSE,
-                                    [ main.ONOSip[0],
-                                      'org.onosproject.provider.nil.NullProviders', 'deviceCount 8'],
-                                    sleep=main.verifySleep,
-                                    attempts = main.verifyAttempts )
-        cfgStatus = cfgStatus and utilities.retry( main.ONOSbench.onosCfgSet,
-                                                   main.FALSE,
-                                                   [ main.ONOSip[0],
-                                                     'org.onosproject.provider.nil.NullProviders', 'topoShape reroute'],
-                                                   sleep=main.verifySleep,
-                                                   attempts = main.verifyAttempts )
-
-        cfgStatus = cfgStatus and utilities.retry( main.ONOSbench.onosCfgSet,
-                                                   main.FALSE,
-                                                   [ main.ONOSip[0],
-                                                     'org.onosproject.provider.nil.NullProviders', 'enabled true'],
-                                                   sleep=main.verifySleep,
-                                                   attempts = main.verifyAttempts )
-
-
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=cfgStatus,
-                                 onpass="Successfully configured null-provider",
-                                 onfail="Failed to configure null-provider" )
-
-        # give onos some time to settle
-        time.sleep(main.startUpSleep)
-
-        main.log.info("Setting default flows to zero")
-        main.defaultFlows = 0
-
-        main.step("Check status of null-provider setup")
-        caseResult = appStatus and cfgStatus
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=caseResult,
-                                 onpass="Setting up null-provider was successfull",
-                                 onfail="Failed to setup null-provider" )
-
-        # This tells the following cases if we are using the null-provider or ovs
-        main.switchType = "null:"
-
-        # If the null-provider setup was unsuccessfull, then there is no point to
-        # run the subsequent cases
-
-        time.sleep(main.startUpSleep)
-        main.step( "Balancing Masters" )
-
-        stepResult = main.FALSE
-        stepResult = utilities.retry( main.CLIs[0].balanceMasters,
-                                      main.FALSE,
-                                      [],
-                                      sleep=3,
-                                      attempts=3 )
-
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Balance masters was successfull",
-                                 onfail="Failed to balance masters")
-
-        time.sleep( 5 )
-        if not caseResult:
-            main.setupSkipped = True
-
-    def CASE11( self, main):
-        '''
-            Setting up mininet
-        '''
-        import json
-        import time 
-        devices = []
-        devices = main.CLIs[0].getAllDevicesId()
-        for d in devices:
-            main.CLIs[0].deviceRemove( d )
-
-        main.log.info("Set Intent Compiler use Flow Object")
-        main.CLIs[0].setCfg("org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
-        "useFlowObjectives", "true")
-        time.sleep(main.startUpSleep)
-        main.step('Starting mininet topology')
-        mnStatus = main.Mininet1.startNet(topoFile='~/mininet/custom/rerouteTopo.py')
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=mnStatus,
-                                 onpass="Successfully started Mininet",
-                                 onfail="Failed to activate Mininet" )
-
-        main.step("Assinging masters to switches")
-        switches = main.Mininet1.getSwitches()
-        swStatus = main.Mininet1.assignSwController( sw=switches.keys(), ip=main.ONOSip )
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=swStatus,
-                                 onpass="Successfully assigned switches to masters",
-                                 onfail="Failed assign switches to masters" )
-
-        time.sleep(main.startUpSleep)
-        # Balancing Masters
-        main.step( "Balancing Masters" )
-        stepResult = main.FALSE
-        stepResult = utilities.retry( main.CLIs[0].balanceMasters,
-                                      main.FALSE,
-                                      [],
-                                      sleep=3,
-                                      attempts=3 )
-
-        utilities.assert_equals( expect=main.TRUE,
-                                       actual=stepResult,
-                                       onpass="Balance masters was successfull",
-                                       onfail="Failed to balance masters" )
-
-        main.log.info("Getting default flows")
-        jsonSum = json.loads(main.CLIs[0].summary())
-        main.defaultFlows = jsonSum["flows"]
-
-        main.step("Check status of Mininet setup")
-        caseResult = mnStatus and swStatus
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=caseResult,
-                                 onpass="Successfully setup Mininet",
-                                 onfail="Failed setup Mininet" )
-
-        # This tells the following cases if we are using the null-provider or ovs
-        main.switchType = "of:"
-
-        time.sleep(main.startUpSleep)
-        main.step( "Balancing Masters" )
-
-        stepResult = main.FALSE
-        stepResult = utilities.retry( main.CLIs[0].balanceMasters,
-                                      main.FALSE,
-                                      [],
-                                      sleep=3,
-                                      attempts=3 )
-
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Balance masters was successfull",
-                                 onfail="Failed to balance masters")
-
-        time.sleep(5)
-        if not caseResult:
-            main.setupSkipped = True
-
-
-
-    def CASE20( self, main ):
-        if main.reroute:
-            main.minIntents = int(main.params['NULL']['REROUTE']['min_intents'])
-            main.maxIntents = int(main.params['NULL']['REROUTE']['max_intents'])
-            main.checkInterval = int(main.params['NULL']['REROUTE']['check_interval'])
-            main.batchSize = int(main.params['NULL']['REROUTE']['batch_size'])
-        else:
-            main.minIntents = int(main.params['NULL']['PUSH']['min_intents'])
-            main.maxIntents = int(main.params['NULL']['PUSH']['max_intents'])
-            main.checkInterval = int(main.params['NULL']['PUSH']['check_interval'])
-            main.batchSize = int(main.params['NULL']['PUSH']['batch_size'])
-
-        # check if the case needs to be skipped
-        if main.setupSkipped:
-            main.setupSkipped = False
-            main.skipCase()
-
-        # the index where the next intents will be installed
-        offfset = 0
-        # keeps track of how many intents have been installed
-        currIntents = 0
-        # keeps track of how many flows have been installed, set to 0 at start
-        currFlows = 0
-        # limit for the number of intents that can be installed
-        main.batchSize = int( int(main.batchSize)/int(main.numCtrls))
-        limit = main.maxIntents / main.batchSize
-        # total intents installed
-        totalIntents = 0
-
-        intentsState = None
-
-        offtmp = 0
-        main.step( "Pushing intents" )
-        stepResult = main.TRUE
-        # temp variable to contain the number of flows
-        flowsNum = 0
-        if main.numCtrls > 1:
-            # if more than one onos nodes, we should check more frequently
-            main.checkInterval = main.checkInterval/4
-
-        # make sure the checkInterval divisible batchSize
-        main.checkInterval = int( int( main.checkInterval / main.batchSize ) * main.batchSize )
-        flowTemp=0
-        totalFlows=0
-        verifyTotalIntents=0
-        for i in range(limit):
-
-            # Threads pool
-            pool = []
-
-            for j in range( int( main.numCtrls) ):
-                if main.numCtrls > 1:
-                    time.sleep( 1 )
-                offtmp = offfset + main.maxIntents * j
-                # Push intents by using threads
-                t = main.Thread( target=main.CLIs[j].pushTestIntents,
-                                 threadID=main.threadID,
-                                 name="Push-Test-Intents",
-                                 args=[ main.switchType + main.ingress,
-                                        main.switchType + main.egress,
-                                        main.batchSize ],
-                                 kwargs={ "offset": offtmp,
-                                          "options": "-i",
-                                          "timeout": main.timeout,
-                                          "background":False,
-                                          "noExit":True} )
-                pool.append(t)
-                t.start()
-                main.threadID = main.threadID + 1
-            for t in pool:
-                t.join()
-                stepResult = stepResult and t.result
-            offfset = offfset + main.batchSize
-
-            totalIntents = main.batchSize * main.numCtrls + totalIntents
-            if totalIntents >= main.minIntents and totalIntents % main.checkInterval == 0:
-                # if reach to minimum number and check interval, verify Intetns and flows
-                time.sleep( main.verifySleep * main.numCtrls )
-
-                main.log.info("Verify Intents states")
-                # k is a control variable for verify retry attempts
-                k = 1
-
-                while k <= main.verifyAttempts:
-                    # while loop for check intents by using REST api
-                    time.sleep(5)
-                    temp = 0
-                    intentsState = main.CLIs[0].checkIntentSummary(timeout=600)
-                    if intentsState:
-                        verifyTotalIntents = main.CLIs[0].getTotalIntentsNum(timeout=600)
-                        if temp < verifyTotalIntents:
-                            temp = verifyTotalIntents
-                        else:
-                            verifyTotalIntents = temp
-                        break
-                        main.log.info("Total Intents: {}".format( totalIntents) )
-                    k = k+1
-
-                totalFlows = main.CLIs[0].getTotalFlowsNum( timeout=600, noExit=True )
-                if flowTemp<totalFlows:
-                    flowTemp = totalFlows
-                else:
-                    totalFlows = flowTemp
-
-                if not intentsState:
-                    # If some intents are not installed, grep the previous flows list, and finished this test case
-                    main.log.warn( "Some intens did not install" )
-                    verifyTotalIntents = main.CLIs[0].getTotalIntentsNum(timeout=600)
-                    main.log.info("Total Intents: {}".format( totalIntents) )
-                    break
-
-        del main.scale[0]
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = intentsState,
-                                 onpass = "Successfully pushed and verified intents",
-                                 onfail = "Failed to push and verify intents" )
-
-        main.log.info( "Total Intents Installed before crash: {}".format( totalIntents ) )
-        main.log.info( "Total Flows ADDED before crash: {}".format( totalFlows ) )
-
-        main.step('clean up Mininet')
-        main.Mininet1.stopNet()
-        main.log.info("Writing results to DS file")
-        with open(main.dbFileName, "a") as dbFile:
-            # Scale number
-            temp = str(main.numCtrls)
-            temp += ",'" + "baremetal1" + "'"
-            # how many intents we installed before crash
-            temp += "," + str(totalIntents)
-            # how many flows we installed before crash
-            temp += "," + str(totalFlows)
-            # other columns in database, but we didn't use in this test
-            temp += "," + "0,0,0,0,0,0"
-            temp += "\n"
-            dbFile.write( temp )
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo b/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo
deleted file mode 100755
index 8e58be7..0000000
--- a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo
+++ /dev/null
@@ -1,101 +0,0 @@
-<TOPOLOGY>
-
-    <COMPONENT>
-
-        <ONOSbench>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosDriver</type>
-            <connect_order>1</connect_order>
-            <COMPONENTS>
-                <home>~/onos</home>
-                <nodes>7</nodes> 
-            </COMPONENTS>
-        </ONOSbench>
-
-        <ONOSrest1>
-            <host>OC1</host>
-            <port>8181</port>
-            <user>onos</user>
-            <password>rocks</password>
-            <type>OnosRestDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </ONOSrest1>
-        <ONOScli1>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli1>
-
-        <ONOScli2>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli2>
-
-        <ONOScli3>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>4</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli3>
-
-        <ONOScli4>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>5</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli4>
-
-        <ONOScli5>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>6</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli5>
-
-        <ONOScli6>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>7</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli6>
-
-        <ONOScli7>
-            <host>localhost</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>OnosCliDriver</type>
-            <connect_order>8</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOScli7>
-
-        <Mininet1>
-            <host>OCN</host>
-            <user>sdn</user>
-            <password>rocks</password>
-            <type>MininetCliDriver</type>
-            <connect_order>5</connect_order>
-            <COMPONENTS>
-            </COMPONENTS>
-        </Mininet1>
-
-    </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/__init__.py b/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/__init__.py
+++ /dev/null
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/dependencies/rerouteTopo.py b/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/dependencies/rerouteTopo.py
deleted file mode 100755
index 774f12f..0000000
--- a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/dependencies/rerouteTopo.py
+++ /dev/null
@@ -1,74 +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.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 MyTopo( Topo ):
-
-    def __init__( self ):
-        # Initialize topology
-        Topo.__init__( self )
-
-        host1 = self.addHost('h1', ip='10.1.0.1/24')
-        host2 = self.addHost('h2', ip='10.1.0.2/24')
-        host3 = self.addHost('h3', ip='10.1.0.3/24')
-        host4 = self.addHost('h4', ip='10.1.0.4/24')
-        host5 = self.addHost('h5', ip='10.1.0.5/24')
-        host6 = self.addHost('h6', ip='10.1.0.6/24')
-        host7 = self.addHost('h7', ip='10.1.0.7/24')
-
-        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' )
-
-
-        self.addLink(s1, host1)
-        self.addLink(s2, host2)
-        self.addLink(s3, host3)
-        self.addLink(s4, host4)
-        self.addLink(s5, host5)
-        self.addLink(s6, host6)
-        self.addLink(s7, host7)
-
-
-
-        self.addLink(s1,s2)
-        self.addLink(s2,s3)
-        self.addLink(s3,s4)
-        self.addLink(s4,s5)
-        self.addLink(s5,s6)
-        self.addLink(s6,s7)
-        self.addLink(s4,s8)
-        self.addLink(s8,s5)
-
-        topos = { 'mytopo': ( lambda: MyTopo() ) }
-
-# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
-
-def setupNetwork():
-    "Create network"
-    topo = MyTopo()
-    network = Mininet(topo=topo, autoSetMacs=True, controller=None)
-    network.start()
-    CLI( network )
-    network.stop()
-
-if __name__ == '__main__':
-    setLogLevel('info')
-    #setLogLevel('debug')
-    setupNetwork()
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/dependencies/startUp.py b/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/dependencies/startUp.py
deleted file mode 100644
index bf2a2b6..0000000
--- a/TestON/tests/SCPF/SCPFscalingMaxIntentsWithFlowObj/dependencies/startUp.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""
-    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/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index a195450..37c68c0 100755
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -294,7 +294,7 @@
         result = False
         count = 0
         while True:
-            count += 0
+            count += 1
             main.Mininet1.link( END1=end1, END2=end2, OPTION="up" )
             main.Mininet1.link( END2=end1, END1=end2, OPTION="up" )
             main.log.info(
