diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
index 0d6014f..e25086a 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
@@ -14,7 +14,10 @@
         <ip3>OC3</ip3>
         <port1>6653</port1>
     </CTRL>
-
+    <GIT>
+        <pull>False</pull>
+        <branch>master</branch>
+    </GIT>
     <DEPENDENCY>
         <path>/USECASE/USECASE_SdnipFunctionCluster/dependencies/</path>
         <topology>USECASE_SdnipI2MN_Cluster.py</topology>
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
index c96fa40..a1fb405 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
@@ -32,8 +32,7 @@
         swResult = main.TRUE
         for i in range ( 1, int( main.params['config']['switchNum'] ) + 1 ):
             sw = "sw%s" % ( i )
-            swResult = swResult and main.Mininet.assignSwController( sw,
-                                                 [ONOS1Ip, ONOS2Ip, ONOS3Ip] )
+            swResult = swResult and main.Mininet.assignSwController( sw, main.ONOSip )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=swResult,
                                  onpass="Successfully connect all switches to ONOS",
@@ -57,143 +56,24 @@
         import time
         import os
         from operator import eq
-
-        main.case( "Setting up ONOS environment" )
-
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-        global ONOS1Ip
-        global ONOS2Ip
-        global ONOS3Ip
-        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 p64514
         global p64515
         global p64516
-        p64514 = main.params['config']['p64514']
-        p64515 = main.params['config']['p64515']
-        p64516 = main.params['config']['p64516']
+        p64514 = main.params[ 'config' ][ 'p64514' ]
+        p64515 = main.params[ 'config' ][ 'p64515' ]
+        p64516 = main.params[ 'config' ][ 'p64516' ]
 
-        main.step( "Copying config files" )
-        src = os.path.dirname( main.testFile ) + "/network-cfg.json"
-        dst = main.ONOSbench.home + "/tools/package/config/network-cfg.json"
-        status = main.ONOSbench.scp( main.ONOSbench, src, dst, direction="to" )
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=status,
-                                 onpass="Copy config file succeeded",
-                                 onfail="Copy config file failed" )
-
-        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.ONOScli1.karafUser )
-
-        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" )
-
-        main.step( "Verify cell connectivity" )
-        verifyResult = main.ONOSbench.verifyCell()
-        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.step( "Uninstalling ONOS" )
-        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" )
-
-        main.ONOSbench.getVersion( report=True )
-
-        main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.buckBuild()
-        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 )
-        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" )
-
-        main.step( "Set up ONOS secure SSH" )
-        secureSshResult = main.ONOSbench.onosSecureSSH( node=ONOS1Ip )
-        secureSshResult = secureSshResult and main.ONOSbench.onosSecureSSH( node=ONOS2Ip )
-        secureSshResult = secureSshResult and main.ONOSbench.onosSecureSSH( node=ONOS3Ip )
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=secureSshResult,
-                                 onpass="Set up ONOS secure SSH succeeded",
-                                 onfail="Set up ONOS secure SSH 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 )
-        onosUpResult = onos1UpResult and onos2UpResult and onos3UpResult
-        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 )
-        main.CLIs.append( main.ONOScli1 )
-        cliResult2 = main.ONOScli2.startOnosCli( ONOS2Ip,
-                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" )
-
-        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" )
-
-        if not ready:
-            main.log.error( "ONOS startup failed!" )
-            main.cleanup()
+        try:
+            from tests.USECASE.dependencies.sdnipBaseFunction import SdnBase
+        except ImportError:
+            main.log.error( "sdnBase not found. exiting the test" )
             main.exit()
+        try:
+            main.sdnBase
+        except ( NameError, AttributeError ):
+            main.sdnBase = SdnBase()
+
+        main.sdnBase.initSetup()
 
     def CASE200( self, main ):
         main.case( "Activate sdn-ip application" )
@@ -229,7 +109,6 @@
             main.cleanup()
             main.exit()
 
-
     def CASE102( self, main ):
         '''
         This test case is to load the methods from other Python files, and create
@@ -244,9 +123,8 @@
                                           wrapperFile1 +
                                           ".py" )
         # Create tunnels
-        main.Functions.setupTunnel( main, '1.1.1.2', 2000, ONOS1Ip, 2000 )
-        main.Functions.setupTunnel( main, '1.1.1.4', 2000, ONOS2Ip, 2000 )
-        main.Functions.setupTunnel( main, '1.1.1.6', 2000, ONOS3Ip, 2000 )
+        for i in range ( len( main.ONOSip ) ):
+            main.Functions.setupTunnel( main, '1.1.1.' + str( ( i + 1 ) * 2 ), 2000, main.ONOSip[ i ], 2000 )
 
         main.log.info( "Wait SDN-IP to finish installing connectivity intents \
         and the BGP paths in data plane are ready..." )
@@ -282,29 +160,7 @@
         '''
         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 )
