Merge "Added try catches in dependency functions"
diff --git a/TestON/bin/cli.py b/TestON/bin/cli.py
index ffe9d67..54d9781 100755
--- a/TestON/bin/cli.py
+++ b/TestON/bin/cli.py
@@ -93,15 +93,23 @@
         mail <mail-id or list of mail-ids seperated by comma>
         example 1, to execute the examples specified in the ~/examples diretory.
         '''
-        args = args.split()
-        options = {}
-        options = self.parseArgs(args,options)
-        options = dictToObj(options)
-        if not testthread:
-            test = TestThread(options)
-            test.start()
-        else :
-            print main.TEST+ " test execution paused, please resume that before executing to another test"
+        try:
+            args = args.split()
+            options = {}
+            options = self.parseArgs(args,options)
+            options = dictToObj(options)
+            if not testthread:
+                test = TestThread(options)
+                test.start()
+                while test.isAlive:
+                    test.join(1)
+            else :
+                print main.TEST+ " test execution paused, please resume that before executing to another test"
+        except KeyboardInterrupt, SystemExit:
+            print "Interrupt called, Exiting."
+            test._Thread__stop()
+            main.cleanup()
+            main.exit()
 
     def do_resume(self, line):
         '''
@@ -157,7 +165,7 @@
             else :
                 try :
                     dump.pprint(vars(main)[line])
-                except KeyError,e:
+                except KeyError as e:
                     print e
         else :
             print "There is no paused test "
@@ -261,7 +269,7 @@
                         options = self.testcasesInRange(index,option,args,options)
                 else :
                     options['testname'] = option
-        except IndexError,e:
+        except IndexError as e:
             print e
 
         return options
@@ -310,7 +318,11 @@
                 super(CLI, self).cmdloop(intro="")
                 self.postloop()
             except KeyboardInterrupt:
-                testthread.pause()
+                if testthread:
+                    testthread.pause()
+                else:
+                    print "KeyboardInterrupt, Exiting."
+                    sys.exit()
 
     def do_echo( self, line ):
         '''
@@ -337,7 +349,7 @@
         '''
         try:
             exec( line )
-        except Exception, e:
+        except Exception as e:
             output( str( e ) + '\n' )
 
     def do_interpret(self,line):
@@ -353,7 +365,7 @@
         try :
             translated_code = ospk.interpret(text=line)
             print translated_code
-        except AttributeError, e:
+        except AttributeError as e:
             print 'Dynamic params are not allowed in single statement translations'
 
     def do_do (self,line):
@@ -367,8 +379,9 @@
             try :
                 translated_code = ospk.interpret(text=line)
                 eval(translated_code)
-            except (AttributeError,SyntaxError), e:
-                print 'Dynamic params are not allowed in single statement translations'
+            except ( AttributeError, SyntaxError ) as e:
+                print 'Dynamic params are not allowed in single statement translations:'
+                print e
         else :
             print "Do will translate and execute the openspeak statement for the paused test.\nPlease use interpret to translate the OpenSpeak statement."
 
@@ -531,8 +544,8 @@
                         if not self.is_stop :
                             result = self.test_on.cleanup()
                         self.is_stop = True
-                except(KeyboardInterrupt):
-                    print "Recevied Interrupt,cleaning-up the logs and drivers before exiting"
+                except KeyboardInterrupt:
+                    print "Recevied Interrupt, cleaning-up the logs and drivers before exiting"
                     result = self.test_on.cleanup()
                     self.is_stop = True
 
@@ -542,9 +555,17 @@
         '''
         Will pause the test.
         '''
