diff --git a/TestON/bin/cli.py b/TestON/bin/cli.py
index 488c359..13423a5 100755
--- a/TestON/bin/cli.py
+++ b/TestON/bin/cli.py
@@ -262,20 +262,24 @@
         '''
         options = self.initOptions(options)
         try :
-            for index, option in enumerate(args):
+            index = 0
+            while index < len( args ):
+                option = args[index]
                 if index > 0 :
-                    if re.match("logdir|mail|example|testdir|testcases|onoscell", option, flags = 0):
-                        index = index+1
-                        options[option] = args[index]
-                        options = self.testcasesInRange(index,option,args,options)
-                    elif re.match("--params", option, flags=0):
+                    if re.match("--params", option, flags=0):
                         # check if there is a params
-                        index = index + 1
-                        options['params'].append(args[index])
+                        options['params'].append(args[index+1])
+                    elif re.match("logdir|mail|example|testdir|testcases|onoscell", option, flags = 0):
+                        options[option] = args[index+1]
+                        options = self.testcasesInRange(index+1,option,args,options)
+                    index += 2
                 else :
                     options['testname'] = option
+                    index += 1
         except IndexError as e:
-            print e
+            print (e)
+            main.cleanup()
+            main.exit()
 
         return options
 
diff --git a/TestON/core/graph.py b/TestON/core/graph.py
index 849baa4..e8c8a7a 100644
--- a/TestON/core/graph.py
+++ b/TestON/core/graph.py
@@ -135,8 +135,9 @@
                                                                                                                                    attributeValueA,
                                                                                                                                    attributeValueB ) )
             if not result:
-                main.log.debug( "Graph: graphDictA: {}".format( graphDictA ) )
-                main.log.debug( "Graph: graphDictB: {}".format( graphDictB ) )
+                #main.log.debug( "Graph: graphDictA: {}".format( graphDictA ) )
+                #main.log.debug( "Graph: graphDictB: {}".format( graphDictB ) )
+                pass
             return result
         except TypeError:
             main.log.exception( "Graph: TypeError exception found" )
@@ -167,7 +168,7 @@
             for chain in self.chains:
                 for edge in chain:
                     nonCutEdges.append( edge )
-            main.log.debug( 'Non-cut-edges: {}'.format( nonCutEdges ) )
+            #main.log.debug( 'Non-cut-edges: {}'.format( nonCutEdges ) )
             return nonCutEdges
         except Exception:
             main.log.exception( "Graph: Uncaught exception" )
@@ -191,14 +192,14 @@
                 # chain, the chain is a cycle chain
                 if chain[ 0 ][ 0 ] == chain[ -1 ][ 1 ]:
                     cycleChains.append( chain )
-            main.log.debug( 'Cycle chains: {}'.format( cycleChains ) )
+            #main.log.debug( 'Cycle chains: {}'.format( cycleChains ) )
             # Get a set of vertices which are the first vertices of a cycle chain (excluding the first
             # cycle chain), and these vertices are a subset of all cut-vertices
             subsetOfCutVertices = []
             if len( cycleChains ) > 1:
                 for cycleChain in cycleChains[ 1: ]:
                     subsetOfCutVertices.append( cycleChain[ 0 ][ 0 ] )
-            main.log.debug( 'Subset of cut vertices: {}'.format( subsetOfCutVertices ) )
+            #main.log.debug( 'Subset of cut vertices: {}'.format( subsetOfCutVertices ) )
             nonCutVertices = []
             assert nonCutEdges != None
             for vertex in self.graphDict.keys():
@@ -213,7 +214,7 @@
                         break
                 if vertexIsNonCut:
                     nonCutVertices.append( vertex )
-            main.log.debug( 'Non-cut-vertices: {}'.format( nonCutVertices ) )
+            #main.log.debug( 'Non-cut-vertices: {}'.format( nonCutVertices ) )
             return nonCutVertices
         except KeyError:
             main.log.exception( "Graph: KeyError exception found" )
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 2f0b28a..e3b50a5 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -414,7 +414,7 @@
         argument is given.
 
         Optional Arguments:
-            result: Case insensite string. Can be 'PASS' or 'FAIL' and will set
+            result: Case insensitive string. Can be 'PASS' or 'FAIL' and will set
                     the case result accordingly.
             msg: Message to be printed when the case is skipped in the reports.
         """
@@ -951,7 +951,7 @@
             if not re.search( ".=.", param ):
                 print( "Error when parsing params: params should follow key=value format" )
                 continue
-            # Split the param string to netest keys and value
+            # Split the param string to catch nested keys and the value
             [ keys, value ] = param.split( "=" )
             # Split the nested keys according to its hierarchy
             keyList = keys.split( "/" )
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 9f4dd29..8eb26ae 100755
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -4931,3 +4931,40 @@
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             return None
+
+    def getIntentPerfSummary( self ):
+        '''
+        Send command to check intent-perf summary
+        Returns: dictionary for intent-perf summary
+                 if something wrong, function will return None
+        '''
+        cmd = "intent-perf -s"
+        respDic = {}
+        resp = self.sendline( cmd )
+        try:
+            # Generate the dictionary to return
+            for l in resp.split( "\n" ):
+                # Delete any white space in line
+                temp = re.sub( r'\s+', '', l )
+                temp = temp.split( ":" )
+                respDic[ temp[0] ] = temp[ 1 ]
+
+        except (TypeError, ValueError):
+            main.log.exception( self.name + ": Object not as expected" )
+            return None
+        except KeyError:
+            main.log.exception( self.name + ": KeyError exception found" )
+            return None
+        except AssertionError:
+            main.log.exception( self.name + ": AssertionError exception found" )
+            return None
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":    " + self.handle.before )
+            return None
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            return None
+        return respDic
+
+
diff --git a/TestON/install.sh b/TestON/install.sh
index dee85c9..4bbfe92 100755
--- a/TestON/install.sh
+++ b/TestON/install.sh
@@ -63,13 +63,20 @@
 echo "Installing TestON dependencies"
 if [ "$DIST" = "Fedora" ]; then
     # Fedora may have vlan enabled by default. Still need to confirm and update later
-    $install python-pip build-essential python-dev pep8 arping python3-requests
+    $install python-pip build-essential python-dev pep8 python3-requests
     $pipinstall pexpect==3.2 configobj==4.7.2 numpy
 else
-    $install python-pip build-essential python-dev pep8 vlan arping python3-requests
+    $install python-pip build-essential python-dev pep8 vlan python3-requests
     $pipinstall pexpect==3.2 configobj==4.7.2 numpy
 fi
 
+# Some Distos have this already from another package
+if which arping > /dev/null ; then
+    echo "Arping command detected, skipping package installation."
+else
+    $install arping
+fi
+
 # Add check here to make sure OnosSystemTest is cloned into home directory (place holder)
 
 # Add symbolic link to main TestON folder in Home dir
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
index 848e4cc..0805112 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
@@ -20,7 +20,7 @@
     # 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,70,[30,21,31,32,21,33]*500,100
+        0,1,2,3,70
     </testcases>
 
     <TEST>
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index 11459b3..42c0ff7 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -806,30 +806,26 @@
                 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 )
+                    main.eventGenerator.triggerEvent( EventType().APP_INTENT_HOST_ADD, EventScheduleMethod().RUN_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 )
+                    main.eventGenerator.triggerEvent( EventType().APP_INTENT_HOST_DEL, EventScheduleMethod().RUN_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' )
+                    main.eventGenerator.triggerEvent( EventType().APP_INTENT_POINT_ADD, EventScheduleMethod().RUN_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' )
+                    main.eventGenerator.triggerEvent( EventType().APP_INTENT_POINT_DEL, EventScheduleMethod().RUN_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
@@ -849,7 +845,6 @@
             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()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/EventScheduler.py b/TestON/tests/CHOTestMonkey/dependencies/EventScheduler.py
index 99ead73..ae32932 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/EventScheduler.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/EventScheduler.py
@@ -78,7 +78,7 @@
             else:
                 main.log.warn( "Event Scheduler - invalid index when isnerting event: %s" % ( index ) )
             self.pendingEventsCondition.notify()
-        self.printEvents()
+        #self.printEvents()
 
     def startScheduler( self ):
         """
@@ -127,7 +127,7 @@
 
         with self.runningEventsCondition:
             self.runningEvents.append( eventTuple )
-        self.printEvents()
+        #self.printEvents()
         rerunNum = 0
         result = eventTuple.startEvent()
         while result == EventStates().FAIL and rerunNum < eventTuple.maxRerunNum:
@@ -150,7 +150,7 @@
                     if len( self.pendingEvents ) == 0:
                         with self.idleCondition:
                             self.idleCondition.notify()
-        self.printEvents()
+        #self.printEvents()
 
     def printEvents( self ):
         """
@@ -172,18 +172,18 @@
             if len( self.pendingEvents ) > 0:
                 events += str( self.pendingEvents[ -1 ].typeIndex )
         events += "]"
-        #main.log.debug( "Event Scheduler - Events: " + events )
+        main.log.debug( "Event Scheduler - Events: " + events )
 
     def isAvailable( self ):
-        with self.pendingEventsCondition:
-            with self.runningEventsCondition:
+        with self.runningEventsCondition:
+            with self.pendingEventsCondition:
                 return len( self.pendingEvents ) < self.pendingEventsCapacity and\
                        len( self.runningEvents ) < self.runningEventsCapacity and\
                        self.isRunning
 
     def isIdle( self ):
-        with self.pendingEventsCondition:
-            with self.runningEventsCondition:
+        with self.runningEventsCondition:
+            with self.pendingEventsCondition:
                 return len( self.pendingEvents ) == 0 and\
                        len( self.runningEvents ) == 0 and\
                        self.isRunning
diff --git a/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py b/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
index 6831811..e9dff29 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
@@ -33,7 +33,7 @@
         self.default = ''
         self.type = 'INTENT'
         self.id = id
-        self.expectedState = 'INSTALLED'
+        self.expectedState = 'UNKNOWN'
 
     def isHostIntent( self ):
         return self.type == 'INTENT_HOST'
@@ -47,12 +47,6 @@
     def isInstalled( self ):
         return self.expectedState == 'INSTALLED'
 
-    def setFailed( self ):
-        self.expectedState = 'FAILED'
-
-    def setInstalled( self ):
-        self.expectedState = 'INSTALLED'
-
 class HostIntent( Intent ):
     def __init__( self, id, hostA, hostB ):
         Intent.__init__( self, id )
@@ -62,6 +56,22 @@
         self.deviceA = hostA.device
         self.deviceB = hostB.device
 
+    def setWithdrawn( self ):
+        self.expectedState = 'WITHDRAWN'
+        if self.hostB in self.hostA.correspondents:
+            self.hostA.correspondents.remove( self.hostB )
+        if self.hostA in self.hostB.correspondents:
+            self.hostB.correspondents.remove( self.hostA )
+
+    def setFailed( self ):
+        self.expectedState = 'FAILED'
+
+    def setInstalled( self ):
+        if self.expectedState == 'UNKNOWN':
+            self.hostA.correspondents.append( self.hostB )
+            self.hostB.correspondents.append( self.hostA )
+        self.expectedState = 'INSTALLED'
+
     def __str__( self ):
         return "ID: " + self.id
 
@@ -72,5 +82,22 @@
         self.deviceA = deviceA
         self.deviceB = deviceB
 
+    def setWithdrawn( self ):
+        self.expectedState = 'WITHDRAWN'
+        for hostA in self.deviceA.hosts:
+            for hostB in self.deviceB.hosts:
+                if hostB in hostA.correspondents:
+                    hostA.correspondents.remove( hostB )
+
+    def setFailed( self ):
+        self.expectedState = 'FAILED'
+
+    def setInstalled( self ):
+        if self.expectedState == 'UNKNOWN':
+            for hostA in self.deviceA.hosts:
+                for hostB in self.deviceB.hosts:
+                    hostA.correspondents.append( hostB )
+        self.expectedState = 'INSTALLED'
+
     def __str__( self ):
         return "ID: " + self.id
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
index 8113b09..07c8cb6 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
@@ -71,47 +71,51 @@
                 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:
-                    for host in main.hosts:
-                        if host.name == args[ 0 ]:
-                            self.hostA = host
-                        elif host.name == args[ 1 ]:
-                            self.hostB = host
-                        if self.hostA != None and self.hostB != None:
-                            break
-                    if self.hostA == None:
-                        main.log.warn( "Host %s does not exist: " % ( args[ 0 ] ) )
+                try:
+                    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
-                    if self.hostB == None:
-                        main.log.warn( "Host %s does not exist: " % ( args[ 1 ] ) )
+                    else:
+                        for host in main.hosts:
+                            if host.name == args[ 0 ]:
+                                self.hostA = host
+                            elif host.name == args[ 1 ]:
+                                self.hostB = host
+                            if self.hostA != None and self.hostB != None:
+                                break
+                        if self.hostA == None:
+                            main.log.warn( "Host %s does not exist: " % ( args[ 0 ] ) )
+                            return EventStates().ABORT
+                        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
-                index = int( args[ 2 ] )
-                if index < 1 or index > int( main.numCtrls ):
-                    main.log.warn( "%s - invalid argument: %s" % ( self.typeString, index ) )
+                    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()
+                except Exception:
+                    main.log.warn( "Caught exception, aborting event" )
                     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 ):
     """
@@ -144,11 +148,9 @@
                 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()
+                else:
+                    newHostIntent.setInstalled()
                 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" )
@@ -184,10 +186,8 @@
                 main.log.warn( self.typeString + " - delete host intent failed" )
                 return EventStates().FAIL
             with main.variableLock:
+                targetIntent.setWithdrawn()
                 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" )
@@ -212,57 +212,61 @@
                 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 ]:
-                            self.deviceA = device
-                        elif device.name == args[ 1 ]:
-                            self.deviceB = device
-                        if self.deviceA != None and self.deviceB != None:
-                            break
-                    if self.deviceA == None:
-                        main.log.warn( "Device %s does not exist: " % ( args[ 0 ] ) )
+                try:
+                    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
-                    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
-                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()
+                        for device in main.devices:
+                            if device.name == args[ 0 ]:
+                                self.deviceA = device
+                            elif device.name == args[ 1 ]:
+                                self.deviceB = device
+                            if self.deviceA != None and self.deviceB != None:
+                                break
+                        if self.deviceA == None:
+                            main.log.warn( "Device %s does not exist: " % ( args[ 0 ] ) )
+                            return EventStates().ABORT
+                        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
+                    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()
+                except Exception:
+                    main.log.warn( "Caught exception, aborting event" )
+                    return EventStates().ABORT
 
 class AddPointIntent( PointIntentEvent ):
     """
@@ -277,7 +281,7 @@
         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
+            # TODO: support multiple hosts under one device
             # Check whether there already exists some intent for the device pair
             # For now we should avoid installing overlapping intents
             for intent in main.intents:
@@ -288,15 +292,13 @@
                     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 )
+                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
@@ -304,11 +306,9 @@
                 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()
+                else:
+                    newPointIntent.setInstalled()
                 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" )
@@ -343,11 +343,8 @@
                 main.log.warn( self.typeString + " - delete point intent failed" )
                 return EventStates().FAIL
             with main.variableLock:
+                targetIntent.setWithdrawn()
                 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" )
diff --git a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.params b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.params
index 9bd9e6b..be4caec 100644
--- a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.params
+++ b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.params
@@ -9,7 +9,7 @@
     </ENV>
 
     <DEPENDENCY>
-        <path>/tests/SCPFhostLat/dependencies/</path>
+        <path>/tests/SCPF/SCPFhostLat/dependencies/</path>
         <topology>topo-perf-1h1s.py</topology>
     </DEPENDENCY>
 
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
index 7c7953a..cf4c6ac 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
@@ -1,6 +1,6 @@
 <PARAMS>
 
-    <testcases>1,2,1,2,1,2,1,2,1,2,1,2,1,2</testcases>
+    <testcases>0,1,2,1,2,1,2,1,2,1,2,1,2,1,2</testcases>
 
     <debugMode></debugMode>  #nothing means false
 
@@ -13,8 +13,8 @@
     <max>7</max>
 
     <GIT>
-        <autopull>off</autopull>
-        <checkout>master</checkout>
+        <gitPull>off</gitPull>
+        <gitBranch>master</gitBranch>
     </GIT>
 
     <CTRL>
@@ -44,6 +44,14 @@
 
     <MN><ip1>OCN</ip1></MN>
 
+    <SLEEP>
+        <startup>10</startup>
+        <install>10</install>
+        <verify>3</verify>
+        <reroute>3</reroute>
+        # timeout for pexpect
+        <timeout>300</timeout>
+    </SLEEP>
     <BENCH>
         <user>sdn</user>
         <ip1>OCN</ip1>
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
index a5944ac..6b333bc 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
@@ -1,346 +1,261 @@
-# ScaleOutTemplate
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
+'''
+SCPFintentEventTp
+    - Use intentperf app to generate a lot of intent install and withdraw events
+    - Test will run with 1,3,5,7 nodes, and with all neighbors
+    - Test will run 400 seconds and grep the overall rate from intent-perf summary
 