-        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.assert_equals( expect=bgpIntentsExpectedNum,
-                                 actual=bgpIntentsActualNum,
-                                 onpass="PointToPointIntent Intent Num is correct!",
-                                 onfail="PointToPointIntent Intent Num is wrong!" )
+        main.sdnBase.pToPIntentTest( 12 )
 
     def CASE3( self, main ):
         '''
@@ -323,56 +179,7 @@
         allRoutesExpected.append( "9.0.0.0/24" + "/" + "10.0.9.1" )
         allRoutesExpected.append( "20.0.0.0/24" + "/" + "10.0.20.1" )
 
-        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'] ) )
-            getRoutesResult = main.ONOScli1.routes( jsonFormat=True )
-            allRoutesActual = \
-                main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
-            allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
-
-        main.log.info( "Routes expected:" )
-        main.log.info( allRoutesStrExpected )
-        main.log.info( "Routes get from ONOS CLI:" )
-        main.log.info( allRoutesStrActual )
-        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 )
-        routeIntentsActualNum = \
-            main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
-        routeIntentsExpectedNum = 7
-        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.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" )
-        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.sdnBase.routeAndIntentCheck( allRoutesExpected, 7 )
 
 
     def CASE4( self, main ):
@@ -386,154 +193,27 @@
         main.Functions.pingHostToHost(main,
                                       hosts=["h64517", "h64518"],
                                       expectAllSuccess=True)
-        main.Functions.pingHostToHost(main,
-                                      hosts=["h64519", "h64520"],
-                                      expectAllSuccess=True)
+        main.Functions.pingHostToHost( main,
+                                       hosts=[ "h64519", "h64520" ],
+                                       expectAllSuccess=True )
 
     def CASE5( self, main ):
         '''
         Cut links to peers one by one, check routes/intents
         '''
-        import time
-        main.case( "Bring down links and check routes/intents" )
-        main.step( "Bring down the link between sw32 and p64514" )
-        linkResult1 = main.Mininet.link( END1="sw32", END2="p64514",
-                                         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' ] ) )
-            main.Functions.checkRouteNum( main, 6 )
-            main.Functions.checkM2SintentNum( main, 6 )
-        else:
-            main.log.error( "Bring down link failed!" )
-            main.cleanup()
-            main.exit()
-
-        main.step( "Bring down the link between sw8 and p64515" )
-        linkResult2 = main.Mininet.link( END1="sw8", END2="p64515",
-                                         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, 5 )
-            main.Functions.checkM2SintentNum( main, 5 )
-        else:
-            main.log.error( "Bring down link failed!" )
-            main.cleanup()
-            main.exit()
-
-        main.step( "Bring down the link between sw28 and p64516" )
-        linkResult3 = main.Mininet.link( END1="sw28", END2="p64516",
-                                         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, 4 )
-            main.Functions.checkM2SintentNum( main, 4 )
-        else:
-            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.assert_equals( expect=main.TRUE,
-                                 actual=flowCheck,
-                                 onpass="Flow status is correct!",
-                                 onfail="Flow status is wrong!" )
-
-        # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
-                       peers=["p64514", "p64515", "p64516"],
-                       expectAllSuccess=False )
-        main.Functions.pingHostToHost( main,
-                        hosts=["h64514", "h64515", "h64516"],
-                        expectAllSuccess=False )
+        main.sdnBase.linkUpDownCheck( "p64514", "p64515", "p64516",
+                                      6, 6, 5, 5, 4, 4,
+                                      "spk1", [ "h64514", "h64515", "h64516" ],
+                                      "down" )
 
     def CASE6( self, main ):
         '''
         Recover links to peers one by one, check routes/intents
         '''
-        import time
-        main.case( "Bring up links and check routes/intents" )
-        main.step( "Bring up the link between sw32 and p64514" )
-        linkResult1 = main.Mininet.link( END1="sw32", END2="p64514",
-                                         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, 5 )
-            main.Functions.checkM2SintentNum( main, 5 )
-        else:
-            main.log.error( "Bring up link failed!" )
-            main.cleanup()
-            main.exit()
-
-        main.step( "Bring up the link between sw8 and p64515" )
-        linkResult2 = main.Mininet.link( END1="sw8", END2="p64515",
-                                         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, 6 )
-            main.Functions.checkM2SintentNum( main, 6 )
-        else:
-            main.log.error( "Bring up link failed!" )
-            main.cleanup()
-            main.exit()
-
-        main.step( "Bring up the link between sw28 and p64516" )
-        linkResult3 = main.Mininet.link( END1="sw28", END2="p64516",
-                                         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, 7 )
-            main.Functions.checkM2SintentNum( main, 7 )
-        else:
-            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.assert_equals( expect=main.TRUE,
-                                 actual=flowCheck,
-                                 onpass="Flow status is correct!",
-                                 onfail="Flow status is wrong!" )
-
-        # Ping test
-        main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
-                       peers=["p64514", "p64515", "p64516"],
-                       expectAllSuccess=True )
-        main.Functions.pingHostToHost( main,
-                        hosts=["h64514", "h64515", "h64516"],
-                        expectAllSuccess=True )
+        main.sdnBase.linkUpDownCheck( "p64514", "p64515", "p64516",
+                                      5, 5, 6, 6, 7, 7,
+                                      "spk1", [ "h64514", "h64515", "h64516" ],
+                                      "up" )
 
     def CASE7( self, main ):
         '''