-        print "Will pause the test's execution, after completion of this step.....\n\n\n\n"
-        cli.pause = True
-        self._stopevent.set()
+        if not cli.pause:
+            print "Will pause the test's execution, after completion of this step.....\n\n\n\n"
+            cli.pause = True
+            self._stopevent.set()
+        elif cli.pause and self.is_stop:
+            print "KeyboardInterrupt, Exiting."
+            self.test_on.exit()
+        else:
+            print "Recevied Interrupt, cleaning-up the logs and drivers before exiting"
+            result = self.test_on.cleanup()
+            self.is_stop = True
 
     def play(self):
         '''
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 4e53ee2..17893a1 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -146,8 +146,10 @@
             try :
                 self.configDict = xmldict.xml_to_dict(xml)
                 return self.configDict
-            except Exception:
+            except IOError:
                 print "There is no such file to parse " + self.configFile
+        else:
+            print "There is no such file to parse " + self.configFile
 
     def componentInit(self,component):
         '''
@@ -400,7 +402,13 @@
                             print "Disconnecting from " + str(tempObject.name) + ": " + \
                                   str(tempObject)
                             tempObject.disconnect()
-                        except Exception:
+                        except KeyboardInterrupt:
+                            pass
+                        except KeyError:
+                            # Component not created yet
+                            self.log.warn( "Could not find the component " +
+                                           str( component ) )
+                        except StandardError:
                             self.log.exception( "Exception while disconnecting from " +
                                                  str( component ) )
                             result = self.FALSE
@@ -408,7 +416,14 @@
                     for driver in self.componentDictionary.keys():
                         try:
                             vars(self)[driver].close_log_handles()
-                        except Exception:
+                        except KeyboardInterrupt:
+                            pass
+                        except KeyError:
+                            # Component not created yet
+                            self.log.warn( "Could not find the component " +
+                                           str( driver ) + " while trying to" +
+                                           " close log file" )
+                        except StandardError:
                             self.log.exception( "Exception while closing log files for " +
                                                  str( driver ) )
                             result = self.FALSE
@@ -440,7 +455,7 @@
                 for component in self.componentDictionary.keys():
                     tempObject  = vars(self)[component]
                     result = tempObject.onfail()
-            except(Exception),e:
+            except StandardError as e:
                 print str(e)
                 result = self.FALSE
         else:
@@ -448,7 +463,7 @@
                 for component in components:
                     tempObject  = vars(self)[component]
                     result = tempObject.onfail()
-            except(Exception),e:
+            except StandardError as e:
                 print str(e)
                 result = self.FALSE
 
@@ -558,7 +573,7 @@
             try :
                 import json
                 response_dict = json.loads(response)
-            except Exception:
+            except StandardError:
                 self.log.exception( "Json Parser is unable to parse the string" )
             return response_dict
         elif ini_match :
@@ -573,8 +588,8 @@
             self.log.info(" Response is in 'XML' format and Converting to '"+return_format+"' format")
             try :
                 response_dict = xmldict.xml_to_dict("<response> "+str(response)+" </response>")
-            except Exception, e:
-                self.log.exception( e )
+            except StandardError:
+                self.log.exception()
             return response_dict
 
     def dict_to_return_format(self,response,return_format,response_dict):
@@ -635,7 +650,10 @@
                 try:
                     thread._Thread__stop()
                 except:
-                    print(str(thread.getName()) + ' could not be terminated' )
+                    # NOTE: We should catch any exceptions while trying to
+                    # close the thread so that we can try to close the other
+                    # threads as well
+                    print( str( thread.getName() ) + ' could not be terminated' )
         sys.exit()
 
 def verifyOptions(options):
@@ -760,7 +778,7 @@
         main.exit()
     try :
         testModule = __import__(main.classPath, globals(), locals(), [main.TEST], -1)
-    except(ImportError):
+    except ImportError:
         print "There was an import error, it might mean that there is no test named "+main.TEST
         main.exit()
 
@@ -773,12 +791,12 @@
 def verifyParams():
     try :
         main.params = main.params['PARAMS']
-    except(KeyError):
+    except KeyError:
         print "Error with the params file: Either the file not specified or the format is not correct"
         main.exit()
     try :
         main.topology = main.topology['TOPOLOGY']
-    except(KeyError):
+    except KeyError:
         print "Error with the Topology file: Either the file not specified or the format is not correct"
         main.exit()
 
