update onos config file for config system, add more scripts

Change-Id: I5aa96764a549a8fa20e247751648e612fcf18c13
diff --git a/TestON/tests/SDNIPfunction/.bash_killcmd b/TestON/tests/SDNIPfunction/.bash_killcmd
new file mode 100644
index 0000000..2b9a15c
--- /dev/null
+++ b/TestON/tests/SDNIPfunction/.bash_killcmd
@@ -0,0 +1,8 @@
+killTestONall(){
+    sudo kill -9 `ps -ef | grep "./cli.py" | grep -v grep | awk '{print $2}'`
+    sudo kill -9 `ps -ef | grep "ssh -X" | grep -v grep | awk '{print $2}'`
+    sudo mn -c
+    sudo pkill bgpd
+    sudo pkill zebra
+    sudo kill -9 `ps -ef | grep "bird" | grep -v grep | awk '{print $2}'`
+}
diff --git a/TestON/tests/SDNIPfunction/Dependency/CASE4-ping-as2host.sh b/TestON/tests/SDNIPfunction/Dependency/CASE4-ping-as2host.sh
new file mode 100755
index 0000000..f7fe154
--- /dev/null
+++ b/TestON/tests/SDNIPfunction/Dependency/CASE4-ping-as2host.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+
+#all the address in this for loop should work
+
+# ping test between as2 and as3
+for ((i=0;i<10;i++)); do
+
+        #echo '------from 3.0.0.x to 4.0.1.'$j'------'
+
+	for ((j=0; j<10; ++j )) ; do
+		echo '3.0.'$i'.1 -> 4.0.'$j'.1'
+    		ping -c 1 -w 1 -I 3.0.$i.1 4.0.$j.1 | grep 'from 4.0.'$j'.1'
+
+	done
+
+done
+for ((i=0;i<10;i++)); do
+
+        #echo '------from 3.0.0.x to 5.0.1.'$j'------'
+
+        for ((j=0; j<10; ++j )) ; do
+                echo '3.0.'$i'.1 -> 5.0.'$j'.1'
+                ping -c 1 -w 1 -I 3.0.$i.1 5.0.$j.1 | grep 'from 5.0.'$j'.1'
+
+        done
+
+done
+
+# ping test between as2 and as4
+for ((i=1;i<2;i++)); do
+       for ((prefix=101; prefix<=200; ++prefix)) ; do
+               for ((j=0; j<10; ++j )) ; do
+                       echo '3.0.0.'$i' - > '$prefix'.0.'$j'.1'
+                       ping -c 1 -w 1 -I 3.0.0.$i $prefix.0.$j.1 | grep 'from '$prefix'.0.'$j'.1'
+
+                done
+        done
+
+done
+
diff --git a/TestON/tests/SDNIPfunction/Dependency/SDNIPfuntionMininet.py b/TestON/tests/SDNIPfunction/Dependency/SDNIPfuntionMininet.py
index 5eba83e..a1554b2 100755
--- a/TestON/tests/SDNIPfunction/Dependency/SDNIPfuntionMininet.py
+++ b/TestON/tests/SDNIPfunction/Dependency/SDNIPfuntionMininet.py
@@ -342,7 +342,7 @@
     root1.cmd('ssh -N -o "PasswordAuthentication no" \
     -o "StrictHostKeyChecking no" -L 2605:1.1.1.1:2605 1.1.1.1 &')
     '''
-    time.sleep( 3000000000 )
+    # time.sleep( 3000000000 )
     CLI( net )
 
     # Close the ssh port forwarding
diff --git a/TestON/tests/SDNIPfunction/README.txt b/TestON/tests/SDNIPfunction/README.txt
new file mode 100644
index 0000000..ea89a19
--- /dev/null
+++ b/TestON/tests/SDNIPfunction/README.txt
@@ -0,0 +1,38 @@
+In this test case, we use 2 VMs. One is running Mininet testbed together with
+Quagga, the other one is running ONOS.
+
+Step 1: Install and configure Quagga.
+SDN-IP application uses Quagga as the BGP speaker. You need to install Quagga
+on the mininet VM.
+After installation, check whether the Quagga directory is /usr/lib/quagga,
+otherwise you need to change the directory in SDNIPfuntionMininet.py.
+Then, generate Quagga configuration files.
+$cd ~/OnosSystemTest/TestON/tests/SDNIPfunction/Dependency/as4quaggas/
+$./quagga-config-gen.sh
+
+Step 2: SDN-IP/ONOS configuration.
+Copy the SDN-IP/ONOS file to your ONOS directory and set the cell.
+$cp ~/OnosSystemTest/TestON/tests/SDNIPfunction/network-cfg.json ~/onos/tools/package/config/network-cfg.json
+$cp ~/OnosSystemTest/TestON/tests/SDNIPfunction/sdnip_single_instance ~/onos/tools/test/cells/sdnip_single_instance
+Then enable the cell file:
+$cell sdnip_single_instance
+
+Step 3: copy .bash_killcmd file to ~/.bash_killcmd on Mininet VM.
+Add "source .bash_killcmd " into the ~/.bashrc file, then run:
+$source ~/.baschrc
+
+Note: you only need to do Step 1, 2, and 3 once.
+
+Step 4: each time, before starting the test, run the following command to clean
+the environment.
+$ killTestONall
+
+Step 5: run Mininet testbed to setup the test environment.
+$sudo ~/OnosSystemTest/TestON/tests/SDNIPfunction/Dependency/SDNIPfuntionMininet.py
+
+Step 6: set up tunnel on Mninet VM to ONOS VM.
+$ssh -nNT -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -l sdn -L 1.1.1.2:2000:10.128.4.52:2000 10.128.4.52 &
+
+Step 7: finally you can run testOn script.
+$cd ~/OnosSystemTest/TestON/bin
+$./cli.py run SDNIPfunction
\ No newline at end of file
diff --git a/TestON/tests/SDNIPfunction/SDNIPfunction.py b/TestON/tests/SDNIPfunction/SDNIPfunction.py
index 8c16638..59e193f 100644
--- a/TestON/tests/SDNIPfunction/SDNIPfunction.py
+++ b/TestON/tests/SDNIPfunction/SDNIPfunction.py
@@ -1,13 +1,13 @@
 # Testing the functionality of SDN-IP with single ONOS instance
 class SDNIPfunction:
 
-    def __init__(self):
+    def __init__( self ):
         self.default = ''
         global branchName
 
 
     # This case is to setup ONOS
-    def CASE100(self, main):
+    def CASE100( self, main ):
         """
            CASE100 is to compile ONOS and install it
            Startup sequence:
@@ -19,69 +19,69 @@
            onos-install -f
            onos-wait-for-start
         """
-        main.case("Setting up test environment")
+        main.case( "Setting up test environment" )
 
         cellName = main.params[ 'ENV' ][ 'cellName' ]
         ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
 
-        main.step("Applying cell variable to environment")
-        cellResult = main.ONOSbench.setCell(cellName)
+        main.step( "Applying cell variable to environment" )
+        cellResult = main.ONOSbench.setCell( cellName )
         verifyResult = main.ONOSbench.verifyCell()
 
         branchName = main.ONOSbench.getBranchName()
-        main.log.info("ONOS is on branch: " + branchName)
+        main.log.info( "ONOS is on branch: " + branchName )
 
-        main.log.report("Uninstalling ONOS")
-        main.ONOSbench.onosUninstall(ONOS1Ip)
+        main.log.report( "Uninstalling ONOS" )
+        main.ONOSbench.onosUninstall( ONOS1Ip )
 
         # cleanInstallResult = main.TRUE
         # gitPullResult = main.TRUE
 
-        main.step("Git pull")
+        main.step( "Git pull" )
         gitPullResult = main.ONOSbench.gitPull()
 
-        main.step("Using mvn clean install")
+        main.step( "Using mvn clean install" )
         if gitPullResult == main.TRUE:
-            cleanInstallResult = main.ONOSbench.cleanInstall(mciTimeout=1000)
+            cleanInstallResult = main.ONOSbench.cleanInstall( mciTimeout = 1000 )
         else:
-             main.log.warn("Did not pull new code so skipping mvn " +
-                            "clean install")
+             main.log.warn( "Did not pull new code so skipping mvn " +
+                            "clean install" )
              cleanInstallResult = main.TRUE
 
-        main.ONOSbench.getVersion(report=True)
+        main.ONOSbench.getVersion( report = True )
 
-        main.step("Creating ONOS package")
-        packageResult = main.ONOSbench.onosPackage(opTimeout=500)
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage( opTimeout = 500 )
 
-        main.step("Installing ONOS package")
-        onos1InstallResult = main.ONOSbench.onosInstall(options="-f",
-                                                           node=ONOS1Ip)
+        main.step( "Installing ONOS package" )
+        onos1InstallResult = main.ONOSbench.onosInstall( options = "-f",
+                                                           node = ONOS1Ip )
 
-        main.step("Checking if ONOS is up yet")
-        for i in range(2):
-            onos1Isup = main.ONOSbench.isup(ONOS1Ip, timeout=420)
+        main.step( "Checking if ONOS is up yet" )
+        for i in range( 2 ):
+            onos1Isup = main.ONOSbench.isup( ONOS1Ip, timeout = 420 )
             if onos1Isup:
                 break
         if not onos1Isup:
-            main.log.report("ONOS1 didn't start!")
+            main.log.report( "ONOS1 didn't start!" )
 
-        cliResult = main.ONOScli.startOnosCli(ONOS1Ip,
-                commandlineTimeout=100, onosStartTimeout=600)
+        cliResult = main.ONOScli.startOnosCli( ONOS1Ip,
+                commandlineTimeout = 100, onosStartTimeout = 600 )
 
-        case1Result = (cleanInstallResult and packageResult and
+        case1Result = ( cleanInstallResult and packageResult and
                         cellResult and verifyResult and
                         onos1InstallResult and
-                        onos1Isup and cliResult)
+                        onos1Isup and cliResult )
 
-        utilities.assert_equals(expect=main.TRUE, actual=case1Result,
-                                 onpass="ONOS startup successful",
-                                 onfail="ONOS startup NOT successful")
+        utilities.assert_equals( expect = main.TRUE, actual = case1Result,
+                                 onpass = "ONOS startup successful",
+                                 onfail = "ONOS startup NOT successful" )
 
         if case1Result == main.FALSE:
             main.cleanup()
             main.exit()
 
-    def CASE4(self, main):
+    def CASE4( self, main ):
         """
         Test the SDN-IP functionality
         allRoutesExpected: all expected routes for all BGP peers
@@ -98,217 +98,217 @@
         from operator import eq
         from time import localtime, strftime
 
-        main.case("This case is to testing the functionality of SDN-IP with \
-        single ONOS instance")
+        main.case( "This case is to testing the functionality of SDN-IP with \
+        single ONOS instance" )
         SDNIPJSONFILEPATH = \
             "/home/admin/ONOS/tools/package/config/sdnip.json"
         # all expected routes for all BGP peers
         allRoutesExpected = []
-        main.step("Start to generate routes for all BGP peers")
-        main.log.info("Generate prefixes for host3")
-        prefixesHost3 = main.QuaggaCliHost3.generatePrefixes(3, 10)
-        main.log.info(prefixesHost3)
+        main.step( "Start to generate routes for all BGP peers" )
+        main.log.info( "Generate prefixes for host3" )
+        prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
+        main.log.info( prefixesHost3 )
         # generate route with next hop
         for prefix in prefixesHost3:
-            allRoutesExpected.append(prefix + "/" + "192.168.20.1")
+            allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
         routeIntentsExpectedHost3 = \
-            main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
+            main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents( 
             prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
-            SDNIPJSONFILEPATH)
+            SDNIPJSONFILEPATH )
 
-        main.log.info("Generate prefixes for host4")
-        prefixesHost4 = main.QuaggaCliHost4.generatePrefixes(4, 10)
-        main.log.info(prefixesHost4)
+        main.log.info( "Generate prefixes for host4" )
+        prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
+        main.log.info( prefixesHost4 )
         # generate route with next hop
         for prefix in prefixesHost4:
-            allRoutesExpected.append(prefix + "/" + "192.168.30.1")
+            allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
         routeIntentsExpectedHost4 = \
-            main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
+            main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents( 
             prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
-            SDNIPJSONFILEPATH)
+            SDNIPJSONFILEPATH )
 
-        main.log.info("Generate prefixes for host5")
-        prefixesHost5 = main.QuaggaCliHost5.generatePrefixes(5, 10)
-        main.log.info(prefixesHost5)
+        main.log.info( "Generate prefixes for host5" )
+        prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
+        main.log.info( prefixesHost5 )
         for prefix in prefixesHost5:
-            allRoutesExpected.append(prefix + "/" + "192.168.60.2")
+            allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
         routeIntentsExpectedHost5 = \
-            main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
+            main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents( 
             prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
-            SDNIPJSONFILEPATH)
+            SDNIPJSONFILEPATH )
 
         routeIntentsExpected = routeIntentsExpectedHost3 + \
             routeIntentsExpectedHost4 + routeIntentsExpectedHost5
 
-        main.step("Get links in the network")
-        listResult = main.ONOScli.links(jsonFormat=False)
-        main.log.info(listResult)
-        main.log.info("Activate sdn-ip application")
-        main.ONOScli.activateApp("org.onosproject.sdnip")
+        main.step( "Get links in the network" )
+        listResult = main.ONOScli.links( jsonFormat = False )
+        main.log.info( listResult )
+        main.log.info( "Activate sdn-ip application" )
+        main.ONOScli.activateApp( "org.onosproject.sdnip" )
         # wait sdn-ip to finish installing connectivity intents, and the BGP
         # paths in data plane are ready.
-        time.sleep(int(main.params[ 'timers' ][ 'SdnIpSetup' ]))
+        time.sleep( int( main.params[ 'timers' ][ 'SdnIpSetup' ] ) )
 
-        main.step("Login all BGP peers and add routes into peers")
+        main.step( "Login all BGP peers and add routes into peers" )
 
-        main.log.info("Login Quagga CLI on host3")
-        main.QuaggaCliHost3.loginQuagga("1.168.30.2")
-        main.log.info("Enter configuration model of Quagga CLI on host3")
-        main.QuaggaCliHost3.enterConfig(64514)
-        main.log.info("Add routes to Quagga on host3")
-        main.QuaggaCliHost3.addRoutes(prefixesHost3, 1)
+        main.log.info( "Login Quagga CLI on host3" )
+        main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
+        main.log.info( "Enter configuration model of Quagga CLI on host3" )
+        main.QuaggaCliHost3.enterConfig( 64514 )
+        main.log.info( "Add routes to Quagga on host3" )
+        main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
 
-        main.log.info("Login Quagga CLI on host4")
-        main.QuaggaCliHost4.loginQuagga("1.168.30.3")
-        main.log.info("Enter configuration model of Quagga CLI on host4")
-        main.QuaggaCliHost4.enterConfig(64516)
-        main.log.info("Add routes to Quagga on host4")
-        main.QuaggaCliHost4.addRoutes(prefixesHost4, 1)
+        main.log.info( "Login Quagga CLI on host4" )
+        main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
+        main.log.info( "Enter configuration model of Quagga CLI on host4" )
+        main.QuaggaCliHost4.enterConfig( 64516 )
+        main.log.info( "Add routes to Quagga on host4" )
+        main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
 
-        main.log.info("Login Quagga CLI on host5")
-        main.QuaggaCliHost5.loginQuagga("1.168.30.5")
-        main.log.info("Enter configuration model of Quagga CLI on host5")
-        main.QuaggaCliHost5.enterConfig(64521)
-        main.log.info("Add routes to Quagga on host5")
-        main.QuaggaCliHost5.addRoutes(prefixesHost5, 1)
+        main.log.info( "Login Quagga CLI on host5" )
+        main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
+        main.log.info( "Enter configuration model of Quagga CLI on host5" )
+        main.QuaggaCliHost5.enterConfig( 64521 )
+        main.log.info( "Add routes to Quagga on host5" )
+        main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
 
-        for i in range(101, 201):
-            prefixesHostX = main.QuaggaCliHost.generatePrefixes(str(i), 10)
-            main.log.info(prefixesHostX)
+        for i in range( 101, 201 ):
+            prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
+            main.log.info( prefixesHostX )
             for prefix in prefixesHostX:
-                allRoutesExpected.append(prefix + "/" + "192.168.40."
-                                           + str(i - 100))
+                allRoutesExpected.append( prefix + "/" + "192.168.40."
+                                           + str( i - 100 ) )
 
             routeIntentsExpectedHostX = \
-            main.QuaggaCliHost.generateExpectedOnePeerRouteIntents(
-                prefixesHostX, "192.168.40." + str(i - 100),
-                "00:00:%02d:00:00:90" % (i - 101), SDNIPJSONFILEPATH)
+            main.QuaggaCliHost.generateExpectedOnePeerRouteIntents( 
+                prefixesHostX, "192.168.40." + str( i - 100 ),
+                "00:00:%02d:00:00:90" % ( i - 101 ), SDNIPJSONFILEPATH )
             routeIntentsExpected = routeIntentsExpected + \
                 routeIntentsExpectedHostX
 
-            main.log.info("Login Quagga CLI on host" + str(i))
-            QuaggaCliHostX = getattr(main, ('QuaggaCliHost' + str(i)))
-            QuaggaCliHostX.loginQuagga("1.168.30." + str(i))
-            main.log.info(
-                "Enter configuration model of Quagga CLI on host" + str(i))
-            QuaggaCliHostX.enterConfig(65000 + i - 100)
-            main.log.info("Add routes to Quagga on host" + str(i))
-            QuaggaCliHostX.addRoutes(prefixesHostX, 1)
+            main.log.info( "Login Quagga CLI on host" + str( i ) )
+            QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
+            QuaggaCliHostX.loginQuagga( "1.168.30." + str( i ) )
+            main.log.info( \
+                "Enter configuration model of Quagga CLI on host" + str( i ) )
+            QuaggaCliHostX.enterConfig( 65000 + i - 100 )
+            main.log.info( "Add routes to Quagga on host" + str( i ) )
+            QuaggaCliHostX.addRoutes( prefixesHostX, 1 )
         # 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' ]))
-        time.sleep(int(main.params[ 'timers' ][ 'PathAvailable' ]))
+        time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
+        time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
         # get routes inside SDN-IP
-        getRoutesResult = main.ONOScli.routes(jsonFormat=True)
+        getRoutesResult = main.ONOScli.routes( jsonFormat = True )
 
         allRoutesActual = \
-            main.QuaggaCliHost3.extractActualRoutesMaster(getRoutesResult)
+            main.QuaggaCliHost3.extractActualRoutesMaster( getRoutesResult )
 
-        allRoutesStrExpected = str(sorted(allRoutesExpected))
-        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 in SDN-IP are correct!***",
-            onfail="***Routes in SDN-IP are wrong!***")
+        allRoutesStrExpected = str( sorted( allRoutesExpected ) )
+        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 in SDN-IP are correct!***",
+            onfail = "***Routes in SDN-IP are wrong!***" )
 
-        getIntentsResult = main.ONOScli.intents(jsonFormat=True)
+        getIntentsResult = main.ONOScli.intents( jsonFormat = True )
 
-        main.step("Check MultiPointToSinglePointIntent intents installed")
+        main.step( "Check MultiPointToSinglePointIntent intents installed" )
         # routeIntentsExpected are generated when generating routes
         # get route intents from ONOS CLI
         routeIntentsActualNum = \
-            main.QuaggaCliHost3.extractActualRouteIntentNum(getIntentsResult)
+            main.QuaggaCliHost3.extractActualRouteIntentNum( getIntentsResult )
         routeIntentsExpectedNum = 1030
-        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 in SDN-IP is \
+        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 in SDN-IP is \
             correct!***",
-            onfail="***MultiPointToSinglePoint Intent Num in SDN-IP is \
-            wrong!***")
+            onfail = "***MultiPointToSinglePoint Intent Num in SDN-IP is \
+            wrong!***" )
 
-        main.step("Check BGP PointToPointIntent intents installed")
+        main.step( "Check BGP PointToPointIntent intents installed" )
 
         bgpIntentsActualNum = \
-            main.QuaggaCliHost3.extractActualBgpIntentNum(getIntentsResult)
+            main.QuaggaCliHost3.extractActualBgpIntentNum( getIntentsResult )
         bgpIntentsExpectedNum = 624
-        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 in SDN-IP are correct!***",
-            onfail="***PointToPointIntent Intent Num in SDN-IP are wrong!***")
+        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 in SDN-IP are correct!***",
+            onfail = "***PointToPointIntent Intent Num in SDN-IP are wrong!***" )
 
         #============================= Ping Test ========================
-        pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
+        pingTestScript = "~/OnosSystemTest/TestON/tests/SDNIPfunction/Dependency/CASE4-ping-as2host.sh"
         pingTestResultsFile = \
-        "~/SDNIP/TestOnEnv/log/CASE4-ping-results-before-delete-routes-"\
-            + strftime("%Y-%m-%d_%H:%M:%S", localtime()) + ".txt"
-        pingTestResults = main.QuaggaCliHost.pingTest(
-            "1.168.30.100", pingTestScript, pingTestResultsFile)
-        main.log.info(pingTestResults)
+        "~/OnosSystemTest/TestON/tests/SDNIPfunction/Dependency/log/CASE4-ping-results-before-delete-routes-"\
+            + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
+        pingTestResults = main.QuaggaCliHost.pingTest( \
+            "1.168.30.100", pingTestScript, pingTestResultsFile )
+        main.log.info( pingTestResults )
         # wait to finish the ping test
-        time.sleep(int(main.params[ 'timers' ][ 'PingTestWithRoutes' ]))
+        time.sleep( int( main.params[ 'timers' ][ 'PingTestWithRoutes' ] ) )
 
         #============================= Deleting Routes ==================
-        main.step("Check deleting routes installed")
-        main.QuaggaCliHost3.deleteRoutes(prefixesHost3, 1)
-        main.QuaggaCliHost4.deleteRoutes(prefixesHost4, 1)
-        main.QuaggaCliHost5.deleteRoutes(prefixesHost5, 1)
+        main.step( "Check deleting routes installed" )
+        main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
+        main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
+        main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
 
-        for i in range(101, 201):
-            prefixesHostX = main.QuaggaCliHost.generatePrefixes(str(i), 10)
-            main.log.info(prefixesHostX)
-            QuaggaCliHostX = getattr(main, ('QuaggaCliHost' + str(i)))
-            QuaggaCliHostX.deleteRoutes(prefixesHostX, 1)
+        for i in range( 101, 201 ):
+            prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
+            main.log.info( prefixesHostX )
+            QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
+            QuaggaCliHostX.deleteRoutes( prefixesHostX, 1 )
         # wait Quagga to finish delivery all routes to each other and to sdn-ip,
         # plus finish un-installing all intents.
-        time.sleep(int(main.params[ 'timers' ][ 'RouteDelivery' ]))
-        time.sleep(int(main.params[ 'timers' ][ 'PathAvailable' ]))
+        time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
+        time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
 
-        getRoutesResult = main.ONOScli.routes(jsonFormat=True)
+        getRoutesResult = main.ONOScli.routes( jsonFormat = True )
         allRoutesActual = \
-            main.QuaggaCliHost3.extractActualRoutesMaster(getRoutesResult)
-        main.log.info("allRoutes_actual = ")
-        main.log.info(allRoutesActual)
+            main.QuaggaCliHost3.extractActualRoutesMaster( getRoutesResult )
+        main.log.info( "allRoutes_actual = " )
+        main.log.info( allRoutesActual )
 
-        utilities.assertEquals(
-            expect="[]", actual=str(allRoutesActual),
-            onpass="***Route number in SDN-IP is 0, correct!***",
-            onfail="***Routes number in SDN-IP is not 0, wrong!***")
+        utilities.assertEquals( \
+            expect = "[]", actual = str( allRoutesActual ),
+            onpass = "***Route number in SDN-IP is 0, correct!***",
+            onfail = "***Routes number in SDN-IP is not 0, wrong!***" )
 
-        main.step("Check intents after deleting routes")
-        getIntentsResult = main.ONOScli.intents(jsonFormat=True)
+        main.step( "Check intents after deleting routes" )
+        getIntentsResult = main.ONOScli.intents( jsonFormat = True )
         routeIntentsActualNum = \
-            main.QuaggaCliHost3.extractActualRouteIntentNum(
-                getIntentsResult)
-        main.log.info("route Intents Actual Num is: ")
-        main.log.info(routeIntentsActualNum)
-        utilities.assertEquals(
-            expect=0, actual=routeIntentsActualNum,
-            onpass="***MultiPointToSinglePoint Intent Num in SDN-IP is 0, \
+            main.QuaggaCliHost3.extractActualRouteIntentNum( 
+                getIntentsResult )
+        main.log.info( "route Intents Actual Num is: " )
+        main.log.info( routeIntentsActualNum )
+        utilities.assertEquals( \
+            expect = 0, actual = routeIntentsActualNum,
+            onpass = "***MultiPointToSinglePoint Intent Num in SDN-IP is 0, \
             correct!***",
-            onfail="***MultiPointToSinglePoint Intent Num in SDN-IP is not 0, \
-            wrong!***")
+            onfail = "***MultiPointToSinglePoint Intent Num in SDN-IP is not 0, \
+            wrong!***" )
 
-        pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
+        pingTestScript = "~/OnosSystemTest/TestON/tests/SDNIPfunction/Dependency/CASE4-ping-as2host.sh"
         pingTestResultsFile = \
-        "~/SDNIP/TestOnEnv/log/CASE4-ping-results-after-delete-routes-"\
-            + strftime("%Y-%m-%d_%H:%M:%S", localtime()) + ".txt"
-        pingTestResults = main.QuaggaCliHost.pingTest(
-            "1.168.30.100", pingTestScript, pingTestResultsFile)
-        main.log.info(pingTestResults)
+        "~/OnosSystemTest/TestON/tests/SDNIPfunction/Dependency/log/CASE4-ping-results-after-delete-routes-"\
+            + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
+        pingTestResults = main.QuaggaCliHost.pingTest( \
+            "1.168.30.100", pingTestScript, pingTestResultsFile )
+        main.log.info( pingTestResults )
         # wait to finish the ping test
-        time.sleep(int(main.params[ 'timers' ][ 'PingTestWithoutRoutes' ]))
+        time.sleep( int( main.params[ 'timers' ][ 'PingTestWithoutRoutes' ] ) )
diff --git a/TestON/tests/SDNIPfunction/addresses.json b/TestON/tests/SDNIPfunction/addresses.json
index a32eb85..71dd77a 100644
--- a/TestON/tests/SDNIPfunction/addresses.json
+++ b/TestON/tests/SDNIPfunction/addresses.json
@@ -3,32 +3,33 @@
         {
             "dpid" : "00:00:00:00:00:00:00:a3",
             "port" : "1",
-            "ips" : ["192.168.10.0/24"],
+            "ips" : ["192.168.10.101/24"],
             "mac" : "00:00:00:00:00:01"
         },
         {
             "dpid" : "00:00:00:00:00:00:00:a5",
             "port" : "1",
-            "ips" : ["192.168.20.0/24"],
+            "ips" : ["192.168.20.101/24"],
             "mac" : "00:00:00:00:00:01"
         },
         {
             "dpid" : "00:00:00:00:00:00:00:a2",
             "port" : "1",
-            "ips" : ["192.168.30.0/24"],
+            "ips" : ["192.168.30.101/24"],
             "mac" : "00:00:00:00:00:01"
         },
         {
             "dpid" : "00:00:00:00:00:00:00:a6",
             "port" : "1",
-            "ips" : ["192.168.40.0/24"],
+            "ips" : ["192.168.40.101/24"],
             "mac" : "00:00:00:00:00:01"
         },
         {
             "dpid" : "00:00:00:00:00:00:00:a4",
             "port" : "4",
-            "ips" : ["192.168.60.0/24"],
+            "ips" : ["192.168.60.101/24"],
             "mac" : "00:00:00:00:00:01"
         }
+
     ]
-}
\ No newline at end of file
+}
diff --git a/TestON/tests/SDNIPfunction/network-cfg.json b/TestON/tests/SDNIPfunction/network-cfg.json
new file mode 100644
index 0000000..3452826
--- /dev/null
+++ b/TestON/tests/SDNIPfunction/network-cfg.json
@@ -0,0 +1,171 @@
+{
+    "ports" : {
+        "of:00000000000000a3/1" : {
+            "interfaces" : {
+                "interfaces" : [
+                    {
+                        "ips"  : [ "192.168.10.101/24" ],
+                        "mac"  : "00:00:00:00:00:01"
+                    }
+                ]
+            }
+        },
+        "of:00000000000000a5/1" : {
+            "interfaces" : {
+                "interfaces" : [
+                    {
+                        "ips"  : [ "192.168.20.101/24" ],
+                        "mac"  : "00:00:00:00:00:01"
+                    }
+                ]
+            }
+        },
+        "of:00000000000000a2/1" : {
+            "interfaces" : {
+                "interfaces" : [
+                    {
+                        "ips"  : [ "192.168.30.101/24" ],
+                        "mac"  : "00:00:00:00:00:01"
+                    }
+                ]
+            }
+        },
+        "of:00000000000000a6/1" : {
+            "interfaces" : {
+                "interfaces" : [
+                    {
+                        "ips"  : [ "192.168.40.101/24" ],
+                        "mac"  : "00:00:00:00:00:01"
+                    }
+                ]
+            }
+        },
+        "of:00000000000000a4/4" : {
+            "interfaces" : {
+                "interfaces" : [
+                    {
+                        "ips"  : [ "192.168.60.101/24" ],
+                        "mac"  : "00:00:00:00:00:01"
+                    }
+                ]
+            }
+        }
+    },
+    "apps" : {
+        "org.onosproject.router" : {
+            "bgp" : {
+                "bgpSpeakers" : [
+                    {
+                        "connectPoint" : "of:00000000000000a1/1",
+                        "peers" : [
+                            "192.168.10.1",
+                            "192.168.20.1",
+                            "192.168.30.1",
+                            "192.168.60.1",
+                            "192.168.40.1",
+                            "192.168.40.2",
+                            "192.168.40.3",
+                            "192.168.40.4",
+                            "192.168.40.5",
+                            "192.168.40.6",
+                            "192.168.40.7",
+                            "192.168.40.8",
+                            "192.168.40.9",
+                            "192.168.40.10",
+                            "192.168.40.11",
+                            "192.168.40.12",
+                            "192.168.40.13",
+                            "192.168.40.14",
+                            "192.168.40.15",
+                            "192.168.40.16",
+                            "192.168.40.17",
+                            "192.168.40.18",
+                            "192.168.40.19",
+                            "192.168.40.20",
+                            "192.168.40.21",
+                            "192.168.40.22",
+                            "192.168.40.23",
+                            "192.168.40.24",
+                            "192.168.40.25",
+                            "192.168.40.26",
+                            "192.168.40.27",
+                            "192.168.40.28",
+                            "192.168.40.29",
+                            "192.168.40.30",
+                            "192.168.40.31",
+                            "192.168.40.32",
+                            "192.168.40.33",
+                            "192.168.40.34",
+                            "192.168.40.35",
+                            "192.168.40.36",
+                            "192.168.40.37",
+                            "192.168.40.38",
+                            "192.168.40.39",
+                            "192.168.40.40",
+                            "192.168.40.41",
+                            "192.168.40.42",
+                            "192.168.40.43",
+                            "192.168.40.44",
+                            "192.168.40.45",
+                            "192.168.40.46",
+                            "192.168.40.47",
+                            "192.168.40.48",
+                            "192.168.40.49",
+                            "192.168.40.50",
+                            "192.168.40.51",
+                            "192.168.40.52",
+                            "192.168.40.53",
+                            "192.168.40.54",
+                            "192.168.40.55",
+                            "192.168.40.56",
+                            "192.168.40.57",
+                            "192.168.40.58",
+                            "192.168.40.59",
+                            "192.168.40.60",
+                            "192.168.40.61",
+                            "192.168.40.62",
+                            "192.168.40.63",
+                            "192.168.40.64",
+                            "192.168.40.65",
+                            "192.168.40.66",
+                            "192.168.40.67",
+                            "192.168.40.68",
+                            "192.168.40.69",
+                            "192.168.40.70",
+                            "192.168.40.71",
+                            "192.168.40.72",
+                            "192.168.40.73",
+                            "192.168.40.74",
+                            "192.168.40.75",
+                            "192.168.40.76",
+                            "192.168.40.77",
+                            "192.168.40.78",
+                            "192.168.40.79",
+                            "192.168.40.80",
+                            "192.168.40.81",
+                            "192.168.40.82",
+                            "192.168.40.83",
+                            "192.168.40.84",
+                            "192.168.40.85",
+                            "192.168.40.86",
+                            "192.168.40.87",
+                            "192.168.40.88",
+                            "192.168.40.89",
+                            "192.168.40.90",
+                            "192.168.40.91",
+                            "192.168.40.92",
+                            "192.168.40.93",
+                            "192.168.40.94",
+                            "192.168.40.95",
+                            "192.168.40.96",
+                            "192.168.40.97",
+                            "192.168.40.98",
+                            "192.168.40.99",
+                            "192.168.40.100"
+                        ]
+                    }
+                ]
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/TestON/tests/SDNIPfunction/sdnip.json b/TestON/tests/SDNIPfunction/sdnip.json
index ea7682d..646d999 100644
--- a/TestON/tests/SDNIPfunction/sdnip.json
+++ b/TestON/tests/SDNIPfunction/sdnip.json
@@ -1,31 +1,529 @@
 {
-
+   
     "bgpPeers" : [
-        {
-            "attachmentDpid" : "00:00:00:00:00:00:00:a3",
-            "attachmentPort" : "1",
-            "ipAddress" : "192.168.10.1"
-        },
-        {
-            "attachmentDpid" : "00:00:00:00:00:00:00:a5",
-            "attachmentPort" : "1",
-            "ipAddress" : "192.168.20.1"
-        },
-        {
-            "attachmentDpid" : "00:00:00:00:00:00:00:a2",
-            "attachmentPort" : "1",
-            "ipAddress" : "192.168.30.1"
-        },
-        {
-            "attachmentDpid" : "00:00:00:00:00:00:00:a6",
-            "attachmentPort" : "1",
-            "ipAddress" : "192.168.40.1"
-        },
-        {
-            "attachmentDpid" : "00:00:00:00:00:00:00:a4",
-            "attachmentPort" : "4",
-            "ipAddress" : "192.168.60.1"
-        }
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a3",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.10.1"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a5",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.20.1"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a2",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.30.1"
+                },
+
+
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.1"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.2"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.3"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.4"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.5"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.6"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.7"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.8"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.9"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.10"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.11"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.12"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.13"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.14"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.15"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.16"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.17"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.18"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.19"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.20"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.21"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.22"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.23"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.24"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.25"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.26"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.27"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.28"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.29"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.30"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.31"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.32"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.33"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.34"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.35"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.36"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.37"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.38"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.39"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.40"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.41"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.42"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.43"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.44"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.45"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.46"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.47"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.48"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.49"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.50"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.51"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.52"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.53"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.54"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.55"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.56"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.57"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.58"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.59"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.60"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.61"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.62"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.63"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.64"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.65"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.66"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.67"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.68"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.69"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.70"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.71"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.72"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.73"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.74"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.75"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.76"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.77"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.78"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.79"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.80"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.81"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.82"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.83"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.84"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.85"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.86"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.87"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.88"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.89"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.90"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.91"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.92"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.93"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.94"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.95"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.96"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.97"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.98"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.99"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a6",
+                    "attachmentPort" : "1",
+                    "ipAddress" : "192.168.40.100"
+                },
+                {
+                    "attachmentDpid" : "00:00:00:00:00:00:00:a4",
+                    "attachmentPort" : "4",
+                    "ipAddress" : "192.168.60.1"
+                }
+
     ],
     "bgpSpeakers" : [
         {
@@ -62,4 +560,4 @@
             ]
         }
     ]
-}
\ No newline at end of file
+}
diff --git a/TestON/tests/SDNIPfunction/sdnip_single_instance b/TestON/tests/SDNIPfunction/sdnip_single_instance
new file mode 100644
index 0000000..9e5de49
--- /dev/null
+++ b/TestON/tests/SDNIPfunction/sdnip_single_instance
@@ -0,0 +1,13 @@
+export ONOS_CELL="sdnip_single_instance"
+
+export ONOS_INSTALL_DIR="/opt/onos"
+export ONOS_NIC=10.128.4.*
+export OC1="10.128.4.52"
+export OCN="127.0.0.1"
+export OCI="${OC1}"
+export ONOS_USER="sdn"                  # ONOS user on remote system
+export ONOS_PWD="rocks"
+
+#export ONOS_APPS="drivers,openflow,config,proxyarp"
+export ONOS_APPS="drivers,openflow,proxyarp"
+