Merge "Fix instalation of SDNIP-ICMP intents in FUNCintent"
diff --git a/TestON/bin/cleanup.sh b/TestON/bin/cleanup.sh
index 3f82161..f931eca 100755
--- a/TestON/bin/cleanup.sh
+++ b/TestON/bin/cleanup.sh
@@ -29,6 +29,5 @@
         echo "Restoring iptables rules on ${i}"
         ssh sdn@$i "sudo iptables -F"
         ssh sdn@$i "sudo iptables-restore < /etc/iptables/rules.v4"
-        exit 0
     done
 fi
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 54e7d0f..a34741a 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -181,7 +181,7 @@
                     main.log.info(
                         "Starting Mininet from topo file " +
                         topoFile )
-                    cmdString += topoFile + " "
+                    cmdString +=  "-E python " + topoFile + " "
                     if args is None:
                         args = ''
                         # TODO: allow use of args from .topo file?
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index ba2b37c..93f98b8 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -2508,7 +2508,7 @@
             nodesStr = self.nodes( jsonFormat=True )
             idList = []
             # Sample nodesStr output
-            # id=local, address=127.0.0.1:9876, state=ACTIVE *
+            # id=local, address=127.0.0.1:9876, state=READY *
             if not nodesStr:
                 main.log.info( "There are no nodes to get id from" )
                 return idList
@@ -3283,7 +3283,6 @@
                 response = self.app( appName, "activate" )
                 if check and response == main.TRUE:
                     for i in range(10):  # try 10 times then give up
-                        # TODO: Check with Thomas about this delay
                         status = self.appStatus( appName )
                         if status == "ACTIVE":
                             return main.TRUE
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index b55f98a..7dbf023 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -671,7 +671,7 @@
             main.exit()
 
     def createCellFile( self, benchIp, fileName, mnIpAddrs,
-                        appString, onosIpAddrs ):
+                        appString, onosIpAddrs, onosUser="sdn" ):
         """
         Creates a cell file based on arguments
         Required:
@@ -683,6 +683,8 @@
                   supported currently
             * ONOS IP addresses ( onosIpAddrs )
                 - Must be passed in as last arguments
+            * ONOS USER (onosUser)
+                - optional argument to set ONOS_USER environment variable
 
         NOTE: Assumes cells are located at:
             ~/<self.home>/tools/test/cells/
@@ -702,6 +704,8 @@
         # Note that you  may not want certain apps listed
         # on here.
         appString = "export ONOS_APPS=" + appString
+        onosGroup = "export ONOS_GROUP=" + onosUser
+        onosUser = "export ONOS_USER=" + onosUser
         mnString = "export OCN="
         if mnIpAddrs == "":
             mnString = ""
@@ -734,6 +738,8 @@
             cellFile.write( "export OCI=$OC1\n" )
             cellFile.write( mnString + "\"" + mnIpAddrs + "\"\n" )
             cellFile.write( appString + "\n" )
+            cellFile.write( onosGroup + "\n" )
+            cellFile.write( onosUser + "\n" )
             cellFile.close()
 
             # We use os.system to send the command to TestON cluster
@@ -936,6 +942,8 @@
             i = self.handle.expect( [ "Network\sis\sunreachable",
                                       "onos\sstart/running,\sprocess",
                                       "ONOS\sis\salready\sinstalled",
+                                      "already\sup-to-date",
+                                      "\$",
                                       pexpect.TIMEOUT ], timeout=60 )
             if i == 0:
                 main.log.warn( "Network is unreachable" )
@@ -953,6 +961,13 @@
                 self.handle.expect( "\$" )
                 return main.TRUE
             elif i == 3:
+                main.log.info( "ONOS is already installed on " + node )
+                self.handle.expect( "\$" )
+                return main.TRUE
+            elif i == 4:
+                main.log.info( "ONOS was installed on " + node )
+                return main.TRUE
+            elif i == 5:
                 main.log.info(
                     "Installation of ONOS on " +
                     node +
@@ -982,16 +997,22 @@
             i = self.handle.expect( [
                 "Job\sis\salready\srunning",
                 "start/running",
+                "\$",
                 "Unknown\sinstance",
                 pexpect.TIMEOUT ], timeout=120 )
-            self.handle.expect( "\$" )
             if i == 0:
+                self.handle.expect( "\$" )
                 main.log.info( "Service is already running" )
                 return main.TRUE
             elif i == 1:
+                self.handle.expect( "\$" )
+                main.log.info( "ONOS service started" )
+                return main.TRUE
+            elif i == 2:
                 main.log.info( "ONOS service started" )
                 return main.TRUE
             else:
+                self.handle.expect( "\$" )
                 main.log.error( "ONOS service failed to start" )
                 main.cleanup()
                 main.exit()
@@ -1019,18 +1040,24 @@
                 "stop/waiting",
                 "Could not resolve hostname",
                 "Unknown\sinstance",
+                "\$",
                 pexpect.TIMEOUT ], timeout=60 )
-            self.handle.expect( "\$" )
             if i == 0:
+                self.handle.expect( "\$" )
                 main.log.info( "ONOS service stopped" )
                 return main.TRUE
             elif i == 1:
+                self.handle.expect( "\$" )
                 main.log.info( "onosStop() Unknown ONOS instance specified: " +
                                str( nodeIp ) )
                 return main.FALSE
             elif i == 2:
+                self.handle.expect( "\$" )
                 main.log.warn( "ONOS wasn't running" )
                 return main.TRUE
+            elif i == 3:
+                main.log.info( "ONOS service stopped" )
+                return main.TRUE
             else:
                 main.log.error( "ONOS service failed to stop" )
                 return main.FALSE
@@ -1079,7 +1106,7 @@
         try:
             self.handle.sendline( "" )
             self.handle.expect( "\$" )
-            cmdStr = "onos-kill " + str( nodeIp )
+            cmdStr = "onos-die " + str( nodeIp )
             self.handle.sendline( cmdStr )
             i = self.handle.expect( [
                 "Killing\sONOS",
@@ -1663,13 +1690,15 @@
                                   " status" )
             i = self.handle.expect( [
                 "start/running",
+                "Running ...",
                 "stop/waiting",
+                "Not Running ...",
                 pexpect.TIMEOUT ], timeout=120 )
 
-            if i == 0:
+            if i == 0 or i == 1:
                 main.log.info( "ONOS is running" )
                 return main.TRUE
-            elif i == 1:
+            elif i == 2 or i == 3:
                 main.log.info( "ONOS is stopped" )
                 main.log.error( "ONOS service failed to check the status" )
                 main.cleanup()
diff --git a/TestON/tests/CHOtest/CHOtest.params b/TestON/tests/CHOtest/CHOtest.params
index 2062a4a..2098689 100644
--- a/TestON/tests/CHOtest/CHOtest.params
+++ b/TestON/tests/CHOtest/CHOtest.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    # 1,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*20,200,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*20,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*20
+    # 1,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*10,200,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*10,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*10
     # 1. Starts ONOS cluster with 5 nodes
     # 20. Starts Att Topology
     # 21. Starts Chordal Topology
@@ -17,9 +17,14 @@
     # 9X. Point,Multi-single,Single-Multi Intents
     # 19X. IPv6 ping across Point,Multi-single,Single-Multi Intents
 
-<testcases>
-1,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*10,200,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*10,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*10
-</testcases>
+    <testcases>
+    1,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*20,200,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*20,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*20
+    </testcases>
+
+    <DEPENDENCY>
+        <path>/tests/CHOtest/Dependencies/</path>
+        <wrapper>CHOtestFunctions</wrapper>
+    </DEPENDENCY>
 
     <GIT>
         #autoPull 'on' or 'off'
@@ -87,24 +92,25 @@
     </SPINECORELINKS>
 
     <timers>
-        <LinkDiscovery>15</LinkDiscovery>
+        <LinkDiscovery>10</LinkDiscovery>
         <SwitchDiscovery>10</SwitchDiscovery>
         <IntentPurgeDelay>15</IntentPurgeDelay>
         <CheckIntentDelay>15</CheckIntentDelay>
         <topoCheckDelay>15</topoCheckDelay>
-        <pingSleep>3</pingSleep>
-        <pingTimeout>300</pingTimeout>
-        <remHostDelay>5</remHostDelay>
-        <remDevDelay>10</remDevDelay>
+        <pingSleep>15</pingSleep>
+        <pingTimeoutSmallTopo>180</pingTimeoutSmallTopo>
+        <pingTimeoutLargeTopo>300</pingTimeoutLargeTopo>
+        <remHostDelay>60</remHostDelay>
+        <remDevDelay>60</remDevDelay>
     </timers>
 
     <TEST>
         <pauseTest>off</pauseTest>
         <email>off</email>
-        <intentChecks>8</intentChecks>
+        <intentChecks>10</intentChecks>
         <linkChecks>3</linkChecks>
         <topoChecks>3</topoChecks>
-        <numPings>5</numPings>
+        <numPings>3</numPings>
     </TEST>
 
 </PARAMS>
diff --git a/TestON/tests/CHOtest/CHOtest.py b/TestON/tests/CHOtest/CHOtest.py
index 40bd549..5c9d673 100644
--- a/TestON/tests/CHOtest/CHOtest.py
+++ b/TestON/tests/CHOtest/CHOtest.py
@@ -24,25 +24,33 @@
         onos-start-cli
         """
         import time
+        import re
+        import imp
 
         global intentState
         main.threadID = 0
+        main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
+        main.dependencyPath = main.testOnDirectory + \
+                              main.params[ 'DEPENDENCY' ][ 'path' ]
+        wrapperFile = main.params[ 'DEPENDENCY' ][ 'wrapper' ]
         main.numCtrls = main.params[ 'CTRL' ][ 'numCtrl' ]
         git_pull = main.params[ 'GIT' ][ 'autoPull' ]
         git_branch = main.params[ 'GIT' ][ 'branch' ]
         karafTimeout = main.params['CTRL']['karafCliTimeout']
+        main.linkSleep = int( main.params['timers']['LinkDiscovery'] )
         main.checkIntentsDelay = int( main.params['timers']['CheckIntentDelay'] )
+        main.pingSleep = int( main.params['timers']['pingSleep'] )
+        main.topoCheckDelay = int( main.params['timers']['topoCheckDelay'] )
+        main.pingTimeoutSmallTopo = int( main.params['timers']['pingTimeoutSmallTopo'] )
+        main.pingTimeoutLargeTopo = int( main.params['timers']['pingTimeoutLargeTopo'] )
+        main.remHostDelay = int( main.params['timers']['remHostDelay'] )
+        main.remDevDelay = int( main.params['timers']['remDevDelay'] )
         main.failSwitch = main.params['TEST']['pauseTest']
         main.emailOnStop = main.params['TEST']['email']
         main.intentCheck = int( main.params['TEST']['intentChecks'] )
         main.linkCheck = int( main.params['TEST']['linkChecks'] )
         main.topoCheck = int( main.params['TEST']['topoChecks'] )
         main.numPings = int( main.params['TEST']['numPings'] )
-        main.pingSleep = int( main.params['timers']['pingSleep'] )
-        main.topoCheckDelay = int( main.params['timers']['topoCheckDelay'] )
-        main.pingTimeout = int( main.params['timers']['pingTimeout'] )
-        main.remHostDelay = int( main.params['timers']['remHostDelay'] )
-        main.remDevDelay = int( main.params['timers']['remDevDelay'] )
         main.newTopo = ""
         main.CLIs = []
 
@@ -52,6 +60,11 @@
         for i in range( 1, int(main.numCtrls) + 1 ):
             main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
 
+        main.CHOtestFunctions = imp.load_source( wrapperFile,
+                                                 main.dependencyPath +
+                                                 wrapperFile +
+                                                 ".py" )
+
         main.case( "Set up test environment" )
         main.log.report( "Set up test environment" )
         main.log.report( "_______________________" )
@@ -159,6 +172,7 @@
             startCliResult = main.TRUE
 
         main.step( "Set IPv6 cfg parameters for Neighbor Discovery" )
+        time.sleep(30)
         cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.proxyarp.ProxyArp", "ipv6NeighborDiscovery", "true" )
         cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "ipv6NeighborDiscovery", "true" )
         cfgResult = cfgResult1 and cfgResult2
@@ -181,10 +195,11 @@
         import copy
 
         main.prefix = 0
-
         main.numMNswitches = int ( main.params[ 'TOPO1' ][ 'numSwitches' ] )
         main.numMNlinks = int ( main.params[ 'TOPO1' ][ 'numLinks' ] )
         main.numMNhosts = int ( main.params[ 'TOPO1' ][ 'numHosts' ] )
+        main.pingTimeout = main.pingTimeoutSmallTopo
+
         main.log.report(
             "Load Att topology and Balance all Mininet switches across controllers" )
         main.log.report(
@@ -245,11 +260,12 @@
         import copy
 
         main.prefix = 1
-
         main.newTopo = main.params['TOPO2']['topo']
         main.numMNswitches = int ( main.params[ 'TOPO2' ][ 'numSwitches' ] )
         main.numMNlinks = int ( main.params[ 'TOPO2' ][ 'numLinks' ] )
         main.numMNhosts = int ( main.params[ 'TOPO2' ][ 'numHosts' ] )
+        main.pingTimeout = main.pingTimeoutSmallTopo
+
         main.log.report(
             "Load Chordal topology and Balance all Mininet switches across controllers" )
         main.log.report(
@@ -307,12 +323,11 @@
         import copy
 
         main.prefix = 2
-
         main.newTopo = main.params['TOPO3']['topo']
         main.numMNswitches = int ( main.params[ 'TOPO3' ][ 'numSwitches' ] )
         main.numMNlinks = int ( main.params[ 'TOPO3' ][ 'numLinks' ] )
         main.numMNhosts = int ( main.params[ 'TOPO3' ][ 'numHosts' ] )
-        main.pingTimeout = 600
+        main.pingTimeout = main.pingTimeoutLargeTopo
 
         main.log.report(
             "Load Spine and Leaf topology and Balance all Mininet switches across controllers" )
@@ -562,13 +577,14 @@
             str( timeDiff ) +
             " seconds" )
 
-        if not pingResult:
-            main.stop()
-
         utilities.assert_equals( expect=main.TRUE, actual=pingResult,
                                  onpass="Reactive Mode IPv4 Pingall test PASS",
                                  onfail="Reactive Mode IPv4 Pingall test FAIL" )
 
+        if not pingResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
         main.step( "Disable Reactive forwarding" )
         appResult =  main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
         utilities.assert_equals( expect=main.TRUE, actual=appResult,
@@ -626,6 +642,10 @@
             str( timeDiff ) +
             " seconds" )
 
+        if not pingResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
         if pingResult == main.TRUE:
             main.log.report( "IPv4 Pingall Test in Reactive mode successful" )
         else:
@@ -687,6 +707,10 @@
             str( timeDiff ) +
             " seconds" )
 
+        if not pingResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
         if pingResult == main.TRUE:
             main.log.report( "IPv4 Pingall Test in Reactive mode successful" )
         else:
@@ -1005,22 +1029,18 @@
                                  onpass="Reactive mode ipv6Fowarding cfg is set to true",
                                  onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
 
-
+        main.step( "Discover hosts using ping" )
         numHosts = int( main.params['TOPO1']['numHosts'] )
-
         for i in range(numHosts):
             src = "h1"
             dest = "1000::" + str(i+1)
             main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
             main.Mininet1.handle.expect( "mininet>" )
             main.log.info( main.Mininet1.handle.before )
-
         hosts = main.CLIs[0].hosts( jsonFormat=False )
-
         main.log.info( hosts )
 
         main.step( "Disable Reactive forwarding" )
-
         main.log.info( "Uninstall IPv6 reactive forwarding app" )
         appCheck = main.TRUE
         appResults = main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
@@ -1075,22 +1095,18 @@
                                  onpass="Reactive mode ipv6Fowarding cfg is set to true",
                                  onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
 
-
+        main.step( "Discover hosts using ping" )
         numHosts = int( main.params['TOPO2']['numHosts'] )
-
         for i in range(numHosts):
             src = "h1"
             dest = "1000::" + str(i+1)
             main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
             main.Mininet1.handle.expect( "mininet>" )
             main.log.info( main.Mininet1.handle.before )
-
         hosts = main.CLIs[0].hosts( jsonFormat=False )
-
         main.log.info( hosts )
 
         main.step( "Disable Reactive forwarding" )
-
         main.log.info( "Uninstall IPv6 reactive forwarding app" )
         appCheck = main.TRUE
         appResults = main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
@@ -1145,22 +1161,18 @@
                                  onpass="Reactive mode ipv6Fowarding cfg is set to true",
                                  onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
 
-
+        main.step( "Discover hosts using ping" )
         numHosts = int( main.params['TOPO3']['numHosts'] )
-
         for i in range(11, numHosts+10):
             src = "h11"
             dest = "1000::" + str(i+1)
             main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
             main.Mininet1.handle.expect( "mininet>" )
             main.log.info( main.Mininet1.handle.before )
-
         hosts = main.CLIs[0].hosts( jsonFormat=False )
-
         main.log.info( hosts )
 
         main.step( "Disable Reactive forwarding" )
-
         main.log.info( "Uninstall IPv6 reactive forwarding app" )
         appCheck = main.TRUE
         appResults = main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
@@ -1307,79 +1319,20 @@
         """
         main.log.report( "Add 300 host intents and verify pingall (Att Topology)" )
         main.log.report( "_______________________________________" )
-        import itertools
-        import time
         main.case( "Install 300 host intents" )
+
         main.step( "Add host Intents" )
-        intentResult = main.TRUE
-        hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
-        intentIdList = []
-        time1 = time.time()
-        for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
-            pool = []
-            for cli in main.CLIs:
-                if i >= len( hostCombos ):
-                    break
-                t = main.Thread( target=cli.addHostIntent,
-                        threadID=main.threadID,
-                        name="addHostIntent",
-                        args=[hostCombos[i][0],hostCombos[i][1]])
-                pool.append(t)
-                t.start()
-                i = i + 1
-                main.threadID = main.threadID + 1
-            for thread in pool:
-                thread.join()
-                intentIdList.append(thread.result)
-        time2 = time.time()
-        main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
-
-        # Saving intent ids to check intents in later cases
+        intentIdList = main.CHOtestFunctions.installHostIntents()
         main.intentIds = list(intentIdList)
 
         main.step("Verify intents are installed")
-
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Waiting for onos to install intents...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
+        intentState = main.CHOtestFunctions.checkIntents()
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(3)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
+        pingResult = main.CHOtestFunctions.checkPingall()
         utilities.assert_equals( expect=main.TRUE, actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
@@ -1406,90 +1359,29 @@
         """
         main.log.report( "Add 300 host intents and verify pingall (Chordal Topo)" )
         main.log.report( "_______________________________________" )
-        import itertools
-
         main.case( "Install 300 host intents" )
+
         main.step( "Add host Intents" )
-        intentResult = main.TRUE
-        hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
-        intentIdList = []
-        time1 = time.time()
-
-        for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
-            pool = []
-            for cli in main.CLIs:
-                if i >= len( hostCombos ):
-                    break
-                t = main.Thread( target=cli.addHostIntent,
-                        threadID=main.threadID,
-                        name="addHostIntent",
-                        args=[hostCombos[i][0],hostCombos[i][1]])
-                pool.append(t)
-                t.start()
-                i = i + 1
-                main.threadID = main.threadID + 1
-            for thread in pool:
-                thread.join()
-                intentIdList.append(thread.result)
-        time2 = time.time()
-        main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
-
-        # Saving intent ids to check intents in later cases
+        intentIdList = main.CHOtestFunctions.installHostIntents()
         main.intentIds = list(intentIdList)
 
         main.step("Verify intents are installed")
-
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Waiting for onos to install intents...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intents Summary ****\n" + str(main.ONOScli1.intents(jsonFormat=False, summary=True)) )
-
+        intentState = main.CHOtestFunctions.checkIntents()
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
+        pingResult = main.CHOtestFunctions.checkPingall()
         utilities.assert_equals( expect=main.TRUE, actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
         caseResult = ( intentState and pingResult )
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=caseResult,
-            onpass="Install 300 Host Intents and Ping All test PASS",
-            onfail="Install 300 Host Intents and Ping All test FAIL" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=caseResult,
+                                 onpass="Install 300 Host Intents and Ping All test PASS",
+                                 onfail="Install 300 Host Intents and Ping All test FAIL" )
 
         if not intentState:
             main.log.debug( "Intents failed to install completely" )