diff --git a/TestON/core/testparser.py b/TestON/core/testparser.py
index 24b1ca2..aab4388 100644
--- a/TestON/core/testparser.py
+++ b/TestON/core/testparser.py
@@ -46,7 +46,7 @@
                 try :
                     while not re.match('^\s*(\'\'\')|^\s*(\"\"\")',testFileList[index],0) :
                         index = index + 1
-                except IndexError,e:
+                except IndexError:
                     print ''
 
             # skip empty lines and single line comments
@@ -58,11 +58,9 @@
         index = 0
         statementsList = self.statementsList
         while index < len(statementsList):
-            #print statementsList[index]
             m= re.match('def\s+CASE(\d+)',statementsList[index],0)
             self.caseBlock = []
             if m:
-                #print m.group(1)
                 index = index + 1
                 try :
                     while not re.match('\s*def\s+CASE(\d+)',statementsList[index],0) :
@@ -72,11 +70,9 @@
                         else :
                             break
                     index = index - 1
-                except IndexError,e:
-                    #print 'IndexError'
+                except IndexError:
                     print ''
                 self.caseCode [str(m.group(1))] = self.caseBlock
-                #print "Case CODE "+self.caseCode [str(m.group(1))]
             index = index + 1
         return self.caseCode
 
@@ -108,8 +104,7 @@
                         else :
                             break
                     index = index - 1
-                except IndexError,e:
-                    #print 'IndexError'
+                except IndexError:
                     print ''
                 stepCode[step] = stepBlock
                 step = step + 1
diff --git a/TestON/core/utilities.py b/TestON/core/utilities.py
index 02ade72..8cd81e5 100644
--- a/TestON/core/utilities.py
+++ b/TestON/core/utilities.py
@@ -121,8 +121,9 @@
         try :
             opcode = operators[str(arguments["OPERATOR"])][valuetype] if arguments["OPERATOR"] == 'equals' else operators[str(arguments["OPERATOR"])]
 
-        except KeyError:
+        except KeyError as e:
             print "Key Error in assertion"
+            print e
             return main.FALSE
 
         if opcode == '=~':
@@ -179,8 +180,9 @@
         if not isinstance(msg,str):
             try:
                 eval(str(msg))
-            except SyntaxError:
-                print "functin definition is not write"
+            except SyntaxError as e:
+                print "function definition is not right"
+                print e
 
         main.last_result = result
         return result
