diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 1d75ae4..1e22267 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1235,6 +1235,29 @@
             main.exit()
         return main.TRUE
 
+    def switch( self, **switchargs ):
+        """
+           start/stop a switch
+        """
+        args = utilities.parse_args( [ "SW", "OPTION" ], **switchargs )
+        sw = args[ "SW" ] if args[ "SW" ] is not None else ""
+        option = args[ "OPTION" ] if args[ "OPTION" ] is not None else ""
+        command = "switch " + str( sw ) + " " + str( option )
+        main.log.info( command )
+        try:
+            self.handle.sendline( command )
+            self.handle.expect( "mininet>" )
+        except pexpect.TIMEOUT:
+            main.log.error( self.name + ": pexpect.TIMEOUT found" )
+            main.cleanup()
+            main.exit()
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            main.cleanup()
+            main.exit()
+        return main.TRUE
+
     def yank( self, **yankargs ):
         """
            yank a mininet switch interface to a host"""
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index a361aca..32aef33 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -1787,43 +1787,35 @@
             main.cleanup()
             main.exit()
 
-    def intents( self, jsonFormat=True ):
+    def intents( self, jsonFormat = True, summary = False, **intentargs):
         """
         Optional:
             * jsonFormat: enable output formatting in json
+            * summary: whether only output the intent summary
+            * type: only output a certain type of intent
+              This options is valid only when jsonFormat is true and summary is
+              true
         Description:
-            Obtain intents currently installed
+            Obtain intents
         """
         try:
             cmdStr = "intents"
+            if summary:
+                cmdStr += " -s"
             if jsonFormat:
                 cmdStr += " -j"
             handle = self.sendline( cmdStr )
-            return handle
-        except TypeError:
-            main.log.exception( self.name + ": Object not as expected" )
-            return None
-        except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
-        except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
-
-    def m2SIntentInstalledNumber( self ):
-        """
-        Description:
-            Obtain the number of multiple point to single point intents
-            installed
-        """
-        try:
-            cmdStr = "intents -s -j"
-            handle = self.sendline( cmdStr )
-            jsonResult = json.loads( handle )
-            return jsonResult['multiPointToSinglePoint']['installed']
+            args = utilities.parse_args( [ "TYPE" ], **intentargs )
+            type = args[ "TYPE" ] if args[ "TYPE" ] is not None else ""
+            if jsonFormat and summary and ( type != "" ):
+                jsonResult = json.loads( handle )
+                if type in jsonResult.keys():
+                    return jsonResult[ type ]
+                else:
+                    main.log.error( "unknown TYPE, return all types of intents" )
+                    return handle
+            else:
+                return handle
 
         except TypeError:
             main.log.exception( self.name + ": Object not as expected" )
@@ -1838,6 +1830,7 @@
             main.cleanup()
             main.exit()
 
+
     def getIntentState(self, intentsId, intentsJson=None):
         """
             Check intent state.
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 2b37186..6c36394 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -711,6 +711,7 @@
                                 "=" + "\"" + arg + "\"" + "\n" )
                 tempCount = tempCount + 1
 
+            cellFile.write( "export OCI=$OC1" )
             cellFile.write( mnString + "\"" + mnIpAddrs + "\"" + "\n" )
             cellFile.write( appString + "\n" )
             cellFile.close()
@@ -1435,9 +1436,9 @@
             self.handle.expect( "\$" )
 
             self.handle.sendline( "tshark -i " + str( interface ) + " -t e -w " + str( dirFile ) + " &" )
-            self.handle.sendline( "\r" )
+            self.handle.sendline( "\n" )
             self.handle.expect( "Capturing on" )
-            self.handle.sendline( "\r" )
+            self.handle.sendline( "\n" )
             self.handle.expect( "\$" )
 
             main.log.info( "Tshark started capturing files on " +
@@ -1661,7 +1662,7 @@
                 cmd += " old"
             self.handle.sendline( cmd )
             self.handle.expect( cmd )
-            self.handle.expect( "\$" )
+            self.handle.expect( "\$ " )
             response = self.handle.before
             return response
         except pexpect.EOF:
@@ -1730,7 +1731,6 @@
         * This function uses root privilege iptables command which may result
           in unwanted network errors. USE WITH CAUTION
         """
-        import time
 
         # NOTE*********
         #   The strict checking methods of this driver function is intentional
diff --git a/TestON/drivers/common/clidriver.py b/TestON/drivers/common/clidriver.py
index fd1a401..b6be81a 100644
--- a/TestON/drivers/common/clidriver.py
+++ b/TestON/drivers/common/clidriver.py
@@ -232,7 +232,7 @@
         i = handle.expect( [ ".ssword:*", default, pexpect.EOF ] )
         if i == 0:
             handle.sendline( pwd )
-            handle.sendline( "\r" )
+            handle.sendline( "\n" )
 
         if i == 1:
             handle.expect( default )
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.params b/TestON/tests/HAclusterRestart/HAclusterRestart.params
index 627bec2..0f37220 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.params
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.params
@@ -40,7 +40,7 @@
         <port7>6633</port7>
     </CTRL>
     <BACKUP>
-        <ENABLED> False </ENABLED>
+        <ENABLED>True</ENABLED>
         <TESTONUSER>admin</TESTONUSER>
         <TESTONIP>10.128.30.9</TESTONIP>
     </BACKUP>
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index b5ebe7d..f7eceb3 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -1717,6 +1717,11 @@
 
         main.case( "Restart entire ONOS cluster" )
 
+        main.step( "Checking ONOS Logs for errors" )
+        for node in main.nodes:
+            main.log.debug( "Checking logs for errors on " + node.name + ":" )
+            main.log.warn( main.ONOSbench.checkLogs( node.ip_address ) )
+
         main.step( "Killing ONOS nodes" )
         killResults = main.TRUE
         killTime = time.time()