@@ -1506,89 +1398,29 @@
         """
         main.log.report( "Add 2278 host intents and verify pingall (Spine Topo)" )
         main.log.report( "_______________________________________" )
-        import itertools
-
         main.case( "Install 2278 host intents" )
-        main.step( "Add host Intents" )
-        intentResult = main.TRUE
-        hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-        main.pingTimeout = 300
-        intentIdList = []
-        time1 = time.time()
-        for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
-            pool = []
-            for cli in main.CLIs:
-                if i >= len( hostCombos ):
-                    break
-                t = main.Thread( target=cli.addHostIntent,
-                        threadID=main.threadID,
-                        name="addHostIntent",
-                        args=[hostCombos[i][0],hostCombos[i][1]])
-                pool.append(t)
-                t.start()
-                i = i + 1
-                main.threadID = main.threadID + 1
-            for thread in pool:
-                thread.join()
-                intentIdList.append(thread.result)
-        time2 = time.time()
-        main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
 
-        # Saving intent ids to check intents in later cases
+        main.step( "Add host Intents" )
+        intentIdList = main.CHOtestFunctions.installHostIntents()
         main.intentIds = list(intentIdList)
 
         main.step("Verify intents are installed")
-
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Waiting for onos to install intents...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intents Summary ****\n" + str(main.ONOScli1.intents(jsonFormat=False, summary=True)) )
-
+        intentState = main.CHOtestFunctions.checkIntents()
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
+        pingResult = main.CHOtestFunctions.checkPingall()
         utilities.assert_equals( expect=main.TRUE, actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
         caseResult = ( intentState and pingResult )
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=caseResult,
-            onpass="Install 2278 Host Intents and Ping All test PASS",
-            onfail="Install 2278 Host Intents and Ping All test FAIL" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=caseResult,
+                                 onpass="Install 2278 Host Intents and Ping All test PASS",
+                                 onfail="Install 2278 Host Intents and Ping All test FAIL" )
 
         if not intentState:
             main.log.debug( "Intents failed to install completely" )
@@ -1605,24 +1437,12 @@
         """
         main.log.report( "Verify IPv6 ping across 300 host intents (Att Topology)" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all 300 host intents" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First pingall failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -1633,29 +1453,20 @@
             onpass="IPv6 Ping across 300 host intents test PASS",
             onfail="IPv6 Ping across 300 host intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE161( self ):
         """
         Verify IPv6 ping across 300 host intents (Chordal Topology)
         """
         main.log.report( "Verify IPv6 ping across 300 host intents (Chordal Topology)" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all 300 host intents" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First pingall failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
         utilities.assert_equals( expect=main.TRUE, actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
@@ -1667,29 +1478,20 @@
             onpass="IPv6 Ping across 300 host intents test PASS",
             onfail="IPv6 Ping across 300 host intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE162( self ):
         """
         Verify IPv6 ping across 2278 host intents (Spine Topology)
         """
         main.log.report( "Verify IPv6 ping across 2278 host intents (Spine Topology)" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all 2278 host intents" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First pingall failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
         utilities.assert_equals( expect=main.TRUE, actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
@@ -1701,6 +1503,10 @@
             onpass="IPv6 Ping across 2278 host intents test PASS",
             onfail="IPv6 Ping across 2278 host intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE70( self, main ):
         """
         Randomly bring some core links down and verify ping all ( Host Intents-Att Topo)
@@ -1716,7 +1522,6 @@
         link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
         link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
         switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Att Topo)" )
         main.log.report( "___________________________________________________________________________" )
@@ -1739,88 +1544,46 @@
                 END1=link1End1,
                 END2=main.randomLink1[ i ],
                 OPTION="down" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
             main.Mininet1.link(
                 END1=link2End1,
                 END2=main.randomLink2[ i ],
                 OPTION="down" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
             main.Mininet1.link(
                 END1=link3End1,
                 END2=main.randomLink3[ i ],
                 OPTION="down" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
 
         main.step("Verify link down is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkDown = main.ONOSbench.checkStatus(
-            topology_output, main.numMNswitches, str(
-                int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
-            if linkDown:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkDown,
-            onpass="Link down discovered properly",
-            onfail="Link down was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down",
+                                                          int( main.numMNlinks ) -
+                                                          int( switchLinksToToggle ) * 6 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkDown,
+                                 onpass="Link down discovered properly",
+                                 onfail="Link down was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
         caseResult = linkDown and pingResult and intentState
-        utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=caseResult,
                                  onpass="Random Link cut Test PASS",
                                  onfail="Random Link cut Test FAIL" )
 
@@ -1844,7 +1607,7 @@
         link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
         link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
         link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
         switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
 
         main.log.report(
@@ -1859,84 +1622,39 @@
                 END1=link1End1,
                 END2=main.randomLink1[ i ],
                 OPTION="up" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
             main.Mininet1.link(
                 END1=link2End1,
                 END2=main.randomLink2[ i ],
                 OPTION="up" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
             main.Mininet1.link(
                 END1=link3End1,
                 END2=main.randomLink3[ i ],
                 OPTION="up" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
 
         main.step("Verify link up is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkUp = main.ONOSbench.checkStatus(
-                topology_output,
-                main.numMNswitches,
-                str( main.numMNlinks ) )
-            if linkUp:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkUp,
-            onpass="Link up discovered properly",
-            onfail="Link up was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up",
+                                                        int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -1971,7 +1689,7 @@
         link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
         link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
         switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report( "Randomly bring some core links down and verify ping all (Point Intents-Att Topo)" )
         main.log.report( "___________________________________________________________________________" )
@@ -1994,83 +1712,39 @@
                 END1=link1End1,
                 END2=main.randomLink1[ i ],
                 OPTION="down" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
             main.Mininet1.link(
                 END1=link2End1,
                 END2=main.randomLink2[ i ],
                 OPTION="down" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
             main.Mininet1.link(
                 END1=link3End1,
                 END2=main.randomLink3[ i ],
                 OPTION="down" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
 
         main.step("Verify link down is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkDown = main.ONOSbench.checkStatus(
-            topology_output, main.numMNswitches, str(
-                int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
-            if linkDown:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkDown,
-            onpass="Link down discovered properly",
-            onfail="Link down was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down",
+                                                          int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkDown,
+                                 onpass="Link down discovered properly",
+                                 onfail="Link down was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -2099,7 +1773,7 @@
         link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
         link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
         link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
         switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
 
         main.log.report(
@@ -2114,84 +1788,38 @@
                 END1=link1End1,
                 END2=main.randomLink1[ i ],
                 OPTION="up" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
             main.Mininet1.link(
                 END1=link2End1,
                 END2=main.randomLink2[ i ],
                 OPTION="up" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
             main.Mininet1.link(
                 END1=link3End1,
                 END2=main.randomLink3[ i ],
                 OPTION="up" )
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
 
         main.step("Verify link up is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkUp = main.ONOSbench.checkStatus(
-                topology_output,
-                main.numMNswitches,
-                str( main.numMNlinks ) )
-            if linkUp:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkUp,
-            onpass="Link up discovered properly",
-            onfail="Link up was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -2217,7 +1845,7 @@
         """
         import random
         import itertools
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Chordal Topo)" )
         main.log.report( "___________________________________________________________________________" )
@@ -2236,73 +1864,28 @@
                 END1=switch[0],
                 END2=switch[1],
                 OPTION="down")
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
 
         main.step("Verify link down is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkDown = main.ONOSbench.checkStatus(
-            topology_output, main.numMNswitches, str(
-                int( main.numMNlinks ) - 5 * 2 ) )
-            if linkDown:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkDown,
-            onpass="Link down discovered properly",
-            onfail="Link down was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 5 * 2 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkDown,
+                                 onpass="Link down discovered properly",
+                                 onfail="Link down was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -2328,7 +1911,7 @@
         Bring the core links up that are down and verify ping all ( Host Intents Chordal Topo )
         """
         import random
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report(
             "Bring the core links up that are down and verify ping all (Host Intents-Chordal Topo" )
@@ -2343,74 +1926,28 @@
                 END1=switch[0],
                 END2=switch[1],
                 OPTION="up")
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
 
         main.step("Verify link up is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkUp = main.ONOSbench.checkStatus(
-                topology_output,
-                main.numMNswitches,
-                str( main.numMNlinks ) )
-            if linkUp:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkUp,
-            onpass="Link up discovered properly",
-            onfail="Link up was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -2436,7 +1973,7 @@
         """
         import random
         import itertools
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report( "Randomly bring some core links down and verify ping all ( Point Intents-Chordal Topo)" )
         main.log.report( "___________________________________________________________________________" )
@@ -2455,73 +1992,28 @@
                 END1=switch[0],
                 END2=switch[1],
                 OPTION="down")
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
 
         main.step("Verify link down is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkDown = main.ONOSbench.checkStatus(
-            topology_output, main.numMNswitches, str(
-                int( main.numMNlinks ) - 5 * 2 ) )
-            if linkDown:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkDown,
-            onpass="Link down discovered properly",
-            onfail="Link down was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 5 * 2 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkDown,
+                                 onpass="Link down discovered properly",
+                                 onfail="Link down was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -2547,7 +2039,7 @@
         Bring the core links up that are down and verify ping all ( Point Intents Chordal Topo )
         """
         import random
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report(
             "Bring the core links up that are down and verify ping all ( Point Intents-Chordal Topo" )
@@ -2562,74 +2054,28 @@
                 END1=switch[0],
                 END2=switch[1],
                 OPTION="up")
-            time.sleep( link_sleep )
+            time.sleep( main.linkSleep )
 
         main.step("Verify link up is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkUp = main.ONOSbench.checkStatus(
-                topology_output,
-                main.numMNswitches,
-                str( main.numMNlinks ) )
-            if linkUp:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkUp,
-            onpass="Link up discovered properly",
-            onfail="Link up was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -2664,7 +2110,7 @@
         link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
         link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' )
         link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' )
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
         main.log.report( "___________________________________________________________________________" )
@@ -2684,75 +2130,30 @@
         # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" )
         # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" )
         main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" )
-        time.sleep( link_sleep )
+        time.sleep( main.linkSleep )
         main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
-        time.sleep( link_sleep )
+        time.sleep( main.linkSleep )
 
-        main.step("Verify link down is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
+        main.step( "Verify link down is discoverd by onos" )
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 4 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkDown,
+                                 onpass="Link down discovered properly",
+                                 onfail="Link down was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
-            topology_output = main.ONOScli1.topology()
-            linkDown = main.ONOSbench.checkStatus(
-            topology_output, main.numMNswitches, str(
-                int( main.numMNlinks ) - 4 ))
-            if linkDown:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkDown,
-            onpass="Link down discovered properly",
-            onfail="Link down was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
-
-        main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        main.step( "Verify intents are installed" )
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -2780,7 +2181,7 @@
         import random
         link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
         link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
         main.log.report(
             "Bring the core links up that are down and verify ping all (Host Intents-Spine Topo" )
         main.log.report(
@@ -2793,76 +2194,30 @@
         # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" )
         # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" )
         main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" )
-        time.sleep( link_sleep )
+        time.sleep( main.linkSleep )
         main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
-        time.sleep( link_sleep )
+        time.sleep( main.linkSleep )
 
         main.step("Verify link up is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkUp = main.ONOSbench.checkStatus(
-                topology_output,
-                main.numMNswitches,
-                str( main.numMNlinks ) )
-            if linkUp:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkUp,
-            onpass="Link up discovered properly",
-            onfail="Link up was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -2897,8 +2252,7 @@
         link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
         link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' )
         link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' )
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-        main.pingTimeout = 400
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
 
         main.log.report( "Bring some core links down and verify ping all (Point Intents-Spine Topo)" )
         main.log.report( "___________________________________________________________________________" )
@@ -2918,75 +2272,30 @@
         # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" )
         # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" )
         main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" )
-        time.sleep( link_sleep )
+        time.sleep( main.linkSleep )
         main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
-        time.sleep( link_sleep )
+        time.sleep( main.linkSleep )
 
         main.step("Verify link down is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkDown = main.ONOSbench.checkStatus(
-            topology_output, main.numMNswitches, str(
-                int( main.numMNlinks ) - 4 ))
-            if linkDown:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkDown,
-            onpass="Link down discovered properly",
-            onfail="Link down was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 4 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkDown,
+                                 onpass="Link down discovered properly",
+                                 onfail="Link down was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3014,7 +2323,7 @@
         import random
         link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
         link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
-        link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+        main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
         main.log.report(
             "Bring the core links up that are down and verify ping all (Point Intents-Spine Topo" )
         main.log.report(
@@ -3027,76 +2336,30 @@
         # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" )
         # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" )
         main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" )
-        time.sleep( link_sleep )
+        time.sleep( main.linkSleep )
         main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
-        time.sleep( link_sleep )
+        time.sleep( main.linkSleep )
 
         main.step("Verify link up is discoverd by onos")
-        # Giving onos multiple chances to discover link events
-        for i in range( main.linkCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-                main.log.info("Giving onos some time...")
-                time.sleep( link_sleep )
-
-            topology_output = main.ONOScli1.topology()
-            linkUp = main.ONOSbench.checkStatus(
-                topology_output,
-                main.numMNswitches,
-                str( main.numMNlinks ) )
-            if linkUp:
-                break
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=linkUp,
-            onpass="Link up discovered properly",
-            onfail="Link up was not discovered in " +
-            str( link_sleep * main.linkCheck ) +
-            " seconds" )
+        linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkUp,
+                                 onpass="Link up discovered properly",
+                                 onfail="Link up was not discovered in " +
+                                        str( main.linkSleep * main.linkCheck ) +
+                                        " seconds" )
 
         main.step("Verify intents are installed")
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Giving onos some time...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3122,23 +2385,12 @@
         """
         main.log.report( "IPv6 ping all with some core links down( Host Intents-Att Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with some core links down( Host Intents-Att Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("Failed to ping Ipv6 hosts. Retrying...")
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3149,30 +2401,22 @@
             onpass="IPv6 Ping across 300 host intents test PASS",
             onfail="IPv6 Ping across 300 host intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE180( self ):
         """
         IPv6 ping all with after core links back up( Host Intents-Att Topo)
         """
         main.log.report( "IPv6 ping all with after core links back up( Host Intents-Att Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with after core links back up( Host Intents-Att Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3183,30 +2427,22 @@
             onpass="IPv6 Ping across 300 host intents test PASS",
             onfail="IPv6 Ping across 300 host intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE171( self ):
         """
         IPv6 ping all with some core links down( Point Intents-Att Topo)
         """
         main.log.report( "IPv6 ping all with some core links down( Point Intents-Att Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with some core links down( Point Intents-Att Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3217,30 +2453,22 @@
             onpass="IPv6 Ping across 600 point intents test PASS",
             onfail="IPv6 Ping across 600 point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE181( self ):
         """
         IPv6 ping all with after core links back up( Point Intents-Att Topo)
         """
         main.log.report( "IPv6 ping all with after core links back up( Point Intents-Att Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with after core links back up( Point Intents-Att Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3251,30 +2479,22 @@
             onpass="IPv6 Ping across 600 Point intents test PASS",
             onfail="IPv6 Ping across 600 Point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE172( self ):
         """
         IPv6 ping all with some core links down( Host Intents-Chordal Topo)
         """
         main.log.report( "IPv6 ping all with some core links down( Host Intents-Chordal Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with some core links down( Host Intents-Chordal Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3291,24 +2511,12 @@
         """
         main.log.report( "IPv6 ping all with after core links back up( Host Intents-Chordal Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with after core links back up( Host Intents-Chordal Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3319,30 +2527,22 @@
             onpass="IPv6 Ping across 300 host intents test PASS",
             onfail="IPv6 Ping across 300 host intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE173( self ):
         """
         IPv6 ping all with some core links down( Point Intents-Chordal Topo)
         """
         main.log.report( "IPv6 ping all with some core links down( Point Intents-Chordal Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with some core links down( Point Intents-Chordal Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3353,30 +2553,22 @@
             onpass="IPv6 Ping across 600 point intents test PASS",
             onfail="IPv6 Ping across 600 point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE183( self ):
         """
         IPv6 ping all with after core links back up( Point Intents-Chordal Topo)
         """
         main.log.report( "IPv6 ping all with after core links back up( Point Intents-Chordal Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with after core links back up( Point Intents-Chordal Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3387,30 +2579,22 @@
             onpass="IPv6 Ping across 600 Point intents test PASS",
             onfail="IPv6 Ping across 600 Point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE174( self ):
         """
         IPv6 ping all with some core links down( Host Intents-Spine Topo)
         """
         main.log.report( "IPv6 ping all with some core links down( Host Intents-Spine Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with some core links down( Host Intents-Spine Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3421,30 +2605,22 @@
             onpass="IPv6 Ping across 2278 host intents test PASS",
             onfail="IPv6 Ping across 2278 host intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE184( self ):
         """
         IPv6 ping all with after core links back up( Host Intents-Spine Topo)
         """
         main.log.report( "IPv6 ping all with after core links back up( Host Intents-Spine Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with after core links back up( Host Intents-Spine Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3455,30 +2631,22 @@
             onpass="IPv6 Ping across 2278 host intents test PASS",
             onfail="IPv6 Ping across 2278 host intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE175( self ):
         """
         IPv6 ping all with some core links down( Point Intents-Spine Topo)
         """
         main.log.report( "IPv6 ping all with some core links down( Point Intents-Spine Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with some core links down( Point Intents-Spine Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3489,30 +2657,22 @@
             onpass="IPv6 Ping across 4556 point intents test PASS",
             onfail="IPv6 Ping across 4556 point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE185( self ):
         """
         IPv6 ping all with after core links back up( Point Intents-Spine Topo)
         """
         main.log.report( "IPv6 ping all with after core links back up( Point Intents-Spine Topo )" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all with after core links back up( Point Intents-Spine Topo )" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First ping failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -3523,90 +2683,37 @@
             onpass="IPv6 Ping across 4556 Point intents test PASS",
             onfail="IPv6 Ping across 4556 Point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE90( self ):
         """
         Install 600 point intents and verify ping all (Att Topology)
         """
         main.log.report( "Add 600 point intents and verify pingall (Att Topology)" )
         main.log.report( "_______________________________________" )
-        import itertools
-        import time
         main.case( "Install 600 point intents" )
+
         main.step( "Add point Intents" )
-        intentResult = main.TRUE
-        deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
-        intentIdList = []
-        time1 = time.time()
-        for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
-            pool = []
-            for cli in main.CLIs:
-                if i >= len( deviceCombos ):
-                    break
-                t = main.Thread( target=cli.addPointIntent,
-                        threadID=main.threadID,
-                        name="addPointIntent",
-                        args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
-                pool.append(t)
-                t.start()
-                i = i + 1
-                main.threadID = main.threadID + 1
-            for thread in pool:
-                thread.join()
-                intentIdList.append(thread.result)
-        time2 = time.time()
-        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
-
-        # Saving intent ids to check intents in later case
+        intentIdList = main.CHOtestFunctions.installPointIntents()
         main.intentIds = list(intentIdList)
 
         main.step("Verify intents are installed")
-
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Waiting for onos to install intents...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
         caseResult = ( intentState and pingResult )
-
         utilities.assert_equals(
             expect=main.TRUE,
             actual=caseResult,
@@ -3628,85 +2735,27 @@
         """
         main.log.report( "Add 600 point intents and verify pingall (Chordal Topology)" )
         main.log.report( "_______________________________________" )
-        import itertools
-        import time
         main.case( "Install 600 point intents" )
+
         main.step( "Add point Intents" )
-        intentResult = main.TRUE
-        deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
-        intentIdList = []
-        time1 = time.time()
-        for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
-            pool = []
-            for cli in main.CLIs:
-                if i >= len( deviceCombos ):
-                    break
-                t = main.Thread( target=cli.addPointIntent,
-                        threadID=main.threadID,
-                        name="addPointIntent",
-                        args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
-                pool.append(t)
-                #time.sleep(1)
-                t.start()
-                i = i + 1
-                main.threadID = main.threadID + 1
-            for thread in pool:
-                thread.join()
-                intentIdList.append(thread.result)
-        time2 = time.time()
-        main.log.info( "Time for adding point intents: %2f seconds" %(time2-time1) )
-
-        # Saving intent ids to check intents in later case
+        intentIdList = main.CHOtestFunctions.installPointIntents()
         main.intentIds = list(intentIdList)
 
         main.step("Verify intents are installed")
-
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Waiting for onos to install intents...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
         caseResult = ( intentState and pingResult )
-
         utilities.assert_equals(
             expect=main.TRUE,
             actual=caseResult,
@@ -3728,88 +2777,27 @@
         """
         main.log.report( "Add 4556 point intents and verify pingall (Spine Topology)" )
         main.log.report( "_______________________________________" )
-        import itertools
-        import time
         main.case( "Install 4556 point intents" )
-        main.step( "Add point Intents" )
-        intentResult = main.TRUE
-        main.pingTimeout = 600
-        for i in range(len(main.hostMACs)):
-            main.MACsDict[main.deviceDPIDs[i+10]] = main.hostMACs[i].split('/')[0]
-        print main.MACsDict
-        deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) )
-        intentIdList = []
-        time1 = time.time()
-        for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
-            pool = []
-            for cli in main.CLIs:
-                if i >= len( deviceCombos ):
-                    break
-                t = main.Thread( target=cli.addPointIntent,
-                        threadID=main.threadID,
-                        name="addPointIntent",
-                        args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
-                pool.append(t)
-                #time.sleep(1)
-                t.start()
-                i = i + 1
-                main.threadID = main.threadID + 1
-            for thread in pool:
-                thread.join()
-                intentIdList.append(thread.result)
-        time2 = time.time()
-        main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
 
-        # Saving intent ids to check intents in later case
+        main.step( "Add point Intents" )
+        intentIdList = main.CHOtestFunctions.installPointIntents()
         main.intentIds = list(intentIdList)
 
         main.step("Verify intents are installed")
-
-        # Giving onos multiple chances to install intents
-        for i in range( main.intentCheck ):
-            if i != 0:
-                main.log.warn( "Verification failed. Retrying..." )
-            main.log.info("Waiting for onos to install intents...")
-            time.sleep( main.checkIntentsDelay )
-
-            intentState = main.TRUE
-            for e in range(int(main.numCtrls)):
-                main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
-            if intentState:
-                break
-        else:
-            #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
-
-        utilities.assert_equals( expect=main.TRUE, actual=intentState,
+        intentState = main.CHOtestFunctions.checkIntents()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=intentState,
                                  onpass="INTENTS INSTALLED",
                                  onfail="SOME INTENTS NOT INSTALLED" )
 
         main.step( "Verify Ping across all hosts" )
-        for i in range(main.numPings):
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
-            if not pingResult:
-                main.log.warn("First pingall failed. Retrying...")
-                time.sleep(main.pingSleep)
-            else: break
-
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
         caseResult = ( intentState and pingResult )
-
         utilities.assert_equals(
             expect=main.TRUE,
             actual=caseResult,
@@ -3864,7 +2852,6 @@
         main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
 
         main.step("Verify intents are installed")
-
         # Giving onos multiple chances to install intents
         for i in range( main.intentCheck ):
             if i != 0:
@@ -3875,15 +2862,15 @@
             intentState = main.TRUE
             for e in range(int(main.numCtrls)):
                 main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
             if intentState:
                 break
-        else:
+        if not intentState:
             #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
 
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
@@ -3984,7 +2971,6 @@
         main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
 
         main.step("Verify intents are installed")
-
         # Giving onos multiple chances to install intents
         for i in range( main.intentCheck ):
             if i != 0:
@@ -3995,15 +2981,15 @@
             intentState = main.TRUE
             for e in range(int(main.numCtrls)):
                 main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
             if intentState:
                 break
-        else:
+        if not intentState:
             #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
 
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
@@ -4104,7 +3090,6 @@
         main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
 
         main.step("Verify intents are installed")
-
         # Giving onos multiple chances to install intents
         for i in range( main.intentCheck ):
             if i != 0:
@@ -4115,15 +3100,15 @@
             intentState = main.TRUE
             for e in range(int(main.numCtrls)):
                 main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
             if intentState:
                 break
-        else:
+        if not intentState:
             #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
 
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
@@ -4223,7 +3208,6 @@
         main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
 
         main.step("Verify intents are installed")
-
         # Giving onos multiple chances to install intents
         for i in range( main.intentCheck ):
             if i != 0:
@@ -4234,15 +3218,15 @@
             intentState = main.TRUE
             for e in range(int(main.numCtrls)):
                 main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
             if intentState:
                 break
-        else:
+        if not intentState:
             #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
 
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
@@ -4342,7 +3326,6 @@
         main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
 
         main.step("Verify intents are installed")
-
         # Giving onos multiple chances to install intents
         for i in range( main.intentCheck ):
             if i != 0:
@@ -4353,15 +3336,15 @@
             intentState = main.TRUE
             for e in range(int(main.numCtrls)):
                 main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
             if intentState:
                 break
-        else:
+        if not intentState:
             #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
 
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
@@ -4467,7 +3450,6 @@
         main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
 
         main.step("Verify intents are installed")
-
         # Giving onos multiple chances to install intents
         for i in range( main.intentCheck ):
             if i != 0:
@@ -4478,15 +3460,15 @@
             intentState = main.TRUE
             for e in range(int(main.numCtrls)):
                 main.log.info( "Checking intents on CLI %s" % (e+1) )
-                intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
-                        intentState
-                if not intentState:
-                    main.log.warn( "Not all intents installed" )
+                IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+                if not IntentStateIndividual:
+                    main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+                intentState = intentState and IntentStateIndividual
             if intentState:
                 break
-        else:
+        if not intentState:
             #Dumping intent summary
-            main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+            main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
 
         utilities.assert_equals( expect=main.TRUE, actual=intentState,
                                  onpass="INTENTS INSTALLED",
@@ -4555,24 +3537,12 @@
         """
         main.log.report( "Verify IPv6 ping across 600 Point intents (Att Topology)" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all 600 Point intents" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First pingall failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -4583,30 +3553,22 @@
             onpass="IPv6 Ping across 600 Point intents test PASS",
             onfail="IPv6 Ping across 600 Point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE191( self ):
         """
         Verify IPv6 ping across 600 Point intents (Chordal Topology)
         """
         main.log.report( "Verify IPv6 ping across 600 Point intents (Chordal Topology)" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all 600 Point intents" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First pingall failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -4617,30 +3579,22 @@
             onpass="IPv6 Ping across 600 Point intents test PASS",
             onfail="IPv6 Ping across 600 Point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE192( self ):
         """
         Verify IPv6 ping across 4556 Point intents (Spine Topology)
         """
         main.log.report( "Verify IPv6 ping across 4556 Point intents (Spine Topology)" )
         main.log.report( "_________________________________________________" )
-        import itertools
-        import time
         main.case( "IPv6 ping all 4556 Point intents" )
+
         main.step( "Verify IPv6 Ping across all hosts" )
-        pingResult = main.FALSE
-        time1 = time.time()
-        pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        if not pingResult:
-            main.log.warn("First pingall failed. Retrying...")
-            time1 = time.time()
-            pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
-        time2 = time.time()
-        timeDiff = round( ( time2 - time1 ), 2 )
-        main.log.report(
-            "Time taken for IPv6 Ping All: " +
-            str( timeDiff ) +
-            " seconds" )
-        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+        pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=pingResult,
                                  onpass="PING ALL PASS",
                                  onfail="PING ALL FAIL" )
 
@@ -4651,6 +3605,10 @@
             onpass="IPv6 Ping across 4556 Point intents test PASS",
             onfail="IPv6 Ping across 4556 Point intents test FAIL" )
 
+        if not caseResult and main.failSwitch:
+            main.log.report("Stopping test")
+            main.stop( email=main.emailOnStop )
+
     def CASE10( self ):
         import time
         import re
@@ -4680,6 +3638,8 @@
         removeIntentCount = 0
         intentsCount = len(intentsList)
         main.log.info ( "Current number of intents:  " + str(intentsCount) )
+
+        main.step( "Remove all installed intents" )
         if ( len( intentsList ) > 1 ):
             results = main.TRUE
             main.log.info("Removing intent...")
@@ -4748,6 +3708,8 @@
             step1Result = main.FALSE
 
         print main.ONOScli1.intents()
+
+        main.log.info( main.ONOScli1.summary( jsonFormat=False ) )
         caseResult = step1Result
         utilities.assert_equals( expect=main.TRUE, actual=caseResult,
                                  onpass="Intent removal test successful",
diff --git a/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py b/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py
new file mode 100644
index 0000000..7441a5b
--- /dev/null
+++ b/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py
@@ -0,0 +1,152 @@
+"""
+Wrapper functions for CHOtest
+Author: you@onlab.us
+"""
+
+def __init__( self ):
+    self.default = ''
+
+def installHostIntents():
+    """
+    Install one host intent for each combination of hosts in the topology
+    """
+    import itertools
+    import time
+
+    hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+    intentIdList = []
+    for i in xrange( 0, len( hostCombos ), int( main.numCtrls ) ):
+        pool = []
+        for cli in main.CLIs:
+            if i >= len( hostCombos ):
+                break
+            t = main.Thread( target=cli.addHostIntent,
+                             threadID=main.threadID,
+                             name="addHostIntent",
+                             args=[hostCombos[i][0],
+                                   hostCombos[i][1]])
+            pool.append(t)
+            t.start()
+            i = i + 1
+            main.threadID = main.threadID + 1
+        for thread in pool:
+            thread.join()
+            intentIdList.append( thread.result )
+
+    return intentIdList
+
+def installPointIntents():
+    """
+    Install one point intent for each permutation of devices in the topology
+    """
+    import itertools
+    import time
+
+    if main.prefix == 2:
+        # Spine-leaf topology is a special case
+        for i in range( len( main.hostMACs ) ):
+            main.MACsDict[ main.deviceDPIDs[ i+10 ] ] = main.hostMACs[ i ].split('/')[0]
+        deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) )
+    else:
+        deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
+    intentIdList = []
+    time1 = time.time()
+    for i in xrange( 0, len( deviceCombos ), int( main.numCtrls ) ):
+        pool = []
+        for cli in main.CLIs:
+            if i >= len( deviceCombos ):
+                break
+            t = main.Thread( target=cli.addPointIntent,
+                             threadID=main.threadID,
+                             name="addPointIntent",
+                             args=[ deviceCombos[i][0],
+                                    deviceCombos[i][1],
+                                    1, 1, '',
+                                    main.MACsDict.get( deviceCombos[i][0] ),
+                                    main.MACsDict.get( deviceCombos[i][1] ) ] )
+            pool.append(t)
+            t.start()
+            i = i + 1
+            main.threadID = main.threadID + 1
+        for thread in pool:
+            thread.join()
+            intentIdList.append( thread.result )
+    time2 = time.time()
+    main.log.info("Time taken for adding point intents: %2f seconds" %( time2 - time1 ) )
+
+    return intentIdList
+
+def checkIntents():
+    """
+    Check if all the intents are in INSTALLED state
+    """
+    import time
+
+    intentResult = main.TRUE
+    for i in range( main.intentCheck ):
+        if i != 0:
+            main.log.warn( "Verification failed. Retrying..." )
+        main.log.info("Waiting for onos to install intents...")
+        time.sleep( main.checkIntentsDelay )
+
+        intentResult = main.TRUE
+        for e in range(int(main.numCtrls)):
+            main.log.info( "Checking intents on CLI %s" % (e+1) )
+            intentResultIndividual = main.CLIs[e].checkIntentState( intentsId=main.intentIds )
+            if not intentResultIndividual:
+                main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+            intentResult = intentResult and intentResultIndividual
+        if intentResult:
+            break
+    if not intentResult:
+        main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+    return intentResult
+
+def checkPingall( protocol="IPv4" ):
+    """
+    Verify ping across all hosts
+    """
+    import time
+
+    pingResult = main.TRUE
+    for i in range( main.numPings ):
+        if i != 0:
+            main.log.warn( "Pingall failed. Retrying..." )
+            main.log.info( "Giving ONOS some time...")
+            time.sleep( main.pingSleep )
+
+        pingResult = main.Mininet1.pingall( protocol=protocol, timeout=main.pingTimeout )
+        if pingResult:
+            break
+
+    return pingResult
+
+def checkLinkEvents( linkEvent, linkNum ):
+    """
+    Verify link down/up events are correctly discovered by ONOS
+    linkNum: the correct link number after link down/up
+    """
+    import time
+
+    linkResult = main.TRUE
+    for i in range( main.linkCheck ):
+        if i != 0:
+            main.log.warn( "Verification failed. Retrying..." )
+            main.log.info( "Giving ONOS some time..." )
+            time.sleep( main.linkSleep )
+
+        linkResult = main.TRUE
+        for e in range( int( main.numCtrls ) ):
+            main.log.info( "Checking link number on ONOS%s" % (e+1) )
+            topology_output = main.CLIs[e].topology()
+            linkResultIndividual = main.ONOSbench.checkStatus( topology_output,
+                                                               main.numMNswitches,
+                                                               str( linkNum ) )
+            if not linkResultIndividual:
+                main.log.warn( "Link %s not discovered by ONOS%s" % ( linkEvent, (e+1) ) )
+            linkResult = linkResult and linkResultIndividual
+        if linkResult:
+            break
+
+    return linkResult
diff --git a/TestON/tests/FUNCintent/FUNCintent.params b/TestON/tests/FUNCintent/FUNCintent.params
index 370caeb..3271819 100644
--- a/TestON/tests/FUNCintent/FUNCintent.params
+++ b/TestON/tests/FUNCintent/FUNCintent.params
@@ -11,7 +11,8 @@
     # 14 - Discover hosts with Mininet Pingall
     # 15 - Discover hosts with Scapy arping ( only discovers scapy hosts )
     # 16 - Balance ownership of switches
-    # 17 - Stop Mininet
+    # 17 - Activate Flow Objectives
+    # 18 - Stop Mininet
     # 1000 - Test host intents
     # 2000 - Test point intents
     # 3000 - Test single to multi point intents
@@ -19,10 +20,10 @@
     # 5000 - Test host mobility
     # 6000 - Test Multi Point intent End Point Failure
 
-    <testcases>1,[2,10,12,13,15,16,1000,2000,3000,4000,5000,6000,17]*2,[2,11,12,13,15,16,1000,2000,3000,4000,5000,6000,17]*2</testcases>
+    <testcases>1,[2,10,12,13,15,16,1000,2000,3000,4000,5000,6000,18]*2,[2,10,12,13,15,16,17,1000,2000,3000,4000,5000,6000,18]*2,[2,11,12,13,15,16,1000,2000,3000,4000,5000,6000,18]*2,[2,11,12,13,15,16,17,1000,2000,3000,4000,5000,6000,18]*2</testcases>
 
     <SCALE>
-        <size>1,3,1,3</size>
+        <size>1,3,1,3,1,3,1,3</size>
     </SCALE>
 
     <DEPENDENCY>
diff --git a/TestON/tests/FUNCintent/FUNCintent.py b/TestON/tests/FUNCintent/FUNCintent.py
index d725c3c..0855dc1 100644
--- a/TestON/tests/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNCintent/FUNCintent.py
@@ -134,6 +134,7 @@
 
         # main.scale[ 0 ] determines the current number of ONOS controller
         main.numCtrls = int( main.scale[ 0 ] )
+        main.flowCompiler = "Flow Rules"
 
         main.case( "Starting up " + str( main.numCtrls ) +
                    " node(s) ONOS cluster" )
@@ -548,12 +549,31 @@
         balanceResult = utilities.retry( f=main.CLIs[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
 
         utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
+                                 actual=balanceResult,
                                  onpass="Successfully balanced mastership of switches",
                                  onfail="Failed to balance mastership of switches" )
 
     def CASE17( self, main ):
         """
+            Use Flow Objectives
+        """
+        main.case( "Enable intent compilation using Flow Objectives" )
+        main.step( "Enabling Flow Objectives" )
+
+        main.flowCompiler = "Flow Objectives"
+
+        cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
+
+        stepResult = main.CLIs[ 0 ].setCfg( component=cmd,
+                                            propName="useFlowObjectives", value="true" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully activated Flow Objectives",
+                                 onfail="Failed to activate Flow Objectives" )
+
+    def CASE18( self, main ):
+        """
             Stop mininet and remove scapy host
         """
         main.log.report( "Stop Mininet and Scapy" )
@@ -626,13 +646,14 @@
 
         main.testName = "Host Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case tests Host intents using " +\
                                 str( main.numCtrls ) + " node(s) cluster;\n" +\
                                 "Different type of hosts will be tested in " +\
                                 "each step such as IPV4, Dual stack, VLAN " +\
-                                "etc;\nThe test will use OF " + main.OFProtocol\
-                                + " OVS running in Mininet"
+                                "etc;\nThe test will use OF " + main.OFProtocol +\
+                                " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "IPV4: Add host intents between h1 and h9" )
         main.assertReturnString = "Assertion Result for IPV4 host intent with mac addresses\n"
@@ -856,14 +877,15 @@
 
         main.testName = "Point Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test point to point" +\
                                " intents using " + str( main.numCtrls ) +\
                                " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         # No option point intents
         main.step( "NOOPTION: Add point intents between h1 and h9" )
@@ -1177,14 +1199,15 @@
 
         main.testName = "Single to Multi Point Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" +\
                                " multi point intents using " +\
                                str( main.numCtrls ) + " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "NOOPTION: Install and test single point to multi point intents" )
         main.assertReturnString = "Assertion results for IPV4 single to multi point intent with no options set\n"
@@ -1382,14 +1405,15 @@
 
         main.testName = "Multi To Single Point Intents"
         main.case( main.testName + " Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" +\
                                " multi point intents using " +\
                                str( main.numCtrls ) + " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "NOOPTION: Add multi point to single point intents" )
         main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
diff --git a/TestON/tests/FUNCintentRest/FUNCintentRest.params b/TestON/tests/FUNCintentRest/FUNCintentRest.params
index 07a5cff..7b29e9d 100644
--- a/TestON/tests/FUNCintentRest/FUNCintentRest.params
+++ b/TestON/tests/FUNCintentRest/FUNCintentRest.params
@@ -11,17 +11,18 @@
     # 14 - Discover all hosts and Create a dictionary of hosts information
     # 15 - Discover hosts with scapy arping ( only discovers scapy hosts )
     # 16 - Balance ownership of switches
-    # 17 - Stop Mininet
+    # 17 - Activate Flow Objectives
+    # 18 - Stop Mininet
     # 1000 - Test host intents
     # 2000 - Test point intents
     # 3000 - Test single to multi point intents
     # 4000 - Test multi to single point intents
     # 5000 - Test host mobility
 
-    <testcases>1,[2,10,12,13,15,16,1000,2000,5000,17]*2,[2,11,12,13,15,16,1000,2000,5000,17]*2</testcases>
+    <testcases>1,[2,10,12,13,15,16,1000,2000,5000,18]*2,[2,10,12,13,15,16,17,1000,2000,5000,18]*2,[2,11,12,13,15,16,1000,2000,5000,18]*2,[2,11,12,13,15,16,17,1000,2000,5000,18]*2</testcases>
 
     <SCALE>
-        <size>1,3,1,3</size>
+        <size>1,3,1,3,1,3,1,3</size>
     </SCALE>
 
     <DEPENDENCY>
diff --git a/TestON/tests/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNCintentRest/FUNCintentRest.py
index 1a32bc1..8c6c8d5 100644
--- a/TestON/tests/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNCintentRest/FUNCintentRest.py
@@ -154,6 +154,7 @@
 
         # main.scale[ 0 ] determines the current number of ONOS controller
         main.numCtrls = int( main.scale[ 0 ] )
+        main.flowCompiler = "Flow Rules"
 
         main.case( "Starting up " + str( main.numCtrls ) +
                    " node(s) ONOS cluster" )
@@ -671,6 +672,25 @@
 
     def CASE17( self, main ):
         """
+            Use Flow Objectives
+        """
+        main.case( "Enable intent compilation using Flow Objectives" )
+        main.step( "Enabling Flow Objectives" )
+
+        main.flowCompiler = "Flow Objectives"
+
+        cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
+
+        stepResult = main.CLIs2[ 0 ].setCfg( component=cmd,
+                                            propName="useFlowObjectives", value="true" )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully activated Flow Objectives",
+                                 onfail="Failed to activate Flow Objectives" )
+
+    def CASE18( self, main ):
+        """
             Stop mininet and remove scapy hosts
         """
         main.log.report( "Stop Mininet and Scapy" )
@@ -743,13 +763,14 @@
         intentLeadersOld = main.CLIs2[ 0 ].leaderCandidates()
 
         main.case( "Host Intents Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case tests Host intents using " +\
                                 str( main.numCtrls ) + " node(s) cluster;\n" +\
                                 "Different type of hosts will be tested in " +\
                                 "each step such as IPV4, Dual stack, VLAN " +\
-                                "etc;\nThe test will use OF " + main.OFProtocol\
-                                + " OVS running in Mininet"
+                                "etc;\nThe test will use OF " + main.OFProtocol +\
+                                " OVS running in Mininet and compile intents" +\
+                                " using " + main.flowCompiler
 
         main.step( "IPV4: Add and test host intents between h1 and h9" )
         main.assertReturnString = "Assertion result for IPV4 host intent with mac addresses\n"
@@ -960,14 +981,15 @@
                                 main.numSwitch"
 
         main.case( "Point Intents Test - " + str( main.numCtrls ) +
-                   " NODE(S) - OF " + main.OFProtocol )
+                   " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test point to point" +\
                                " intents using " + str( main.numCtrls ) +\
                                " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         # No option point intents
         main.step( "NOOPTION: Add point intents between h1 and h9" )
@@ -1255,14 +1277,15 @@
                                 main.numSwitch"
 
         main.case( "Single To Multi Point Intents Test - " +
-                   str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
+                   str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" +\
                                " multi point intents using " +\
                                str( main.numCtrls ) + " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "NOOPTION: Add single point to multi point intents" )
         stepResult = main.TRUE
@@ -1395,14 +1418,15 @@
                                 main.numSwitch"
 
         main.case( "Multi To Single Point Intents Test - " +
-                   str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
+                   str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
         main.caseExplanation = "This test case will test single point to" +\
                                " multi point intents using " +\
                                str( main.numCtrls ) + " node(s) cluster;\n" +\
                                "Different type of hosts will be tested in " +\
                                "each step such as IPV4, Dual stack, VLAN etc" +\
                                ";\nThe test will use OF " + main.OFProtocol +\
-                               " OVS running in Mininet"
+                               " OVS running in Mininet and compile intents" +\
+                               " using " + main.flowCompiler
 
         main.step( "NOOPTION: Add multi point to single point intents" )
         stepResult = main.TRUE
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index 4e7ac23..f903f95 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -182,7 +182,7 @@
         #       index = The number of the graph under plot name
         job = "HAclusterRestart"
         plotName = "Plot-HA"
-        index = "1"
+        index = "2"
         graphs = '<ac:structured-macro ac:name="html">\n'
         graphs += '<ac:plain-text-body><![CDATA[\n'
         graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2533,7 +2533,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/HAfullNetPartition/HAfullNetPartition.py b/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
index 925a1c6..5a6de1a 100644
--- a/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
+++ b/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
@@ -179,7 +179,7 @@
         #       index = The number of the graph under plot name
         job = "HAfullNetPartition"
         plotName = "Plot-HA"
-        index = "0"
+        index = "1"
         graphs = '<ac:structured-macro ac:name="html">\n'
         graphs += '<ac:plain-text-body><![CDATA[\n'
         graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2537,7 +2537,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/HAkillNodes/HAkillNodes.py b/TestON/tests/HAkillNodes/HAkillNodes.py
index 3461278..7654097 100644
--- a/TestON/tests/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HAkillNodes/HAkillNodes.py
@@ -186,7 +186,7 @@
         #       index = The number of the graph under plot name
         job = "HAkillNodes"
         plotName = "Plot-HA"
-        index = "1"
+        index = "2"
         graphs = '<ac:structured-macro ac:name="html">\n'
         graphs += '<ac:plain-text-body><![CDATA[\n'
         graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2547,7 +2547,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/HAsanity/HAsanity.py b/TestON/tests/HAsanity/HAsanity.py
index b45bffc..624b720 100644
--- a/TestON/tests/HAsanity/HAsanity.py
+++ b/TestON/tests/HAsanity/HAsanity.py
@@ -178,7 +178,7 @@
         #       index = The number of the graph under plot name
         job = "HAsanity"
         plotName = "Plot-HA"
-        index = "1"
+        index = "2"
         graphs = '<ac:structured-macro ac:name="html">\n'
         graphs += '<ac:plain-text-body><![CDATA[\n'
         graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2434,7 +2434,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index 3ab5072..2b98bbe 100644
--- a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -159,7 +159,7 @@
         #       index = The number of the graph under plot name
         job = "HAsingleInstanceRestart"
         plotName = "Plot-HA"
-        index = "1"
+        index = "2"
         graphs = '<ac:structured-macro ac:name="html">\n'
         graphs += '<ac:plain-text-body><![CDATA[\n'
         graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
diff --git a/TestON/tests/HAstopNodes/HAstopNodes.py b/TestON/tests/HAstopNodes/HAstopNodes.py
index a98c62a..21ec7f3 100644
--- a/TestON/tests/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HAstopNodes/HAstopNodes.py
@@ -179,7 +179,7 @@
         #       index = The number of the graph under plot name
         job = "HAstopNodes"
         plotName = "Plot-HA"
-        index = "1"
+        index = "2"
         graphs = '<ac:structured-macro ac:name="html">\n'
         graphs += '<ac:plain-text-body><![CDATA[\n'
         graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2536,7 +2536,7 @@
                 activeIps = []
                 currentResult = main.FALSE
                 for node in current:
-                    if node['state'] == 'ACTIVE':
+                    if node['state'] == 'READY':
                         activeIps.append( node['ip'] )
                 activeIps.sort()
                 if ips == activeIps:
diff --git a/TestON/tests/PLATdockertest/PLATdockertest.py b/TestON/tests/PLATdockertest/PLATdockertest.py
index f56ae70..2e743f3 100755
--- a/TestON/tests/PLATdockertest/PLATdockertest.py
+++ b/TestON/tests/PLATdockertest/PLATdockertest.py
@@ -167,7 +167,7 @@
         main.log.debug("Rest call response: " + str(status) + " - " + response)
         if status == 200:
             jrsp = json.loads(response)
-            clusterIP = [item["ip"]for item in jrsp["nodes"] if item["status"]== "ACTIVE"]
+            clusterIP = [item["ip"]for item in jrsp["nodes"] if item["status"]== "READY"]
             main.log.debug(" IPlist is:" + ",".join(IPlist))
             main.log.debug("cluster IP is" + ",".join(clusterIP) )
             if set(IPlist) == set(clusterIP): stepResult = main.TRUE
diff --git a/TestON/tests/SCPFhostLat/README b/TestON/tests/SCPFhostLat/README
new file mode 100644
index 0000000..d0ff2d7
--- /dev/null
+++ b/TestON/tests/SCPFhostLat/README
@@ -0,0 +1,12 @@
+Host LATENCY
+
+Summary: This is a performance test suite to measure the time it takes ONOS
+        to recognize a host going up and down.
+
+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 "admin" root user. The 7 NODES must have
+    their clocks synced to TestStation via ptpd and be accurate to the
+    millisecond. You will also need the Wireshark disector to see openflow packets.
+
+NOTE: Only scale sizes 1,3,5 and 7 will be functional
diff --git a/TestON/tests/SCPFhostLat/SCPFhostLat.params b/TestON/tests/SCPFhostLat/SCPFhostLat.params
new file mode 100644
index 0000000..390304e
--- /dev/null
+++ b/TestON/tests/SCPFhostLat/SCPFhostLat.params
@@ -0,0 +1,52 @@
+<PARAMS>
+    <testcases>0,1,2,11,20,1,2,11,20,1,2,11,20,1,2,11,20</testcases>
+
+    <SCALE>1,3,5,7</SCALE>
+
+    <ENV>
+        <cellName>topo_perf_test</cellName>
+        <cellApps>drivers,metrics,openflow</cellApps>
+    </ENV>
+
+    <DEPENDENCY>
+        <path>/tests/SCPFhostLat/Dependency/</path>
+        <topology>topo-perf-1h1s.py</topology>
+    </DEPENDENCY>
+
+    <GIT>
+        <pull>False</pull>
+        <branch>master</branch>
+    </GIT>
+
+    <CTRL>
+        <port>6653</port>
+    </CTRL>
+
+    <SLEEP>
+        <startup>10</startup>
+        <install>10</install>
+        <measurement>5</measurement>
+        <timeout>10</timeout>
+    </SLEEP>
+
+    <TSHARK>
+        <tsharkPath>/tmp/hostLatTshark</tsharkPath>
+        <tsharkPacketIn>OF 1.3 150 of_packet_in</tsharkPacketIn>
+    </TSHARK>
+
+    <TEST>
+        # Number of times to iterate each case
+        <numIter>25</numIter>
+        # Number of iterations to ignore initially( warm up )
+        <iterIgnore>5</iterIgnore>
+        <singleSwThreshold>0,1000</singleSwThreshold>
+        <hostTimestamp>topologyHostEventTimestamp</hostTimestamp>
+    </TEST>
+
+    <DATABASE>
+        <file>/tmp/HostAddLatency</file>
+        <nic>1gig</nic>
+        <node>baremetal</node>
+    </DATABASE>
+
+</PARAMS>
diff --git a/TestON/tests/SCPFhostLat/SCPFhostLat.py b/TestON/tests/SCPFhostLat/SCPFhostLat.py
new file mode 100644
index 0000000..c24b6a7
--- /dev/null
+++ b/TestON/tests/SCPFhostLat/SCPFhostLat.py
@@ -0,0 +1,355 @@
+"""
+    SCPFhostLat
+    This test will test the host found latency.
+    Host will arping a ip address, tshark will caputure the package time, then compare with the topology event timestamp.
+    Test will run with 1 node from start, and scale up to 7 nodes.
+    The event timestamp will only greb the latest one, then calculate average and standar dev.
+
+    yunpeng@onlab.us
+"""
+class SCPFhostLat:
+
+    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.cellName = main.params[ 'ENV' ][ 'cellName' ]
+        main.apps = main.params[ 'ENV' ][ 'cellApps' ]
+        main.scale = ( main.params[ 'SCALE' ] ).split( "," )
+        main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
+        main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
+        main.installSleep = int( main.params[ 'SLEEP' ][ 'install' ] )
+        main.measurementSleep = int( main.params['SLEEP']['measurement'])
+        main.timeout = int( main.params['SLEEP']['timeout'] )
+        main.dbFileName = main.params['DATABASE']['file']
+        main.cellData = {} # for creating cell file
+
+        # Tshark params
+        main.tsharkResultPath = main.params['TSHARK']['tsharkPath']
+        main.tsharkPacketIn = main.params['TSHARK']['tsharkPacketIn']
+
+        main.numlter = main.params['TEST']['numIter']
+        main.iterIgnore = int(main.params['TEST']['iterIgnore'])
+        main.hostTimestampKey = main.params['TEST']['hostTimestamp']
+        main.thresholdStr = main.params['TEST']['singleSwThreshold']
+        main.thresholdObj = main.thresholdStr.split(',')
+        main.thresholdMin = int(main.thresholdObj[0])
+        main.thresholdMax = int(main.thresholdObj[1])
+        main.threadID = 0
+
+        main.CLIs = []
+        main.ONOSip = []
+        main.maxNumBatch = 0
+        main.ONOSip = main.ONOSbench.getOnosIps()
+        main.log.info(main.ONOSip)
+        main.setupSkipped = False
+
+        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.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.commit = main.ONOSbench.getVersion(report=True)
+        main.commit = main.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 = "'" + main.commit + "',"
+            temp += "'" + nic + "',"
+            dbFile.write(temp)
+            dbFile.close()
+
+    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
+        time.sleep( main.startUpSleep )
+        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.log.step(" Start ONOS cli using thread ")
+        time.sleep( main.startUpSleep )
+        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 CASE11( self, main ):
+        main.log.info( "set and configure Application" )
+        import json
+        import time
+        time.sleep(main.startUpSleep)
+        main.step( "Activating org.onosproject.proxyarp" )
+        appStatus = utilities.retry( main.ONOSrest1.activateApp,
+                                     main.FALSE,
+                                     ['org.onosproject.proxyarp'],
+                                     sleep=3,
+                                     attempts=3 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=appStatus,
+                                 onpass="Successfully activated proxyarp",
+                                 onfail="Failed to activated proxyarp")
+
+        main.step( "Set up Default Topology Provider" )
+        appStatus = main.TRUE
+        configName = 'org.onosproject.net.topology.impl.DefaultTopologyProvider'
+        configParam = 'maxEvents'
+        appStatus = appStatus and main.CLIs[0].setCfg(  configName, configParam,'1' )
+        configParam = 'maxBatchMs'
+        appStatus = appStatus and main.CLIs[0].setCfg( configName, configParam, '0')
+        configParam = 'maxIdleMs'
+        appStatus = appStatus and main.CLIs[0].setCfg( configName, configParam,'0' )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=appStatus,
+                                 onpass="Successfully set DefaultTopologyProvider",
+                                 onfail="Failed to set DefaultTopologyProvider" )
+
+        time.sleep(main.startUpSleep)
+        main.step('Starting mininet topology')
+        mnStatus = main.Mininet1.startNet(args='--topo=linear,1')
+        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[0] )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=swStatus,
+                                 onpass="Successfully assigned switches to masters",
+                                 onfail="Failed assign switches to masters" )
+
+        time.sleep(main.startUpSleep)
+
+    def CASE20(self, main):
+        """
+        host1 send arping package and measure latency
+
+        There are only 1 levels of latency measurements to this test:
+        1 ) ARPING-to-device measurement: Measurement the time from host1
+        send apring package to onos processing the host event
+
+        """
+        import time
+        import subprocess
+        import json
+        import requests
+        import os
+        import numpy
+
+        # Host adding measurement
+        assertion = main.TRUE
+
+        main.log.report('Latency of adding one host to ONOS')
+        main.log.report('First ' + str(main.iterIgnore) + ' iterations ignored' + ' for jvm warmup time')
+        main.log.report('Total iterations of test: ' + str(main.numlter))
+
+        addingHostTime = []
+        metricsResultList = []
+        for i in range(0, int(main.numlter)):
+            main.log.info('Clean up data file')
+            with open(main.tsharkResultPath, "w") as dbFile:
+                dbFile.write("")
+
+            main.log.info('Starting tshark capture')
+            main.ONOSbench.tsharkGrep(main.tsharkPacketIn, main.tsharkResultPath)
+            time.sleep(main.measurementSleep)
+
+            main.log.info('host 1 arping...')
+            main.Mininet1.arping(srcHost='h1', dstHost='10.0.0.2')
+
+            time.sleep(main.measurementSleep)
+
+            main.log.info('Stopping all Tshark processes')
+            main.ONOSbench.tsharkStop()
+
+            time.sleep(main.measurementSleep)
+
+            # Get tshark output
+            with open(main.tsharkResultPath, "r") as resultFile:
+                resultText = resultFile.readline()
+                main.log.info('Capture result:' + resultText)
+                resultText = resultText.split(' ')
+                if len(resultText) > 1:
+                    tsharkResultTime = float(resultText[1]) * 1000.0
+                else:
+                    main.log.error('Tshark output file for packet_in' + ' returned unexpected results')
+                    hostTime = 0
+                    caseResult = main.FALSE
+                resultFile.close()
+            # Compare the timestemps, and get the lowest one.
+            temp = 0;
+            # Get host event timestamps from each nodes
+            for node in range (0, main.numCtrls):
+                metricsResult = json.loads(main.CLIs[node].topologyEventsMetrics())
+                metricsResult = metricsResult.get(main.hostTimestampKey).get("value")
+                main.log.info("ONOS topology event matrics timestemp: {}".format(str(metricsResult)) )
+
+                if temp < metricsResult:
+                    temp = metricsResult
+                metricsResult = temp
+
+            addingHostTime.append(float(metricsResult) - tsharkResultTime)
+            main.log.info("Result of this iteration: {}".format( str( float(metricsResult) - tsharkResultTime) ))
+            # gethost to remove
+            gethost = main.ONOSrest1.hosts()
+            HosttoRemove = []
+            HosttoRemove.append( json.loads( gethost[1:len(gethost)-1] ).get('id') )
+            main.CLIs[0].removeHost(HosttoRemove)
+
+        main.log.info("Result List: {}".format(addingHostTime))
+
+        # calculate average latency from each nodes
+        averageResult = numpy.average(addingHostTime)
+        main.log.info("Average Latency: {}".format(averageResult))
+
+        # calculate std
+        stdResult = numpy.std(addingHostTime)
+        main.log.info("std: {}".format(stdResult))
+
+        # write to DB file
+        main.log.info("Writing results to DS file")
+        with open(main.dbFileName, "a") as dbFile:
+            # Scale number
+            temp = str(main.numCtrls)
+            temp += ",'" + "baremetal1" + "'"
+            # average latency
+            temp += "," + str( averageResult )
+            # std of latency
+            temp += "," + str(stdResult)
+            temp += "\n"
+            dbFile.write( temp )
+
+        assertion = main.TRUE
+
+        utilities.assert_equals(expect=main.TRUE, actual=assertion,
+                onpass='Host latency test successful',
+                onfail='Host latency test failed')
+
+        main.Mininet1.stopNet()
+        del main.scale[0]
diff --git a/TestON/tests/SCPFhostLat/SCPFhostLat.topo b/TestON/tests/SCPFhostLat/SCPFhostLat.topo
new file mode 100644
index 0000000..0b81b6e
--- /dev/null
+++ b/TestON/tests/SCPFhostLat/SCPFhostLat.topo
@@ -0,0 +1,112 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+                <home>~/onos</home>
+                <nodes>7</nodes> 
+            </COMPONENTS>
+        </ONOSbench>
+
+        <ONOScli1>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli1>
+
+        <ONOScli2>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli2>
+
+        <ONOScli3>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli3>
+
+        <ONOScli4>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli4>
+
+        <ONOScli5>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli5>
+
+        <ONOScli6>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli6>
+
+        <ONOScli7>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli7>
+
+        <ONOS1>
+            <host>OC1</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>9</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1>
+
+        <Mininet1>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>MininetCliDriver</type>
+            <connect_order>16</connect_order>
+            <COMPONENTS>
+            </COMPONENTS>
+        </Mininet1>
+
+        <ONOSrest1>
+            <host>OC1</host>
+            <port>8181</port>
+            <user>onos</user>
+            <password>rocks</password>
+            <type>OnosRestDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENT>
+            </COMPONENT>
+        </ONOSrest1>
+
+    </COMPONENT>
+
+</TOPOLOGY>
diff --git a/TestON/tests/SCPFhostLat/__init__.py b/TestON/tests/SCPFhostLat/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFhostLat/__init__.py
diff --git a/TestON/tests/SCPFintentEventTpWithFlowObj/README b/TestON/tests/SCPFintentEventTpWithFlowObj/README
new file mode 100644
index 0000000..980c748
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/README
@@ -0,0 +1,28 @@
+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 "admin" 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/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params
new file mode 100644
index 0000000..5ccea03
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params
@@ -0,0 +1,71 @@
+<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>admin</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>admin</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/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
new file mode 100644
index 0000000..092af87
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
@@ -0,0 +1,335 @@
+# 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.log.step("Grabbing commit number")
+            commit = main.ONOSbench.getVersion()
+            commit = (commit.split(" "))[1]
+
+            main.log.step("Creating results file")
+            # Create results file with flow object
+            flowObjResultsDB = open("/tmp/IntentEventTPflowObjDB", "w+")
+            flowObjResultsDB.close()
+
+        # -- END OF INIT SECTION --#
+
+        main.log.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.log.step("Safety check, killing all ONOS processes")
+        main.log.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.log.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.NewDistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
+        main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.net.intent.impl.IntentManager", "skipReleaseResourcesOnWithdrawal " + skipRelRsrc)
+        devices = int(clusterCount)*10
+
+        main.log.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=[ "10.128.174.1",
+                                        "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/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo
new file mode 100644
index 0000000..01370b6
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo
@@ -0,0 +1,147 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+                <home>~/onos</home>
+                <nodes>7</nodes> 
+            </COMPONENTS>
+        </ONOSbench>
+
+        <ONOS1cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1cli>
+
+        <ONOS2cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2cli>
+
+        <ONOS3cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3cli>
+
+        <ONOS4cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4cli>
+
+        <ONOS5cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5cli>
+
+        <ONOS6cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6cli>
+
+        <ONOS7cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</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/SCPFintentEventTpWithFlowObj/__init__.py b/TestON/tests/SCPFintentEventTpWithFlowObj/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/__init__.py
diff --git a/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params
new file mode 100644
index 0000000..1521a75
--- /dev/null
+++ b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params
@@ -0,0 +1,66 @@
+<PARAMS>
+
+    <testcases>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>
+        <switchCount>7</switchCount>
+        <warmUp>5</warmUp>
+        <sampleSize>20</sampleSize>
+        <wait></wait>
+        <intents>1,100,1000</intents>                       #list format, will be split on ','
+        <debug>True</debug>                                        #"True" for true
+    </TEST>
+
+    <GIT>
+        <autopull>off</autopull>
+        <checkout>master</checkout>
+    </GIT>
+
+    <CTRL>
+        <USER>admin</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>localhost</ip1>
+    </MN>
+
+    <BENCH>
+        <user>admin</user>
+        <ip1>localhost</ip1>
+    </BENCH>
+
+    <JSON>
+    </JSON>
+
+</PARAMS>
diff --git a/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py
new file mode 100644
index 0000000..ec47721
--- /dev/null
+++ b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py
@@ -0,0 +1,274 @@
+# ScaleOutTemplate
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os.path
+
+
+class SCPFintentInstallWithdrawLatWithFlowObj:
+
+    def __init__( self ):
+        self.default = ''
+        
+    def CASE1( self, main ):
+
+        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' ]
+        main.maxNodes = int(main.params[ 'max' ])
+        skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        switchCount = main.params[ 'TEST' ][ 'switchCount' ]
+
+        # -- 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 = [ 0 ]
+            scale = (main.params[ 'SCALE' ]).split(",")
+            clusterCount = int(scale[0])
+
+            #Populate ONOSIp with ips from params
+            ONOSIp = [0]
+            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" )
+
+            commit = main.ONOSbench.getVersion()
+            commit = (commit.split(" "))[1]
+
+            resultsDB = open("/tmp/IntentInstallWithdrawLatDBWFO", "w+")
+            resultsDB.close()
+
+        # -- END OF INIT SECTION --#
+
+        clusterCount = int(scale[0])
+        scale.remove(scale[0])
+
+        #kill off all onos processes
+        main.log.step("Safety check, killing all ONOS processes")
+        main.log.step("before initiating environment setup")
+        for node in range(1, main.maxNodes + 1):
+            main.ONOSbench.onosDie(ONOSIp[node])
+
+        #Uninstall everywhere
+        main.log.step( "Cleaning Enviornment..." )
+        for i in range(1, main.maxNodes + 1):
+            main.log.info(" Uninstalling ONOS " + str(i) )
+            main.ONOSbench.onosUninstall( ONOSIp[i] )
+
+        #construct the cell file
+        main.log.info("Creating cell file")
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+            cellIp.append(ONOSIp[node])
+
+        main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), cellIp)
+
+        main.step( "Set Cell" )
+        main.ONOSbench.setCell(cellName)
+
+        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(1, clusterCount + 1):
+            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+            main.ONOSbench.onosInstall( ONOSIp[node])
+
+        for node in range(1, clusterCount + 1):
+            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.ONOS1cli.startOnosCli( ONOSIp[1] )
+        main.log.info("Startup sequence complete")
+
+        time.sleep(30)
+
+        for i in range(3):
+            main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", ("deviceCount " + str(switchCount)) )
+            main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
+            main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
+            main.ONOS1cli.setCfg( "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"," useFlowObjectives","true" )
+            if main.ONOSbench.verifySummary(ONOSIp[1], switchCount):
+                break
+            else:
+                print "Failed- looping"
+
+        main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
+        main.ONOSbench.handle.expect(":~")
+        main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+
+    def CASE2( self, main ):
+
+        import time
+        import numpy
+
+        testStatus = "pass"
+        sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
+        warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
+        intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
+        switchCount = int(main.params[ 'TEST' ][ 'switchCount' ])
+        debug = main.params[ 'TEST' ][ 'switchCount' ]
+        for i in range(0,len(intentsList)):
+            intentsList[i] = int(intentsList[i])
+
+        ######################
+        debug = True
+        ######################
+
+        linkCount = 0
+        for i in range(0,10):
+            main.ONOSbench.handle.sendline("onos $OC1 links|wc -l")
+            main.ONOSbench.handle.expect(":~")
+            linkCount = main.ONOSbench.handle.before
+            if debug: main.log.info("Link Count check: " + linkCount)
+            if str((switchCount*2)-2) in linkCount:
+                break
+            time.sleep(2)
+
+        links = "--"
+        for i in range(8):
+            if debug: main.log.info("top of loop")
+            main.ONOSbench.handle.sendline("onos $OC1 links")
+            main.ONOSbench.handle.expect(":~")
+            links = main.ONOSbench.handle.before
+            if "=null:" in links:
+                break
+            if debug: main.log.info(str(links))
+            if i > 3:
+                main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
+            if i == 7:
+                main.log.error("link data missing")
+            time.sleep(3)
+
+        links = links.splitlines()
+        templinks = links
+
+        tempDevices = []
+        for line in links:
+            temp = line.split(" ")
+            temp[0].replace("src=","")
+            temp[0] = (temp[0].split("/"))[0]
+            tempDevices.append(temp[0])
+
+        tempDevices.sort()
+        devices = []
+        for i in tempDevices:
+            if "src=null" in i:
+                devices.append(i.replace("src=", ""))
+        if debug: main.log.info(str(devices))
+
+        ingress = devices[0]
+        egress = devices.pop()
+        if debug: main.log.info(ingress)
+        if debug: main.log.info(egress)
+
+        for intentSize in intentsList:
+            cmd = "onos $OC1 push-test-intents "
+            cmd += ingress + "/6 "
+            cmd += egress + "/5 "
+            cmd += str(intentSize) + " 1"
+            installed = []
+            withdrawn = []
+            testStatus = ""
+
+            for run in range(0, (warmUp + sampleSize)):
+                if run > warmUp:
+                    time.sleep(5)
+
+                myRawResult = "--"
+
+                main.ONOSbench.handle.sendline(cmd)
+                main.ONOSbench.handle.expect(":~")
+                myRawResult = main.ONOSbench.handle.before
+
+                if debug: main.log.info(myRawResult)
+
+                if run >= warmUp:
+                    myRawResult = myRawResult.splitlines()
+                    for line in myRawResult:
+                        if "Failure:" in line:
+                            main.log.error("INTENT TEST FAILURE, ABORTING TESTCASE")
+                            testStatus = "fail"
+                            break
+
+                        if "install" in line:
+                            installed.append(int(line.split(" ")[5]))
+
+                        if "withdraw" in line:
+                            withdrawn.append(int(line.split(" ")[5]))
+
+                if testStatus == "fail":
+                    main.log.info("Installed: " + str(installed))
+                    main.log.info("Withdrawn: " + str(withdrawn))
+                    main.log.info("Scale: " + str(clusterCount))
+                    main.log.info("Warmup: " + str(warmUp) + " SampleSize: " + str(sampleSize))
+                    main.log.info("Run: " + str(run))
+                    main.log.error("Skipping test case")
+                    main.skipCase()
+
+            main.log.report("----------------------------------------------------")
+            main.log.report("Scale: " + str(clusterCount) + "\tIntent batch size: " + str(intentSize))
+            main.log.report("Data samples: " + str(sampleSize) + "\tWarm up tests: " + str(warmUp))
+            main.log.report("Installed average: " + str(numpy.mean(installed)))
+            main.log.report("Installed standard deviation: " + str(numpy.std(installed)))
+            main.log.report("Withdraw average: " + str(numpy.mean(withdrawn)))
+            main.log.report("Withdraw standard deviation: " + str(numpy.std(withdrawn)))
+            main.log.report("     ")
+
+            resultString = "'" + commit + "',"
+            resultString += str(clusterCount) + ","
+            resultString += str(intentSize) + ","
+            resultString += str(numpy.mean(installed)) + ","
+            resultString += str(numpy.std(installed)) + ","
+            resultString += str(numpy.mean(withdrawn)) + ","
+            resultString += str(numpy.std(withdrawn)) + "\n"
+            resultsDB = open("/tmp/IntentInstallWithdrawLatDBWFO", "a")
+            resultsDB.write(resultString)
+            resultsDB.close()
+
+            main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+            time.sleep(20)
diff --git a/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo
new file mode 100644
index 0000000..01370b6
--- /dev/null
+++ b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo
@@ -0,0 +1,147 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+                <home>~/onos</home>
+                <nodes>7</nodes> 
+            </COMPONENTS>
+        </ONOSbench>
+
+        <ONOS1cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1cli>
+
+        <ONOS2cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2cli>
+
+        <ONOS3cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3cli>
+
+        <ONOS4cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4cli>
+
+        <ONOS5cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5cli>
+
+        <ONOS6cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6cli>
+
+        <ONOS7cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</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/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py
diff --git a/TestON/tests/SCPFintentRerouteLatWithFlowObj/README b/TestON/tests/SCPFintentRerouteLatWithFlowObj/README
new file mode 100644
index 0000000..af912f1
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/README
@@ -0,0 +1,29 @@
+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 "admin" 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/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params
new file mode 100644
index 0000000..73175d1
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params
@@ -0,0 +1,79 @@
+<PARAMS>
+
+    <testcases>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>
+        <wait></wait>
+        <intents>1,100,1000</intents>                       #list format, will be split on ','
+        <debug>True</debug>
+
+        <s1>1,1,1,1,1,1,1,1</s1>
+        <s3>2,2,1,1,3,3,3,1</s3>
+        <s5>2,2,1,1,3,4,5,3</s5>
+        <s7>2,3,1,1,5,6,7,4</s7>
+
+    </TEST>
+
+    <METRICS>
+        <Submitted>0</Submitted>
+        <Installed>1</Installed>
+        <Failed>0</Failed>
+        <Withdraw>0</Withdraw>
+        <Withdrawn>0</Withdrawn>
+    </METRICS>
+
+    <GIT>
+        <autopull>off</autopull>
+        <checkout>master</checkout>
+    </GIT>
+
+    <CTRL>
+        <USER>admin</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>localhost</ip1>
+    </MN>
+
+    <BENCH>
+        <user>admin</user>
+        <ip1>localhost</ip1>
+    </BENCH>
+
+    <JSON>
+    </JSON>
+
+</PARAMS>
diff --git a/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
new file mode 100644
index 0000000..439ecef
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
@@ -0,0 +1,419 @@
+# ScaleOutTemplate
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os.path
+
+
+class SCPFintentRerouteLatWithFlowObj:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):
+
+        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' ]
+        BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+        main.maxNodes = int(main.params[ 'max' ])
+        skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+
+        # -- 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 = [ 0 ]
+            scale = (main.params[ 'SCALE' ]).split(",")
+            clusterCount = int(scale[0])
+
+            #Populate ONOSIp with ips from params
+            ONOSIp = [0]
+            ONOSIp.extend(main.ONOSbench.getOnosIps())
+
+            print("-----------------" + str(ONOSIp))
+            #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" )
+
+            commit = main.ONOSbench.getVersion()
+            commit = (commit.split(" "))[1]
+
+            resultsDB = open("/tmp/IntentRerouteLatDBWithFlowObj", "w+")
+            resultsDB.close()
+
+        # -- END OF INIT SECTION --#
+
+        clusterCount = int(scale[0])
+        scale.remove(scale[0])
+
+        #kill off all onos processes
+        main.log.step("Safety check, killing all ONOS processes")
+        main.log.step("before initiating environment setup")
+        for node in range(1, main.maxNodes + 1):
+            main.ONOSbench.onosDie(ONOSIp[node])
+
+        #Uninstall everywhere
+        main.log.step( "Cleaning Enviornment..." )
+        for i in range(1, main.maxNodes + 1):
+            main.log.info(" Uninstalling ONOS " + str(i) )
+            main.ONOSbench.onosUninstall( ONOSIp[i] )
+
+        #construct the cell file
+        main.log.info("Creating cell file")
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+            cellIp.append(ONOSIp[node])
+
+        main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), cellIp)
+
+        main.step( "Set Cell" )
+        main.ONOSbench.setCell(cellName)
+
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage()
+
+        main.step( "verify cells" )
+        verifyCellResult = main.ONOSbench.verifyCell()
+
+        main.log.report( "Initializing " + str( clusterCount ) + " node cluster." )
+        for node in range(1, clusterCount + 1):
+            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+            main.ONOSbench.onosInstall( ONOSIp[node])
+
+        for node in range(1, clusterCount + 1):
+            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")
+
+        deviceMastership = (main.params[ 'TEST' ][ "s" + str(clusterCount) ]).split(",")
+        print("Device mastership list: " + str(deviceMastership))
+
+        main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled false")
+
+        main.log.step("Setting up null provider")
+        for i in range(3):
+            main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "deviceCount 8")
+            main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "topoShape reroute")
+            main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
+            main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator", "useFlowObjectives true" )
+            time.sleep(5)
+            main.ONOSbench.handle.sendline("onos $OC1 summary")
+            main.ONOSbench.handle.expect(":~")
+            x = main.ONOSbench.handle.before
+            if "devices=8" in x and "links=16," in x:
+                break
+
+        index = 1
+        for node in deviceMastership:
+            for attempt in range(0,10):
+                cmd = ( "onos $OC" + node + """ "device-role null:000000000000000""" + str(index) + " " + ONOSIp[int(node)]  + """ master" """)
+                main.log.info("assigning mastership of device " + str(index) + " to node " + node + ": \n " + cmd + "\n")
+                main.ONOSbench.handle.sendline(cmd)
+                main.ONOSbench.handle.expect(":~")
+                time.sleep(4)
+
+                cmd = ( "onos $OC" + node + " roles|grep 00000" + str(index))
+                main.log.info(cmd)
+                main.ONOSbench.handle.sendline(cmd)
+                main.ONOSbench.handle.expect(":~")
+                check = main.ONOSbench.handle.before
+                main.log.info("CHECK:\n" + check)
+                if ("master=" + ONOSIp[int(node)]) in check:
+                    break
+            index += 1
+
+        main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+
+    def CASE2( self, main ):
+
+        import time
+        import numpy
+        import datetime
+        #from scipy import stats
+
+        ts = time.time()
+
+        sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
+        warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
+        intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
+        debug = main.params[ 'TEST' ][ 'debug' ]
+        for i in range(0,len(intentsList)):
+            intentsList[i] = int(intentsList[i])
+
+        timestampMetrics = []
+        if main.params['METRICS']['Submitted'] == "1":
+            timestampMetrics.append("Submitted")
+        if main.params['METRICS']['Installed'] == "1":
+            timestampMetrics.append("Installed")
+        if main.params['METRICS']['Failed'] == "1":
+            timestampMetrics.append("Failed")
+        if main.params['METRICS']['Withdraw'] == "1":
+            timestampMetrics.append("Withdraw")
+        if main.params['METRICS']['Withdrawn'] == "1":
+            timestampMetrics.append("Withdrawn")
+        if debug: main.log.info(timestampMetrics)
+
+        if debug == "True":
+            debug = True
+        else:
+            debug = False
+
+        ingress = "null:0000000000000001"
+        egress = "null:0000000000000007"
+
+        for intents in intentsList:
+            main.log.report("Intent Batch size: " + str(intents) + "\n      ")
+            myResult = [["latency", "lastNode"] for x in range(sampleSize)]
+
+            for run in range(0, (warmUp + sampleSize)):
+                if run > warmUp:
+                    main.log.info("Starting test iteration " + str(run-warmUp))
+
+                cmd = """onos $OC1 "push-test-intents -i """
+                cmd += ingress + "/0 "
+                cmd += egress + "/0 "
+                cmd += str(intents) +""" 1" """
+                if debug: main.log.info(cmd)
+
+                withdrawCmd = cmd.replace("intents -i", "intents -w ")
+
+                #push-test-intents
+                main.ONOSbench.handle.sendline(cmd)
+                main.ONOSbench.handle.expect(":~")
+                myRawResult = main.ONOSbench.handle.before
+
+                for i in range(0, 40):
+                    main.ONOSbench.handle.sendline("onos $OC1 summary")
+                    main.ONOSbench.handle.expect(":~")
+                    linkCheck = main.ONOSbench.handle.before
+                    if ("links=16,") in linkCheck and ("flows=" + str(intents*7) + ","):
+                        break
+                    if i == 39:
+                        main.log.error("Flow/link count incorrect, data invalid."+ linkCheck)
+                        main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
+                        #main.ONOSbench.logReport(ONOSIp[(clusterCount-1)], ["ERROR", "WARNING", "EXCEPT"], "d")
+                        main.ONOSbench.sendline("onos $OC1 summary")
+                        main.ONOSbench.sendline("onos $OC1 devices")
+                        main.ONOSbench.sendline("onos $OC1 links")
+                        main.ONOSbench.expect(":~")
+                        main.log.info(main.ONOSbench.before)
+
+                #collect timestamp from link cut
+                cmd = """onos $OC1 null-link "null:0000000000000004/1 null:0000000000000003/2 down" """
+                if debug: main.log.info("COMMAND: " + str(cmd))
+                main.ONOSbench.handle.sendline(cmd)
+                main.ONOSbench.handle.expect(":~")
+
+                cmd = "onos-ssh $OC1 cat /opt/onos/log/karaf.log | grep TopologyManager| tail -1"
+                for i in range(0,10):
+                    main.ONOSbench.handle.sendline(cmd)
+                    time.sleep(2)
+                    main.ONOSbench.handle.expect(":~")
+                    raw = main.ONOSbench.handle.before
+                    #if "NullLinkProvider" in raw and "links=14" in raw:
+                    if "links=14" in raw:
+                        break
+                    if i >= 9:
+                        main.log.error("Expected output not being recieved... continuing")
+                        main.log.info(raw)
+                        break
+                    time.sleep(2)
+
+                if debug: main.log.debug("raw: " + raw)
+
+                temp = raw.splitlines()
+
+                if debug: main.log.debug("temp (after splitlines): " + str(temp))
+
+                # Since the string is deterministic the date is always the 3rd element.
+                # However, if the data were grepping for in the onos log changes then this will
+                # not work. This is why we print out the raw and temp string so we can visually
+                # check if everything is in the correct order. temp should like this:
+                # temp = ['/onos$ onos-ssh $OC1 cat /opt/onos/log/karaf.log | grep Top ', 
+                #         'ologyManager| tail -1', '2015-10-15 12:03:33,736 ... ]
+                temp = temp[2]
+
+                if debug: main.log.debug("temp (checking for date): " + str(temp))
+
+                cutTimestamp = (temp.split(" "))[0] + " " + (temp.split(" "))[1]
+
+                if debug: main.log.info("Cut timestamp: " + cutTimestamp)
+
+                #validate link count and flow count
+                for i in range(0, 40):
+                    main.ONOSbench.handle.sendline("onos $OC1 summary")
+                    main.ONOSbench.handle.expect(":~")
+                    linkCheck = main.ONOSbench.handle.before
+                    #if "links=" + str(7*intents)+ "," in linkCheck and ("flows=" + str(7*intents) + ",") in linkCheck:
+                    if "links=14," in linkCheck and ("flows=" + str(8*intents) + ",") in linkCheck:
+                        break
+                    if i == 39:
+                        main.log.error("Link or flow count incorrect, data invalid." + linkCheck)
+                        main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
+
+                time.sleep(5) #trying to avoid negative values
+
+                #intents events metrics installed timestamp
+                IEMtimestamps = [0]*(clusterCount + 1)
+                installedTemp = [0]*(clusterCount + 1)
+                for node in range(1, clusterCount +1):
+                    cmd = "onos $OC" + str(node) + """ "intents-events-metrics"|grep Timestamp """
+                    raw = ""
+                    while "epoch)" not in raw:
+                        main.ONOSbench.handle.sendline(cmd)
+                        main.ONOSbench.handle.expect(":~")
+                        raw = main.ONOSbench.handle.before
+
+                    print(raw)
+
+                    intentsTimestamps = {}
+                    rawTimestamps = raw.splitlines()
+                    for line in rawTimestamps:
+                        if "Timestamp" in line and "grep" not in line:
+                            metricKey = (line.split(" "))[1]
+                            metricTimestamp = (line.split(" ")[len(line.split(" ")) -1]).replace("epoch)=","")
+                            metricTimestamp = float(metricTimestamp)
+                            metricTimestamp = numpy.divide(metricTimestamp, 1000)
+                            if debug: main.log.info(repr(metricTimestamp))
+                            intentsTimestamps[metricKey] = metricTimestamp
+                            if metricKey == "Installed":
+                                installedTemp[node] = metricTimestamp
+
+                    main.log.info("Node: " + str(node) + " Timestamps: " + str(intentsTimestamps))
+                    IEMtimestamps[node] = intentsTimestamps
+
+                myMax = max(installedTemp)
+                indexOfMax = installedTemp.index(myMax)
+
+                #number crunch
+                for metric in timestampMetrics:     #this is where we sould add support for computing other timestamp metrics
+                    if metric == "Installed":
+                        if run >= warmUp:
+                            main.log.report("link cut timestamp: " + cutTimestamp)
+                            #readableInstalledTimestamp = str(intentsTimestamps["Installed"])
+                            readableInstalledTimestamp = str(myMax)
+
+                            #main.log.report("Intent Installed timestamp: " + str(intentsTimestamps["Installed"]))
+                            main.log.report("Intent Installed timestamp: " + str(myMax))
+
+                            cutEpoch = time.mktime(time.strptime(cutTimestamp, "%Y-%m-%d %H:%M:%S,%f"))
+                            if debug: main.log.info("cutEpoch=" + str(cutEpoch))
+                            #rerouteLatency = float(intentsTimestamps["Installed"] - cutEpoch)
+                            rerouteLatency = float(myMax - cutEpoch)
+
+                            rerouteLatency = numpy.divide(rerouteLatency, 1000)
+                            main.log.report("Reroute latency:" + str(rerouteLatency) + " (seconds)\n    ")
+                            myResult[run-warmUp][0] = rerouteLatency
+                            myResult[run-warmUp][1] = indexOfMax
+                            if debug: main.log.info("Latency: " + str(myResult[run-warmUp][0]))
+                            if debug: main.log.info("last node: " + str(myResult[run-warmUp][1]))
+
+                cmd = """ onos $OC1 null-link "null:0000000000000004/1 null:0000000000000003/2 up" """
+                if debug: main.log.info(cmd)
+                main.ONOSbench.handle.sendline(cmd)
+                main.ONOSbench.handle.expect(":~")
+
+                #wait for intent withdraw
+                main.ONOSbench.handle.sendline(withdrawCmd)
+                main.log.info(withdrawCmd)
+                main.ONOSbench.handle.expect(":~")
+                if debug: main.log.info(main.ONOSbench.handle.before)
+                main.ONOSbench.handle.sendline("onos $OC1 intents|grep WITHDRAWN|wc -l")
+                main.ONOSbench.handle.expect(":~")
+                intentWithdrawCheck = main.ONOSbench.handle.before
+                if (str(intents)) in intentWithdrawCheck:
+                    main.log.info("intents withdrawn")
+                if debug: main.log.info(intentWithdrawCheck)
+
+                # wait for links to be reestablished
+                for i in range(0, 10):
+                    main.ONOSbench.handle.sendline("onos $OC1 summary")
+                    main.ONOSbench.handle.expect(":~")
+                    linkCheck = main.ONOSbench.handle.before
+                    if "links=16," in linkCheck:
+                        break
+                    time.sleep(1)
+                    if i == 9:
+                        main.log.info("Links Failed to reconnect, next iteration of data invalid." + linkCheck)
+
+                if run < warmUp:
+                    main.log.info("Warm up run " + str(run+1) + " completed")
+
+            if debug: main.log.info(myResult)
+            latTemp = []
+            nodeTemp = []
+            for i in myResult:
+                latTemp.append(i[0])
+                nodeTemp.append(i[1])
+
+            mode = {}
+            for i in nodeTemp:
+                if i in mode:
+                    mode[i] += 1
+                else:
+                    mode[i] = 1
+
+            for i in mode.keys():
+                if mode[i] == max(mode.values()):
+                    nodeMode = i
+
+            average = numpy.average(latTemp)
+            stdDev = numpy.std(latTemp)
+
+            average = numpy.multiply(average, 1000)
+            stdDev = numpy.multiply(stdDev, 1000)
+
+            main.log.report("Scale: " + str(clusterCount) + "  \tIntent batch: " + str(intents))
+            main.log.report("Latency average:................" + str(average))
+            main.log.report("Latency standard deviation:....." + str(stdDev))
+            main.log.report("Mode of last node to respond:..." + str(nodeMode))
+            main.log.report("________________________________________________________")
+
+            resultsDB = open("/tmp/IntentRerouteLatDBWithFlowObj", "a")
+            resultsDB.write("'" + commit + "',")
+            resultsDB.write(str(clusterCount) + ",")
+            resultsDB.write(str(intents) + ",")
+            resultsDB.write(str(average) + ",")
+            resultsDB.write(str(stdDev) + "\n")
+            resultsDB.close()
+
+            main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
diff --git a/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo
new file mode 100644
index 0000000..01370b6
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo
@@ -0,0 +1,147 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+                <home>~/onos</home>
+                <nodes>7</nodes> 
+            </COMPONENTS>
+        </ONOSbench>
+
+        <ONOS1cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1cli>
+
+        <ONOS2cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2cli>
+
+        <ONOS3cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3cli>
+
+        <ONOS4cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4cli>
+
+        <ONOS5cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5cli>
+
+        <ONOS6cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6cli>
+
+        <ONOS7cli>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</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/SCPFintentRerouteLatWithFlowObj/__init__.py b/TestON/tests/SCPFintentRerouteLatWithFlowObj/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/__init__.py
diff --git a/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
index 68b040f..830fbf2 100644
--- a/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
@@ -341,7 +341,7 @@
 
     def CASE100( self, main ):
         '''
-            Balance masters, ping and bring third ONOS node down
+           Bring Down node 3 
         '''
 
         main.case("Balancing Masters and bring ONOS node 3 down: TORUS %sx%s" % (main.currScale, main.currScale))
@@ -360,7 +360,10 @@
         main.log.info( "Removing dead node from list of active nodes" )
         main.activeNodes.pop( main.deadNode )
 
-
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully bring down node 3",
+                                 onfail="Failed to bring down node 3" )
 
     def CASE200( self, main ):
         '''
diff --git a/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py b/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
index 03d6c56..27bc5c2 100644
--- a/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
+++ b/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
@@ -402,6 +402,8 @@
         offtmp = 0
         main.step( "Pushing intents" )
         stepResult = main.TRUE
+        # temp variable to contain the number of flows
+        flowsNum = 0
 
         for i in range(limit):
 
@@ -457,9 +459,8 @@
                         break
                     intentVerify = main.FALSE
                     k = k+1
-
                 if not intentVerify:
-                    # If some intents are not installed, finished this test case
+                    # If some intents are not installed, grep the previous flows list, and finished this test case
                     main.log.warn( "Some intens did not install" )
                     # We don't want to check flows if intents not installed, because onos will drop flows
                     if currFlows == 0:
@@ -471,13 +472,16 @@
                 main.log.info("Verify Flows states")
                 k = 1
                 flowsVerify = main.TRUE
-
                 while k <= main.verifyAttempts:
                     # while loop for check flows by using REST api
                     time.sleep(3)
                     temp = 0
                     flowsStateCount = []
                     flowsState = json.loads( main.ONOSrest1.flows() )
+                    main.log.info("Total flows now: {}".format(len(flowsState)))
+                    if ( flowsNum < len(flowsState) ):
+                        flowsNum = len(flowsState)
+                    print(flowsNum)
                     for f in flowsState:
                         # get PENDING_ADD flows
                         if f.get("state") == "PENDING_ADD":
@@ -531,7 +535,7 @@
 
         # we need the total intents before crash
         totalIntents = len(intentsState)
-        totalFlows = len(flowsState)
+        totalFlows = flowsNum
 
         main.log.info( "Total Intents Installed before crash: {}".format( totalIntents ) )
         main.log.info( "Total Flows ADDED before crash: {}".format( totalFlows ) )
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/rerouteTopo.py b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/rerouteTopo.py
new file mode 100755
index 0000000..774f12f
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/rerouteTopo.py
@@ -0,0 +1,74 @@
+#!/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/SCPFscalingMaxIntentsWithFlowObj/Dependency/startUp.py b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/startUp.py
new file mode 100644
index 0000000..bf2a2b6
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/startUp.py
@@ -0,0 +1,38 @@
+"""
+    This wrapper function is use for starting up onos instance
+"""
+
+import time
+import os
+import json
+
+def onosBuild( main, gitBranch ):
+    """
+        This includes pulling ONOS and building it using maven install
+    """
+
+    buildResult = main.FALSE
+
+    # Git checkout a branch of ONOS
+    checkOutResult = main.ONOSbench.gitCheckout( gitBranch )
+    # Does the git pull on the branch that was checked out
+    if not checkOutResult:
+        main.log.warn( "Failed to checked out " + gitBranch +
+                                           " branch")
+    else:
+        main.log.info( "Successfully checked out " + gitBranch +
+                                           " branch")
+    gitPullResult = main.ONOSbench.gitPull()
+    if gitPullResult == main.ERROR:
+        main.log.error( "Error pulling git branch" )
+    else:
+        main.log.info( "Successfully pulled " + gitBranch + " branch" )
+
+    # Maven clean install
+    buildResult = main.ONOSbench.cleanInstall()
+
+    return buildResult
+
+
+
+
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/README b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/README
new file mode 100644
index 0000000..0c16859
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/README
@@ -0,0 +1,11 @@
+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/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params
new file mode 100644
index 0000000..a6a3377
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params
@@ -0,0 +1,99 @@
+<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/SCPFscalingMaxIntents/Dependency/</path>
+        <wrapper1>startUp</wrapper1>
+        <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>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>100</batch_size>
+            <min_intents>100</min_intents>
+            <max_intents>100000</max_intents>
+            <check_interval>100</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/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py
new file mode 100644
index 0000000..e405fd3
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py
@@ -0,0 +1,561 @@
+import sys
+import json
+import time
+import os
+'''
+SCPFscalingMaxIntentsWithFlowObj
+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.ONOSip = []
+        main.maxNumBatch = 0
+        main.ONOSip = main.ONOSbench.getOnosIps()
+        main.log.info(main.ONOSip)
+        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.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.log.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
+
+        time.sleep(main.startUpSleep)
+
+        main.step("Activating openflow")
+        appStatus = utilities.retry( main.ONOSrest1.activateApp,
+                                     main.FALSE,
+                                     ['org.onosproject.openflow'],
+                                     sleep=3,
+                                     attempts=3 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=appStatus,
+                                 onpass="Successfully activated openflow",
+                                 onfail="Failed activate openflow" )
+
+        time.sleep(main.startUpSleep)
+        main.log.info("Set Intent Compiler use Flow Object")
+        main.CLIs[0].setCfg( "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator", "useFlowObjectives", "true" )
+
+        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:"
+
+        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
+        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
+
+        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 } )
+                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
+                intentVerify = main.FALSE
+
+                while k <= main.verifyAttempts:
+                    # while loop for check intents by using REST api
+                    time.sleep(5)
+                    temp = 0
+                    intentsState = json.loads( main.ONOSrest1.intents() )
+                    for f in intentsState:
+                        # get INSTALLED intents number
+                        if f.get("state") == "INSTALLED":
+                            temp = temp + 1
+
+                    main.log.info("Total Intents: {} INSTALLED: {}".format(totalIntents, temp))
+                    if totalIntents == temp:
+                        intentVerify = main.TRUE
+                        break
+                    intentVerify = main.FALSE
+                    k = k+1
+                if not intentVerify:
+                    # If some intents are not installed, grep the previous flows list, and finished this test case
+                    main.log.warn( "Some intens did not install" )
+                    # We don't want to check flows if intents not installed, because onos will drop flows
+                    if currFlows == 0:
+                    # If currFlows equal 0, which means we failed to install intents at first, or we didn't get
+                    # the correct number, so we need get flows here.
+                        flowsState = json.loads( main.ONOSrest1.flows() )
+                    break
+
+                main.log.info("Verify Flows states")
+                k = 1
+                flowsVerify = main.TRUE
+                while k <= main.verifyAttempts:
+                    # while loop for check flows by using REST api
+                    time.sleep(3)
+                    temp = 0
+                    flowsStateCount = []
+                    flowsState = json.loads( main.ONOSrest1.flows() )
+                    main.log.info("Total flows now: {}".format(len(flowsState)))
+                    if ( flowsNum < len(flowsState) ):
+                        flowsNum = len(flowsState)
+                    print(flowsNum)
+                    for f in flowsState:
+                        # get PENDING_ADD flows
+                        if f.get("state") == "PENDING_ADD":
+                            temp = temp + 1
+
+                    flowsStateCount.append(temp)
+                    temp = 0
+
+                    for f in flowsState:
+                        # get PENDING_REMOVE flows
+                        if f.get("state") == "PENDING_REMOVE":
+                            temp = temp + 1
+
+                    flowsStateCount.append(temp)
+                    temp = 0
+
+                    for f in flowsState:
+                        # get REMOVED flows
+                        if f.get("state") == "REMOVED":
+                            temp = temp + 1
+
+                    flowsStateCount.append(temp)
+                    temp = 0
+
+                    for f in flowsState:
+                        # get FAILED flwos
+                        if f.get("state") == "FAILED":
+                            temp = temp + 1
+
+                    flowsStateCount.append(temp)
+                    temp = 0
+                    k = k + 1
+                    for c in flowsStateCount:
+                        if int(c) > 0:
+                            flowsVerify = main.FALSE
+
+                    main.log.info( "Check flows States:" )
+                    main.log.info( "PENDING_ADD: {}".format( flowsStateCount[0]) )
+                    main.log.info( "PENDING_REMOVE: {}".format( flowsStateCount[1]) )
+                    main.log.info( "REMOVED: {}".format( flowsStateCount[2]) )
+                    main.log.info( "FAILED: {}".format( flowsStateCount[3]) )
+
+                    if flowsVerify == main.TRUE:
+                        break
+
+        del main.scale[0]
+        utilities.assert_equals( expect = main.TRUE,
+                                 actual = intentVerify,
+                                 onpass = "Successfully pushed and verified intents",
+                                 onfail = "Failed to push and verify intents" )
+
+        # we need the total intents before crash
+        totalIntents = len(intentsState)
+        totalFlows = flowsNum
+
+        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/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo
new file mode 100755
index 0000000..fd28336
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo
@@ -0,0 +1,101 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</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>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli1>
+
+        <ONOScli2>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli2>
+
+        <ONOScli3>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli3>
+
+        <ONOScli4>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli4>
+
+        <ONOScli5>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli5>
+
+        <ONOScli6>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli6>
+
+        <ONOScli7>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli7>
+
+        <Mininet1>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>MininetCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS>
+            </COMPONENTS>
+        </Mininet1>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/__init__.py b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/__init__.py
diff --git a/TestON/tests/USECASE_SdnipFunction/Dependency/Functions.py b/TestON/tests/USECASE_SdnipFunction/Dependency/Functions.py
index ddd8c1e..428cbce 100644
--- a/TestON/tests/USECASE_SdnipFunction/Dependency/Functions.py
+++ b/TestON/tests/USECASE_SdnipFunction/Dependency/Functions.py
@@ -1,11 +1,16 @@
 
 def checkRouteNum( main, routeNumExpected ):