@@ -191,7 +193,6 @@
         '''
         newArgs = {}
         for key,value in kwargs.iteritems():
-            #currentKey =  str.upper(key)
             if isinstance(args,list) and str.upper(key) in args:
                 for each in args:
                     if each==str.upper(key):
@@ -199,8 +200,6 @@
                     elif each != str.upper(key) and (newArgs.has_key(str(each)) == False ):
                         newArgs[str(each)] = None
 
-
-
         return newArgs
 
     def send_mail(self):
@@ -211,7 +210,7 @@
                 sub = "Result summary of \""+main.TEST+"\" run on component \""+main.test_target+"\" Version \""+vars(main)[main.test_target].get_version()+"\": "+str(main.TOTAL_TC_SUCCESS)+"% Passed"
             else :
                 sub = "Result summary of \""+main.TEST+"\": "+str(main.TOTAL_TC_SUCCESS)+"% Passed"
-        except KeyError,AttributeError:
+        except ( KeyError, AttributeError ):
             sub = "Result summary of \""+main.TEST+"\": "+str(main.TOTAL_TC_SUCCESS)+"% Passed"
 
         msg['Subject'] = sub
@@ -250,7 +249,7 @@
             try :
                 parsedInfo = ConfigObj(self.fileName)
                 return parsedInfo
-            except Exception:
+            except StandardError:
                 print "There is no such file to parse "+fileName
         else:
             return 0
diff --git a/TestON/core/xmldict.py b/TestON/core/xmldict.py
index 2cc47da..8d1dcf4 100644
--- a/TestON/core/xmldict.py
+++ b/TestON/core/xmldict.py
@@ -37,7 +37,7 @@
         root = ElementTree.XML(root_or_str)
     try :
         return {root.tag: _from_xml(root, strict)}
-    except Exception:
+    except StandardError:
         return None
 
 def dict_to_xml(dict_xml):
diff --git a/TestON/core/xmlparser.py b/TestON/core/xmlparser.py
index e2cfb1d..f12f69c 100644
--- a/TestON/core/xmlparser.py
+++ b/TestON/core/xmlparser.py
@@ -39,7 +39,7 @@
             try :
                 parsedInfo = xmldict.xml_to_dict(xml)
                 return parsedInfo
-            except Exception as e:
+            except StandardError as e:
                 print "Error parsing file " + fileName + ": " + e.message
         else :
             print "File name is not correct"
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 7ff0cd1..a361aca 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -4010,3 +4010,27 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanup()
             main.exit()
+    def maps( self, jsonFormat=True ):
+        """
+        Description: Returns result of onos:maps
+        Optional:
+            * jsonFormat: enable json formatting of output
+        """
+        try:
+            cmdStr = "maps"
+            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()
diff --git a/TestON/tests/FUNCintent/FUNCintent.py b/TestON/tests/FUNCintent/FUNCintent.py
index 797a91a..8ed3988 100644
--- a/TestON/tests/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNCintent/FUNCintent.py
@@ -1075,29 +1075,36 @@
                                ";\nThe test will use OF " + main.OFProtocol +\
                                " OVS running in Mininet"
 
-        main.step( "NOOPTION: Add multi point to single point intents" )
-        stepResult = main.TRUE
         hostNames = [ 'h8', 'h16', 'h24' ]
         devices = [ 'of:0000000000000005/8', 'of:0000000000000006/8', \
                     'of:0000000000000007/8' ]
         macs = [ '00:00:00:00:00:08', '00:00:00:00:00:10', '00:00:00:00:00:18' ]
-        stepResult = main.intentFunction.multiToSingleIntent(
-                                         main,
-                                         name="NOOPTION",
-                                         hostNames=hostNames,
-                                         devices=devices,
-                                         sw1="s5",
-                                         sw2="s2",
-                                         expectedLink=18 )
 
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="NOOPTION: Successfully added multi "
-                                        + " point to single point intents" +
-                                        " with no match action",
-                                 onfail="NOOPTION: Failed to add multi point" +
-                                        " to single point intents" +
-                                        " with no match action" )
+        # This test as written attempts something that is impossible
+        # Multi to Single Raw intent cannot be bi-directional, so pings are not usable to test it
+        # This test should be re-written so that one multi-to-single NOOPTION
+        # intent is installed, with listeners at the destinations, so that one way
+        # packets can be detected
+        #
+        # main.step( "NOOPTION: Add multi point to single point intents" )
+        # stepResult = main.TRUE
+        # stepResult = main.intentFunction.multiToSingleIntent(
+        #                                  main,
+        #                                  name="NOOPTION",
+        #                                  hostNames=hostNames,
+        #                                  devices=devices,
+        #                                  sw1="s5",
+        #                                  sw2="s2",
+        #                                  expectedLink=18 )
+        #
+        # utilities.assert_equals( expect=main.TRUE,
+        #                          actual=stepResult,
+        #                          onpass="NOOPTION: Successfully added multi "
+        #                                 + " point to single point intents" +
+        #                                 " with no match action",
+        #                          onfail="NOOPTION: Failed to add multi point" +
+        #                                 " to single point intents" +
+        #                                 " with no match action" )
 
         main.step( "IPV4: Add multi point to single point intents" )
         stepResult = main.TRUE
diff --git a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
index fb3f7db..7ec7f64 100644
--- a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
@@ -156,7 +156,7 @@
 
         time.sleep(20)
 
-        main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled false")
+        main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
 
         devices = int(clusterCount)*10
 
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"
+