@@ -2694,7 +2699,8 @@
         main.Mininet2.stopTcpdump()
 
         testname = main.TEST
-        if main.params[ 'BACKUP' ] == "True":
+        main.log.error( main.params[ 'BACKUP' ][ 'ENABLED' ] )
+        if main.params[ 'BACKUP' ][ 'ENABLED' ] == "True":
             main.step( "Copying MN pcap and ONOS log files to test station" )
             teststationUser = main.params[ 'BACKUP' ][ 'TESTONUSER' ]
             teststationIP = main.params[ 'BACKUP' ][ 'TESTONIP' ]
@@ -2707,36 +2713,38 @@
             logFolder = "/opt/onos/log/"
             logFiles = [ "karaf.log", "karaf.log.1" ]
             # NOTE: must end in /
-            dstDir = "~/packet_captures/"
             for f in logFiles:
                 for node in main.nodes:
                     main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
                                                     ":" + logFolder + f + " " +
                                                     teststationUser + "@" +
                                                     teststationIP + ":" +
-                                                    dstDir + str( testname ) +
-                                                    "-" + node.name + "-" + f )
-                    main.ONOSbench.handle.expect( "\$" )
+                                                    main.logdir + "/" +
+                                                    node.name + "-" + f )
+                    main.ONOSbench.handle.expect( "\$ " )
+                    print main.ONOSbench.handle.before
 
             # std*.log's
             # NOTE: must end in /
             logFolder = "/opt/onos/var/"
             logFiles = [ "stderr.log", "stdout.log" ]
             # NOTE: must end in /
-            dstDir = "~/packet_captures/"
             for f in logFiles:
                 for node in main.nodes:
                     main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
                                                     ":" + logFolder + f + " " +
                                                     teststationUser + "@" +
                                                     teststationIP + ":" +
-                                                    dstDir + str( testname ) +
-                                                    "-" + node.name + "-" + f )
-                    main.ONOSbench.handle.expect( "\$" )
+                                                    main.logdir + "/" +
+                                                    node.name + "-" + f )
+                    main.ONOSbench.handle.expect( "\$ " )
+                    print main.ONOSbench.handle.before
             # sleep so scp can finish
             time.sleep( 10 )
-            main.step( "Packing and rotating pcap archives" )
-            os.system( "~/TestON/dependencies/rotate.sh " + str( testname ) )
+            # main.step( "Packing and rotating pcap archives" )
+            # os.system( "~/TestON/dependencies/rotate.sh " + str( testname ) )
+        else:
+            main.log.debug( "skipping saving log files" )
 
         main.step( "Stopping Mininet" )
         mnResult = main.Mininet1.stopNet()
@@ -2746,9 +2754,8 @@
 
         main.step( "Checking ONOS Logs for errors" )
         for node in main.nodes:
-            print colors[ 'purple' ] + "Checking logs for errors on " + \
-                node.name + ":" + colors[ 'end' ]
-            print main.ONOSbench.checkLogs( node.ip_address, restart=True )
+            main.log.debug( "Checking logs for errors on " + node.name + ":" )
+            main.log.warn( main.ONOSbench.checkLogs( node.ip_address ) )
 
         try:
             timerLog = open( main.logdir + "/Timers.csv", 'w')
diff --git a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
index bc7d17e..eb581ea 100644
--- a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
@@ -22,7 +22,7 @@
         global init
         try:
             if type(init) is not bool:
-                init = Fals
+                init = False
         except NameError:
             init = False
 
@@ -178,34 +178,17 @@
         main.ONOSbench.handle.expect(":~")
         print main.ONOSbench.handle.before
 
-        lastOutput = "--"
-        origin = time.time()
-        clockStarted = False
-        while True:
-
-            main.ONOSbench.handle.sendline("")
-            main.ONOSbench.handle.expect(":~")
-
-            main.ONOSbench.handle.sendline("onos $OC1 summary")
-            main.ONOSbench.handle.expect(":~")
-
-            main.log.info("before" + main.ONOSbench.handle.before)
-            clusterCheck = main.ONOSbench.handle.before
-            print("\nBefore: " + str(clusterCheck))
-            if ("SCC(s)=1,") in clusterCheck:
+        for i in range(3):
+            passed = main.ONOSbench.verifySummary( ONOSIp[0] )
+            if passed:
+                main.log.info("Clusters have converged")
                 break
-            if clusterCheck != lastOutput:
-                sameOutput = False
-            elif clusterCheck == lastOutput:
-                if clockStarted == False:
-                    start = time.time()
-                    clockStarted = True
-                if time.time() > (start + 30):
-                    main.log.error("TIMEOUT EXCEEDED: Clusters have not converged, continuing anyway...")
-                    break
-            lastOutput = clusterCheck
-            time.sleep(5)
+            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
@@ -322,17 +305,16 @@
             main.ONOSbench.handle.expect(":~")
             main.log.info("Stopping intentperf" )
 