+    import time
     main.step( "Check routes installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Route number expected:" )
     main.log.info( routeNumExpected )
     main.log.info( "Route number from ONOS CLI:" )
 
     routeNumActual = main.ONOScli.ipv4RouteNumber()
+    if routeNumActual != routeNumExpected:
+        time.sleep( wait )
+        routeNumActual = main.ONOScli.ipv4RouteNumber()
     main.log.info( routeNumActual )
     utilities.assertEquals( \
         expect = routeNumExpected, actual = routeNumActual,
@@ -13,13 +18,20 @@
         onfail = "Route number is wrong!" )
 
 def checkM2SintentNum( main, intentNumExpected ):
+    import time
     main.step( "Check M2S intents installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Intent number expected:" )
     main.log.info( intentNumExpected )
     main.log.info( "Intent number from ONOS CLI:" )
     jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
                                        TYPE = "multiPointToSinglePoint" )
     intentNumActual = jsonResult['installed']
+    if intentNumActual != intentNumExpected:
+        time.sleep( wait )
+        jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
+                                           TYPE = "multiPointToSinglePoint" )
+        intentNumActual = jsonResult['installed']
     main.log.info( intentNumActual )
     utilities.assertEquals( \
         expect = intentNumExpected, actual = intentNumActual,
@@ -27,13 +39,21 @@
         onfail = "M2S intent number is wrong!" )
 
 def checkP2PintentNum( main, intentNumExpected ):