@@ -627,7 +307,7 @@
                                  onpass="Starting switch succeeded!",
                                  onfail="Starting switch failed!" )
 
-        result2 = main.Mininet.assignSwController( "sw32", ONOS1Ip )
+        result2 = main.Mininet.assignSwController( "sw32", main.ONOSip[ 0 ] )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=result2,
                                  onpass="Connect switch to ONOS succeeded!",
@@ -738,7 +418,7 @@
         utilities.assert_equals( expect=main.TRUE, actual=result1,
                                  onpass="Starting switch succeeded!",
                                  onfail="Starting switch failed!" )
-        result2 = main.Mininet.assignSwController( "sw11", ONOS1Ip )
+        result2 = main.Mininet.assignSwController( "sw11", main.ONOSip[ 0 ] )
         utilities.assert_equals( expect=main.TRUE, actual=result2,
                                  onpass="Connect switch to ONOS succeeded!",
                                  onfail="Connect switch to ONOS failed!" )
@@ -874,12 +554,9 @@
                 main.log.info( leaderIP )
 
         main.step( "Uninstall ONOS/SDN-IP leader node" )
-        if leaderIP == ONOS1Ip:
-            uninstallResult = main.ONOSbench.onosStop( ONOS1Ip )
-        elif leaderIP == ONOS2Ip:
-            uninstallResult = main.ONOSbench.onosStop( ONOS2Ip )
-        else:
-            uninstallResult = main.ONOSbench.onosStop( ONOS3Ip )
+        for ip in main.ONOSip:
+            if leaderIP == ip:
+                uninstallResult = main.ONOSbench.onosStop( ip )
 
         utilities.assert_equals( expect=main.TRUE,
                                  actual=uninstallResult,
@@ -890,7 +567,7 @@
             main.exit()
         time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
 
-        if leaderIP == ONOS1Ip:
+        if leaderIP == main.ONOSip[ 0 ]:
             main.Functions.checkRouteNum( main, 7, ONOScli="ONOScli2" )
             main.Functions.checkM2SintentNum( main, 7, ONOScli="ONOScli2" )
             main.Functions.checkP2PintentNum( main, 30 * 2, ONOScli="ONOScli2" )