-            resultsDB = open("/tmp/IntentEventTPDB", "a")
-            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)
+            with open("/tmp/IntentEventTPDB", "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()
 
diff --git a/TestON/tests/SCPFmaxIntents/Dependency/maxIntentFunctions.py b/TestON/tests/SCPFmaxIntents/Dependency/maxIntentFunctions.py
index 87f2015..268279c 100644
--- a/TestON/tests/SCPFmaxIntents/Dependency/maxIntentFunctions.py
+++ b/TestON/tests/SCPFmaxIntents/Dependency/maxIntentFunctions.py
@@ -72,7 +72,7 @@
         main.log.exception("Timeout exception caught in pushIntents")
     return main.FALSE
 
-def verifyFlows( main, expectedFlows, state="ADDED", sleep=1,  timeout=120):
+def verifyFlows( main, expectedFlows, state="ADDED", sleep=1, numcheck=10, timeout=120):
     '''
         This function returns main.TRUE if the number of expected flows are in
         the specified state
@@ -80,17 +80,19 @@
         @params
             expectedFlows: the flows you expect to see in the specified state
             state: the state of the flow to check for
+            sleep: how long it should sleep for each check
+            numcheck: how many times it should check
             timeout: the timeout for pexpect
     '''
     cmd = "flows | grep " + state + " | wc -l"
-    for i in range(10):
+    for i in range(numcheck):
         flows = getFlows( main, state, sleep, timeout )
         if expectedFlows == flows:
             return main.TRUE
 
     return main.FALSE
 
-def verifyIntents( main, expectedIntents, state="INSTALLED", sleep=1, timeout=120):
+def verifyIntents( main, expectedIntents, state="INSTALLED", sleep=1, numcheck=10, timeout=120):
     '''
         This function returns main.TRUE if the number of expected intents are in
         the specified state
@@ -98,12 +100,15 @@
         @params
             expectedFlows: the intents you expect to see in the specified state
             state: the state of the intent to check for
+            sleep: how long it should sleep for each check
+            numcheck: how many times it should check
             timeout: the timeout for pexpect
     '''
     cmd = "intents | grep " + state + " | wc -l"
-    for i in range(10):
+    for i in range(numcheck):
         intents = getIntents( main, state, sleep, timeout )
         if expectedIntents == intents:
             return main.TRUE
+        time.sleep(sleep)
 
     return main.FALSE
diff --git a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
index a4231d9..7c999f8 100755
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
@@ -1,9 +1,12 @@
 <PARAMS>
 
-    # 0-init, 1-setup, 10-null provider setup,
-    # 11-mininet setup, 20-pushing intents,
+    # 0-init
+    # 1-setup
+    # 10-null provider setup
+    # 11-mininet setup
+    # 20-pushing intents,
     # 21-rerouting intents
-    # 0,1,10,20,1,11,20,1,10,21,1,11,21,100
+    # 0,1,11,20,1,11,21,1,10,20,1,10,21,100
     <testcases>0,1,11,20,1,11,21,1,10,20,1,10,21,100</testcases>
 
     <SCALE>
@@ -34,23 +37,24 @@
 
     <SLEEP>
         <startup>3</startup>
-        <install>5</install>
-        <verify>15</verify>
-        <reroute>15</reroute>
+        <install>0</install>
+        <verify>0</verify>
+        <reroute>3</reroute>
         # timeout for pexpect
         <timeout>120</timeout>
     </SLEEP>
 
     <DATABASE>
+        <file>MaxIntentDB</file>
         <nic>1gig</nic>
         <node>baremetal</node>
     </DATABASE>
 
     <TEST>
-        <batch_size>1000</batch_size>
+        <batch_size>10000</batch_size>
         <min_intents>800000</min_intents>
         <max_intents>1000000</max_intents>
-        <check_interval>10000</check_interval>
+        <check_interval>20000</check_interval>
     </TEST>
 
 </PARAMS>
diff --git a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
index 762f6fd..a790864 100644
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
@@ -37,7 +37,6 @@
                 main.params['DEPENDENCY']['path']
         main.cellName = main.params[ 'ENV' ][ 'cellName' ]
         main.apps = main.params[ 'ENV' ][ 'cellApps' ]
-        gitBranch = main.params[ 'GIT' ][ 'branch' ]
         main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
         main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
         main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
@@ -46,32 +45,42 @@
         main.minIntents = int(main.params['TEST']['min_intents'])
         main.maxIntents = int(main.params['TEST']['max_intents'])
         main.checkInterval = int(main.params['TEST']['check_interval'])
-        wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
-        wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
         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'] )
-        gitPull = main.params[ 'GIT' ][ 'pull' ]
         main.batchSize = int(main.params['TEST']['batch_size'])
-        nic = main.params['DATABASE']['nic']
-        node = main.params['DATABASE']['node']
+        main.dbFileName = main.params['DATABASE']['file']
         main.cellData = {} # for creating cell file
         main.CLIs = []
         main.ONOSip = []
         main.maxNumBatch = 0
-
         main.ONOSip = main.ONOSbench.getOnosIps()
         main.log.info(main.ONOSip)
+        main.setupSkipped = False
+
+        wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
+        wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
+        gitBranch = main.params[ 'GIT' ][ 'branch' ]
+        gitPull = main.params[ 'GIT' ][ 'pull' ]
+        nic = main.params['DATABASE']['nic']
+        node = main.params['DATABASE']['node']
+        nic = main.params['DATABASE']['nic']
+        node = main.params['DATABASE']['node']
 
         # main.scale[ 0 ] determines the current number of ONOS controller
         main.numCtrls = int( main.scale[ 0 ] )
 
-        # Assigning ONOS cli handles to a list
-        for i in range( 1,  main.maxNodes + 1 ):
-            main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+        main.log.info("Creating list of ONOS cli handles")
+        for i in range(main.maxNodes):
+            main.CLIs.append( getattr( main, 'ONOScli' + str( i+1 )))
 
-        # -- INIT SECTION, ONLY RUNS ONCE -- #
+        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 +
@@ -87,43 +96,26 @@
                                                     main.Mininet1.user_name,
                                                     main.Mininet1.ip_address )
 
-        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" )
+        commit = main.ONOSbench.getVersion(report=True)
+        commit = commit.split(" ")[1]
 
         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" )
+            if not main.startUp.onosBuild( main, gitBranch ):
+                main.log.error("Failed to build ONOS")
+                main.cleanup()
+                main.exit()
         else:
             main.log.warn( "Did not pull new code so skipping mvn " +
                            "clean install" )
 