+    import time
     main.step( "Check P2P intents installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Intent number expected:" )
     main.log.info( intentNumExpected )
     main.log.info( "Intent number from ONOS CLI:" )
     jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
                                        TYPE = "pointToPoint" )
     intentNumActual = jsonResult['installed']
+
+    if intentNumActual != intentNumExpected:
+        time.sleep( wait )
+        jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
+                                           TYPE = "pointToPoint" )
+        intentNumActual = jsonResult['installed']
     main.log.info( intentNumActual )
     utilities.assertEquals( \
         expect = intentNumExpected, actual = intentNumActual,
@@ -41,11 +61,16 @@
         onfail = "P2P intent number is wrong!" )
 
 def checkFlowNum( main, switch, flowNumExpected ):
+    import time
     main.step( "Check flow entry number in " + switch )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Flow number expected:" )
     main.log.info( flowNumExpected )
     main.log.info( "Flow number actual:" )
     flowNumActual = main.Mininet.getSwitchFlowCount( switch )
+    if flowNumActual != flowNumExpected :
+        time.sleep( wait )
+        flowNumActual = main.Mininet.getSwitchFlowCount( switch )
     main.log.info( flowNumActual )
     utilities.assertEquals( \
         expect = flowNumExpected, actual = flowNumActual,
@@ -109,7 +134,8 @@
         * expectAllSuccess - boolean indicating if you expect all results
         succeed if True, otherwise expect all results fail if False
     """
-    main.step( "Check ping between each host pair" )
+    main.step( "Check ping between each host pair, expect all to succede=" +
+               str( expectAllSuccess ) )
     if len( hosts ) == 0:
         main.log.error( "Parameter hosts can not be empty." )
         main.cleanup()
diff --git a/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.params b/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.params
index a7a8f72..404aa10 100644
--- a/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.params
+++ b/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.params
@@ -1,10 +1,11 @@
 <PARAMS>
 
-    <testcases>100, 101, 102, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10</testcases>
+    <testcases>101, 100, 200, 102, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10</testcases>
 
     #Environment variables
     <ENV>
-        <cellName>sdnip_single_instance</cellName>
+        <cellName>sdnip_single</cellName>
+        <appString>drivers,openflow,proxyarp</appString>
     </ENV>
 
     <CTRL>
@@ -13,16 +14,6 @@
         <port1>6653</port1>
     </CTRL>
 
-    <GIT>
-        <branch1>master</branch1>
-        <branch2>onos-1.3</branch2>
-    </GIT>
-
-    <JSON>
-        <prefix>prefix</prefix>
-        <nextHop>nextHop</nextHop>
-    </JSON>
-
     <DEPENDENCY>
         <path>/USECASE_SdnipFunction/Dependency/</path>
         <topology>USECASE_SdnipI2MN.py</topology>
diff --git a/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.py b/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.py
index ee0b120..8e601a3 100644
--- a/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.py
+++ b/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.py
@@ -5,7 +5,6 @@
         self.default = ''
         global branchName
 
-    # This case is to setup Mininet testbed
     def CASE100( self, main ):
         """
             Start mininet
@@ -19,11 +18,11 @@
 
         main.step( "Starting Mininet Topology" )
         topology = main.dependencyPath + main.topology
-        topoResult = main.Mininet.startNet( topoFile = topology )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = topoResult,
-                                 onpass = "Successfully loaded topology",
-                                 onfail = "Failed to load topology" )
+        topoResult = main.Mininet.startNet( topoFile=topology )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=topoResult,
+                                 onpass="Successfully loaded topology",
+                                 onfail="Failed to load topology" )
         # Exit if topology did not load properly
         if not topoResult:
             main.cleanup()
@@ -37,11 +36,10 @@
         for i in range ( 1, int( main.params['config']['switchNum'] ) + 1 ):
             sw = "sw%s" % ( i )
             swResult = swResult and main.Mininet.assignSwController( sw, ONOS1Ip )
-            # swResult = swResult and main.Mininet.assignSwController( sw, ONOS1Ip, port = "6633" )
-        utilities.assert_equals( expect = main.TRUE,
-                             actual = swResult,
-                             onpass = "Successfully connect all switches to ONOS",
-                             onfail = "Failed to connect all switches to ONOS" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=swResult,
+                                 onpass="Successfully connect all switches to ONOS",
+                                 onfail="Failed to connect all switches to ONOS" )
         if not swResult:
             main.cleanup()
             main.exit()
@@ -53,16 +51,14 @@
 
         tunnelResult = main.TRUE
         tunnelResult = main.Mininet.node( "root", command )
-        utilities.assert_equals( expect = True,
-                             actual = ( "PasswordAuthentication" in tunnelResult ),
-                             onpass = "Created tunnel succeeded",
-                             onfail = "Create tunnel failed" )
+        utilities.assert_equals( expect=True,
+                                 actual=( "PasswordAuthentication" in tunnelResult ),
+                                 onpass="Created tunnel succeeded",
+                                 onfail="Create tunnel failed" )
         if ("PasswordAuthentication" not in tunnelResult) :
             main.cleanup()
             main.exit()
 
-
-    # This case is to setup ONOS
     def CASE101( self, main ):
         """
            Package ONOS and install it
@@ -75,123 +71,141 @@
         """
         import json
         import time
+        import os
         from operator import eq
 
-        main.case( "Setting up test environment" )
+        main.case( "Setting up ONOS environment" )
 
         cellName = main.params[ 'ENV' ][ 'cellName' ]
+        global ONOS1Ip
+        ONOS1Ip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
+        ipList = [ ONOS1Ip ]
+
+        main.step( "Create cell file" )
+        cellAppString = main.params[ 'ENV' ][ 'appString' ]
+        main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
+                                       main.Mininet.ip_address,
+                                       cellAppString, ipList )
 
         main.step( "Applying cell variable to environment" )
         cellResult = main.ONOSbench.setCell( cellName )
-        utilities.assert_equals( expect = main.TRUE,
-                             actual = cellResult,
-                             onpass = "Set cell succeeded",
-                             onfail = "Set cell failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=cellResult,
+                                 onpass="Set cell succeeded",
+                                 onfail="Set cell failed" )
 
         verifyResult = main.ONOSbench.verifyCell()
-        utilities.assert_equals( expect = main.TRUE,
-                             actual = verifyResult,
-                             onpass = "Verify cell succeeded",
-                             onfail = "Verify cell failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=verifyResult,
+                                 onpass="Verify cell succeeded",
+                                 onfail="Verify cell failed" )
 
         branchName = main.ONOSbench.getBranchName()
         main.log.report( "ONOS is on branch: " + branchName )
 
         main.log.step( "Uninstalling ONOS" )
         uninstallResult = main.ONOSbench.onosUninstall( ONOS1Ip )
-        utilities.assert_equals( expect = main.TRUE,
-                                actual = uninstallResult,
-                                onpass = "Uninstall ONOS succeeded",
-                                onfail = "Uninstall ONOS failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=uninstallResult,
+                                 onpass="Uninstall ONOS succeeded",
+                                 onfail="Uninstall ONOS failed" )
         '''
         main.step( "Git pull" )
         gitPullResult = main.ONOSbench.gitPull()
         main.log.info( "gitPullResult" )
         main.log.info( gitPullResult )
         gitPullResult2 = ( gitPullResult == main.TRUE ) or ( gitPullResult == 3 )
-        utilities.assert_equals( expect = True,
-                                 actual = gitPullResult2,
-                                 onpass = "Git pull ONOS succeeded",
-                                 onfail = "Git pull ONOS failed" )
+        utilities.assert_equals( expect=True,
+                                 actual=gitPullResult2,
+                                 onpass="Git pull ONOS succeeded",
+                                 onfail="Git pull ONOS failed" )
 
         main.step( "Using mvn clean install" )
         if gitPullResult == main.TRUE:
-            mciResult = main.ONOSbench.cleanInstall( mciTimeout = 1000 )
-            utilities.assert_equals( expect = main.TRUE,
-                                     actual = mciResult,
-                                     onpass = "Maven clean install ONOS succeeded",
-                                     onfail = "Maven clean install ONOS failed" )
+            mciResult = main.ONOSbench.cleanInstall( mciTimeout=1000 )
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=mciResult,
+                                     onpass="Maven clean install ONOS succeeded",
+                                     onfail="Maven clean install ONOS failed" )
         else:
              main.log.warn( "Did not pull new code so skipping mvn " +
                             "clean install" )
              mciResult = main.TRUE
         '''
 
-        main.ONOSbench.getVersion( report = True )
+        main.ONOSbench.getVersion( report=True )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage( opTimeout = 500 )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = packageResult,
-                                 onpass = "Package ONOS succeeded",
-                                 onfail = "Package ONOS failed" )
+        packageResult = main.ONOSbench.onosPackage( opTimeout=500 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=packageResult,
+                                 onpass="Package ONOS succeeded",
+                                 onfail="Package ONOS failed" )
 
         main.step( "Installing ONOS package" )
-        onos1InstallResult = main.ONOSbench.onosInstall( options = "-f",
-                                                         node = ONOS1Ip )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = onos1InstallResult,
-                                 onpass = "Install ONOS succeeded",
-                                 onfail = "Install ONOS failed" )
+        onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                         node=ONOS1Ip )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=onos1InstallResult,
+                                 onpass="Install ONOS succeeded",
+                                 onfail="Install ONOS failed" )
 
         main.step( "Checking if ONOS is up yet" )
-        onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout = 420 )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = onos1UpResult,
-                                 onpass = "ONOS is up",
-                                 onfail = "ONOS is NOT up" )
+        onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout=420 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=onos1UpResult,
+                                 onpass="ONOS is up",
+                                 onfail="ONOS is NOT up" )
 
         main.step( "Checking if ONOS CLI is ready" )
         cliResult = main.ONOScli.startOnosCli( ONOS1Ip,
-                commandlineTimeout = 100, onosStartTimeout = 600 )
-        utilities.assert_equals( expect = main.TRUE,
-                         actual = cliResult,
-                         onpass = "ONOS CLI is ready",
-                         onfail = "ONOS CLI is NOT ready" )
+                commandlineTimeout=100, onosStartTimeout=600 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=cliResult,
+                                 onpass="ONOS CLI is ready",
+                                 onfail="ONOS CLI is not ready" )
 
-        caseResult = ( cellResult and verifyResult and
-                       packageResult and
-                       onos1InstallResult and onos1UpResult and cliResult )
+        for i in range( 10 ):
+            ready = True
+            output = main.ONOScli.summary()
+            if not output:
+                ready = False
+            if ready:
+                break
+            time.sleep( 30 )
+        utilities.assert_equals( expect=True, actual=ready,
+                                 onpass="ONOS summary command succeded",
+                                 onfail="ONOS summary command failed" )
 
-        utilities.assert_equals( expect = main.TRUE, actual = caseResult,
-                                 onpass = "ONOS startup successful",
-                                 onfail = "ONOS startup NOT successful" )
-
-        if caseResult == main.FALSE:
-            main.log.info( "ONOS startup failed!" )
+        if not ready:
+            main.log.error( "ONOS startup failed!" )
             main.cleanup()
             main.exit()
 
+    def CASE200( self, main ):
+        main.case( "Activate sdn-ip application" )
+        main.log.info( "waiting link discovery......" )
+        time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+
         main.log.info( "Get links in the network" )
-        time.sleep( int ( main.params['timers']['TopoDiscovery'] ) )
         summaryResult = main.ONOScli.summary()
         linkNum = json.loads( summaryResult )[ "links" ]
+        listResult = main.ONOScli.links( jsonFormat=False )
+        main.log.info( listResult )
         if linkNum < 100:
-            main.log.info( "Link number is wrong!" )
-            listResult = main.ONOScli.links( jsonFormat = False )
+            main.log.error( "Link number is wrong!" )
+            time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+            listResult = main.ONOScli.links( jsonFormat=False )
             main.log.info( listResult )
             main.cleanup()
             main.exit()
 
-        listResult = main.ONOScli.links( jsonFormat = False )
-        main.log.info( listResult )
-
         main.step( "Activate sdn-ip application" )
         activeSDNIPresult = main.ONOScli.activateApp( "org.onosproject.sdnip" )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = activeSDNIPresult,
-                                 onpass = "Activate SDN-IP succeeded",
-                                 onfail = "Activate SDN-IP failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=activeSDNIPresult,
+                                 onpass="Activate SDN-IP succeeded",
+                                 onfail="Activate SDN-IP failed" )
         if not activeSDNIPresult:
             main.log.info( "Activate SDN-IP failed!" )
             main.cleanup()