-import sys
-import os.path
+    yunpeng@onlab.us
+'''
+
 import time
 
 
 class SCPFintentEventTp:
-
     def __init__( self ):
         self.default = ''
 
-    def CASE1( self, main ):
-        import sys
-        import os.path
-        import time
+    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']
 
-        global init
-        try:
-            if type(init) is not bool:
-                init = False
-        except NameError:
-            init = False
+        main.case( "Pull onos branch and build onos on Teststation." )
 
-        #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']
+        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()
 
-        homeDir = os.path.expanduser('~')
+            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.cellName = main.params['ENV']['cellName']
+        main.Apps = main.params['ENV']['cellApps']
+        main.BENCHIp = main.params['BENCH']['ip1']
+        main.BENCHUser = main.params['BENCH']['user']
+        main.MN1Ip = main.params['MN']['ip1']
+        main.maxNodes = int(main.params['max'])
+        main.numSwitches = (main.params['TEST']['numSwitches']).split(",")
+        main.flowRuleBU = main.params['TEST']['flowRuleBUEnabled']
+        main.skipRelRsrc = main.params['TEST']['skipReleaseResourcesOnWithdrawal']
         main.flowObj = main.params['TEST']['flowObj']
+        main.startUpSleep = int(main.params['SLEEP']['startup'])
+        main.installSleep = int(main.params['SLEEP']['install'])
+        main.verifySleep = int(main.params['SLEEP']['verify'])
+        main.scale = (main.params['SCALE']).split(",")
+        main.testDuration = main.params[ 'TEST' ][ 'duration' ]
+        main.logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+        main.debug = main.params[ 'debugMode' ]
+        main.numKeys = main.params[ 'TEST' ][ 'numKeys' ]
+        main.timeout = int(main.params['SLEEP']['timeout'])
+        main.cyclePeriod = main.params[ 'TEST' ][ 'cyclePeriod' ]
         if main.flowObj == "True":
             main.flowObj = True
             main.dbFileName = main.params['DATABASE']['dbFlowObj']
         else:
             main.flowObj = False
             main.dbFileName = main.params['DATABASE']['dbName']
+        # Create DataBase file
+        main.log.info( "Create Database file " + main.dbFileName )
+        resultsDB = open( main.dbFileName, "w+" )
+        resultsDB.close()
 
-        main.exceptions = [0]*11
-        main.warnings = [0]*11
-        main.errors = [0]*11
+        # set neighbors
+        main.neighbors = "1"
 
-        # -- 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
+    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.pop(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) ) )
 
-            clusterCount = 0
-            ONOSIp = main.ONOSbench.getOnosIps()
-            print ONOSIp
-            print main.ONOSbench.onosIps.values()
+        if not main.CLIs:
+            main.log.error( "Failed to create the list of ONOS cli handles" )
+            main.cleanup()
+            main.exit()
 
-            scale = (main.params[ 'SCALE' ]).split(",")
-            clusterCount = int(scale[0])
+        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")
 
-            #Populate ONOSIp with ips from params
-            ONOSIp.extend(main.ONOSbench.getOnosIps())
+        for i in range( main.numCtrls ):
+            main.ONOSbench.onosDie( main.ONOSip[i] )
 
-            #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")
-            resultsDB = open(main.dbFileName, "w+")
-            resultsDB.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.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( "verify cells" )
-        verifyCellResult = main.ONOSbench.verifyCell()
+        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.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])
+        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
 
-        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")
+        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 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 )
 
-        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)
+        # config apps
+        main.CLIs[0].setCfg( "org.onosproject.store.flow.impl.DistributedFlowRuleStore",
+                            "backupEnabled " + main.flowRuleBU )
+        main.CLIs[0].setCfg( "org.onosproject.net.intent.impl.IntentManager",
+                                  "skipReleaseResourcesOnWithdrawal " + main.skipRelRsrc )
+        main.CLIs[0].setCfg( "org.onosproject.provider.nil.NullProviders", "deviceCount " + str(int(main.numCtrls*10)) )
+        main.CLIs[0].setCfg( "org.onosproject.provider.nil.NullProviders", "topoShape linear" )
+        main.CLIs[0].setCfg( "org.onosproject.provider.nil.NullProviders", "enabled true" )
         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.CLIs[0].setCfg("org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
+                                "useFlowObjectives", value="true")
+        time.sleep( main.startUpSleep )
 
-        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)
+        # balanceMasters
+        main.CLIs[0].balanceMasters()
+        time.sleep( main.startUpSleep )
 
-            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
-        time.sleep(5)
-
-        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
+    def CASE2(self, main):
         import numpy
-        import os.path
 
-        global currentNeighbors
-        neighbors = []
+        main.log.info( "Cluster Count = " + str( main.numCtrls ) )
+        # adjust neighbors
+        if main.numCtrls == 1:
+            main.neighbors = "0"
+            main.log.info( "Neighbors: 0" )
+        elif main.neighbors != "0":
+            main.neighbors = "0"
+            main.log.info( "Neighbors: 0" )
+        elif main.neighbors == "0":
+            main.neighbors = str( main.numCtrls - 1 )
+            main.log.info( "Neighbors: " + main.neighbors )
 
-        try:
-            currentNeighbors
-        except:
-            currentNeighbors = "0"
-            neighbors = ['0']
-        else:
-            if currentNeighbors == "r":      #reset
-                currentNeighbors = "a"
-                neighbors = ['0']
-            else:
-                currentNeighbors = "r"
-                neighbors = ['a']
+        main.log.info( "Config intent-perf app" )
+        main.CLIs[0].setCfg( "org.onosproject.intentperf.IntentPerfInstaller", "numKeys " + main.numKeys )
+        main.CLIs[0].setCfg( "org.onosproject.intentperf.IntentPerfInstaller", "numNeighbors " + str( main.neighbors ) )
+        main.CLIs[0].setCfg( "org.onosproject.intentperf.IntentPerfInstaller", "cyclePeriod " + main.cyclePeriod )
 
-        if clusterCount == 1:
-            currentNeighbors = "r"
+        main.log.info( "Starting intent-perf test for " + str(main.testDuration) + " seconds..." )
+        main.CLIs[0].sendline( "intent-perf-start" )
+        stop = time.time() + float( main.testDuration )
 
-        main.log.info("Cluster Count = " + str(clusterCount))
+        while time.time() < stop:
+            time.sleep(15)
+            result = main.CLIs[0].getIntentPerfSummary()
+            if result:
+                for ip in main.ONOSip:
+                    main.log.info( "Node {} Overall Rate: {}".format( ip, result[ip] ) )
+        main.log.info( "Stop intent-perf" )
+        for node in main.CLIs:
+            node.sendline( "intent-perf-stop" )
+        if result:
+            for ip in main.ONOSip:
+                main.log.info( "Node {} final Overall Rate: {}".format( ip, result[ip] ) )
 
-        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(main.dbFileName, "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"])
-
+        with open( main.dbFileName, "a" ) as resultDB:
+            for nodes in range( 0, len( main.ONOSip ) ):
+                resultString = "'" + main.commit + "',"
+                resultString += "'1gig',"
+                resultString += str(main.numCtrls) + ","
+                resultString += "'baremetal" + str( nodes+1 ) + "',"
+                resultString += main.neighbors + ","
+                resultString += result[ main.ONOSip[ nodes ] ]+","
+                resultString += str(0) + "\n"  # no stddev
+                resultDB.write( resultString )
+        resultDB.close()
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
index 7dbda89..7c69450 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
@@ -15,6 +15,7 @@
         <warmUp>5</warmUp>
         <sampleSize>20</sampleSize>
         <intents>1,100,1000</intents>                       #list format, will be split on ','
+        <FObjintents>1,100</FObjintents>
         <ingress>null:0000000000000001/0</ingress>
         <egress>null:0000000000000007/0</egress>
         <debug>False</debug>
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index b282ebf..93c467c 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -77,7 +77,6 @@
         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']
@@ -86,9 +85,11 @@
         if main.flowObj == "True":
             main.flowObj = True
             main.dbFileName = main.params['DATABASE']['dbFlowObj']
+            main.intentsList = (main.params['TEST']['FObjintents']).split(",")
         else:
             main.flowObj = False
             main.dbFileName = main.params['DATABASE']['dbName']
+            main.intentsList = (main.params['TEST']['intents']).split(",")
 
         for i in range(0, len(main.intentsList)):
             main.intentsList[i] = int(main.intentsList[i])
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
index 0d8687e..0a81dc6 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
@@ -9,6 +9,11 @@
         <cellApps>drivers,metrics,openflow</cellApps>
     </ENV>
 
+    <DEPENDENCY>
+        <path>/tests/SCPF/SCPFportLat/dependencies/</path>
+        <topology>topo-perf-2sw.py</topology>
+    </DEPENDENCY>
+
     <GIT>
         <autopull>off</autopull>
         <checkout>master</checkout>
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
index 35147ca..e6f62ef 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
@@ -21,6 +21,7 @@
             init = False
 
         #Load values from params file
+        main.testOnDirectory = os.path.dirname(os.getcwd())
         checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
         gitPull = main.params[ 'GIT' ][ 'autopull' ]
         cellName = main.params[ 'ENV' ][ 'cellName' ]
@@ -34,6 +35,9 @@
         topoCfgName = main.params['TEST']['topoConfigName']
         resultPath = main.params['DB']['portEventResultPath']
         skipMvn = main.params ['TEST']['mci']
+        main.topology = main.params['DEPENDENCY']['topology']
+        main.dependencyPath = main.testOnDirectory + \
+                              main.params['DEPENDENCY']['path']
         testONpath = re.sub( "(tests)$", "bin", main.testDir )  # TestON/bin
 
         # -- INIT SECTION, ONLY RUNS ONCE -- #
@@ -135,6 +139,10 @@
         verifyCellResult = main.ONOSbench.verifyCell()
 
         main.step('Starting mininet topology ')
+        copyResult = main.ONOSbench.copyMininetFile(main.topology,
+                                                    main.dependencyPath,
+                                                    main.Mininet1.user_name,
+                                                    main.Mininet1.ip_address)
         main.Mininet1.startNet()
 
         main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
diff --git a/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py b/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py
new file mode 100644
index 0000000..ad88767
--- /dev/null
+++ b/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py
@@ -0,0 +1,19 @@
+'''
+imple 2 switch topology for topologoy performance test
+'''
+
+from mininet.topo import Topo
+
+class MyTopo( Topo ):
+    def __init__(self):
+        Topo.__init__(self)
+        s1 = self.addSwitch( "s1", dpid="0000000000000001")
+        s2 = self.addSwitch( "s2", dpid="0000000000000002")
+
+        h1 = self.addHost( "h1" )
+        h2 = self.addHost( "h2" )
+        self.addLink( s1, s2 )
+        self.addLink( s1, h1 )
+        self.addLink( s2, h2 )
+
+topos = { 'mytopo': ( lambda: MyTopo() ) }
diff --git a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
index e905e5a..55cef23 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
@@ -88,7 +88,7 @@
             commit = main.ONOSbench.getVersion()       ####
             commit = (commit.split(" "))[1]
 
-            temp = testONpath.replace("bin","") + "tests/SCPFswitchLat/dependencies/"
+            temp = testONpath.replace("bin","") + "tests/SCPF/SCPFswitchLat/dependencies/"
             main.ONOSbench.scp( main.Mininet1,
                                 temp + "topo-perf-1sw.py",
                                 main.Mininet1.home,
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
index b516cc0..19ee08c 100755
--- a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
@@ -55,6 +55,7 @@
         """
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
             Testcaselib as run
+        import time
         if not hasattr( main, 'apps' ):
             run.initTest( main )
         description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
@@ -69,6 +70,7 @@
         # switch failure
         switch = main.params[ 'kill' ][ 'switch' ]
         run.killSwitch( main, switch, switches='7', links='24' )
+        time.sleep( main.switchSleep )
         run.pingAll( main, "CASE2_Failure" )
         run.recoverSwitch( main, switch, switches='8', links='32' )
         run.checkFlows( main, minFlowCount=350 )
@@ -125,6 +127,7 @@
         """
         from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
             Testcaselib as run
+        import time
         if not hasattr( main, 'apps' ):
             run.initTest( main )
         description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
@@ -139,6 +142,7 @@
         # switch failure
         switch = main.params[ 'kill' ][ 'switch' ]
         run.killSwitch( main, switch, switches='7', links='24' )
+        time.sleep( main.switchSleep )
         run.pingAll( main, "CASE4_Failure" )
         run.recoverSwitch( main, switch, switches='8', links='32' )
         run.checkFlows( main, minFlowCount=350 )