-        main.case( "Starting up " + str( main.numCtrls ) +
-                   " node(s) ONOS cluster" )
-
-        # kill off all onos processes
+        main.log.info( "Starting up %s node(s) ONOS cluster" % main.numCtrls)
         main.log.info( "Safety check, killing all ONOS processes" +
                        " before initiating enviornment setup" )
 
         for i in range( main.maxNodes ):
             main.ONOSbench.onosDie( main.ONOSip[ i ] )
 
-        main.log.info( "NODE COUNT = " + str( main.numCtrls))
+        main.log.info( "NODE COUNT = %s" % main.numCtrls)
 
         tempOnosIp = []
         for i in range( main.numCtrls ):
@@ -135,42 +127,27 @@
                                        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.log.info( "Applying cell to environment" )
+        cell = main.ONOSbench.setCell( "temp" )
+        verify = main.ONOSbench.verifyCell()
+        if not cell or not verify:
+            main.log.error("Failed to apply cell to environment")
+            main.cleanup()
+            main.exit()
 
-        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" )
-
-        commit = main.ONOSbench.getVersion()
-        commit = commit.split(" ")[1]
+        main.log.info( "Creating ONOS package" )
+        if not main.ONOSbench.onosPackage():
+            main.log.error("Failed to create ONOS package")
+            main.cleanup()
+            main.exit()
 
         main.log.info("Creating DB file")
-        nic = main.params['DATABASE']['nic']
-        node = main.params['DATABASE']['node']
-
-        try:
-            dbFileName="/tmp/MaxIntentDB"
-            dbfile = open(dbFileName, "w+")
+        with open(main.dbFileName, "w+") as dbFile:
             temp = "'" + commit + "',"
             temp += "'" + nic + "',"
             temp += str(main.numCtrls) + ","
             temp += "'" + node + "1" + "'"
-            dbfile.write(temp)
-            dbfile.close()
-        except IOError:
-            main.log.warn("Error opening " + dbFileName + " to write results.")
+            dbFile.write(temp)
 
     def CASE1( self, main ):
         """
@@ -179,63 +156,37 @@
         - Install ONOS cluster
         - Connect to cli
         """
-        main.step( "Uninstalling ONOS package" )
-        onosUninstallResult = main.TRUE
+
+        main.log.info( "Uninstalling ONOS package" )
+        main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[i] )
         for i in range( main.maxNodes ):
-            onosUninstallResult = onosUninstallResult and \
-                    main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
-        stepResult = onosUninstallResult
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully uninstalled ONOS package",
-                                 onfail="Failed to uninstall ONOS package" )
+            if not main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[i] ):
+                main.log.error("Failed to uninstall onos on node %s" % (i+1))
+                main.cleanup()
+                main.exit()
 
-        time.sleep( main.startUpSleep )
-        main.step( "Installing ONOS package" )
-        onosInstallResult = main.TRUE
+        main.log.info( "Installing ONOS package" )
         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" )
+            if not main.ONOSbench.onosInstall( node=main.ONOSip[i] ):
+                main.log.error("Failed to install onos on node %s" % (i+1))
+                main.cleanup()
+                main.exit()
 
-        main.step( "Starting ONOS service" )
-        stopResult = main.TRUE
-        startResult = main.TRUE
-        onosIsUp = main.TRUE
-
+        main.log.info( "Starting ONOS service" )
         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" )
+            start = main.ONOSbench.onosStart( main.ONOSip[i] )
+            isup = main.ONOSbench.isup( main.ONOSip[i] )
+            if not start or not isup:
+                main.log.error("Failed to start onos service on node %s" % (i+1))
+                main.cleanup()
+                main.exit()
 
-        main.step( "Start ONOS cli" )
-        cliResult = main.TRUE
+        main.log.info( "Starting ONOS cli" )
         for i in range( main.numCtrls ):