@@ -226,39 +240,45 @@
         '''
 
         main.case( "Ping tests between BGP peers and speakers" )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
 
 
     def CASE2( self, main ):
         '''
         point-to-point intents test for each BGP peer and BGP speaker pair
         '''
+        import time
         main.case( "Check point-to-point intents" )
         main.log.info( "There are %s BGP peers in total "
                        % main.params[ 'config' ][ 'peerNum' ] )
         main.step( "Check P2P intents number from ONOS CLI" )
 
-        getIntentsResult = main.ONOScli.intents( jsonFormat = True )
+        getIntentsResult = main.ONOScli.intents( jsonFormat=True )
         bgpIntentsActualNum = \
             main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6
+        if bgpIntentsActualNum != bgpIntentsExpectedNum:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            bgpIntentsActualNum = \
+                main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         main.log.info( "bgpIntentsExpected num is:" )
         main.log.info( bgpIntentsExpectedNum )
         main.log.info( "bgpIntentsActual num is:" )
         main.log.info( bgpIntentsActualNum )
         utilities.assertEquals( \
-            expect = True,
-            actual = eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
-            onpass = "PointToPointIntent Intent Num is correct!",
-            onfail = "PointToPointIntent Intent Num is wrong!" )
+            expect=True,
+            actual=eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
+            onpass="PointToPointIntent Intent Num is correct!",
+            onfail="PointToPointIntent Intent Num is wrong!" )
 
 
     def CASE3( self, main ):
         '''
         routes and intents check to all BGP peers
         '''
+        import time
         main.case( "Check routes and M2S intents to all BGP peers" )
 
         allRoutesExpected = []
@@ -266,11 +286,16 @@
         allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
         allRoutesExpected.append( "6.0.0.0/24" + "/" + "10.0.6.1" )
 
-        getRoutesResult = main.ONOScli.routes( jsonFormat = True )
+        getRoutesResult = main.ONOScli.routes( jsonFormat=True )
         allRoutesActual = \
             main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
         allRoutesStrExpected = str( sorted( allRoutesExpected ) )
         allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
+        if allRoutesStrActual != allRoutesStrExpected:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            allRoutesActual = \
+                main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
+            allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
 
         main.step( "Check routes installed" )
         main.log.info( "Routes expected:" )
@@ -278,32 +303,40 @@
         main.log.info( "Routes get from ONOS CLI:" )
         main.log.info( allRoutesStrActual )
         utilities.assertEquals( \
-            expect = allRoutesStrExpected, actual = allRoutesStrActual,
-            onpass = "Routes are correct!",
-            onfail = "Routes are wrong!" )
+            expect=allRoutesStrExpected, actual=allRoutesStrActual,
+            onpass="Routes are correct!",
+            onfail="Routes are wrong!" )
 
         main.step( "Check M2S intents installed" )
-        getIntentsResult = main.ONOScli.intents( jsonFormat = True )
+        getIntentsResult = main.ONOScli.intents( jsonFormat=True )
         routeIntentsActualNum = \
             main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
         routeIntentsExpectedNum = 3
+        if routeIntentsActualNum != routeIntentsExpectedNum:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            routeIntentsActualNum = \
+                main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
 
         main.log.info( "MultiPointToSinglePoint Intent Num expected is:" )
         main.log.info( routeIntentsExpectedNum )
         main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
         main.log.info( routeIntentsActualNum )
         utilities.assertEquals( \
-            expect = True,
-            actual = eq( routeIntentsExpectedNum, routeIntentsActualNum ),
-            onpass = "MultiPointToSinglePoint Intent Num is correct!",
-            onfail = "MultiPointToSinglePoint Intent Num is wrong!" )
+            expect=routeIntentsExpectedNum,
+            actual=routeIntentsActualNum,
+            onpass="MultiPointToSinglePoint Intent Num is correct!",
+            onfail="MultiPointToSinglePoint Intent Num is wrong!" )
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
 
     def CASE4( self, main ):
@@ -312,8 +345,8 @@
         '''
         main.case( "Ping test for each route, all hosts behind BGP peers" )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE5( self, main ):
@@ -323,68 +356,72 @@
         import time
         main.case( "Bring down links and check routes/intents" )
         main.step( "Bring down the link between sw32 and peer64514" )
-        linkResult1 = main.Mininet.link( END1 = "sw32", END2 = "peer64514",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult1,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
+                                         OPTION="down" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult1,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
 
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 2 )
             main.Functions.checkM2SintentNum( main, 2 )
         else:
-            main.log.info( "Bring down link failed!" )
+            main.log.error( "Bring down link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Bring down the link between sw8 and peer64515" )
-        linkResult2 = main.Mininet.link( END1 = "sw8", END2 = "peer64515",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult2,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
+                                         OPTION="down" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult2,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
             main.Functions.checkM2SintentNum( main, 1 )
         else:
-            main.log.info( "Bring down link failed!" )
+            main.log.error( "Bring down link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Bring down the link between sw28 and peer64516" )
-        linkResult3 = main.Mininet.link( END1 = "sw28", END2 = "peer64516",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult3,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
+                                         OPTION="down" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult3,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 0 )
             main.Functions.checkM2SintentNum( main, 0 )
         else:
-            main.log.info( "Bring down link failed!" )
+            main.log.error( "Bring down link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = False )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=False )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = False )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=False )
 
 
     def CASE6( self, main ):
@@ -394,67 +431,71 @@
         import time
         main.case( "Bring up links and check routes/intents" )
         main.step( "Bring up the link between sw32 and peer64514" )
-        linkResult1 = main.Mininet.link( END1 = "sw32", END2 = "peer64514",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult1,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult1,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
             main.Functions.checkM2SintentNum( main, 1 )
         else:
-            main.log.info( "Bring up link failed!" )
+            main.log.error( "Bring up link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Bring up the link between sw8 and peer64515" )
-        linkResult2 = main.Mininet.link( END1 = "sw8", END2 = "peer64515",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult2,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult2,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 2 )
             main.Functions.checkM2SintentNum( main, 2 )
         else:
-            main.log.info( "Bring up link failed!" )
+            main.log.error( "Bring up link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Bring up the link between sw28 and peer64516" )
-        linkResult3 = main.Mininet.link( END1 = "sw28", END2 = "peer64516",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult3,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult3,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
             main.Functions.checkM2SintentNum( main, 3 )
         else:
-            main.log.info( "Bring up link failed!" )
+            main.log.error( "Bring up link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE7( self, main ):
@@ -464,10 +505,10 @@
         import time
         main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
         main.step( "Stop sw32" )
-        result = main.Mininet.switch( SW = "sw32", OPTION = "stop" )
-        utilities.assertEquals( expect = main.TRUE, actual = result,
-                                onpass = "Stopping switch succeeded!",
-                                onfail = "Stopping switch failed!" )
+        result = main.Mininet.switch( SW="sw32", OPTION="stop" )
+        utilities.assertEquals( expect=main.TRUE, actual=result,
+                                onpass="Stopping switch succeeded!",
+                                onfail="Stopping switch failed!" )
 
         if result == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -475,46 +516,50 @@
             main.Functions.checkM2SintentNum( main, 2 )
             main.Functions.checkP2PintentNum( main, 12 )
         else:
-            main.log.info( "Stopping switch failed!" )
+            main.log.error( "Stopping switch failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check ping between hosts behind BGP peers" )
-        result1 = main.Mininet.pingHost( src = "host64514", target = "host64515" )
-        result2 = main.Mininet.pingHost( src = "host64515", target = "host64516" )
-        result3 = main.Mininet.pingHost( src = "host64514", target = "host64516" )
+        result1 = main.Mininet.pingHost( src="host64514", target="host64515" )
+        result2 = main.Mininet.pingHost( src="host64515", target="host64516" )
+        result3 = main.Mininet.pingHost( src="host64514", target="host64516" )
 
         pingResult1 = ( result1 == main.FALSE ) and ( result2 == main.TRUE ) \
                                                 and ( result3 == main.FALSE )
-        utilities.assert_equals( expect = True, actual = pingResult1,
-                                 onpass = "Ping test result is correct",
-                                 onfail = "Ping test result is wrong" )
+        utilities.assert_equals( expect=True, actual=pingResult1,
+                                 onpass="Ping test result is correct",
+                                 onfail="Ping test result is wrong" )
 
         if pingResult1 == False:
             main.cleanup()
             main.exit()
 
         main.step( "Check ping between BGP peers and speakers" )
-        result4 = main.Mininet.pingHost( src = "speaker1", target = "peer64514" )
-        result5 = main.Mininet.pingHost( src = "speaker1", target = "peer64515" )
-        result6 = main.Mininet.pingHost( src = "speaker1", target = "peer64516" )
+        result4 = main.Mininet.pingHost( src="speaker1", target="peer64514" )
+        result5 = main.Mininet.pingHost( src="speaker1", target="peer64515" )
+        result6 = main.Mininet.pingHost( src="speaker1", target="peer64516" )
 
         pingResult2 = ( result4 == main.FALSE ) and ( result5 == main.TRUE ) \
                                                 and ( result6 == main.TRUE )
-        utilities.assert_equals( expect = True, actual = pingResult2,
-                                 onpass = "Speaker1 ping peers successful",
-                                 onfail = "Speaker1 ping peers NOT successful" )
+        utilities.assert_equals( expect=True, actual=pingResult2,
+                                 onpass="Speaker1 ping peers successful",
+                                 onfail="Speaker1 ping peers NOT successful" )
 
         if pingResult2 == False:
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
 
     def CASE8( self, main ):
@@ -525,19 +570,19 @@
         import time
         main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
         main.step( "Start sw32" )
-        result1 = main.Mininet.switch( SW = "sw32", OPTION = "start" )
+        result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = result1,
-            onpass = "Starting switch succeeded!",
-            onfail = "Starting switch failed!" )
+            expect=main.TRUE,
+            actual=result1,
+            onpass="Starting switch succeeded!",
+            onfail="Starting switch failed!" )
 
         result2 = main.Mininet.assignSwController( "sw32", ONOS1Ip )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = result2,
-            onpass = "Connect switch to ONOS succeeded!",
-            onfail = "Connect switch to ONOS failed!" )
+            expect=main.TRUE,
+            actual=result2,
+            onpass="Connect switch to ONOS succeeded!",
+            onfail="Connect switch to ONOS failed!" )
 
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -545,24 +590,28 @@
             main.Functions.checkM2SintentNum( main, 3 )
             main.Functions.checkP2PintentNum( main, 18 )
         else:
-            main.log.info( "Starting switch failed!" )
+            main.log.error( "Starting switch failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE9( self, main ):
@@ -577,15 +626,15 @@
         main.Functions.checkFlowNum( main, "sw11", 13 )
         main.Functions.checkFlowNum( main, "sw1", 3 )
         main.Functions.checkFlowNum( main, "sw7", 3 )
-        main.log.info( main.Mininet.checkFlows( "sw11" ) )
-        main.log.info( main.Mininet.checkFlows( "sw1" ) )
-        main.log.info( main.Mininet.checkFlows( "sw7" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw11" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw1" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw7" ) )
 
         main.step( "Stop sw11" )
-        result = main.Mininet.switch( SW = "sw11", OPTION = "stop" )
-        utilities.assertEquals( expect = main.TRUE, actual = result,
-                                onpass = "Stopping switch succeeded!",
-                                onfail = "Stopping switch failed!" )
+        result = main.Mininet.switch( SW="sw11", OPTION="stop" )
+        utilities.assertEquals( expect=main.TRUE, actual=result,
+                                onpass="Stopping switch succeeded!",
+                                onfail="Stopping switch failed!" )
         if result:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -593,23 +642,27 @@
             main.Functions.checkM2SintentNum( main, 3 )
             main.Functions.checkP2PintentNum( main, 18 )
         else:
-            main.log.info( "Stopping switch failed!" )
+            main.log.error( "Stopping switch failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE10( self, main ):
@@ -623,18 +676,18 @@
         main.log.info( "Check the flow status before starting sw11" )
         main.Functions.checkFlowNum( main, "sw1", 11 )
         main.Functions.checkFlowNum( main, "sw7", 5 )
-        main.log.info( main.Mininet.checkFlows( "sw1" ) )
-        main.log.info( main.Mininet.checkFlows( "sw7" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw1" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw7" ) )
 
         main.step( "Start sw11" )
-        result1 = main.Mininet.switch( SW = "sw11", OPTION = "start" )
-        utilities.assertEquals( expect = main.TRUE, actual = result1,
-                                onpass = "Starting switch succeeded!",
-                                onfail = "Starting switch failed!" )
+        result1 = main.Mininet.switch( SW="sw11", OPTION="start" )
+        utilities.assertEquals( expect=main.TRUE, actual=result1,
+                                onpass="Starting switch succeeded!",
+                                onfail="Starting switch failed!" )
         result2 = main.Mininet.assignSwController( "sw11", ONOS1Ip )
-        utilities.assertEquals( expect = main.TRUE, actual = result2,
-                                onpass = "Connect switch to ONOS succeeded!",
-                                onfail = "Connect switch to ONOS failed!" )
+        utilities.assertEquals( expect=main.TRUE, actual=result2,
+                                onpass="Connect switch to ONOS succeeded!",
+                                onfail="Connect switch to ONOS failed!" )
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
@@ -645,20 +698,24 @@
             main.log.debug( main.Mininet.checkFlows( "sw1" ) )
             main.log.debug( main.Mininet.checkFlows( "sw7" ) )
         else:
-            main.log.info( "Starting switch failed!" )
+            main.log.error( "Starting switch failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/Dependency/Functions.py b/TestON/tests/USECASE_SdnipFunctionCluster/Dependency/Functions.py
index 8d4007a..5f78896 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/Dependency/Functions.py
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/Dependency/Functions.py
@@ -1,14 +1,20 @@
 
-def checkRouteNum( main, routeNumExpected, ONOScli = "ONOScli1" ):
+def checkRouteNum( main, routeNumExpected, ONOScli="ONOScli1" ):
+    import time
     main.step( "Check routes installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Route number expected:" )
     main.log.info( routeNumExpected )
     main.log.info( "Route number from ONOS CLI:" )
 
     if ONOScli == "ONOScli1":
-        routeNumActual = main.ONOScli1.ipv4RouteNumber()
+        cli = main.ONOScli1
     else:
-        routeNumActual = main.ONOScli2.ipv4RouteNumber()
+        cli = main.ONOScli2
+    routeNumActual = cli.ipv4RouteNumber()
+    if routeNumActual != routeNumExpected:
+        time.sleep( wait )
+        routeNumActual = cli.ipv4RouteNumber()
 
     main.log.info( routeNumActual )
     utilities.assertEquals( \
@@ -17,17 +23,24 @@
         onfail = "Route number is wrong!" )
 
 def checkM2SintentNum( main, intentNumExpected, ONOScli = "ONOScli1" ):
+    import time
     main.step( "Check M2S intents installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Intent number expected:" )
     main.log.info( intentNumExpected )
     main.log.info( "Intent number from ONOS CLI:" )
     if ONOScli == "ONOScli1":
-        jsonResult = main.ONOScli1.intents( jsonFormat = True, summary = True,
-                                            TYPE = "multiPointToSinglePoint" )
+        cli = main.ONOScli1
     else:
-        jsonResult = main.ONOScli2.intents( jsonFormat = True, summary = True,
-                                            TYPE = "multiPointToSinglePoint" )
+        cli = main.ONOScli2
+    jsonResult = cli.intents( jsonFormat = True, summary = True,
+                              TYPE = "multiPointToSinglePoint" )
     intentNumActual = jsonResult['installed']
+    if intentNumActual != intentNumExpected:
+        time.sleep( wait )
+        jsonResult = cli.intents( jsonFormat = True, summary = True,
+                                  TYPE = "multiPointToSinglePoint" )
+        intentNumActual = jsonResult['installed']
     main.log.info( intentNumActual )
     utilities.assertEquals( \
         expect = intentNumExpected, actual = intentNumActual,
@@ -35,17 +48,25 @@
         onfail = "M2S intent number is wrong!" )
 
 def checkP2PintentNum( main, intentNumExpected, ONOScli = "ONOScli1" ):
+    import time
     main.step( "Check P2P intents installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Intent number expected:" )
     main.log.info( intentNumExpected )
     main.log.info( "Intent number from ONOS CLI:" )
     if ONOScli == "ONOScli1":
-        jsonResult = main.ONOScli1.intents( jsonFormat = True, summary = True,
-                                            TYPE = "pointToPoint" )
+        cli = main.ONOScli1
     else:
-        jsonResult = main.ONOScli2.intents( jsonFormat = True, summary = True,
-                                            TYPE = "pointToPoint" )
+        cli = main.ONOScli2
+    jsonResult = cli.intents( jsonFormat = True, summary = True,
+                              TYPE = "pointToPoint" )
     intentNumActual = jsonResult['installed']
+
+    if intentNumActual != intentNumExpected:
+        time.sleep( wait )
+        jsonResult = cli.intents( jsonFormat = True, summary = True,
+                                  TYPE = "pointToPoint" )
+        intentNumActual = jsonResult['installed']
     main.log.info( intentNumActual )
     utilities.assertEquals( \
         expect = intentNumExpected, actual = intentNumActual,
@@ -53,11 +74,16 @@
         onfail = "P2P intent number is wrong!" )
 
 def checkFlowNum( main, switch, flowNumExpected ):
+    import time
     main.step( "Check flow entry number in " + switch )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Flow number expected:" )
     main.log.info( flowNumExpected )
     main.log.info( "Flow number actual:" )
     flowNumActual = main.Mininet.getSwitchFlowCount( switch )
+    if flowNumActual != flowNumExpected :
+        time.sleep( wait )
+        flowNumActual = main.Mininet.getSwitchFlowCount( switch )
     main.log.info( flowNumActual )
     utilities.assertEquals( \
         expect = flowNumExpected, actual = flowNumActual,
@@ -121,7 +147,8 @@
         * expectAllSuccess - boolean indicating if you expect all results
         succeed if True, otherwise expect all results fail if False
     """
-    main.step( "Check ping between each host pair" )
+    main.step( "Check ping between each host pair, expect all to succede=" +
+               str( expectAllSuccess ) )
     if len( hosts ) == 0:
         main.log.error( "Parameter hosts can not be empty." )
         main.cleanup()
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
index c746f55..3fccbe2 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
@@ -3,27 +3,18 @@
     <testcases>101, 100, 200, 102, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12</testcases>
     #Environment variables
     <ENV>
-        <cellName>sdnip_multiple_instance_BM</cellName>
+        <cellName>SDNIP</cellName>
+        <appString>drivers,openflow,proxyarp</appString>
     </ENV>
 
     <CTRL>
-        <numCtrl>1</numCtrl>
+        <numCtrl>3</numCtrl>
         <ip1>OC1</ip1>
         <ip2>OC2</ip2>
         <ip3>OC3</ip3>
         <port1>6653</port1>
     </CTRL>
 
-    <GIT>
-        <branch1>master</branch1>
-        <branch2>onos-1.3</branch2>
-    </GIT>
-
-    <JSON>
-        <prefix>prefix</prefix>
-        <nextHop>nextHop</nextHop>
-    </JSON>
-
     <DEPENDENCY>
         <path>/USECASE_SdnipFunctionCluster/Dependency/</path>
         <topology>USECASE_SdnipI2MN_Cluster.py</topology>
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
index 7d97c10..7593368 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
@@ -10,18 +10,18 @@
             Start mininet
         """
         import imp
-        main.log.case( "Setup the Mininet testbed" )
+        main.case( "Setup the Mininet testbed" )
         main.dependencyPath = main.testDir + \
                               main.params[ 'DEPENDENCY' ][ 'path' ]
         main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
 
         main.step( "Starting Mininet Topology" )
         topology = main.dependencyPath + main.topology
-        topoResult = main.Mininet.startNet( topoFile = topology )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = topoResult,
-                                 onpass = "Successfully loaded topology",
-                                 onfail = "Failed to load topology" )
+        topoResult = main.Mininet.startNet( topoFile=topology )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=topoResult,
+                                 onpass="Successfully loaded topology",
+                                 onfail="Failed to load topology" )
         # Exit if topology did not load properly
         if not topoResult:
             main.cleanup()
@@ -34,11 +34,10 @@
             sw = "sw%s" % ( i )
             swResult = swResult and main.Mininet.assignSwController( sw,
                                                  [ONOS1Ip, ONOS2Ip, ONOS3Ip] )
-
-        utilities.assert_equals( expect = main.TRUE,
-                             actual = swResult,
-                             onpass = "Successfully connect all switches to ONOS",
-                             onfail = "Failed to connect all switches to ONOS" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=swResult,
+                                 onpass="Successfully connect all switches to ONOS",
+                                 onfail="Failed to connect all switches to ONOS" )
         if not swResult:
             main.cleanup()
             main.exit()
@@ -68,6 +67,7 @@
         ONOS1Ip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
         ONOS2Ip = os.getenv( main.params[ 'CTRL' ][ 'ip2' ] )
         ONOS3Ip = os.getenv( main.params[ 'CTRL' ][ 'ip3' ] )
+        ipList = [ ONOS1Ip, ONOS2Ip, ONOS3Ip ]
 
         global peer64514
         global peer64515
@@ -76,18 +76,24 @@
         peer64515 = main.params['config']['peer64515']
         peer64516 = main.params['config']['peer64516']
 
+        main.step( "Create cell file" )
+        cellAppString = main.params[ 'ENV' ][ 'appString' ]
+        main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
+                                       main.Mininet.ip_address,
+                                       cellAppString, ipList )
+
         main.step( "Applying cell variable to environment" )
         cellResult = main.ONOSbench.setCell( cellName )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = cellResult,
-                                 onpass = "Set cell succeeded",
-                                 onfail = "Set cell failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=cellResult,
+                                 onpass="Set cell succeeded",
+                                 onfail="Set cell failed" )
 
         verifyResult = main.ONOSbench.verifyCell()
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = verifyResult,
-                                 onpass = "Verify cell succeeded",
-                                 onfail = "Verify cell failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=verifyResult,
+                                 onpass="Verify cell succeeded",
+                                 onfail="Verify cell failed" )
 
         branchName = main.ONOSbench.getBranchName()
         main.log.report( "ONOS is on branch: " + branchName )
@@ -96,92 +102,111 @@
         uninstallResult = main.ONOSbench.onosUninstall( ONOS1Ip ) \
                           and main.ONOSbench.onosUninstall( ONOS2Ip ) \
                           and main.ONOSbench.onosUninstall( ONOS3Ip )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = uninstallResult,
-                                 onpass = "Uninstall ONOS from nodes succeeded",
-                                 onfail = "Uninstall ONOS form nodes failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=uninstallResult,
+                                 onpass="Uninstall ONOS from nodes succeeded",
+                                 onfail="Uninstall ONOS form nodes failed" )
 
-        main.ONOSbench.getVersion( report = True )
+        main.ONOSbench.getVersion( report=True )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage( opTimeout = 500 )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = packageResult,
-                                 onpass = "Package ONOS succeeded",
-                                 onfail = "Package ONOS failed" )
+        packageResult = main.ONOSbench.onosPackage( opTimeout=500 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=packageResult,
+                                 onpass="Package ONOS succeeded",
+                                 onfail="Package ONOS failed" )
 
         main.step( "Installing ONOS package" )
-        onos1InstallResult = main.ONOSbench.onosInstall( options = "-f",
-                                                         node = ONOS1Ip )
-        onos2InstallResult = main.ONOSbench.onosInstall( options = "-f",
-                                                         node = ONOS2Ip )
-        onos3InstallResult = main.ONOSbench.onosInstall( options = "-f",
-                                                         node = ONOS3Ip )
+        onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                         node=ONOS1Ip )
+        onos2InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                         node=ONOS2Ip )
+        onos3InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                         node=ONOS3Ip )
         onosInstallResult = onos1InstallResult and onos2InstallResult \
                             and onos3InstallResult
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = onosInstallResult,
-                                 onpass = "Install ONOS to nodes succeeded",
-                                 onfail = "Install ONOS to nodes failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=onosInstallResult,
+                                 onpass="Install ONOS to nodes succeeded",
+                                 onfail="Install ONOS to nodes failed" )
 
         main.step( "Checking if ONOS is up yet" )
-        onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout = 420 )
-        onos2UpResult = main.ONOSbench.isup( ONOS2Ip, timeout = 420 )
-        onos3UpResult = main.ONOSbench.isup( ONOS3Ip, timeout = 420 )
+        onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout=420 )
+        onos2UpResult = main.ONOSbench.isup( ONOS2Ip, timeout=420 )
+        onos3UpResult = main.ONOSbench.isup( ONOS3Ip, timeout=420 )
         onosUpResult = onos1UpResult and onos2UpResult and onos3UpResult
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = onos1UpResult and onosUpResult,
-                                 onpass = "ONOS nodes are up",
-                                 onfail = "ONOS nodes are NOT up" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=onosUpResult,
+                                 onpass="ONOS nodes are up",
+                                 onfail="ONOS nodes are NOT up" )
 
         main.step( "Checking if ONOS CLI is ready" )
+        main.CLIs = []
         cliResult1 = main.ONOScli1.startOnosCli( ONOS1Ip,
-                commandlineTimeout = 100, onosStartTimeout = 600 )
+                commandlineTimeout=100, onosStartTimeout=600 )
+        main.CLIs.append( main.ONOScli1 )
         cliResult2 = main.ONOScli2.startOnosCli( ONOS2Ip,
-                commandlineTimeout = 100, onosStartTimeout = 600 )
-        cliResult = cliResult1 and cliResult2
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = cliResult,
-                                 onpass = "ONOS CLI (on node1) is ready",
-                                 onfail = "ONOS CLI (on node1) ready" )
+                commandlineTimeout=100, onosStartTimeout=600 )
+        main.CLIs.append( main.ONOScli2 )
+        cliResult3 = main.ONOScli3.startOnosCli( ONOS3Ip,
+                commandlineTimeout=100, onosStartTimeout=600 )
+        main.CLIs.append( main.ONOScli3 )
+        cliResult = cliResult1 and cliResult2 and cliResult3
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=cliResult,
+                                 onpass="ONOS CLIs are ready",
+                                 onfail="ONOS CLIs are not ready" )
 
-        caseResult = ( cellResult and verifyResult and
-                       packageResult and
-                       onosInstallResult and onosUpResult and cliResult )
+        main.step( "Checking if ONOS CLI is ready for issuing commands" )
+        for i in range( 10 ):
+            ready = True
+            for cli in main.CLIs:
+                output = cli.summary()
+                if not output:
+                    ready = False
+            if ready:
+                break
+            time.sleep( 30 )
+        utilities.assert_equals( expect=True, actual=ready,
+                                 onpass="ONOS summary command succeded",
+                                 onfail="ONOS summary command failed" )
 
-        utilities.assert_equals( expect = main.TRUE, actual = caseResult,
-                                 onpass = "ONOS startup successful",
-                                 onfail = "ONOS startup NOT successful" )
-
-        if caseResult == main.FALSE:
+        if not ready:
             main.log.error( "ONOS startup failed!" )
             main.cleanup()
             main.exit()
 
-
     def CASE200( self, main ):
         main.case( "Activate sdn-ip application" )
         main.log.info( "waiting link discovery......" )
-        time.sleep( int ( main.params['timers']['TopoDiscovery'] ) )
+        time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
 
-        main.log.info( "Get links in the network" )
+        main.step( "Get links in the network" )
         summaryResult = main.ONOScli1.summary()
         linkNum = json.loads( summaryResult )[ "links" ]
-        listResult = main.ONOScli1.links( jsonFormat = False )
-        main.log.info( listResult )
-
+        main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) )
         if linkNum < 100:
-            main.log.error( "Link number is wrong!" )
+            main.log.error( "Link number is wrong! Retrying..." )
+            time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+            summaryResult = main.ONOScli1.summary()
+            linkNum = json.loads( summaryResult )[ "links" ]
+        main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) )
+        utilities.assert_equals( expect=100,
+                                 actual=linkNum,
+                                 onpass="ONOS correctly discovered all links",
+                                 onfail="ONOS Failed to discover all links" )
+        if linkNum < 100:
             main.cleanup()
             main.exit()
 
         main.step( "Activate sdn-ip application" )
         activeSDNIPresult = main.ONOScli1.activateApp( "org.onosproject.sdnip" )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = activeSDNIPresult,
-                                 onpass = "Activate SDN-IP succeeded",
-                                 onfail = "Activate SDN-IP failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=activeSDNIPresult,
+                                 onpass="Activate SDN-IP succeeded",
+                                 onfail="Activate SDN-IP failed" )
         if not activeSDNIPresult:
+            main.log.info( "Activate SDN-IP failed!" )
             main.cleanup()
             main.exit()
 
@@ -211,106 +236,110 @@
         main.log.info( "Wait Quagga to finish delivery all routes to each \
         other and to sdn-ip, plus finish installing all intents..." )
         time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
-        # TODO
-        # time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
-
-        '''
-        # TODO: use for together with wrapperFile1
-        wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
-        main.USECASE_SdnipI2MN_Cluster = imp.load_source( wrapperFile2,
-                                                         main.dependencyPath +
-                                                         wrapperFile2 +
-                                                         ".py" )
-        '''
-
 
     def CASE1( self, main ):
         '''
         ping test from 3 bgp peers to BGP speaker
         '''
 
-        main.case( "Ping tests between BGP peers and speakers" )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [peer64514, peer64515, peer64516],
-                       expectAllSuccess = True )
-
+        main.case( "Ping between BGP peers and speakers" )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[peer64514, peer64515, peer64516],
+                       expectAllSuccess=True )
 
     def CASE2( self, main ):
         '''
         point-to-point intents test for each BGP peer and BGP speaker pair
         '''
+        import time
         main.case( "Check point-to-point intents" )
         main.log.info( "There are %s BGP peers in total "
                        % main.params[ 'config' ][ 'peerNum' ] )
         main.step( "Check P2P intents number from ONOS CLI" )
 
-        getIntentsResult = main.ONOScli1.intents( jsonFormat = True )
+        getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
         bgpIntentsActualNum = \
             main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6 * 2
+        if bgpIntentsActualNum != bgpIntentsExpectedNum:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
+            bgpIntentsActualNum = \
+                main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         main.log.info( "bgpIntentsExpected num is:" )
         main.log.info( bgpIntentsExpectedNum )
         main.log.info( "bgpIntentsActual num is:" )
         main.log.info( bgpIntentsActualNum )
-        utilities.assertEquals( \
-            expect = True,
-            actual = eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
-            onpass = "PointToPointIntent Intent Num is correct!",
-            onfail = "PointToPointIntent Intent Num is wrong!" )
-
+        utilities.assert_equals( expect=bgpIntentsExpectedNum,
+                                 actual=bgpIntentsActualNum,
+                                 onpass="PointToPointIntent Intent Num is correct!",
+                                 onfail="PointToPointIntent Intent Num is wrong!" )
 
     def CASE3( self, main ):
         '''
         routes and intents check to all BGP peers
         '''
+        import time
         main.case( "Check routes and M2S intents to all BGP peers" )
 
+        main.step( "Check routes installed" )
         allRoutesExpected = []
         allRoutesExpected.append( "4.0.0.0/24" + "/" + "10.0.4.1" )
         allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
         allRoutesExpected.append( "6.0.0.0/24" + "/" + "10.0.6.1" )
 
-        getRoutesResult = main.ONOScli1.routes( jsonFormat = True )
+        getRoutesResult = main.ONOScli1.routes( jsonFormat=True )
         allRoutesActual = \
             main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
         allRoutesStrExpected = str( sorted( allRoutesExpected ) )
         allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
+        if allRoutesStrActual != allRoutesStrExpected:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            allRoutesActual = \
+                main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
+            allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
 
-        main.step( "Check routes installed" )
         main.log.info( "Routes expected:" )
         main.log.info( allRoutesStrExpected )
         main.log.info( "Routes get from ONOS CLI:" )
         main.log.info( allRoutesStrActual )
-        utilities.assertEquals( \
-            expect = allRoutesStrExpected, actual = allRoutesStrActual,
-            onpass = "Routes are correct!",
-            onfail = "Routes are wrong!" )
+        utilities.assert_equals( expect=allRoutesStrExpected,
+                                 actual=allRoutesStrActual,
+                                 onpass="Routes are correct!",
+                                 onfail="Routes are wrong!" )
 
         main.step( "Check M2S intents installed" )
-        getIntentsResult = main.ONOScli1.intents( jsonFormat = True )
+        getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
         routeIntentsActualNum = \
             main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
         routeIntentsExpectedNum = 3