-            cliResult = cliResult and \
-                        main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
-        stepResult = cliResult
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully start ONOS cli",
-                                 onfail="Failed to start ONOS cli" )
+            if not main.CLIs[i].startOnosCli( main.ONOSip[i] ):
+                main.log.error("Failed to start onos cli on node %s" % (i+1))
+                main.cleanup()
+                main.exit()
 
     def CASE10( self, main ):
         """
@@ -245,49 +196,36 @@
         import pexpect
 
         # Activate apps
-        main.log.step("Activating apps")
-        stepResult = main.CLIs[0].activateApp('org.onosproject.null')
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully activated null-provider",
-                                 onfail="Failed to activate null-provider")
+        main.log.info("Activating null-provider")
+        appStatus = main.CLIs[0].activateApp('org.onosproject.null')
+        if not appStatus:
+            main.log.error("Failed to activate null-provider")
 
         # Setup the null-provider
-        main.log.step("Configuring null-provider")
-        stepResult = main.FALSE
-        for i in range(3):
-            main.ONOSbench.onosCfgSet( main.ONOSip[0],
-                                                    'org.onosproject.provider.nil.NullProviders',
-                                                    'deviceCount 3' )
-            main.ONOSbench.onosCfgSet( main.ONOSip[0],
-                                                    'org.onosproject.provider.nil.NullProviders',
-                                                    'topoShape reroute' )
-            main.ONOSbench.onosCfgSet( main.ONOSip[0],
-                                                    'org.onosproject.provider.nil.NullProviders',
-                                                    'enabled true' )
-            # give onos some time to settle
-            time.sleep(main.startUpSleep)
-            jsonSum = json.loads(main.CLIs[0].summary())
-            if jsonSum['devices'] == 3 and jsonSum['SCC(s)'] == 1:
-                stepResult = main.TRUE
-                break
-        utilities.assert_equals( expect=stepResult,
-                                     actual=stepResult,
-                                     onpass="Successfully configured the null-provider",
-                                     onfail="Failed to configure the null-provider")
+        main.log.info("Configuring null-provider")
+        cfgStatus = main.ONOSbench.onosCfgSet( main.ONOSip[0],
+                'org.onosproject.provider.nil.NullProviders', 'deviceCount 3' )
+        cfgStatus = cfgStatus and main.ONOSbench.onosCfgSet( main.ONOSip[0],
+                'org.onosproject.provider.nil.NullProviders', 'topoShape reroute' )
+        cfgStatus = cfgStatus and main.ONOSbench.onosCfgSet( main.ONOSip[0],
+                'org.onosproject.provider.nil.NullProviders', 'enabled true' )
 
+        if not cfgStatus:
+            main.log.error("Failed to configure null-provider")
 
-        main.log.step("Get default flows")
-        jsonSum = json.loads(main.CLIs[0].summary())
+        # give onos some time to settle
+        time.sleep(main.startUpSleep)
 
-        # flows installed by the null-provider
-        main.defaultFlows = jsonSum["flows"]
+        main.defaultFlows = 0
         main.ingress =  ":0000000000000001/3"
         main.egress = ":0000000000000003/2"
         main.switch = "null"
         main.linkUpCmd = "null-link null:0000000000000001/3 null:0000000000000003/1 up"
         main.linkDownCmd = "null-link null:0000000000000001/3 null:0000000000000003/1 down"
 
+        if not appStatus or not cfgStatus:
+            main.setupSkipped = True
+
     def CASE11( self, main ):
         '''
             Setting up mininet
@@ -295,37 +233,33 @@
         import json
         import time
 
-        # Activate apps
-        main.log.step("Activating apps")
-        stepResult = main.CLIs[0].activateApp('org.onosproject.openflow')
+        main.log.step("Activating openflow")
+        appStatus = main.CLIs[0].activateApp('org.onosproject.openflow')
+        if appStatus:
+            main.log.error("Failed to activate openflow")
 
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully activated openflow",
-                                 onfail="Failed to activate openflow")
-        # give onos some time settle
         time.sleep(main.startUpSleep)
 
-        main.log.step('Starting mininet topology')
-        main.Mininet1.startNet(topoFile='~/mininet/custom/rerouteTopo.py')
-        main.Mininet1.assignSwController(sw='s1', ip=main.ONOSip[0])
-        main.Mininet1.assignSwController(sw='s2', ip=main.ONOSip[0])
-        main.Mininet1.assignSwController(sw='s3', ip=main.ONOSip[0])
+        main.log.info('Starting mininet topology')
+        mnStatus = main.Mininet1.startNet(topoFile='~/mininet/custom/rerouteTopo.py')
+        if mnStatus:
+            main.log.error("Failed to start mininet")
+
+        main.log.info("Assinging masters to switches")
+        swStatus =  main.Mininet1.assignSwController(sw='s1', ip=main.ONOSip[0])
+        swStatus = swStatus and  main.Mininet1.assignSwController(sw='s2', ip=main.ONOSip[0])
+        swStatus = swStatus and main.Mininet1.assignSwController(sw='s3', ip=main.ONOSip[0])
+        if not swStatus:
+            main.log.info("Failed to assign masters to switches")
+
         time.sleep(main.startUpSleep)
 
         jsonSum = json.loads(main.CLIs[0].summary())
-        if jsonSum['devices'] == 3 and jsonSum['SCC(s)'] == 1:
-            stepResult = main.TRUE
+        sumStatus = (jsonSum['devices'] == 3 and jsonSum['SCC(s)'] == 1)
 
-        utilities.assert_equals( expect=stepResult,
-                                     actual=stepResult,
-                                     onpass="Successfully assigned switches to their master",
-                                     onfail="Failed to assign switches")
-
-        main.log.step("Get default flows")
+        main.log.step("Getting default flows")
         jsonSum = json.loads(main.CLIs[0].summary())
 
-        # flows installed by the null-provider
         main.defaultFlows = jsonSum["flows"]
         main.ingress =  ":0000000000000001/3"
         main.egress = ":0000000000000003/2"
@@ -333,12 +267,20 @@
         main.linkDownCmd = 'link s1 s3 down'
         main.linkUpCmd = 'link s1 s3 up'
 
+        if not appStatus or not mnStatus or not swStatus or not sumStatus:
+            main.setupSkipped = True
 
     def CASE20( self, main ):
         import pexpect
         '''
             Pushing intents
         '''
+
+        # check if the setup case has been skipped
+        if main.setupSkipped:
+            main.setupSkipped = False
+            main.skipCase()
+
         # the index where the next intents will be installed
         offset = 0
         # the number of intents we expect to be in the installed state
@@ -354,77 +296,52 @@
 
         for i in range(limit):
             # Push intents
-            main.log.step("Pushing intents")
-            stepResult = main.intentFunctions.pushIntents( main,
-                                                           main.switch,
-                                                           main.ingress,
-                                                           main.egress,
-                                                           main.batchSize,
-                                                           offset,
-                                                           sleep=main.installSleep,
-                                                           timeout=main.timeout,
-                                                           options="-i" )
-            utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully pushed intents",
-                                 onfail="Failed to push intents")
-            if stepResult == main.FALSE:
-                break
+            main.log.info("Pushing intents")
+            main.intentFunctions.pushIntents( main,
+                                              main.switch,
+                                              main.ingress,
+                                              main.egress,
+                                              main.batchSize,
+                                              offset,
+                                              sleep=main.installSleep,
+                                              timeout=main.timeout,
+                                              options="-i" )
 
             offset += main.batchSize
             expectedIntents = offset
             expectedFlows += main.batchSize*2
 
+            main.log.info("Grabbing number of installed intents and flows")
             maxIntents = main.intentFunctions.getIntents( main )
             maxFlows = main.intentFunctions.getFlows( main )
 
             if offset >= main.minIntents and offset % main.checkInterval == 0 or expectedIntents == main.maxIntents:
                 # Verifying intents
-                main.log.step("Verifying intents")
-                main.log.info("Expected intents: " + str(expectedIntents))
-                stepResult = main.intentFunctions.verifyIntents( main,
-                                                                 expectedIntents,
-                                                                 sleep=main.verifySleep,
-                                                                 timeout=main.timeout)
-                utilities.assert_equals( expect=main.TRUE,
-                                         actual=stepResult,
-                                         onpass="Successfully verified intents",
-                                         onfail="Failed to verify intents")
-
-                if stepResult == main.FALSE:
-                    break
-
+                main.log.info("Verifying intents\nExpected intents: " + str(expectedIntents))
+                intentStatus = main.intentFunctions.verifyIntents( main,
+                                                                   expectedIntents,
+                                                                   sleep=main.verifySleep,
+                                                                   timeout=main.timeout)
                 # Verfying flows
-                main.log.step("Verifying flows")
-                main.log.info("Expected Flows: " + str(expectedFlows))
-                stepResult = main.intentFunctions.verifyFlows( main,
+                main.log.info("Verifying flows\nExpected Flows: " + str(expectedFlows))
+                flowStatus = main.intentFunctions.verifyFlows( main,
                                                                expectedFlows,
                                                                sleep=main.verifySleep,
                                                                timeout=main.timeout)
 
-                utilities.assert_equals( expect=main.TRUE,
-                                         actual=stepResult,
-                                         onpass="Successfully verified flows",
-                                         onfail="Failed to verify flows")
-
-                if stepResult == main.FALSE:
+                if not flowStatus or not intentsStataus:
+                    main.log.error("Failed to verify")
                     break
 
-        main.log.report("Done pushing intents")
         main.log.info("Summary: Intents=" + str(expectedIntents) + " Flows=" + str(expectedFlows))
         main.log.info("Installed intents: " + str(maxIntents) +
                       " Added flows: " + str(maxFlows))
 
         main.log.info("Writing results to DB file")
-        try:
-            dbFileName="/tmp/MaxIntentDB"
-            dbfile = open(dbFileName, "a")
+        with open(dbFileName, "a") as dbFile:
             temp = "," + str(maxIntents)
             temp += "," + str(maxFlows)
-            dbfile.write(temp)
-            dbfile.close()
-        except IOError:
-            main.log.warn("Error opening " + dbFileName + " to write results.")
+            dbFile.write(temp)
 
         # Stopping mininet
         if main.switch == "of":
@@ -437,6 +354,12 @@
         '''
             Reroute
         '''
+
+        # check if the setup case has been skipped
+        if main.setupSkipped:
+            main.setupSkipped = False
+            main.skipCase()
+
         # the index where the next intents will be installed
         offset = 0
         # the number of intents we expect to be in the installed state
@@ -452,59 +375,41 @@
 
         for i in range(limit):
             # Push intents
-            main.log.step("Pushing intents")
-            stepResult = main.intentFunctions.pushIntents( main,
-                                                           main.switch,
-                                                           main.ingress,
-                                                           main.egress,
-                                                           main.batchSize,
-                                                           offset,
-                                                           sleep=main.installSleep,
-                                                           options="-i",
-                                                           timeout=main.timeout )
-            utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully pushed intents",
-                                 onfail="Failed to push intents")
-            if stepResult == main.FALSE:
-                break
-
-            maxIntents = main.intentFunctions.getIntents( main )
-            maxFlows = main.intentFunctions.getFlows( main )
+            main.log.info("Pushing intents")
+            main.intentFunctions.pushIntents( main,
+                                              main.switch,
+                                              main.ingress,
+                                              main.egress,
+                                              main.batchSize,
+                                              offset,
+                                              sleep=main.installSleep,
+                                              timeout=main.timeout,
+                                              options="-i" )
 
             offset += main.batchSize
             expectedIntents = offset
             expectedFlows += main.batchSize*2
 
+            main.log.info("Grabbing number of installed intents and flows")
+            maxIntents = main.intentFunctions.getIntents( main )
+            maxFlows = main.intentFunctions.getFlows( main )
+
             # Verifying intents
-            main.log.step("Verifying intents")
-            main.log.info("Expected intents: " + str(expectedIntents))
-            stepResult = main.intentFunctions.verifyIntents( main,
-                                                             expectedIntents,
-                                                             sleep=main.verifySleep,
-                                                             timeout=main.timeout )
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=stepResult,
-                                     onpass="Successfully verified intents",
-                                     onfail="Failed to verify intents")
-
-            if stepResult == main.FALSE:
-                break
-
+            main.log.info("Verifying intents\n\tExpected intents: " + str(expectedIntents))
+            intentStatus = main.intentFunctions.verifyIntents( main,
+                                                               expectedIntents,
+                                                               sleep=main.verifySleep,
+                                                               timeout=main.timeout)
             # Verfying flows
-            main.log.step("Verifying flows")
-            main.log.info("Expected Flows: " + str(expectedFlows))
-            stepResult = main.intentFunctions.verifyFlows( main,
+            main.log.info("Verifying flows\n\tExpected Flows: " + str(expectedFlows))
+            flowStatus = main.intentFunctions.verifyFlows( main,
                                                            expectedFlows,
                                                            sleep=main.verifySleep,
-                                                           timeout=main.timeout )
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=stepResult,
-                                     onpass="Successfully verified flows",
-                                     onfail="Failed to verify flows")
+                                                           timeout=main.timeout)
 
-            if stepResult == main.FALSE:
-                break
+            if not flowStatus or not intentsStataus:
+                main.log.error("Failed to verify\n\tSkipping case")
+                main.log.skipCase()
 
             # tear down a link
             main.log.step("Tearing down link")
@@ -516,28 +421,27 @@
                 main.log.info("Sending: " + main.linkDownCmd)
                 main.CLIs[0].handle.sendline(main.linkDownCmd)
                 main.CLIs[0].handle.expect('onos>')
+
             time.sleep(main.rerouteSleep)
 
             # rerouting adds a 1000 flows
             expectedFlows += 1000
 
+            main.log.info("Grabbing number of added flows")
+            maxFlows = main.intentFunctions.getFlows( main )
+
             # Verfying flows
-            main.log.step("Verifying flows")
-            main.log.info("Expected Flows: " + str(expectedFlows))
-            stepResult = main.intentFunctions.verifyFlows( main,
+            main.log.info("Verifying flows\n\tExpected Flows: " + str(expectedFlows))
+            flowStatus = main.intentFunctions.verifyFlows( main,
                                                            expectedFlows,
                                                            sleep=main.verifySleep,
                                                            timeout=main.timeout)
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=stepResult,
-                                     onpass="Successfully verified flows",
-                                     onfail="Failed to verify flows")
-
-            if stepResult == main.FALSE:
-                break
+            if not flowStatus:
+                main.log.error("Failed to verify flows\n\tSkipping case")
+                main.skipCase()
 
             # Bring link back up
-            main.log.step("Tearing down link")
+            main.log.step("Bringing link back up")
             if main.switch == "of":
                 main.log.info("Sending: " + main.linkUpCmd)
                 main.Mininet1.handle.sendline(main.linkUpCmd)
@@ -546,22 +450,17 @@
                 main.log.info("Sending: " + main.linkUpCmd)
                 main.CLIs[0].handle.sendline(main.linkUpCmd)
                 main.CLIs[0].handle.expect('onos>')
+
             time.sleep(main.rerouteSleep)
 
-        main.log.report("Done pushing intents")
         main.log.info("Summary: Intents=" + str(expectedIntents) + " Flows=" + str(expectedFlows))
         main.log.info("Installed intents: " + str(maxIntents) +
                       " Added flows: " + str(maxFlows))
 
-        try:
-            dbFileName="/tmp/MaxIntentDB"
-            dbfile = open(dbFileName, "a")
+        with open(main.dbFileName, "a") as dbFile:
             temp = "," + str(maxIntents)
             temp += "," + str(maxFlows)
-            dbfile.write(temp)
-            dbfile.close()
-        except IOError:
-            main.log.warn("Error opening " + dbFileName + " to write results.")
+            dbFile.write(temp)
 
         # Stopping mininet
         if main.switch == "of":
diff --git a/TestON/tests/USECASE_SdnipI2/Dependency/Functions.py b/TestON/tests/USECASE_SdnipI2/Dependency/Functions.py
new file mode 100644
index 0000000..732ff41
--- /dev/null
+++ b/TestON/tests/USECASE_SdnipI2/Dependency/Functions.py
@@ -0,0 +1,41 @@
+
+def checkRouteNum( main, routeNumExpected ):
+    main.step( "Check routes installed" )
+    main.log.info( "Route number expected:" )
+    main.log.info( routeNumExpected )
+    main.log.info( "Route number from ONOS CLI:" )
+
+    routeNumActual = main.ONOScli.ipv4RouteNumber()
+    main.log.info( routeNumActual )
+    utilities.assertEquals( \
+        expect = routeNumExpected, actual = routeNumActual,
+        onpass = "***Route number is correct!***",
+        onfail = "***Route number is wrong!***" )
+
+def checkM2SintentNum( main, intentNumExpected ):
+    main.step( "Check M2S intents installed" )
+    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']
+    main.log.info( intentNumActual )
+    utilities.assertEquals( \
+        expect = intentNumExpected, actual = intentNumActual,
+        onpass = "***M2S intent number is correct!***",
+        onfail = "***M2S intent number is wrong!***" )
+
+def checkP2PintentNum( main, intentNumExpected ):
+    main.step( "Check P2P intents installed" )
+    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']
+    main.log.info( intentNumActual )
+    utilities.assertEquals( \
+        expect = intentNumExpected, actual = intentNumActual,
+        onpass = "***P2P intent number is correct!***",
+        onfail = "***P2P intent number is wrong!***" )
diff --git a/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.params b/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.params
index b13806a..fd65488 100644
--- a/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.params
+++ b/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.params
@@ -1,6 +1,6 @@
 <PARAMS>
 
-    <testcases>100, 101, 1, 4</testcases>
+    <testcases>100, 101, 102, 7, 8, 1, 4</testcases>
 
     #Environment variables
     <ENV>
@@ -27,6 +27,7 @@
     <DEPENDENCY>
         <path>/USECASE_SdnipI2/Dependency/</path>
         <topology>USECASE_SdnipI2MN.py</topology>
+        <wrapper1>Functions</wrapper1>
     </DEPENDENCY>
 
     <config>
diff --git a/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.py b/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.py
index d7b8802..6808576 100644
--- a/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.py
+++ b/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.py
@@ -11,6 +11,7 @@
             Start mininet
         """
         import os