+        if routeIntentsActualNum != routeIntentsExpectedNum:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
+            routeIntentsActualNum = \
+                main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
 
         main.log.info( "MultiPointToSinglePoint Intent Num expected is:" )
         main.log.info( routeIntentsExpectedNum )
         main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
         main.log.info( routeIntentsActualNum )
-        utilities.assertEquals( \
-            expect = True,
-            actual = eq( routeIntentsExpectedNum, routeIntentsActualNum ),
-            onpass = "MultiPointToSinglePoint Intent Num is correct!",
-            onfail = "MultiPointToSinglePoint Intent Num is wrong!" )
+        utilities.assert_equals( expect=routeIntentsExpectedNum,
+                                 actual=routeIntentsActualNum,
+                                 onpass="MultiPointToSinglePoint Intent Num is correct!",
+                                 onfail="MultiPointToSinglePoint Intent Num is wrong!" )
 
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
 
     def CASE4( self, main ):
@@ -319,8 +348,8 @@
         '''
         main.case( "Ping test for each route, all hosts behind BGP peers" )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE5( self, main ):
@@ -330,12 +359,12 @@
         import time
         main.case( "Bring down links and check routes/intents" )
         main.step( "Bring down the link between sw32 and peer64514" )
-        linkResult1 = main.Mininet.link( END1 = "sw32", END2 = "peer64514",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult1,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
+                                         OPTION="down" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult1,
+                                 onpass="Bring down link succeeded!",
+                                 onfail="Bring down link failed!" )
 
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -347,12 +376,12 @@
             main.exit()
 
         main.step( "Bring down the link between sw8 and peer64515" )
-        linkResult2 = main.Mininet.link( END1 = "sw8", END2 = "peer64515",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult2,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
+                                         OPTION="down" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult2,
+                                 onpass="Bring down link succeeded!",
+                                 onfail="Bring down link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
@@ -363,12 +392,12 @@
             main.exit()
 
         main.step( "Bring down the link between sw28 and peer64516" )
-        linkResult3 = main.Mininet.link( END1 = "sw28", END2 = "peer64516",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult3,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
+                                         OPTION="down" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult3,
+                                 onpass="Bring down link succeeded!",
+                                 onfail="Bring down link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 0 )
@@ -379,20 +408,22 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = False )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=False )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = False )
-
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=False )
 
     def CASE6( self, main ):
         '''
@@ -401,12 +432,12 @@
         import time
         main.case( "Bring up links and check routes/intents" )
         main.step( "Bring up the link between sw32 and peer64514" )
-        linkResult1 = main.Mininet.link( END1 = "sw32", END2 = "peer64514",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult1,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
+                                         OPTION="up" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult1,
+                                 onpass="Bring up link succeeded!",
+                                 onfail="Bring up link failed!" )
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
@@ -417,12 +448,12 @@
             main.exit()
 
         main.step( "Bring up the link between sw8 and peer64515" )
-        linkResult2 = main.Mininet.link( END1 = "sw8", END2 = "peer64515",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult2,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
+                                         OPTION="up" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult2,
+                                 onpass="Bring up link succeeded!",
+                                 onfail="Bring up link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 2 )
@@ -433,12 +464,12 @@
             main.exit()
 
         main.step( "Bring up the link between sw28 and peer64516" )
-        linkResult3 = main.Mininet.link( END1 = "sw28", END2 = "peer64516",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult3,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
+                                         OPTION="up" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=linkResult3,
+                                 onpass="Bring up link succeeded!",
+                                 onfail="Bring up link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
@@ -449,20 +480,22 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
-
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
     def CASE7( self, main ):
         '''
@@ -471,10 +504,10 @@
         import time
         main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
         main.step( "Stop sw32" )
-        result = main.Mininet.switch( SW = "sw32", OPTION = "stop" )
-        utilities.assertEquals( expect = main.TRUE, actual = result,
-                                onpass = "Stopping switch succeeded!",
-                                onfail = "Stopping switch failed!" )
+        result = main.Mininet.switch( SW="sw32", OPTION="stop" )
+        utilities.assert_equals( expect=main.TRUE, actual=result,
+                                 onpass="Stopping switch succeeded!",
+                                 onfail="Stopping switch failed!" )
 
         if result == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -487,30 +520,30 @@
             main.exit()
 
         main.step( "Check ping between hosts behind BGP peers" )
-        result1 = main.Mininet.pingHost( src = "host64514", target = "host64515" )
-        result2 = main.Mininet.pingHost( src = "host64515", target = "host64516" )
-        result3 = main.Mininet.pingHost( src = "host64514", target = "host64516" )
+        result1 = main.Mininet.pingHost( src="host64514", target="host64515" )
+        result2 = main.Mininet.pingHost( src="host64515", target="host64516" )
+        result3 = main.Mininet.pingHost( src="host64514", target="host64516" )
 
         pingResult1 = ( result1 == main.FALSE ) and ( result2 == main.TRUE ) \
                       and ( result3 == main.FALSE )
-        utilities.assert_equals( expect = True, actual = pingResult1,
-                                 onpass = "Ping test result is correct",
-                                 onfail = "Ping test result is wrong" )
+        utilities.assert_equals( expect=True, actual=pingResult1,
+                                 onpass="Ping test result is correct",
+                                 onfail="Ping test result is wrong" )
 
         if pingResult1 == False:
             main.cleanup()
             main.exit()
 
         main.step( "Check ping between BGP peers and speaker1" )
-        result4 = main.Mininet.pingHost( src = "speaker1", target = "peer64514" )
-        result5 = main.Mininet.pingHost( src = "speaker1", target = "peer64515" )
-        result6 = main.Mininet.pingHost( src = "speaker1", target = "peer64516" )
+        result4 = main.Mininet.pingHost( src="speaker1", target="peer64514" )
+        result5 = main.Mininet.pingHost( src="speaker1", target="peer64515" )
+        result6 = main.Mininet.pingHost( src="speaker1", target="peer64516" )
 
         pingResult2 = ( result4 == main.FALSE ) and ( result5 == main.TRUE ) \
                       and ( result6 == main.TRUE )
-        utilities.assert_equals( expect = True, actual = pingResult2,
-                                 onpass = "Speaker1 ping peers successful",
-                                 onfail = "Speaker1 ping peers NOT successful" )
+        utilities.assert_equals( expect=True, actual=pingResult2,
+                                 onpass="Speaker1 ping peers successful",
+                                 onfail="Speaker1 ping peers NOT successful" )
 
         if pingResult2 == False:
             main.cleanup()
@@ -518,27 +551,29 @@
 
         main.step( "Check ping between BGP peers and speaker2" )
         # TODO
-        result7 = main.Mininet.pingHost( src = "speaker2", target = peer64514 )
-        result8 = main.Mininet.pingHost( src = "speaker2", target = peer64515 )
-        result9 = main.Mininet.pingHost( src = "speaker2", target = peer64516 )
+        result7 = main.Mininet.pingHost( src="speaker2", target=peer64514 )
+        result8 = main.Mininet.pingHost( src="speaker2", target=peer64515 )
+        result9 = main.Mininet.pingHost( src="speaker2", target=peer64516 )
 
         pingResult3 = ( result7 == main.FALSE ) and ( result8 == main.TRUE ) \
                                                 and ( result9 == main.TRUE )
-        utilities.assert_equals( expect = True, actual = pingResult2,
-                                 onpass = "Speaker2 ping peers successful",
-                                 onfail = "Speaker2 ping peers NOT successful" )
+        utilities.assert_equals( expect=True, actual=pingResult2,
+                                 onpass="Speaker2 ping peers successful",
+                                 onfail="Speaker2 ping peers NOT successful" )
 
         if pingResult3 == False:
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
-
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
     def CASE8( self, main ):
         '''
@@ -548,19 +583,17 @@
         import time
         main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
         main.step( "Start sw32" )
-        result1 = main.Mininet.switch( SW = "sw32", OPTION = "start" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = result1,
-            onpass = "Starting switch succeeded!",
-            onfail = "Starting switch failed!" )
+        result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=result1,
+                                 onpass="Starting switch succeeded!",
+                                 onfail="Starting switch failed!" )
 
         result2 = main.Mininet.assignSwController( "sw32", ONOS1Ip )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = result2,
-            onpass = "Connect switch to ONOS succeeded!",
-            onfail = "Connect switch to ONOS failed!" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=result2,
+                                 onpass="Connect switch to ONOS succeeded!",
+                                 onfail="Connect switch to ONOS failed!" )
 
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -573,23 +606,25 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [peer64514, peer64515, peer64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[peer64514, peer64515, peer64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
-
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
     def CASE9( self, main ):
         '''
@@ -608,10 +643,10 @@
         main.log.info( main.Mininet.checkFlows( "sw7" ) )
 
         main.step( "Stop sw11" )
-        result = main.Mininet.switch( SW = "sw11", OPTION = "stop" )
-        utilities.assertEquals( expect = main.TRUE, actual = result,
-                                onpass = "Stopping switch succeeded!",
-                                onfail = "Stopping switch failed!" )
+        result = main.Mininet.switch( SW="sw11", OPTION="stop" )
+        utilities.assert_equals( expect=main.TRUE, actual=result,
+                                 onpass="Stopping switch succeeded!",
+                                 onfail="Stopping switch failed!" )
         if result:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -624,21 +659,24 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [peer64514, peer64515, peer64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[peer64514, peer64515, peer64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE10( self, main ):
@@ -656,14 +694,14 @@
         main.log.info( main.Mininet.checkFlows( "sw7" ) )
 
         main.step( "Start sw11" )
-        result1 = main.Mininet.switch( SW = "sw11", OPTION = "start" )
-        utilities.assertEquals( expect = main.TRUE, actual = result1,
-                                onpass = "Starting switch succeeded!",
-                                onfail = "Starting switch failed!" )
+        result1 = main.Mininet.switch( SW="sw11", OPTION="start" )
+        utilities.assert_equals( expect=main.TRUE, actual=result1,
+                                 onpass="Starting switch succeeded!",
+                                 onfail="Starting switch failed!" )
         result2 = main.Mininet.assignSwController( "sw11", ONOS1Ip )
-        utilities.assertEquals( expect = main.TRUE, actual = result2,
-                                onpass = "Connect switch to ONOS succeeded!",
-                                onfail = "Connect switch to ONOS failed!" )
+        utilities.assert_equals( expect=main.TRUE, actual=result2,
+                                 onpass="Connect switch to ONOS succeeded!",
+                                 onfail="Connect switch to ONOS failed!" )
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
@@ -679,21 +717,24 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [peer64514, peer64515, peer64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[peer64514, peer64515, peer64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE11(self, main):
@@ -705,21 +746,24 @@
         main.Functions.checkM2SintentNum( main, 3 )
         main.Functions.checkP2PintentNum( main, 18 * 2 )
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [peer64514, peer64515, peer64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[peer64514, peer64515, peer64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
         main.step( "Kill speaker1" )
         command1 = "ps -e | grep bgp -c"
@@ -737,10 +781,10 @@
 
         result3 = main.Mininet.node( "root", command1 )
 
-        utilities.assert_equals( expect = True,
-                                 actual = ( "4" in result3 ),
-                                 onpass = "Kill speaker1 succeeded",
-                                 onfail = "Kill speaker1 failed" )
+        utilities.assert_equals( expect=True,
+                                 actual=( "4" in result3 ),
+                                 onpass="Kill speaker1 succeeded",
+                                 onfail="Kill speaker1 failed" )
         if ( "4" not in result3 ) :
             main.log.info( result3 )
             main.cleanup()
@@ -752,23 +796,26 @@
         main.Functions.checkP2PintentNum( main, 18 * 2 )
 
         main.step( "Check whether all flow status are ADDED" )
-        utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=flowCheck,
+                                 onpass="Flow status is correct!",
+                                 onfail="Flow status is wrong!" )
 
         '''
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = False )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=False )
         '''
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [peer64514, peer64515, peer64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[peer64514, peer64515, peer64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE12( self, main ):
@@ -794,44 +841,50 @@
         else:
             uninstallResult = main.ONOSbench.onosStop( ONOS3Ip )
 
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = uninstallResult,
-                                 onpass = "Uninstall ONOS leader succeeded",
-                                 onfail = "Uninstall ONOS leader failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=uninstallResult,
+                                 onpass="Uninstall ONOS leader succeeded",
+                                 onfail="Uninstall ONOS leader failed" )
         if uninstallResult != main.TRUE:
             main.cleanup()
             main.exit()
         time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
 
         if leaderIP == ONOS1Ip:
-            main.Functions.checkRouteNum( main, 3, ONOScli = "ONOScli2" )
-            main.Functions.checkM2SintentNum( main, 3, ONOScli = "ONOScli2" )
-            main.Functions.checkP2PintentNum( main, 18 * 2, ONOScli = "ONOScli2" )
+            main.Functions.checkRouteNum( main, 3, ONOScli="ONOScli2" )
+            main.Functions.checkM2SintentNum( main, 3, ONOScli="ONOScli2" )
+            main.Functions.checkP2PintentNum( main, 18 * 2, ONOScli="ONOScli2" )
 
             main.step( "Check whether all flow status are ADDED" )
-            utilities.assertEquals( \
-                expect = main.TRUE,
-                actual = main.ONOScli2.checkFlowsState( isPENDING_ADD = False ),
-                onpass = "Flow status is correct!",
-                onfail = "Flow status is wrong!" )
+            flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                         main.FALSE,
+                                         kwargs={'isPENDING':False},
+                                         attempts=10 )
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=flowCheck,
+                                     onpass="Flow status is correct!",
+                                     onfail="Flow status is wrong!" )
         else:
             main.Functions.checkRouteNum( main, 3 )
             main.Functions.checkM2SintentNum( main, 3 )
             main.Functions.checkP2PintentNum( main, 18 * 2 )
 
             main.step( "Check whether all flow status are ADDED" )
-            utilities.assertEquals( \
-                expect = main.TRUE,
-                actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-                onpass = "Flow status is correct!",
-                onfail = "Flow status is wrong!" )
+            flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                         main.FALSE,
+                                         kwargs={'isPENDING':False},
+                                         attempts=10 )
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=flowCheck,
+                                     onpass="Flow status is correct!",
+                                     onfail="Flow status is wrong!" )
 
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["peer64514", "peer64515", "peer64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [peer64514, peer64515, peer64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["peer64514", "peer64515", "peer64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[peer64514, peer64515, peer64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
index f3c9b5f..a10527a 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
@@ -26,6 +26,14 @@
             <connect_order>3</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOScli2>
+        <ONOScli3>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli3>
 
         <QuaggaCliSpeaker1>
             <host>127.0.0.1</host>
@@ -49,4 +57,3 @@
 
     </COMPONENT>
 </TOPOLOGY>
-
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/Dependency/Functions.py b/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/Dependency/Functions.py
index 97a432a..a3c7540 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/Dependency/Functions.py
+++ b/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/Dependency/Functions.py
@@ -1,14 +1,20 @@
 
-def checkRouteNum( main, routeNumExpected, ONOScli = "ONOScli1" ):
+def checkRouteNum( main, routeNumExpected, ONOScli="ONOScli1" ):
+    import time
     main.step( "Check routes installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Route number expected:" )
     main.log.info( routeNumExpected )
     main.log.info( "Route number from ONOS CLI:" )
 
     if ONOScli == "ONOScli1":
-        routeNumActual = main.ONOScli1.ipv4RouteNumber()
+        cli = main.ONOScli1
     else:
-        routeNumActual = main.ONOScli2.ipv4RouteNumber()
+        cli = main.ONOScli2
+    routeNumActual = cli.ipv4RouteNumber()
+    if routeNumActual != routeNumExpected:
+        time.sleep( wait )
+        routeNumActual = cli.ipv4RouteNumber()
 
     main.log.info( routeNumActual )
     utilities.assertEquals( \
@@ -17,17 +23,24 @@
         onfail = "Route number is wrong!" )
 
 def checkM2SintentNum( main, intentNumExpected, ONOScli = "ONOScli1" ):
+    import time
     main.step( "Check M2S intents installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Intent number expected:" )
     main.log.info( intentNumExpected )
     main.log.info( "Intent number from ONOS CLI:" )
     if ONOScli == "ONOScli1":
-        jsonResult = main.ONOScli1.intents( jsonFormat = True, summary = True,
-                                            TYPE = "multiPointToSinglePoint" )
+        cli = main.ONOScli1
     else:
-        jsonResult = main.ONOScli2.intents( jsonFormat = True, summary = True,
-                                            TYPE = "multiPointToSinglePoint" )
+        cli = main.ONOScli2
+    jsonResult = cli.intents( jsonFormat = True, summary = True,
+                              TYPE = "multiPointToSinglePoint" )
     intentNumActual = jsonResult['installed']
+    if intentNumActual != intentNumExpected:
+        time.sleep( wait )
+        jsonResult = cli.intents( jsonFormat = True, summary = True,
+                                  TYPE = "multiPointToSinglePoint" )
+        intentNumActual = jsonResult['installed']
     main.log.info( intentNumActual )
     utilities.assertEquals( \
         expect = intentNumExpected, actual = intentNumActual,
@@ -35,17 +48,25 @@
         onfail = "M2S intent number is wrong!" )
 
 def checkP2PintentNum( main, intentNumExpected, ONOScli = "ONOScli1" ):
+    import time
     main.step( "Check P2P intents installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Intent number expected:" )
     main.log.info( intentNumExpected )
     main.log.info( "Intent number from ONOS CLI:" )
     if ONOScli == "ONOScli1":
-        jsonResult = main.ONOScli1.intents( jsonFormat = True, summary = True,
-                                            TYPE = "pointToPoint" )
+        cli = main.ONOScli1
     else:
-        jsonResult = main.ONOScli2.intents( jsonFormat = True, summary = True,
-                                            TYPE = "pointToPoint" )
+        cli = main.ONOScli2
+    jsonResult = cli.intents( jsonFormat = True, summary = True,
+                              TYPE = "pointToPoint" )
     intentNumActual = jsonResult['installed']
+
+    if intentNumActual != intentNumExpected:
+        time.sleep( wait )
+        jsonResult = cli.intents( jsonFormat = True, summary = True,
+                                  TYPE = "pointToPoint" )
+        intentNumActual = jsonResult['installed']
     main.log.info( intentNumActual )
     utilities.assertEquals( \
         expect = intentNumExpected, actual = intentNumActual,
@@ -53,11 +74,16 @@
         onfail = "P2P intent number is wrong!" )
 
 def checkFlowNum( main, switch, flowNumExpected ):
+    import time
     main.step( "Check flow entry number in " + switch )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Flow number expected:" )
     main.log.info( flowNumExpected )
     main.log.info( "Flow number actual:" )
     flowNumActual = main.Mininet.getSwitchFlowCount( switch )
+    if flowNumActual != flowNumExpected :
+        time.sleep( wait )
+        flowNumActual = main.Mininet.getSwitchFlowCount( switch )
     main.log.info( flowNumActual )
     utilities.assertEquals( \
         expect = flowNumExpected, actual = flowNumActual,
@@ -121,7 +147,8 @@
         * expectAllSuccess - boolean indicating if you expect all results
         succeed if True, otherwise expect all results fail if False
     """
-    main.step( "Check ping between each host pair" )
+    main.step( "Check ping between each host pair, expect all to succede=" +
+               str( expectAllSuccess ) )
     if len( hosts ) == 0:
         main.log.error( "Parameter hosts can not be empty." )
         main.cleanup()
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.params b/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.params
index 8124dfe..a36059e 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.params
+++ b/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.params
@@ -2,10 +2,11 @@
 
     <testcases>101, 100, 200, 102, 1, 2, 3, 4, 7, 8, 9, 10, 11, 12</testcases>
     # case6 needs a new driver, will enable it after this new driver
-    #<testcases>101, 100, 200, 102, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12</testcases>
+    #101, 100, 200, 102, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
     #Environment variables
     <ENV>
-        <cellName>sdnip_multiple_instance_VM</cellName>
+        <cellName>SDNIP</cellName>
+        <appString>drivers,openflow,proxyarp</appString>
     </ENV>
 
     <CTRL>
@@ -19,16 +20,6 @@
         <port1>6653</port1>
     </CTRL>
 
-    <GIT>
-        <branch1>master</branch1>
-        <branch2>onos-1.3</branch2>
-    </GIT>
-
-    <JSON>
-        <prefix>prefix</prefix>
-        <nextHop>nextHop</nextHop>
-    </JSON>
-
     <DEPENDENCY>
         <path>/USECASE_SdnipFunctionCluster_fsfw/Dependency/</path>
         <topology>USECASE_SdnipI2MN_Cluster.py</topology>
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.py b/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.py
index 782110c..98c28bb 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.py
+++ b/TestON/tests/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.py
@@ -5,12 +5,10 @@
         self.default = ''
         global branchName
 
-    # This case is to setup Mininet testbed
     def CASE100( self, main ):
         """
             Start mininet
         """
-        import os
         import imp
         main.log.case( "Setup the Mininet testbed" )
         main.dependencyPath = main.testDir + \
@@ -19,11 +17,11 @@
 
         main.step( "Starting Mininet Topology" )
         topology = main.dependencyPath + main.topology
-        topoResult = main.Mininet.startNet( topoFile = topology )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = topoResult,
-                                 onpass = "Successfully loaded topology",
-                                 onfail = "Failed to load topology" )
+        topoResult = main.Mininet.startNet( topoFile=topology )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=topoResult,
+                                 onpass="Successfully loaded topology",
+                                 onfail="Failed to load topology" )
         # Exit if topology did not load properly
         if not topoResult:
             main.cleanup()
@@ -34,12 +32,12 @@
         for i in range ( 1, int( main.params['config']['switchNum'] ) + 1 ):
             sw = "sw%s" % ( i )
             swResult = swResult and main.Mininet.assignSwController( sw, fsfwIp,
-                                                                     port = fsfwPort )
+                                                                     port=fsfwPort )
 
-        utilities.assert_equals( expect = main.TRUE,
-                             actual = swResult,
-                             onpass = "Successfully connect all switches to FSFW",
-                             onfail = "Failed to connect all switches to FSFW" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=swResult,
+                                 onpass="Successfully connect all switches to FSFW",
+                                 onfail="Failed to connect all switches to FSFW" )
         if not swResult:
             main.cleanup()
             main.exit()
@@ -69,6 +67,7 @@
         ONOS1Ip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
         ONOS2Ip = os.getenv( main.params[ 'CTRL' ][ 'ip2' ] )
         ONOS3Ip = os.getenv( main.params[ 'CTRL' ][ 'ip3' ] )
+        ipList = [ ONOS1Ip, ONOS2Ip, ONOS3Ip ]
 
         global pr64514
         global pr64515
@@ -82,18 +81,24 @@
         fsfwIp = main.params[ 'CTRL' ][ 'fsfwIp' ]
         fsfwPort = main.params[ 'CTRL' ][ 'fsfwPort' ]
 
+        main.step( "Create cell file" )
+        cellAppString = main.params[ 'ENV' ][ 'appString' ]
+        main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
+                                       main.Mininet.ip_address,
+                                       cellAppString, ipList )
+
         main.step( "Applying cell variable to environment" )
         cellResult = main.ONOSbench.setCell( cellName )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = cellResult,
-                                 onpass = "Set cell succeeded",
-                                 onfail = "Set cell failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=cellResult,
+                                 onpass="Set cell succeeded",
+                                 onfail="Set cell failed" )
 
         verifyResult = main.ONOSbench.verifyCell()
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = verifyResult,
-                                 onpass = "Verify cell succeeded",
-                                 onfail = "Verify cell failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=verifyResult,
+                                 onpass="Verify cell succeeded",
+                                 onfail="Verify cell failed" )
 
         branchName = main.ONOSbench.getBranchName()
         main.log.report( "ONOS is on branch: " + branchName )
@@ -102,92 +107,105 @@
         uninstallResult = main.ONOSbench.onosUninstall( ONOS1Ip ) \
                           and main.ONOSbench.onosUninstall( ONOS2Ip ) \
                           and main.ONOSbench.onosUninstall( ONOS3Ip )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = uninstallResult,
-                                 onpass = "Uninstall ONOS from nodes succeeded",
-                                 onfail = "Uninstall ONOS form nodes failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=uninstallResult,
+                                 onpass="Uninstall ONOS from nodes succeeded",
+                                 onfail="Uninstall ONOS form nodes failed" )
 
-        main.ONOSbench.getVersion( report = True )
+        main.ONOSbench.getVersion( report=True )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage( opTimeout = 500 )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = packageResult,
-                                 onpass = "Package ONOS succeeded",
-                                 onfail = "Package ONOS failed" )
+        packageResult = main.ONOSbench.onosPackage( opTimeout=500 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=packageResult,
+                                 onpass="Package ONOS succeeded",
+                                 onfail="Package ONOS failed" )
 
         main.step( "Installing ONOS package" )
-        onos1InstallResult = main.ONOSbench.onosInstall( options = "-f",
-                                                         node = ONOS1Ip )
-        onos2InstallResult = main.ONOSbench.onosInstall( options = "-f",
-                                                         node = ONOS2Ip )
-        onos3InstallResult = main.ONOSbench.onosInstall( options = "-f",
-                                                         node = ONOS3Ip )
+        onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                         node=ONOS1Ip )
+        onos2InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                         node=ONOS2Ip )
+        onos3InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                         node=ONOS3Ip )
         onosInstallResult = onos1InstallResult and onos2InstallResult \
                             and onos3InstallResult
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = onosInstallResult,
-                                 onpass = "Install ONOS to nodes succeeded",
-                                 onfail = "Install ONOS to nodes failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=onosInstallResult,
+                                 onpass="Install ONOS to nodes succeeded",
+                                 onfail="Install ONOS to nodes failed" )
 
         main.step( "Checking if ONOS is up yet" )
-        onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout = 420 )
-        onos2UpResult = main.ONOSbench.isup( ONOS2Ip, timeout = 420 )
-        onos3UpResult = main.ONOSbench.isup( ONOS3Ip, timeout = 420 )
+        onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout=420 )
+        onos2UpResult = main.ONOSbench.isup( ONOS2Ip, timeout=420 )
+        onos3UpResult = main.ONOSbench.isup( ONOS3Ip, timeout=420 )
         onosUpResult = onos1UpResult and onos2UpResult and onos3UpResult
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = onos1UpResult and onosUpResult,
-                                 onpass = "ONOS nodes are up",
-                                 onfail = "ONOS nodes are NOT up" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=onosUpResult,
+                                 onpass="ONOS nodes are up",
+                                 onfail="ONOS nodes are NOT up" )
 
         main.step( "Checking if ONOS CLI is ready" )
+        main.CLIs = []
         cliResult1 = main.ONOScli1.startOnosCli( ONOS1Ip,
-                commandlineTimeout = 100, onosStartTimeout = 600 )
+                commandlineTimeout=100, onosStartTimeout=600 )
+        main.CLIs.append( main.ONOScli1 )
         cliResult2 = main.ONOScli2.startOnosCli( ONOS2Ip,
-                commandlineTimeout = 100, onosStartTimeout = 600 )
-        cliResult = cliResult1 and cliResult2
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = cliResult,
-                                 onpass = "ONOS CLI (on node1) is ready",
-                                 onfail = "ONOS CLI (on node1) ready" )
+                commandlineTimeout=100, onosStartTimeout=600 )
+        main.CLIs.append( main.ONOScli2 )
+        cliResult3 = main.ONOScli3.startOnosCli( ONOS3Ip,
+                commandlineTimeout=100, onosStartTimeout=600 )
+        main.CLIs.append( main.ONOScli3 )
+        cliResult = cliResult1 and cliResult2 and cliResult3
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=cliResult,
+                                 onpass="ONOS CLIs are ready",
+                                 onfail="ONOS CLIs are not ready" )
 
-        caseResult = ( cellResult and verifyResult and
-                       packageResult and
-                       onosInstallResult and onosUpResult and cliResult )
+        for i in range( 10 ):
+            ready = True
+            for cli in main.CLIs:
+                output = cli.summary()
+                if not output:
+                    ready = False
+            if ready:
+                break
+            time.sleep( 30 )
+        utilities.assert_equals( expect=True, actual=ready,
+                                 onpass="ONOS summary command succeded",
+                                 onfail="ONOS summary command failed" )
 
-        utilities.assert_equals( expect = main.TRUE, actual = caseResult,
-                                 onpass = "ONOS startup successful",
-                                 onfail = "ONOS startup NOT successful" )
-
-        if caseResult == main.FALSE:
+        if not ready:
             main.log.error( "ONOS startup failed!" )
             main.cleanup()
             main.exit()
 
-
     def CASE200( self, main ):
         main.case( "Activate sdn-ip application" )
         main.log.info( "waiting link discovery......" )
-        time.sleep( int ( main.params['timers']['TopoDiscovery'] ) )
+        time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
 
         main.log.info( "Get links in the network" )
         summaryResult = main.ONOScli1.summary()
         linkNum = json.loads( summaryResult )[ "links" ]
-        listResult = main.ONOScli1.links( jsonFormat = False )
+        listResult = main.ONOScli1.links( jsonFormat=False )
         main.log.info( listResult )
-
         if linkNum < 100:
             main.log.error( "Link number is wrong!" )
+            time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+            listResult = main.ONOScli1.links( jsonFormat=False )
+            main.log.info( listResult )
             main.cleanup()
             main.exit()
 
         main.step( "Activate sdn-ip application" )
         activeSDNIPresult = main.ONOScli1.activateApp( "org.onosproject.sdnip" )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = activeSDNIPresult,
-                                 onpass = "Activate SDN-IP succeeded",
-                                 onfail = "Activate SDN-IP failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=activeSDNIPresult,
+                                 onpass="Activate SDN-IP succeeded",
+                                 onfail="Activate SDN-IP failed" )
         if not activeSDNIPresult:
+            main.log.info( "Activate SDN-IP failed!" )
             main.cleanup()
             main.exit()
 
@@ -217,18 +235,6 @@
         main.log.info( "Wait Quagga to finish delivery all routes to each \
         other and to sdn-ip, plus finish installing all intents..." )
         time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
-        # TODO
-        # time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
-
-        '''
-        # TODO: use for together with wrapperFile1
-        wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
-        main.USECASE_SdnipI2MN_Cluster = imp.load_source( wrapperFile2,
-                                                         main.dependencyPath +
-                                                         wrapperFile2 +
-                                                         ".py" )
-        '''
-
 
     def CASE1( self, main ):
         '''
@@ -236,42 +242,47 @@
         '''
 
         main.case( "Ping tests between BGP peers and speakers" )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [pr64514, pr64515, pr64516],
-                       expectAllSuccess = True )
-
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[pr64514, pr64515, pr64516],
+                       expectAllSuccess=True )
 
     def CASE2( self, main ):
         '''
         point-to-point intents test for each BGP peer and BGP speaker pair
         '''
+        import time
         main.case( "Check point-to-point intents" )
         main.log.info( "There are %s BGP peers in total "
                        % main.params[ 'config' ][ 'peerNum' ] )
         main.step( "Check P2P intents number from ONOS CLI" )
 
-        getIntentsResult = main.ONOScli1.intents( jsonFormat = True )
+        getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
         bgpIntentsActualNum = \
             main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6 * 2
+        if bgpIntentsActualNum != bgpIntentsExpectedNum:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            bgpIntentsActualNum = \
+                main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         main.log.info( "bgpIntentsExpected num is:" )
         main.log.info( bgpIntentsExpectedNum )
         main.log.info( "bgpIntentsActual num is:" )
         main.log.info( bgpIntentsActualNum )
         utilities.assertEquals( \
-            expect = True,
-            actual = eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
-            onpass = "PointToPointIntent Intent Num is correct!",
-            onfail = "PointToPointIntent Intent Num is wrong!" )
+            expect=True,
+            actual=eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
+            onpass="PointToPointIntent Intent Num is correct!",
+            onfail="PointToPointIntent Intent Num is wrong!" )
 
 
     def CASE3( self, main ):
         '''
         routes and intents check to all BGP peers
         '''
+        import time
         main.case( "Check routes and M2S intents to all BGP peers" )
 
         allRoutesExpected = []
@@ -279,11 +290,16 @@
         allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
         allRoutesExpected.append( "6.0.0.0/24" + "/" + "10.0.6.1" )
 
-        getRoutesResult = main.ONOScli1.routes( jsonFormat = True )
+        getRoutesResult = main.ONOScli1.routes( jsonFormat=True )
         allRoutesActual = \
             main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
         allRoutesStrExpected = str( sorted( allRoutesExpected ) )
         allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
+        if allRoutesStrActual != allRoutesStrExpected:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            allRoutesActual = \
+                main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
+            allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
 
         main.step( "Check routes installed" )
         main.log.info( "Routes expected:" )
@@ -291,32 +307,40 @@
         main.log.info( "Routes get from ONOS CLI:" )
         main.log.info( allRoutesStrActual )
         utilities.assertEquals( \
-            expect = allRoutesStrExpected, actual = allRoutesStrActual,
-            onpass = "Routes are correct!",
-            onfail = "Routes are wrong!" )
+            expect=allRoutesStrExpected, actual=allRoutesStrActual,
+            onpass="Routes are correct!",
+            onfail="Routes are wrong!" )
 
         main.step( "Check M2S intents installed" )
-        getIntentsResult = main.ONOScli1.intents( jsonFormat = True )
+        getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
         routeIntentsActualNum = \
             main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
         routeIntentsExpectedNum = 3
+        if routeIntentsActualNum != routeIntentsExpectedNum:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            routeIntentsActualNum = \
+                main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
 
         main.log.info( "MultiPointToSinglePoint Intent Num expected is:" )
         main.log.info( routeIntentsExpectedNum )
         main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
         main.log.info( routeIntentsActualNum )
         utilities.assertEquals( \
-            expect = True,
-            actual = eq( routeIntentsExpectedNum, routeIntentsActualNum ),
-            onpass = "MultiPointToSinglePoint Intent Num is correct!",
-            onfail = "MultiPointToSinglePoint Intent Num is wrong!" )
+            expect=routeIntentsExpectedNum,
+            actual=routeIntentsActualNum,
+            onpass="MultiPointToSinglePoint Intent Num is correct!",
+            onfail="MultiPointToSinglePoint Intent Num is wrong!" )
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
 
     def CASE4( self, main ):
@@ -325,8 +349,8 @@
         '''
         main.case( "Ping test for each route, all hosts behind BGP peers" )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE5( self, main ):
@@ -336,16 +360,16 @@
         import time
         main.case( "Bring down links and check routes/intents" )
         main.step( "Bring down the link between sw32 and peer64514" )
-        linkResult1 = main.Mininet.link( END1 = "sw32", END2 = "pr64514",
-                                         OPTION = "down" )
+        linkResult1 = main.Mininet.link( END1="sw32", END2="pr64514",
+                                         OPTION="down" )
         # When bring down a link, Mininet will bring down both the interfaces
         # at the two sides of the link. Here we do not want to bring down the
         # host side interface, since I noticed when bring up in CASE6, some of
         # the configuration information will lost.
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult1,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult1,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
 
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -357,12 +381,12 @@
             main.exit()
 
         main.step( "Bring down the link between sw8 and peer64515" )
-        linkResult2 = main.Mininet.link( END1 = "sw8", END2 = "pr64515",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult2,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult2 = main.Mininet.link( END1="sw8", END2="pr64515",
+                                         OPTION="down" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult2,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
@@ -373,12 +397,12 @@
             main.exit()
 
         main.step( "Bring down the link between sw28 and peer64516" )
-        linkResult3 = main.Mininet.link( END1 = "sw28", END2 = "pr64516",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult3,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult3 = main.Mininet.link( END1="sw28", END2="pr64516",
+                                         OPTION="down" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult3,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 0 )
@@ -389,19 +413,23 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = False )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=False )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = False )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=False )
 
 
     def CASE6( self, main ):
@@ -411,12 +439,12 @@
         import time
         main.case( "Bring up links and check routes/intents" )
         main.step( "Bring up the link between sw32 and peer64514" )
-        linkResult1 = main.Mininet.link( END1 = "sw32", END2 = "pr64514",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult1,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult1 = main.Mininet.link( END1="sw32", END2="pr64514",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult1,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
@@ -427,12 +455,12 @@
             main.exit()
 
         main.step( "Bring up the link between sw8 and peer64515" )
-        linkResult2 = main.Mininet.link( END1 = "sw8", END2 = "pr64515",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult2,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult2 = main.Mininet.link( END1="sw8", END2="pr64515",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult2,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 2 )
@@ -443,12 +471,12 @@
             main.exit()
 
         main.step( "Bring up the link between sw28 and peer64516" )
-        linkResult3 = main.Mininet.link( END1 = "sw28", END2 = "pr64516",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult3,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult3 = main.Mininet.link( END1="sw28", END2="pr64516",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult3,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
@@ -459,19 +487,23 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE7( self, main ):
@@ -481,10 +513,10 @@
         import time
         main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
         main.step( "Stop sw32" )
-        result = main.Mininet.switch( SW = "sw32", OPTION = "stop" )
-        utilities.assertEquals( expect = main.TRUE, actual = result,
-                                onpass = "Stopping switch succeeded!",
-                                onfail = "Stopping switch failed!" )
+        result = main.Mininet.switch( SW="sw32", OPTION="stop" )
+        utilities.assertEquals( expect=main.TRUE, actual=result,
+                                onpass="Stopping switch succeeded!",
+                                onfail="Stopping switch failed!" )
 
         if result == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -497,30 +529,30 @@
             main.exit()
 
         main.step( "Check ping between hosts behind BGP peers" )
-        result1 = main.Mininet.pingHost( src = "host64514", target = "host64515" )
-        result2 = main.Mininet.pingHost( src = "host64515", target = "host64516" )
-        result3 = main.Mininet.pingHost( src = "host64514", target = "host64516" )
+        result1 = main.Mininet.pingHost( src="host64514", target="host64515" )
+        result2 = main.Mininet.pingHost( src="host64515", target="host64516" )
+        result3 = main.Mininet.pingHost( src="host64514", target="host64516" )
 
         pingResult1 = ( result1 == main.FALSE ) and ( result2 == main.TRUE ) \
                       and ( result3 == main.FALSE )
-        utilities.assert_equals( expect = True, actual = pingResult1,
-                                 onpass = "Ping test result is correct",
-                                 onfail = "Ping test result is wrong" )
+        utilities.assert_equals( expect=True, actual=pingResult1,
+                                 onpass="Ping test result is correct",
+                                 onfail="Ping test result is wrong" )
 
         if pingResult1 == False:
             main.cleanup()
             main.exit()
 
         main.step( "Check ping between BGP peers and speaker1" )
-        result4 = main.Mininet.pingHost( src = "speaker1", target = "pr64514" )
-        result5 = main.Mininet.pingHost( src = "speaker1", target = "pr64515" )
-        result6 = main.Mininet.pingHost( src = "speaker1", target = "pr64516" )
+        result4 = main.Mininet.pingHost( src="speaker1", target="pr64514" )
+        result5 = main.Mininet.pingHost( src="speaker1", target="pr64515" )
+        result6 = main.Mininet.pingHost( src="speaker1", target="pr64516" )
 
         pingResult2 = ( result4 == main.FALSE ) and ( result5 == main.TRUE ) \
                       and ( result6 == main.TRUE )
-        utilities.assert_equals( expect = True, actual = pingResult2,
-                                 onpass = "Speaker1 ping peers successful",
-                                 onfail = "Speaker1 ping peers NOT successful" )
+        utilities.assert_equals( expect=True, actual=pingResult2,
+                                 onpass="Speaker1 ping peers successful",
+                                 onfail="Speaker1 ping peers NOT successful" )
 
         if pingResult2 == False:
             main.cleanup()
@@ -528,26 +560,30 @@
 
         main.step( "Check ping between BGP peers and speaker2" )
         # TODO
-        result7 = main.Mininet.pingHost( src = "speaker2", target = pr64514 )
-        result8 = main.Mininet.pingHost( src = "speaker2", target = pr64515 )
-        result9 = main.Mininet.pingHost( src = "speaker2", target = pr64516 )
+        result7 = main.Mininet.pingHost( src="speaker2", target=pr64514 )
+        result8 = main.Mininet.pingHost( src="speaker2", target=pr64515 )
+        result9 = main.Mininet.pingHost( src="speaker2", target=pr64516 )
 
         pingResult3 = ( result7 == main.FALSE ) and ( result8 == main.TRUE ) \
                                                 and ( result9 == main.TRUE )
-        utilities.assert_equals( expect = True, actual = pingResult2,
-                                 onpass = "Speaker2 ping peers successful",
-                                 onfail = "Speaker2 ping peers NOT successful" )
+        utilities.assert_equals( expect=True, actual=pingResult2,
+                                 onpass="Speaker2 ping peers successful",
+                                 onfail="Speaker2 ping peers NOT successful" )
 
         if pingResult3 == False:
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
 
     def CASE8( self, main ):
@@ -558,20 +594,20 @@
         import time
         main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
         main.step( "Start sw32" )
-        result1 = main.Mininet.switch( SW = "sw32", OPTION = "start" )
+        result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = result1,
-            onpass = "Starting switch succeeded!",
-            onfail = "Starting switch failed!" )
+            expect=main.TRUE,
+            actual=result1,
+            onpass="Starting switch succeeded!",
+            onfail="Starting switch failed!" )
 
         result2 = main.Mininet.assignSwController( "sw32", fsfwIp,
-                                                   port = fsfwPort )
+                                                   port=fsfwPort )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = result2,
-            onpass = "Connect switch to FSFW succeeded!",
-            onfail = "Connect switch to FSFW failed!" )
+            expect=main.TRUE,
+            actual=result2,
+            onpass="Connect switch to FSFW succeeded!",
+            onfail="Connect switch to FSFW failed!" )
 
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -584,22 +620,26 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [pr64514, pr64515, pr64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[pr64514, pr64515, pr64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE9( self, main ):
@@ -619,10 +659,10 @@
         main.log.info( main.Mininet.checkFlows( "sw7" ) )
 
         main.step( "Stop sw11" )
-        result = main.Mininet.switch( SW = "sw11", OPTION = "stop" )
-        utilities.assertEquals( expect = main.TRUE, actual = result,
-                                onpass = "Stopping switch succeeded!",
-                                onfail = "Stopping switch failed!" )
+        result = main.Mininet.switch( SW="sw11", OPTION="stop" )
+        utilities.assertEquals( expect=main.TRUE, actual=result,
+                                onpass="Stopping switch succeeded!",
+                                onfail="Stopping switch failed!" )
         if result:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -635,21 +675,25 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [pr64514, pr64515, pr64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[pr64514, pr64515, pr64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE10( self, main ):
@@ -667,15 +711,15 @@
         main.log.info( main.Mininet.checkFlows( "sw7" ) )
 
         main.step( "Start sw11" )
-        result1 = main.Mininet.switch( SW = "sw11", OPTION = "start" )
-        utilities.assertEquals( expect = main.TRUE, actual = result1,
-                                onpass = "Starting switch succeeded!",
-                                onfail = "Starting switch failed!" )
+        result1 = main.Mininet.switch( SW="sw11", OPTION="start" )
+        utilities.assertEquals( expect=main.TRUE, actual=result1,
+                                onpass="Starting switch succeeded!",
+                                onfail="Starting switch failed!" )
         result2 = main.Mininet.assignSwController( "sw11", fsfwIp,
-                                                   port = fsfwPort )
-        utilities.assertEquals( expect = main.TRUE, actual = result2,
-                                onpass = "Connect switch to FSFW succeeded!",
-                                onfail = "Connect switch to FSFW failed!" )
+                                                   port=fsfwPort )
+        utilities.assertEquals( expect=main.TRUE, actual=result2,
+                                onpass="Connect switch to FSFW succeeded!",
+                                onfail="Connect switch to FSFW failed!" )
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
@@ -691,21 +735,25 @@
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [pr64514, pr64515, pr64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[pr64514, pr64515, pr64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE11(self, main):
@@ -717,21 +765,25 @@
         main.Functions.checkM2SintentNum( main, 3 )
         main.Functions.checkP2PintentNum( main, 18 * 2 )
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [pr64514, pr64515, pr64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[pr64514, pr64515, pr64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
         main.step( "Kill speaker1" )
         command1 = "ps -e | grep bgp -c"
@@ -749,10 +801,10 @@
 
         result3 = main.Mininet.node( "root", command1 )
 
-        utilities.assert_equals( expect = True,
-                                 actual = ( "4" in result3 ),
-                                 onpass = "Kill speaker1 succeeded",
-                                 onfail = "Kill speaker1 failed" )
+        utilities.assert_equals( expect=True,
+                                 actual=( "4" in result3 ),
+                                 onpass="Kill speaker1 succeeded",
+                                 onfail="Kill speaker1 failed" )
         if ( "4" not in result3 ) :
             main.log.info( result3 )
             main.cleanup()
@@ -764,23 +816,27 @@
         main.Functions.checkP2PintentNum( main, 18 * 2 )
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         '''
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = False )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=False )
         '''
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [pr64514, pr64515, pr64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[pr64514, pr64515, pr64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE12( self, main ):
@@ -806,44 +862,52 @@
         else:
             uninstallResult = main.ONOSbench.onosStop( ONOS3Ip )
 
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = uninstallResult,
-                                 onpass = "Uninstall ONOS leader succeeded",
-                                 onfail = "Uninstall ONOS leader failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=uninstallResult,
+                                 onpass="Uninstall ONOS leader succeeded",
+                                 onfail="Uninstall ONOS leader failed" )
         if uninstallResult != main.TRUE:
             main.cleanup()
             main.exit()
         time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
 
         if leaderIP == ONOS1Ip:
-            main.Functions.checkRouteNum( main, 3, ONOScli = "ONOScli2" )
-            main.Functions.checkM2SintentNum( main, 3, ONOScli = "ONOScli2" )
-            main.Functions.checkP2PintentNum( main, 18 * 2, ONOScli = "ONOScli2" )
+            main.Functions.checkRouteNum( main, 3, ONOScli="ONOScli2" )
+            main.Functions.checkM2SintentNum( main, 3, ONOScli="ONOScli2" )
+            main.Functions.checkP2PintentNum( main, 18 * 2, ONOScli="ONOScli2" )
 
             main.step( "Check whether all flow status are ADDED" )
+            flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                         main.FALSE,
+                                         kwargs={'isPENDING':False},
+                                         attempts=10 )
             utilities.assertEquals( \
-                expect = main.TRUE,
-                actual = main.ONOScli2.checkFlowsState( isPENDING_ADD = False ),
-                onpass = "Flow status is correct!",
-                onfail = "Flow status is wrong!" )
+                expect=main.TRUE,
+                actual=flowCheck,
+                onpass="Flow status is correct!",
+                onfail="Flow status is wrong!" )
         else:
             main.Functions.checkRouteNum( main, 3 )
             main.Functions.checkM2SintentNum( main, 3 )
             main.Functions.checkP2PintentNum( main, 18 * 2 )
 
             main.step( "Check whether all flow status are ADDED" )
+            flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                         main.FALSE,
+                                         kwargs={'isPENDING':False},
+                                         attempts=10 )
             utilities.assertEquals( \
-                expect = main.TRUE,
-                actual = main.ONOScli1.checkFlowsState( isPENDING_ADD = False ),
-                onpass = "Flow status is correct!",
-                onfail = "Flow status is wrong!" )
+                expect=main.TRUE,
+                actual=flowCheck,
+                onpass="Flow status is correct!",
+                onfail="Flow status is wrong!" )
 
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker2"],
-                       peers = [pr64514, pr64515, pr64516],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker2"],
+                       peers=[pr64514, pr64515, pr64516],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
diff --git a/TestON/tests/USECASE_SdnipFunction_fsfw/Dependency/Functions.py b/TestON/tests/USECASE_SdnipFunction_fsfw/Dependency/Functions.py
index d79bc76..dd0b29f 100644
--- a/TestON/tests/USECASE_SdnipFunction_fsfw/Dependency/Functions.py
+++ b/TestON/tests/USECASE_SdnipFunction_fsfw/Dependency/Functions.py
@@ -1,11 +1,16 @@
 
 def checkRouteNum( main, routeNumExpected ):
+    import time
     main.step( "Check routes installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Route number expected:" )
     main.log.info( routeNumExpected )
     main.log.info( "Route number from ONOS CLI:" )
 
     routeNumActual = main.ONOScli.ipv4RouteNumber()
+    if routeNumActual != routeNumExpected:
+        time.sleep( wait )
+        routeNumActual = main.ONOScli.ipv4RouteNumber()
     main.log.info( routeNumActual )
     utilities.assertEquals( \
         expect = routeNumExpected, actual = routeNumActual,
@@ -13,13 +18,20 @@
         onfail = "Route number is wrong!" )
 
 def checkM2SintentNum( main, intentNumExpected ):
+    import time
     main.step( "Check M2S intents installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Intent number expected:" )
     main.log.info( intentNumExpected )
     main.log.info( "Intent number from ONOS CLI:" )
     jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
                                        TYPE = "multiPointToSinglePoint" )
     intentNumActual = jsonResult['installed']
+    if intentNumActual != intentNumExpected:
+        time.sleep( wait )
+        jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
+                                           TYPE = "multiPointToSinglePoint" )
+        intentNumActual = jsonResult['installed']
     main.log.info( intentNumActual )
     utilities.assertEquals( \
         expect = intentNumExpected, actual = intentNumActual,
@@ -27,13 +39,21 @@
         onfail = "M2S intent number is wrong!" )
 
 def checkP2PintentNum( main, intentNumExpected ):
+    import time
     main.step( "Check P2P intents installed" )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Intent number expected:" )
     main.log.info( intentNumExpected )
     main.log.info( "Intent number from ONOS CLI:" )
     jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
                                        TYPE = "pointToPoint" )
     intentNumActual = jsonResult['installed']
+
+    if intentNumActual != intentNumExpected:
+        time.sleep( wait )
+        jsonResult = main.ONOScli.intents( jsonFormat = True, summary = True,
+                                           TYPE = "pointToPoint" )
+        intentNumActual = jsonResult['installed']
     main.log.info( intentNumActual )
     utilities.assertEquals( \
         expect = intentNumExpected, actual = intentNumActual,
@@ -41,11 +61,16 @@
         onfail = "P2P intent number is wrong!" )
 
 def checkFlowNum( main, switch, flowNumExpected ):
+    import time
     main.step( "Check flow entry number in " + switch )
+    wait = int( main.params['timers']['PathAvailable'] )
     main.log.info( "Flow number expected:" )
     main.log.info( flowNumExpected )
     main.log.info( "Flow number actual:" )
     flowNumActual = main.Mininet.getSwitchFlowCount( switch )
+    if flowNumActual != flowNumExpected :
+        time.sleep( wait )
+        flowNumActual = main.Mininet.getSwitchFlowCount( switch )
     main.log.info( flowNumActual )
     utilities.assertEquals( \
         expect = flowNumExpected, actual = flowNumActual,
@@ -109,7 +134,8 @@
         * expectAllSuccess - boolean indicating if you expect all results
         succeed if True, otherwise expect all results fail if False
     """
-    main.step( "Check ping between each host pair" )
+    main.step( "Check ping between each host pair, expect all to succede=" +
+               str( expectAllSuccess ) )
     if len( hosts ) == 0:
         main.log.error( "Parameter hosts can not be empty." )
         main.cleanup()
diff --git a/TestON/tests/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.params b/TestON/tests/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.params
index 8f0dc3f..98d6bad 100644
--- a/TestON/tests/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.params
+++ b/TestON/tests/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.params
@@ -1,11 +1,12 @@
 <PARAMS>
 
     <testcases>100, 101, 102, 1, 2, 3, 4, 7, 8, 9, 10</testcases>
-    #<testcases>100, 101, 102, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10</testcases>
+    #100, 101, 102, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
     # case6 needs a new driver, will enable it after this new driver
     #Environment variables
     <ENV>
-        <cellName>sdnip_single_instance</cellName>
+        <cellName>SDNIP</cellName>
+        <appString>drivers,openflow,proxyarp</appString>
     </ENV>
 
     <CTRL>
@@ -17,16 +18,6 @@
         <port1>6653</port1>
     </CTRL>
 
-    <GIT>
-        <branch1>master</branch1>
-        <branch2>onos-1.3</branch2>
-    </GIT>
-
-    <JSON>
-        <prefix>prefix</prefix>
-        <nextHop>nextHop</nextHop>
-    </JSON>
-
     <DEPENDENCY>
         <path>/USECASE_SdnipFunction_fsfw/Dependency/</path>
         <topology>USECASE_SdnipI2MN.py</topology>
diff --git a/TestON/tests/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py b/TestON/tests/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
index 9a2144e..938b6e0 100644
--- a/TestON/tests/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
+++ b/TestON/tests/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
@@ -5,7 +5,6 @@
         self.default = ''
         global branchName
 
-    # This case is to setup Mininet testbed
     def CASE100( self, main ):
         """
             Start mininet
@@ -19,11 +18,11 @@
 
         main.step( "Starting Mininet Topology" )
         topology = main.dependencyPath + main.topology
-        topoResult = main.Mininet.startNet( topoFile = topology )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = topoResult,
-                                 onpass = "Successfully loaded topology",
-                                 onfail = "Failed to load topology" )
+        topoResult = main.Mininet.startNet( topoFile=topology )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=topoResult,
+                                 onpass="Successfully loaded topology",
+                                 onfail="Failed to load topology" )
         # Exit if topology did not load properly
         if not topoResult:
             main.cleanup()
@@ -44,32 +43,31 @@
         for i in range ( 1, int( main.params['config']['switchNum'] ) + 1 ):
             sw = "sw%s" % ( i )
             swResult = swResult and main.Mininet.assignSwController( sw, fsfwIp,
-                                                                     port = fsfwPort )
-        utilities.assert_equals( expect = main.TRUE,
-                             actual = swResult,
-                             onpass = "Successfully connect all switches to ONOS",
-                             onfail = "Failed to connect all switches to ONOS" )
+                                                                     port=fsfwPort )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=swResult,
+                                 onpass="Successfully connect all switches to ONOS",
+                                 onfail="Failed to connect all switches to ONOS" )
         if not swResult:
             main.cleanup()
             main.exit()
 
         main.step( "Set up tunnel from Mininet node to onos node" )
         forwarding1 = '%s:2000:%s:2000' % ( '1.1.1.2', ONOS1Ip )
-        command = 'ssh -nNT -o "PasswordAuthentication no" \
-        -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % ( forwarding1, ONOS1Ip )
+        command = 'ssh -nNT -o "PasswordAuthentication no"'
+        command += ' -o "StrictHostKeyChecking no" -l sdn'
+        command += ' -L %s %s & ' % ( forwarding1, ONOS1Ip )
 
         tunnelResult = main.TRUE
         tunnelResult = main.Mininet.node( "root", command )
-        utilities.assert_equals( expect = True,
-                             actual = ( "PasswordAuthentication" in tunnelResult ),
-                             onpass = "Created tunnel succeeded",
-                             onfail = "Create tunnel failed" )
+        utilities.assert_equals( expect=True,
+                                 actual=( "PasswordAuthentication" in tunnelResult ),
+                                 onpass="Created tunnel succeeded",
+                                 onfail="Create tunnel failed" )
         if ("PasswordAuthentication" not in tunnelResult) :
             main.cleanup()
             main.exit()
 
-
-    # This case is to setup ONOS
     def CASE101( self, main ):
         """
            Package ONOS and install it
@@ -82,100 +80,92 @@
         """
         import json
         import time
+        import os
         from operator import eq
 
         main.case( "Setting up test environment" )
 
         cellName = main.params[ 'ENV' ][ 'cellName' ]
+        global ONOS1Ip
+        ONOS1Ip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
+        ipList = [ ONOS1Ip ]
+
+        main.step( "Create cell file" )
+        cellAppString = main.params[ 'ENV' ][ 'appString' ]
+        main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
+                                       main.Mininet.ip_address,
+                                       cellAppString, ipList )
 
         main.step( "Applying cell variable to environment" )
         cellResult = main.ONOSbench.setCell( cellName )
-        utilities.assert_equals( expect = main.TRUE,
-                             actual = cellResult,
-                             onpass = "Set cell succeeded",
-                             onfail = "Set cell failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=cellResult,
+                                 onpass="Set cell succeeded",
+                                 onfail="Set cell failed" )
 
         verifyResult = main.ONOSbench.verifyCell()
-        utilities.assert_equals( expect = main.TRUE,
-                             actual = verifyResult,
-                             onpass = "Verify cell succeeded",
-                             onfail = "Verify cell failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=verifyResult,
+                                 onpass="Verify cell succeeded",
+                                 onfail="Verify cell failed" )
 
         branchName = main.ONOSbench.getBranchName()
         main.log.report( "ONOS is on branch: " + branchName )
 
         main.log.step( "Uninstalling ONOS" )
         uninstallResult = main.ONOSbench.onosUninstall( ONOS1Ip )
-        utilities.assert_equals( expect = main.TRUE,
-                                actual = uninstallResult,
-                                onpass = "Uninstall ONOS succeeded",
-                                onfail = "Uninstall ONOS failed" )
-        '''
-        main.step( "Git pull" )
-        gitPullResult = main.ONOSbench.gitPull()
-        main.log.info( "gitPullResult" )
-        main.log.info( gitPullResult )
-        gitPullResult2 = ( gitPullResult == main.TRUE ) or ( gitPullResult == 3 )
-        utilities.assert_equals( expect = True,
-                                 actual = gitPullResult2,
-                                 onpass = "Git pull ONOS succeeded",
-                                 onfail = "Git pull ONOS failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=uninstallResult,
+                                 onpass="Uninstall ONOS succeeded",
+                                 onfail="Uninstall ONOS failed" )
 
-        main.step( "Using mvn clean install" )
-        if gitPullResult == main.TRUE:
-            mciResult = main.ONOSbench.cleanInstall( mciTimeout = 1000 )
-            utilities.assert_equals( expect = main.TRUE,
-                                     actual = mciResult,
-                                     onpass = "Maven clean install ONOS succeeded",
-                                     onfail = "Maven clean install ONOS failed" )
-        else:
-             main.log.warn( "Did not pull new code so skipping mvn " +
-                            "clean install" )
-             mciResult = main.TRUE
-        '''
-
-        main.ONOSbench.getVersion( report = True )
+        main.ONOSbench.getVersion( report=True )
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage( opTimeout = 500 )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = packageResult,
-                                 onpass = "Package ONOS succeeded",
-                                 onfail = "Package ONOS failed" )
+        packageResult = main.ONOSbench.onosPackage( opTimeout=500 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=packageResult,
+                                 onpass="Package ONOS succeeded",
+                                 onfail="Package ONOS failed" )
 
         main.step( "Installing ONOS package" )
-        onos1InstallResult = main.ONOSbench.onosInstall( options = "-f",
-                                                         node = ONOS1Ip )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = onos1InstallResult,
-                                 onpass = "Install ONOS succeeded",
-                                 onfail = "Install ONOS failed" )
+        onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
+                                                         node=ONOS1Ip )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=onos1InstallResult,
+                                 onpass="Install ONOS succeeded",
+                                 onfail="Install ONOS failed" )
 
         main.step( "Checking if ONOS is up yet" )
-        onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout = 420 )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = onos1UpResult,
-                                 onpass = "ONOS is up",
-                                 onfail = "ONOS is NOT up" )
+        onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout=420 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=onos1UpResult,
+                                 onpass="ONOS is up",
+                                 onfail="ONOS is NOT up" )
 
         main.step( "Checking if ONOS CLI is ready" )
         cliResult = main.ONOScli.startOnosCli( ONOS1Ip,
-                commandlineTimeout = 100, onosStartTimeout = 600 )
-        utilities.assert_equals( expect = main.TRUE,
-                         actual = cliResult,
-                         onpass = "ONOS CLI is ready",
-                         onfail = "ONOS CLI is NOT ready" )
+                                               commandlineTimeout=100,
+                                               onosStartTimeout=600 )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=cliResult,
+                                 onpass="ONOS CLI is ready",
+                                 onfail="ONOS CLI is not ready" )
 
-        caseResult = ( cellResult and verifyResult and
-                       packageResult and
-                       onos1InstallResult and onos1UpResult and cliResult )
+        for i in range( 10 ):
+            ready = True
+            output = main.ONOScli.summary()
+            if not output:
+                ready = False
+            if ready:
+                break
+            time.sleep( 30 )
+        utilities.assert_equals( expect=True, actual=ready,
+                                 onpass="ONOS summary command succeded",
+                                 onfail="ONOS summary command failed" )
 
-        utilities.assert_equals( expect = main.TRUE, actual = caseResult,
-                                 onpass = "ONOS startup successful",
-                                 onfail = "ONOS startup NOT successful" )
-
-        if caseResult == main.FALSE:
-            main.log.info( "ONOS startup failed!" )
+        if not ready:
+            main.log.error( "ONOS startup failed!" )
             main.cleanup()
             main.exit()
 
@@ -183,33 +173,33 @@
         time.sleep( int ( main.params['timers']['TopoDiscovery'] ) )
         summaryResult = main.ONOScli.summary()
         linkNum = json.loads( summaryResult )[ "links" ]
+        listResult = main.ONOScli.links( jsonFormat=False )
+        main.log.info( listResult )
         if linkNum < 100:
-            main.log.info( "Link number is wrong!" )
-            listResult = main.ONOScli.links( jsonFormat = False )
+            main.log.error( "Link number is wrong!" )
+            time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+            listResult = main.ONOScli.links( jsonFormat=False )
             main.log.info( listResult )
             main.cleanup()
             main.exit()
 
-        listResult = main.ONOScli.links( jsonFormat = False )
-        main.log.info( listResult )
-
         main.step( "Activate sdn-ip application" )
         activeSDNIPresult = main.ONOScli.activateApp( "org.onosproject.sdnip" )
-        utilities.assert_equals( expect = main.TRUE,
-                                 actual = activeSDNIPresult,
-                                 onpass = "Activate SDN-IP succeeded",
-                                 onfail = "Activate SDN-IP failed" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=activeSDNIPresult,
+                                 onpass="Activate SDN-IP succeeded",
+                                 onfail="Activate SDN-IP failed" )
         if not activeSDNIPresult:
             main.log.info( "Activate SDN-IP failed!" )
             main.cleanup()
             main.exit()
 
 
-        main.log.info( "Wait SDN-IP to finish installing connectivity intents \
-        and the BGP paths in data plane are ready..." )
+        main.log.info( "Wait for SDN-IP to finish installing connectivity intents " +
+                       "and for the BGP paths in the data plane to be ready..." )
         time.sleep( int( main.params[ 'timers' ][ 'SdnIpSetup' ] ) )
-        main.log.info( "Wait Quagga to finish delivery all routes to each \
-        other and to sdn-ip, plus finish installing all intents..." )
+        main.log.info( "Wait for Quagga to finish delivery of all routes to each " +
+                       "other and sdn-ip, plus finish installing all intents..." )
         time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
         time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
 
@@ -233,39 +223,45 @@
         '''
 
         main.case( "Ping tests between BGP peers and speakers" )
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
 
 
     def CASE2( self, main ):
         '''
         point-to-point intents test for each BGP peer and BGP speaker pair
         '''
+        import time
         main.case( "Check point-to-point intents" )
         main.log.info( "There are %s BGP peers in total "
                        % main.params[ 'config' ][ 'peerNum' ] )
         main.step( "Check P2P intents number from ONOS CLI" )
 
-        getIntentsResult = main.ONOScli.intents( jsonFormat = True )
+        getIntentsResult = main.ONOScli.intents( jsonFormat=True )
         bgpIntentsActualNum = \
             main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6
+        if bgpIntentsActualNum != bgpIntentsExpectedNum:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            bgpIntentsActualNum = \
+                main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
         main.log.info( "bgpIntentsExpected num is:" )
         main.log.info( bgpIntentsExpectedNum )
         main.log.info( "bgpIntentsActual num is:" )
         main.log.info( bgpIntentsActualNum )
         utilities.assertEquals( \
-            expect = True,
-            actual = eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
-            onpass = "PointToPointIntent Intent Num is correct!",
-            onfail = "PointToPointIntent Intent Num is wrong!" )
+            expect=True,
+            actual=eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
+            onpass="PointToPointIntent Intent Num is correct!",
+            onfail="PointToPointIntent Intent Num is wrong!" )
 
 
     def CASE3( self, main ):
         '''
         routes and intents check to all BGP peers
         '''
+        import time
         main.case( "Check routes and M2S intents to all BGP peers" )
 
         allRoutesExpected = []
@@ -273,11 +269,16 @@
         allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
         allRoutesExpected.append( "6.0.0.0/24" + "/" + "10.0.6.1" )
 
-        getRoutesResult = main.ONOScli.routes( jsonFormat = True )
+        getRoutesResult = main.ONOScli.routes( jsonFormat=True )
         allRoutesActual = \
             main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
         allRoutesStrExpected = str( sorted( allRoutesExpected ) )
         allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
+        if allRoutesStrActual != allRoutesStrExpected:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            allRoutesActual = \
+                main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
+            allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
 
         main.step( "Check routes installed" )
         main.log.info( "Routes expected:" )
@@ -285,32 +286,40 @@
         main.log.info( "Routes get from ONOS CLI:" )
         main.log.info( allRoutesStrActual )
         utilities.assertEquals( \
-            expect = allRoutesStrExpected, actual = allRoutesStrActual,
-            onpass = "Routes are correct!",
-            onfail = "Routes are wrong!" )
+            expect=allRoutesStrExpected, actual=allRoutesStrActual,
+            onpass="Routes are correct!",
+            onfail="Routes are wrong!" )
 
         main.step( "Check M2S intents installed" )
-        getIntentsResult = main.ONOScli.intents( jsonFormat = True )
+        getIntentsResult = main.ONOScli.intents( jsonFormat=True )
         routeIntentsActualNum = \
             main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
         routeIntentsExpectedNum = 3
+        if routeIntentsActualNum != routeIntentsExpectedNum:
+            time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+            routeIntentsActualNum = \
+                main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
 
         main.log.info( "MultiPointToSinglePoint Intent Num expected is:" )
         main.log.info( routeIntentsExpectedNum )
         main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
         main.log.info( routeIntentsActualNum )
         utilities.assertEquals( \
-            expect = True,
-            actual = eq( routeIntentsExpectedNum, routeIntentsActualNum ),
-            onpass = "MultiPointToSinglePoint Intent Num is correct!",
-            onfail = "MultiPointToSinglePoint Intent Num is wrong!" )
+            expect=routeIntentsExpectedNum,
+            actual=routeIntentsActualNum,
+            onpass="MultiPointToSinglePoint Intent Num is correct!",
+            onfail="MultiPointToSinglePoint Intent Num is wrong!" )
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
 
     def CASE4( self, main ):
@@ -319,8 +328,8 @@
         '''
         main.case( "Ping test for each route, all hosts behind BGP peers" )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE5( self, main ):