+        import imp
         main.log.case( "Start Mininet topology" )
         main.dependencyPath = main.testDir + \
                               main.params[ 'DEPENDENCY' ][ 'path' ]
@@ -123,6 +124,19 @@
         time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
 
 
+    def CASE102( self, main ):
+        '''
+        This test case is to load the methods from other Python files.
+        '''
+        main.case( "Loading the methods from other Python file" )
+        # load the methods from other file
+        wrapperFile = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
+        main.Functions = imp.load_source( wrapperFile,
+                                          main.dependencyPath +
+                                          wrapperFile +
+                                          ".py" )
+
+
     def CASE1( self, main ):
         '''
         ping test from 3 bgp peers to BGP speaker
@@ -235,3 +249,180 @@
         if caseResult == main.FALSE:
             main.cleanup()
             main.exit()
+
+
+    def CASE5( self, main ):
+        '''
+        Cut links to peers one by one, check routes/intents
+        '''
+        import time
+        main.case( "This case is to bring down links and check routes/intents" )
+        main.step( "Bring down the link between sw32 and peer64514" )
+        result = main.Mininet.link( END1 = "sw32", END2 = "peer64514",
+                                    OPTION = "down" )
+        if result == 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.exit();
+
+        main.step( "Bring down the link between sw8 and peer64515" )
+        result = main.Mininet.link( END1 = "sw8", END2 = "peer64515",
+                                    OPTION = "down" )
+        if result == 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.exit();
+
+        main.step( "Bring down the link between sw28 and peer64516" )
+        result = main.Mininet.link( END1 = "sw28", END2 = "peer64516",
+                                    OPTION = "down" )
+        if result == 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.exit();
+
+
+    def CASE6(self, main):
+        '''
+        Recover links to peers one by one, check routes/intents
+        '''
+        import time
+        main.case( "This case is to bring up links and check routes/intents" )
+        main.step( "Bring up the link between sw32 and peer64514" )
+        result = main.Mininet.link( END1 = "sw32", END2 = "peer64514",
+                                    OPTION = "up" )
+        if result == 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.exit();
+
+        main.step( "Bring up the link between sw8 and peer64515" )
+        result = main.Mininet.link( END1 = "sw8", END2 = "peer64515",
+                                    OPTION = "up" )
+        if result == 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.exit();
+
+        main.step( "Bring up the link between sw28 and peer64516" )
+        result = main.Mininet.link( END1 = "sw28", END2 = "peer64516",
+                                    OPTION = "up" )
+        if result == 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.exit();
+        '''
+        Note: at the end of this test case, we should carry out ping test.
+        So we run CASE4 again after CASE6
+        '''
+
+
+    def CASE7(self, main):
+        '''
+        shut down a edge switch, check P-2-P and M-2-S intents, ping test
+        '''
+        import time
+        main.case( "This case is to stop 1 edge switch,\
+        check P-2-P and M-2-S intents, ping test")
+        main.step( "Stop sw32" )
+        result = main.Mininet.switch( SW = "sw32", OPTION = "stop" )
+        if result == main.TRUE:
+            time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
+            main.Functions.checkRouteNum( main, 2 )
+            main.Functions.checkM2SintentNum( main, 2 )
+            main.Functions.checkP2PintentNum( main, 12 )
+        else:
+            main.log.info( "Stop switch failed!!!" )
+            main.exit();
+
+        '''
+        main.step( "Stop sw8" )
+        result = main.Mininet.switch( SW = "sw8", OPTION = "stop" )
+        if result == main.TRUE:
+            time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
+            main.Functions.checkRouteNum( main, 1 )
+
+            # Note: there should be 0 M2S intent, not 1.
+            main.Functions.checkM2SintentNum( main, 0 )
+            main.Functions.checkP2PintentNum( main, 6 )
+        else:
+            main.log.info( "Stop switch failed!!!" )
+            main.exit();
+
+        main.step( "Stop sw28" )
+        result = main.Mininet.switch( SW = "sw28", OPTION = "stop" )
+        if result == main.TRUE:
+            time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
+            main.Functions.checkRouteNum( main, 0 )
+            main.Functions.checkM2SintentNum( main, 0 )
+            main.Functions.checkP2PintentNum( main, 0 )
+        else:
+            main.log.info( "Stop switch failed!!!" )
+            main.exit();
+        '''
+        '''
+        ping test between BGP speaker and BGP peers, ping test between hosts
+        behind BGP peers ===
+        '''
+
+    def CASE8( self, main ):
+        main.case( "This case is to bring up 1 edge switch,\
+        check P-2-P and M-2-S intents, ping test" )
+
+
+    def CASE20( self, main ):
+        '''
+        ping test from 3 bgp peers to BGP speaker
+        '''
+        main.case( "This case is to check ping between BGP peers and speakers" )
+        result1 = main.Mininet.pingHost( src = "speaker1", target = "peer64514" )
+        result2 = main.Mininet.pingHost( src = "speaker1", target = "peer64515" )
+        result3 = main.Mininet.pingHost( src = "speaker1", target = "peer64516" )
+
+
+        caseResult = result1 or result2 or result3
+        utilities.assert_equals( expect = main.FALSE, actual = caseResult,
+                                 onpass = "Speaker1 failed to ping all peers - Correct",
+                                 onfail = "Speaker1 did not fail to ping all peers- NOT Correct" )
+
+        if caseResult == main.TRUE:
+            main.cleanup()
+            main.exit()
+
+
+    def CASE21( self, main ):
+        '''
+        Ping test in data plane for each route
+        '''
+        main.case( "This case is to check ping for each route" )
+        result1 = main.Mininet.pingHost( src = "host64514", target = "host64515" )
+        result2 = main.Mininet.pingHost( src = "host64515", target = "host64516" )
+        result3 = main.Mininet.pingHost( src = "host64514", target = "host64516" )
+
+        caseResult = result1 or result2 or result3
+        utilities.assert_equals( expect = main.FALSE, actual = caseResult,
+                                 onpass = "Ping test for all routes failed- Correct",
+                                 onfail = "Ping test for all routes NOT failed- NOT Correct" )
+
+        if caseResult == main.TRUE:
+            main.cleanup()
+            main.exit()
+