@@ -330,68 +339,72 @@
         import time
         main.case( "Bring down links and check routes/intents" )
         main.step( "Bring down the link between sw32 and peer64514" )
-        linkResult1 = main.Mininet.link( END1 = "sw32", END2 = "pr64514",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult1,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult1 = main.Mininet.link( END1="sw32", END2="pr64514",
+                                         OPTION="down" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult1,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
 
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 2 )
             main.Functions.checkM2SintentNum( main, 2 )
         else:
-            main.log.info( "Bring down link failed!" )
+            main.log.error( "Bring down link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Bring down the link between sw8 and peer64515" )
-        linkResult2 = main.Mininet.link( END1 = "sw8", END2 = "pr64515",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult2,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult2 = main.Mininet.link( END1="sw8", END2="pr64515",
+                                         OPTION="down" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult2,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
             main.Functions.checkM2SintentNum( main, 1 )
         else:
-            main.log.info( "Bring down link failed!" )
+            main.log.error( "Bring down link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Bring down the link between sw28 and peer64516" )
-        linkResult3 = main.Mininet.link( END1 = "sw28", END2 = "pr64516",
-                                         OPTION = "down" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult3,
-                                onpass = "Bring down link succeeded!",
-                                onfail = "Bring down link failed!" )
+        linkResult3 = main.Mininet.link( END1="sw28", END2="pr64516",
+                                         OPTION="down" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult3,
+                                onpass="Bring down link succeeded!",
+                                onfail="Bring down link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 0 )
             main.Functions.checkM2SintentNum( main, 0 )
         else:
-            main.log.info( "Bring down link failed!" )
+            main.log.error( "Bring down link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = False )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=False )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = False )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=False )
 
 
     def CASE6( self, main ):
@@ -401,67 +414,71 @@
         import time
         main.case( "Bring up links and check routes/intents" )
         main.step( "Bring up the link between sw32 and peer64514" )
-        linkResult1 = main.Mininet.link( END1 = "sw32", END2 = "pr64514",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult1,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult1 = main.Mininet.link( END1="sw32", END2="pr64514",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult1,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult1 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 1 )
             main.Functions.checkM2SintentNum( main, 1 )
         else:
-            main.log.info( "Bring up link failed!" )
+            main.log.error( "Bring up link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Bring up the link between sw8 and peer64515" )
-        linkResult2 = main.Mininet.link( END1 = "sw8", END2 = "pr64515",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult2,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult2 = main.Mininet.link( END1="sw8", END2="pr64515",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult2,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult2 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 2 )
             main.Functions.checkM2SintentNum( main, 2 )
         else:
-            main.log.info( "Bring up link failed!" )
+            main.log.error( "Bring up link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Bring up the link between sw28 and peer64516" )
-        linkResult3 = main.Mininet.link( END1 = "sw28", END2 = "pr64516",
-                                         OPTION = "up" )
-        utilities.assertEquals( expect = main.TRUE,
-                                actual = linkResult3,
-                                onpass = "Bring up link succeeded!",
-                                onfail = "Bring up link failed!" )
+        linkResult3 = main.Mininet.link( END1="sw28", END2="pr64516",
+                                         OPTION="up" )
+        utilities.assertEquals( expect=main.TRUE,
+                                actual=linkResult3,
+                                onpass="Bring up link succeeded!",
+                                onfail="Bring up link failed!" )
         if linkResult3 == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
             main.Functions.checkM2SintentNum( main, 3 )
         else:
-            main.log.info( "Bring up link failed!" )
+            main.log.error( "Bring up link failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE7( self, main ):
@@ -471,10 +488,10 @@
         import time
         main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
         main.step( "Stop sw32" )
-        result = main.Mininet.switch( SW = "sw32", OPTION = "stop" )
-        utilities.assertEquals( expect = main.TRUE, actual = result,
-                                onpass = "Stopping switch succeeded!",
-                                onfail = "Stopping switch failed!" )
+        result = main.Mininet.switch( SW="sw32", OPTION="stop" )
+        utilities.assertEquals( expect=main.TRUE, actual=result,
+                                onpass="Stopping switch succeeded!",
+                                onfail="Stopping switch failed!" )
 
         if result == main.TRUE:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -482,46 +499,50 @@
             main.Functions.checkM2SintentNum( main, 2 )
             main.Functions.checkP2PintentNum( main, 12 )
         else:
-            main.log.info( "Stopping switch failed!" )
+            main.log.error( "Stopping switch failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check ping between hosts behind BGP peers" )
-        result1 = main.Mininet.pingHost( src = "host64514", target = "host64515" )
-        result2 = main.Mininet.pingHost( src = "host64515", target = "host64516" )
-        result3 = main.Mininet.pingHost( src = "host64514", target = "host64516" )
+        result1 = main.Mininet.pingHost( src="host64514", target="host64515" )
+        result2 = main.Mininet.pingHost( src="host64515", target="host64516" )
+        result3 = main.Mininet.pingHost( src="host64514", target="host64516" )
 
         pingResult1 = ( result1 == main.FALSE ) and ( result2 == main.TRUE ) \
                                                 and ( result3 == main.FALSE )
-        utilities.assert_equals( expect = True, actual = pingResult1,
-                                 onpass = "Ping test result is correct",
-                                 onfail = "Ping test result is wrong" )
+        utilities.assert_equals( expect=True, actual=pingResult1,
+                                 onpass="Ping test result is correct",
+                                 onfail="Ping test result is wrong" )
 
         if pingResult1 == False:
             main.cleanup()
             main.exit()
 
         main.step( "Check ping between BGP peers and speakers" )
-        result4 = main.Mininet.pingHost( src = "speaker1", target = "pr64514" )
-        result5 = main.Mininet.pingHost( src = "speaker1", target = "pr64515" )
-        result6 = main.Mininet.pingHost( src = "speaker1", target = "pr64516" )
+        result4 = main.Mininet.pingHost( src="speaker1", target="pr64514" )
+        result5 = main.Mininet.pingHost( src="speaker1", target="pr64515" )
+        result6 = main.Mininet.pingHost( src="speaker1", target="pr64516" )
 
         pingResult2 = ( result4 == main.FALSE ) and ( result5 == main.TRUE ) \
                                                 and ( result6 == main.TRUE )
-        utilities.assert_equals( expect = True, actual = pingResult2,
-                                 onpass = "Speaker1 ping peers successful",
-                                 onfail = "Speaker1 ping peers NOT successful" )
+        utilities.assert_equals( expect=True, actual=pingResult2,
+                                 onpass="Speaker1 ping peers successful",
+                                 onfail="Speaker1 ping peers NOT successful" )
 
         if pingResult2 == False:
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
 
     def CASE8( self, main ):
@@ -532,20 +553,20 @@
         import time
         main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
         main.step( "Start sw32" )
-        result1 = main.Mininet.switch( SW = "sw32", OPTION = "start" )
+        result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = result1,
-            onpass = "Starting switch succeeded!",
-            onfail = "Starting switch failed!" )
+            expect=main.TRUE,
+            actual=result1,
+            onpass="Starting switch succeeded!",
+            onfail="Starting switch failed!" )
 
         result2 = main.Mininet.assignSwController( "sw32", fsfwIp,
-                                                   port = fsfwPort )
+                                                   port=fsfwPort )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = result2,
-            onpass = "Connect switch to FSFW succeeded!",
-            onfail = "Connect switch to FSFW failed!" )
+            expect=main.TRUE,
+            actual=result2,
+            onpass="Connect switch to FSFW succeeded!",
+            onfail="Connect switch to FSFW failed!" )
 
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -553,24 +574,28 @@
             main.Functions.checkM2SintentNum( main, 3 )
             main.Functions.checkP2PintentNum( main, 18 )
         else:
-            main.log.info( "Starting switch failed!" )
+            main.log.error( "Starting switch failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
 
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE9( self, main ):
@@ -585,15 +610,15 @@
         main.Functions.checkFlowNum( main, "sw11", 13 )
         main.Functions.checkFlowNum( main, "sw1", 3 )
         main.Functions.checkFlowNum( main, "sw7", 3 )
-        main.log.info( main.Mininet.checkFlows( "sw11" ) )
-        main.log.info( main.Mininet.checkFlows( "sw1" ) )
-        main.log.info( main.Mininet.checkFlows( "sw7" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw11" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw1" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw7" ) )
 
         main.step( "Stop sw11" )
-        result = main.Mininet.switch( SW = "sw11", OPTION = "stop" )
-        utilities.assertEquals( expect = main.TRUE, actual = result,
-                                onpass = "Stopping switch succeeded!",
-                                onfail = "Stopping switch failed!" )
+        result = main.Mininet.switch( SW="sw11", OPTION="stop" )
+        utilities.assertEquals( expect=main.TRUE, actual=result,
+                                onpass="Stopping switch succeeded!",
+                                onfail="Stopping switch failed!" )
         if result:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -601,23 +626,27 @@
             main.Functions.checkM2SintentNum( main, 3 )
             main.Functions.checkP2PintentNum( main, 18 )
         else:
-            main.log.info( "Stopping switch failed!" )
+            main.log.error( "Stopping switch failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
 
 
     def CASE10( self, main ):
@@ -631,19 +660,19 @@
         main.log.info( "Check the flow status before starting sw11" )
         main.Functions.checkFlowNum( main, "sw1", 11 )
         main.Functions.checkFlowNum( main, "sw7", 5 )
-        main.log.info( main.Mininet.checkFlows( "sw1" ) )
-        main.log.info( main.Mininet.checkFlows( "sw7" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw1" ) )
+        main.log.debug( main.Mininet.checkFlows( "sw7" ) )
 
         main.step( "Start sw11" )
-        result1 = main.Mininet.switch( SW = "sw11", OPTION = "start" )
-        utilities.assertEquals( expect = main.TRUE, actual = result1,
-                                onpass = "Starting switch succeeded!",
-                                onfail = "Starting switch failed!" )
+        result1 = main.Mininet.switch( SW="sw11", OPTION="start" )
+        utilities.assertEquals( expect=main.TRUE, actual=result1,
+                                onpass="Starting switch succeeded!",
+                                onfail="Starting switch failed!" )
         result2 = main.Mininet.assignSwController( "sw11", fsfwIp,
-                                                   port = fsfwPort )
-        utilities.assertEquals( expect = main.TRUE, actual = result2,
-                                onpass = "Connect switch to FSFW succeeded!",
-                                onfail = "Connect switch to FSFW failed!" )
+                                                   port=fsfwPort )
+        utilities.assertEquals( expect=main.TRUE, actual=result2,
+                                onpass="Connect switch to FSFW succeeded!",
+                                onfail="Connect switch to FSFW failed!" )
         if result1 and result2:
             time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
             main.Functions.checkRouteNum( main, 3 )
@@ -654,20 +683,24 @@
             main.log.debug( main.Mininet.checkFlows( "sw1" ) )
             main.log.debug( main.Mininet.checkFlows( "sw7" ) )
         else:
-            main.log.info( "Starting switch failed!" )
+            main.log.error( "Starting switch failed!" )
             main.cleanup()
             main.exit()
 
         main.step( "Check whether all flow status are ADDED" )
+        flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+                                     main.FALSE,
+                                     kwargs={'isPENDING':False},
+                                     attempts=10 )
         utilities.assertEquals( \
-            expect = main.TRUE,
-            actual = main.ONOScli.checkFlowsState( isPENDING_ADD = False ),
-            onpass = "Flow status is correct!",
-            onfail = "Flow status is wrong!" )
+            expect=main.TRUE,
+            actual=flowCheck,
+            onpass="Flow status is correct!",
+            onfail="Flow status is wrong!" )
         # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers = ["speaker1"],
-                       peers = ["pr64514", "pr64515", "pr64516"],
-                       expectAllSuccess = True )
+        main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
+                       peers=["pr64514", "pr64515", "pr64516"],
+                       expectAllSuccess=True )
         main.Functions.pingHostToHost( main,
-                        hosts = ["host64514", "host64515", "host64516"],
-                        expectAllSuccess = True )
+                        hosts=["host64514", "host64515", "host64516"],
+                        expectAllSuccess=True )
diff --git a/TestON/tests/USECASE_SegmentRouting/2x2.json b/TestON/tests/USECASE_SegmentRouting/2x2.json
new file mode 100644
index 0000000..31b2cc8
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/2x2.json
@@ -0,0 +1,104 @@
+{
+    "ports" : {
+    "of:0000000000000001/3" : {
+        "interfaces" : [
+        {
+            "ips" : [ "10.0.1.254/24" ]
+        }
+        ]
+    },
+    "of:0000000000000001/4" : {
+        "interfaces" : [
+        {
+            "ips" : [ "10.0.1.254/24" ]
+        }
+        ]
+    },
+    "of:0000000000000002/3" : {
+        "interfaces" : [
+        {
+            "ips" : [ "10.0.2.254/24" ]
+        }
+        ]
+    },
+    "of:0000000000000002/4" : {
+        "interfaces" : [
+        {
+            "ips" : [ "10.0.2.254/24" ]
+        }
+        ]
+    }
+    },
+    "devices" : {
+        "of:0000000000000001" : {
+            "basic":{ "driver" : "ofdpa-cpqd" },
+            "segmentrouting" : {
+                "name" : "Leaf-R1",
+                "nodeSid" : 1,
+                "routerIp" : "192.168.0.1",
+                "routerMac" : "00:00:00:00:00:01",
+                "isEdgeRouter" : true,
+                "adjacencySids" : []
+            }
+        },
+        "of:0000000000000002" : {
+            "basic":{ "driver" : "ofdpa-cpqd" },
+            "segmentrouting" : {
+                "name" : "Leaf-R2",
+                "nodeSid" : 2,
+                "routerIp" : "192.168.0.2",
+                "routerMac" : "00:00:00:00:00:02",
+                "isEdgeRouter" : true,
+                "adjacencySids" : []
+            }
+        },
+        "of:0000000000000101" : {
+            "basic":{ "driver" : "ofdpa-cpqd" },
+            "segmentrouting" : {
+                "name" : "Spine-R1",
+                "nodeSid" : 101,
+                "routerIp" : "192.168.0.101",
+                "routerMac" : "00:00:00:00:01:01",
+                "isEdgeRouter" : false,
+                "adjacencySids" : []
+            }
+        },
+        "of:0000000000000102" : {
+            "basic":{ "driver" : "ofdpa-cpqd" },
+            "segmentrouting" : {
+                "name" : "Spine-R2",
+                "nodeSid" : 102,
+                "routerIp" : "192.168.0.102",
+                "routerMac" : "00:00:00:00:01:02",
+                "isEdgeRouter" : false,
+                "adjacencySids" : []
+            }
+        }
+    },
+    "hosts" : {
+        "00:00:00:00:00:01/-1" : {
+            "basic": {
+                "ips": ["10.0.1.1"],
+                "location": "of:0000000000000001/3"
+            }
+        },
+        "00:00:00:00:00:02/-1" : {
+            "basic": {
+                "ips": ["10.0.1.2"],
+                "location": "of:0000000000000001/4"
+            }
+        },
+        "00:00:00:00:00:03/-1" : {
+            "basic": {
+                "ips": ["10.0.2.1"],
+                "location": "of:0000000000000002/3"
+            }
+        },
+        "00:00:00:00:00:04/-1" : {
+            "basic": {
+                "ips": ["10.0.2.2"],
+                "location": "of:0000000000000002/4"
+            }
+        }
+    }
+}
diff --git a/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py b/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py
new file mode 100755
index 0000000..a2a8a8e
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py
@@ -0,0 +1,93 @@
+#!/usr/bin/python
+
+import os
+from optparse import OptionParser
+
+from mininet.net import Mininet
+from mininet.topo import Topo
+from mininet.node import RemoteController, UserSwitch, Host
+from mininet.link import TCLink
+from mininet.log import setLogLevel
+from mininet.cli import CLI
+
+# Parse command line options and dump results
+def parseOptions():
+    """Parse command line options"""
+    parser = OptionParser()
+    parser.add_option('--spine', dest='spine', type='int', default=2,
+                      help='number of spine switches, default=2')
+    parser.add_option('--leaf', dest='leaf', type='int', default=2,
+                      help='number of leaf switches, default=2')
+    parser.add_option('--fanout', dest='fanout', type='int', default=2,
+                      help='number of hosts per leaf switch, default=2')
+    parser.add_option('--onos', dest='onos', type='int', default=0,
+                      help='number of ONOS Instances, default=0, 0 means localhost, 1 will use OC1 and so on')
+
+    (options, args) = parser.parse_args()
+    return options, args
+
+opts, args = parseOptions()
+
+class LeafAndSpine(Topo):
+    def __init__(self, spine=2, leaf=2, fanout=2, **opts):
+        "Create Leaf and Spine Topo."
+
+        Topo.__init__(self, **opts)
+
+        # Add spine switches
+        spines = {}
+        for s in range(spine):
+            spines[s] = self.addSwitch('spine10%s' % (s + 1), dpid="00000000010%s" % (s + 1))
+        # Set link speeds to 100Mb/s
+        linkopts = dict(bw=100)
+
+        # Add Leaf switches
+        for ls in range(leaf):
+            leafSwitch = self.addSwitch('leaf%s' % (ls + 1), dpid="00000000000%s" % (1+ls))
+            # Connect leaf to all spines
+            for s in range(spine):
+                switch = spines[s]
+                self.addLink(leafSwitch, switch, **linkopts)
+            # Add hosts under a leaf, fanout hosts per leaf switch
+            for f in range(fanout):
+                host = self.addHost('h%s' % (ls * fanout + f + 1),
+                                         cls=IpHost,
+                                         ip='10.0.%s.%s/24' % ((ls + 1), (f + 1)),
+                                         gateway='10.0.%s.254' % (ls + 1))
+                self.addLink(host, leafSwitch, **linkopts)
+
+class IpHost(Host):
+    def __init__(self, name, gateway, *args, **kwargs):
+        super(IpHost, self).__init__(name, *args, **kwargs)
+        self.gateway = gateway
+
+    def config(self, **kwargs):
+        Host.config(self, **kwargs)
+        mtu = "ifconfig "+self.name+"-eth0 mtu 1490"
+        self.cmd(mtu)
+        self.cmd('ip route add default via %s' % self.gateway)
+
+def config(opts):
+    spine = opts.spine
+    leaf = opts.leaf
+    fanout = opts.fanout 
+    controllers= [ os.environ['OC%s' % i] for i in range(1,opts.onos+1) ] if (opts.onos) else ['127.0.0.1']
+    topo = LeafAndSpine(spine=spine, leaf=leaf, fanout=fanout)
+    net = Mininet(topo=topo, link=TCLink, build=False,
+                  switch=UserSwitch,
+                  controller = None,
+                  autoSetMacs = True)
+    i = 0
+    for ip in controllers:
+        net.addController( "c%s" % (i), controller=RemoteController, ip=ip)
+        i += 1;
+    net.build()
+    net.start()
+    CLI(net)
+    net.stop()
+
+if __name__ == '__main__':
+    setLogLevel('info')
+    config(opts)
+    os.system('sudo mn -c')
+
diff --git a/TestON/tests/USECASE_SegmentRouting/Dependency/startUp.py b/TestON/tests/USECASE_SegmentRouting/Dependency/startUp.py
new file mode 100644
index 0000000..bf2a2b6
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/Dependency/startUp.py
@@ -0,0 +1,38 @@
+"""
+    This wrapper function is use for starting up onos instance
+"""
+
+import time
+import os
+import json
+
+def onosBuild( main, gitBranch ):
+    """
+        This includes pulling ONOS and building it using maven install
+    """
+
+    buildResult = main.FALSE
+
+    # Git checkout a branch of ONOS
+    checkOutResult = main.ONOSbench.gitCheckout( gitBranch )
+    # Does the git pull on the branch that was checked out
+    if not checkOutResult:
+        main.log.warn( "Failed to checked out " + gitBranch +
+                                           " branch")
+    else:
+        main.log.info( "Successfully checked out " + gitBranch +
+                                           " branch")
+    gitPullResult = main.ONOSbench.gitPull()
+    if gitPullResult == main.ERROR:
+        main.log.error( "Error pulling git branch" )
+    else:
+        main.log.info( "Successfully pulled " + gitBranch + " branch" )
+
+    # Maven clean install
+    buildResult = main.ONOSbench.cleanInstall()
+
+    return buildResult
+
+
+
+
diff --git a/TestON/tests/USECASE_SegmentRouting/README.md b/TestON/tests/USECASE_SegmentRouting/README.md
new file mode 100644
index 0000000..da75079
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/README.md
@@ -0,0 +1,18 @@
+This test is designed to verify basic connectivity the SegmentRouting application.
+
+It consists of 
+
+1) Installing and Starting ONOS
+2) Starting Mininet and testing connectivity
+
+Requirements
+
+ - A single ONOS instance is required for the test, the application is currently not stable in a cluster.
+ - An updated version of the CPQD switch has to be running to make sure it supports group chaining.
+
+Step 1:
+In this step we copy the proper config file to ONOS, next we package ONOS and install it in the target machine.
+
+Step 2:
+
+In this step we start a 2x2 leaf-spine topology, connect to ONOS, and next we send several pings between hosts to test connectivity.
diff --git a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params
new file mode 100755
index 0000000..dfa3d5f
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params
@@ -0,0 +1,36 @@
+<PARAMS>
+
+    <testcases>1,2,11,9, 2,11,9</testcases>
+
+    <SCALE>
+        <size>1</size>
+        <max>1</max>
+    </SCALE>
+
+    <DEPENDENCY>
+        <path>/tests/USECASE_SegmentRouting/Dependency/</path>
+        <wrapper1>startUp</wrapper1>
+        <topology>cord_fabric.py</topology>
+    </DEPENDENCY>
+
+    <ENV>
+        <cellName>productionCell</cellName>
+        <cellApps>drivers,segmentrouting</cellApps>
+        <diffApps>openflow-base,netcfghostprovider,netcfglinksprovider;openflow</diffApps>
+        <cellUser>sdn</cellUser>
+    </ENV>
+
+    <GIT>
+        <pull>False</pull>
+        <branch>master</branch>
+    </GIT>
+
+    <CTRL>
+        <port>6653</port>
+    </CTRL>
+
+    <SLEEP>
+        <startup>10</startup>
+    </SLEEP>
+
+</PARAMS>
diff --git a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py
new file mode 100644
index 0000000..8635b79
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py
@@ -0,0 +1,251 @@
+
+# This test is to determine if the Segment Routing application is working properly
+
+class USECASE_SegmentRouting:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):
+        import time
+        import os
+        import imp
+        import re
+
+        """
+        - Construct tests variables
+        - GIT ( optional )
+            - Checkout ONOS master branch
+            - Pull latest ONOS code
+        - Building ONOS ( optional )
+            - Install ONOS package
+            - Build ONOS package
+        """
+
+        main.case( "Constructing test variables and building ONOS" )
+        main.step( "Constructing test variables" )
+        stepResult = main.FALSE
+
+        # Test variables
+        main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
+        main.cellName = main.params[ 'ENV' ][ 'cellName' ]
+        main.apps = main.params[ 'ENV' ][ 'cellApps' ]
+        main.diff = ( main.params[ 'ENV' ][ 'diffApps' ] ).split(";")
+        gitBranch = main.params[ 'GIT' ][ 'branch' ]
+        main.dependencyPath = main.testOnDirectory + \
+                              main.params[ 'DEPENDENCY' ][ 'path' ]
+        main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
+        #main.json = ["4x4"]
+        main.json = ["2x2", "2x2"]
+        main.args = [" ", " "]
+        #main.args = [" --spine 4 --leaf 4 "]
+        main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
+        main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
+        main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
+        wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
+        main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
+        gitPull = main.params[ 'GIT' ][ 'pull' ]
+        main.cellData = {} # for creating cell file
+        main.CLIs = []
+        main.ONOSip = []
+
+        main.ONOSip = main.ONOSbench.getOnosIps()
+
+        # Assigning ONOS cli handles to a list
+        for i in range( 1,  main.maxNodes + 1 ):
+            main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+
+        # -- INIT SECTION, ONLY RUNS ONCE -- #
+        main.startUp = imp.load_source( wrapperFile1,
+                                        main.dependencyPath +
+                                        wrapperFile1 +
+                                        ".py" )
+
+        copyResult1 = main.ONOSbench.scp( main.Mininet1,
+                                          main.dependencyPath +
+                                          main.topology,
+                                          main.Mininet1.home,
+                                          direction="to" )
+        if main.CLIs:
+            stepResult = main.TRUE
+        else:
+            main.log.error( "Did not properly created list of ONOS CLI handle" )
+            stepResult = main.FALSE
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully construct " +
+                                        "test variables ",
+                                 onfail="Failed to construct test variables" )
+
+        if gitPull == 'True':
+            main.step( "Building ONOS in " + gitBranch + " branch" )
+            onosBuildResult = main.startUp.onosBuild( main, gitBranch )
+            stepResult = onosBuildResult
+            utilities.assert_equals( expect=main.TRUE,
+                                     actual=stepResult,
+                                     onpass="Successfully compiled " +
+                                            "latest ONOS",
+                                     onfail="Failed to compile " +
+                                            "latest ONOS" )
+        else:
+            main.log.warn( "Did not pull new code so skipping mvn " +
+                           "clean install" )
+         
+    def CASE2( self, main ):
+        """
+        - Set up cell
+            - Create cell file
+            - Set cell file
+            - Verify cell file
+        - Kill ONOS process
+        - Uninstall ONOS cluster
+        - Verify ONOS start up
+        - Install ONOS cluster
+        - Connect to cli
+        """
+
+        # main.scale[ 0 ] determines the current number of ONOS controller
+        main.numCtrls = int( main.scale[ 0 ] )
+
+        main.case( "Package and start ONOS")
+
+        #kill off all onos processes
+        main.log.info( "Safety check, killing all ONOS processes" +
+                       " before initiating environment setup" )
+
+        for i in range( main.maxNodes ):
+            main.ONOSbench.onosDie( main.ONOSip[ i ] )
+
+        print "NODE COUNT = ", main.numCtrls
+
+        tempOnosIp = []
+        for i in range( main.numCtrls ):
+            tempOnosIp.append( main.ONOSip[i] )
+        apps=main.apps
+        if main.diff:
+            apps = main.apps+","+main.diff.pop(0)
+        else: main.log.error( "App list is empty" )
+        onosUser = main.params[ 'ENV' ][ 'cellUser' ]
+        main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
+                                       "temp",
+                                       main.Mininet1.ip_address,
+                                       apps,
+                                       tempOnosIp,
+                                       main.ONOSbench.user_name)
+
+        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" )
+        main.ONOSbench.handle.sendline( "cp ~/OnosSystemTest/TestON/tests/USECASE_SegmentRouting/"+main.json.pop(0)+".json ~/onos/tools/package/config/network-cfg.json")
+        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" )
+
+        time.sleep( main.startUpSleep )
+
+        main.step( "Installing ONOS package" )
+        onosInstallResult = main.TRUE
+        for i in range( main.numCtrls ):
+            onosInstallResult = onosInstallResult and \
+                    main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
+        stepResult = onosInstallResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully installed ONOS package",
+                                 onfail="Failed to install ONOS package" )
+
+        main.step( "Starting ONOS service" )
+        stopResult = main.TRUE
+        startResult = main.TRUE
+        onosIsUp = main.TRUE
+
+        for i in range( main.numCtrls ):
+            onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
+        if onosIsUp == main.TRUE:
+            main.log.report( "ONOS instance is up and ready" )
+        else:
+            main.log.report( "ONOS instance may not be up, stop and " +
+                             "start ONOS again " )
+            for i in range( main.numCtrls ):
+                stopResult = stopResult and \
+                        main.ONOSbench.onosStop( main.ONOSip[ i ] )
+            for i in range( main.numCtrls ):
+                startResult = startResult and \
+                        main.ONOSbench.onosStart( main.ONOSip[ i ] )
+        stepResult = onosIsUp and stopResult and startResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="ONOS service is ready",
+                                 onfail="ONOS service did not start properly" )
+        time.sleep( 2*main.startUpSleep )
+
+    def CASE9( self, main ):
+        '''
+            Report errors/warnings/exceptions
+        '''
+        main.log.case( "Logging test" )
+        #main.ONOSbench.logReport( main.ONOSip[ 0 ],
+        #                          [ "INFO" ],
+        #                          "a" )
+        #main.log.info("Error report: \n" )
+        main.ONOSbench.logReport( main.ONOSip[ 0 ],
+                                  [ "INFO",
+                                    "FOLLOWER",
+                                    "WARN",
+                                    "flow",
+                                    "ERROR",
+                                    "Except" ],
+                                  "s" )
+
+    def CASE11( self, main ):
+        """
+            Start mininet
+        """
+        main.log.case( "Start Leaf-Spine 2x2 Mininet Topology" )
+        main.log.report( "Start Mininet topology" )
+
+        main.step( "Starting Mininet Topology" )
+        args,topo=" "," "
+        #if main.topology:
+        #    topo = main.topology.pop(0)
+        #else: main.log.error( "Topo list is empty" )
+        if main.args:
+            args = "--onos 1 " + main.args.pop(0)
+        else: main.log.error( "Argument list is empty" )
+
+        topoResult = main.Mininet1.startNet( topoFile= main.dependencyPath + main.topology, args=args )
+        stepResult = topoResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully loaded topology",
+                                 onfail="Failed to load topology" )
+        # Exit if topology did not load properly
+        if not topoResult:
+            main.cleanup()
+            main.exit()
+        main.step("Waiting for switch initialization and configuration")
+        time.sleep( 3*main.startUpSleep)
+        pa = main.Mininet1.pingall()
+        utilities.assert_equals( expect=main.TRUE, actual=pa,
+                                 onpass="Full connectivity successfully tested",
+                                 onfail="Full connectivity failed" )
+        # cleanup mininet
+        main.ONOSbench.onosStop( main.ONOSip[0] )
+        main.Mininet1.stopNet()
+
+
+
+
+
diff --git a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.topo b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.topo
new file mode 100755
index 0000000..0484c01
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.topo
@@ -0,0 +1,37 @@
+<TOPOLOGY>
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+                <nodes>1</nodes>
+            </COMPONENTS>
+        </ONOSbench>
+
+        <ONOScli1>
+            <host>localhost</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS>
+            </COMPONENTS>
+        </ONOScli1>
+
+        <Mininet1>
+            <host>OCN</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>MininetCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS>
+                <home>~/mininet/custom/</home>
+            </COMPONENTS>
+        </Mininet1>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE_SegmentRouting/__init__.py b/TestON/tests/USECASE_SegmentRouting/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/__init__.py