Merge "Disabled MultiToSingle NOOPTION intent test. This testcase tested functionality that is not possible in onos. A new test will be added later."
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/CHOtest/CHOtest.py b/TestON/tests/CHOtest/CHOtest.py
index 10eee4a..779f8e9 100644
--- a/TestON/tests/CHOtest/CHOtest.py
+++ b/TestON/tests/CHOtest/CHOtest.py
@@ -2928,7 +2928,7 @@
         main.log.report( "_________________________________________________" )
         import itertools
         import time
-        main.case( "IPv6 ping all 600 Point intents" )
+        main.case( "IPv6 ping all 4556 Point intents" )
         main.step( "Verify IPv6 Ping across all hosts" )
         hostList = [ ('h'+ str(x + 11)) for x in range (main.numMNhosts) ]
         pingResult = main.FALSE
@@ -2948,8 +2948,8 @@
         utilities.assert_equals(
             expect=main.TRUE,
             actual=case192Result,
-            onpass="IPv6 Ping across 600 Point intents test PASS",
-            onfail="IPv6 Ping across 600 Point intents test FAIL" )
+            onpass="IPv6 Ping across 4556 Point intents test PASS",
+            onfail="IPv6 Ping across 4556 Point intents test FAIL" )
 
     def CASE10( self ):
         import time
diff --git a/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.py b/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.py
index b8c592c..4d65bc6 100644
--- a/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.py
+++ b/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.py
@@ -287,10 +287,10 @@
         network = NetworkData()
         network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
         network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
-        network.shared = 'false'
+        network.shared = False
         postdata = network.DictoJson()
 
-        network.shared = 'true'
+        network.shared = True
         postdatanew = network.DictoJson()
 
         main.step( "Post Data via HTTP" )
@@ -392,7 +392,7 @@
                 expect='200',
                 actual=Deletestatus,
                 onpass="Delete Success",
-                onfail="Delete Failed " + str( Getstatus ) + str( result ) )
+                onfail="Delete Failed " + str( Deletestatus ) + str( result ) )
 
         main.step( "Get Data is NULL" )
         Getstatus, result = main.ONOSrest.send( ctrlip, port, network.id, path+'networks/',
@@ -669,10 +669,342 @@
         Getstatus, result = main.ONOSrest.send( ctrlip, port, subnet.id, path + 'subnets/',
                                                  'GET', None, None )
         utilities.assert_equals(
-                expect='the subnet does not exists',
+                expect='The subnet does not exists',
                 actual=result,
                 onpass="Get Subnet Success",
                 onfail="Get Subnet Failed " + str( Getstatus ) + str( result ) )
 
-        if result != 'the subnet does not exists':
-            main.log.error( "Delete Subnet failed" )
\ No newline at end of file
+        if result != 'The subnet does not exists':
+            main.log.error( "Delete Subnet failed" )
+
+    def CASE8( self, main ):
+
+        """
+        Test Post Port
+        """
+        import os
+
+        try:
+            from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import SubnetData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import VirtualPortData
+        except ImportError:
+            main.log.exception( "Something wrong with import file or code error." )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
+
+        main.log.info( "ONOS Port Post test Start" )
+        main.case( "Virtual Network NBI Test - Port" )
+        main.caseExplanation = "Test Port Post NBI " +\
+                                "Verify Stored Data is same with Post Data"
+
+        ctrlip = os.getenv( main.params['CTRL']['ip1'] )
+        httpport = main.params['HTTP']['port']
+        path = main.params['HTTP']['path']
+
+        main.step( "Generate Post Data" )
+        network = NetworkData()
+        network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
+        network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
+        subnet = SubnetData()
+        subnet.id = "e44bd655-e22c-4aeb-b1e9-ea1606875178"
+        subnet.tenant_id = network.tenant_id
+        subnet.network_id = network.id
+        port = VirtualPortData()
+        port.id = "9352e05c-58b8-4f2c-b4df-c20435ser56466"
+        port.subnet_id = subnet.id
+        port.tenant_id = network.tenant_id
+        port.network_id = network.id
+
+        networkpostdata = network.DictoJson()
+        subnetpostdata = subnet.DictoJson()
+        portpostdata = port.DictoJson()
+
+        main.step( "Post Network Data via HTTP(Post port need post network)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'networks/',
+                                                 'POST', None, networkpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Network Success",
+                onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Subnet Data via HTTP(Post port need post subnet)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/',
+                                                 'POST', None, subnetpostdata )
+        utilities.assert_equals(
+                expect='202',
+                actual=Poststatus,
+                onpass="Post Subnet Success",
+                onfail="Post Subnet Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Port Data via HTTP" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/',
+                                                 'POST', None, portpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Port Success",
+                onfail="Post Port Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Get Port Data via HTTP" )
+        Getstatus, result = main.ONOSrest.send( ctrlip, httpport, port.id, path + 'ports/',
+                                                 'GET', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=Getstatus,
+                onpass="Get Port Success",
+                onfail="Get Port Failed " + str( Getstatus ) + "," + str( result ) )
+
+        main.step( "Compare Post Port Data" )
+        IDcmpresult = subnet.JsonCompare( portpostdata, result, 'port', 'id' )
+        TanantIDcmpresult = subnet.JsonCompare( portpostdata, result, 'port', 'tenant_id' )
+        NetoworkIDcmpresult = subnet.JsonCompare( portpostdata, result, 'port', 'network_id' )
+        fixedIpresult = subnet.JsonCompare( portpostdata, result, 'port', 'fixed_ips' )
+
+        Cmpresult = IDcmpresult and TanantIDcmpresult and NetoworkIDcmpresult and fixedIpresult
+        utilities.assert_equals(
+                expect=True,
+                actual=Cmpresult,
+                onpass="Compare Success",
+                onfail="Compare Failed:ID compare:" + str( IDcmpresult ) + \
+                       ",Tenant id compare:"+ str( TanantIDcmpresult ) + \
+                       ",Network id compare:" + str( NetoworkIDcmpresult ) +\
+                       ",FixIp compare:" + str( fixedIpresult ) )
+
+        main.step( "Clean Data via HTTP" )
+        deletestatus,result = main.ONOSrest.send( ctrlip, httpport, network.id, path + 'networks/',
+                                                 'DELETE', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=deletestatus,
+                onpass="Delete Network Success",
+                onfail="Delete Network Failed" )
+
+        if Cmpresult != True:
+            main.log.error( "Post port compare failed" )
+
+    def CASE9( self, main ):
+
+        """
+        Test Update Port
+        """
+        import os
+
+        try:
+            from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import SubnetData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import VirtualPortData
+        except ImportError:
+            main.log.exception( "Something wrong with import file or code error." )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
+
+        main.log.info( "ONOS Port Update test Start" )
+        main.case( "Virtual Network NBI Test - Port" )
+        main.caseExplanation = "Test Port Update NBI " +\
+                                "Verify Stored Data is same with New Post Data"
+
+        ctrlip = os.getenv( main.params['CTRL']['ip1'] )
+        httpport = main.params['HTTP']['port']
+        path = main.params['HTTP']['path']
+
+        main.step( "Generate Post Data" )
+        network = NetworkData()
+        network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
+        network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
+        subnet = SubnetData()
+        subnet.id = "e44bd655-e22c-4aeb-b1e9-ea1606875178"
+        subnet.tenant_id = network.tenant_id
+        subnet.network_id = network.id
+        port = VirtualPortData()
+        port.id = "9352e05c-58b8-4f2c-b4df-c20435ser56466"
+        port.subnet_id = subnet.id
+        port.tenant_id = network.tenant_id
+        port.network_id = network.id
+        port.name = "onos"
+
+        networkpostdata = network.DictoJson()
+        subnetpostdata = subnet.DictoJson()
+        portpostdata = port.DictoJson()
+
+        #create update data
+        port.name = "onos-new"
+        newportpostdata = port.DictoJson()
+        #end
+
+        main.step( "Post Network Data via HTTP(Post port need post network)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'networks/',
+                                                 'POST', None, networkpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Network Success",
+                onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Subnet Data via HTTP(Post port need post subnet)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/',
+                                                 'POST', None, subnetpostdata )
+        utilities.assert_equals(
+                expect='202',
+                actual=Poststatus,
+                onpass="Post Subnet Success",
+                onfail="Post Subnet Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Port Data via HTTP" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/',
+                                                 'POST', None, portpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Port Success",
+                onfail="Post Port Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Update Port Data via HTTP" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, port.id, path + 'ports/',
+                                                 'PUT', None, newportpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Update Port Success",
+                onfail="Update Port Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Get Port Data via HTTP" )
+        Getstatus, result = main.ONOSrest.send( ctrlip, httpport, port.id, path + 'ports/',
+                                                 'GET', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=Getstatus,
+                onpass="Get Port Success",
+                onfail="Get Port Failed " + str( Getstatus ) + "," + str( result ) )
+
+        main.step( "Compare Update Port Data" )
+        IDcmpresult = subnet.JsonCompare( portpostdata, result, 'port', 'id' )
+        TanantIDcmpresult = subnet.JsonCompare( portpostdata, result, 'port', 'tenant_id' )
+        NetoworkIDcmpresult = subnet.JsonCompare( portpostdata, result, 'port', 'network_id' )
+        Nameresult = subnet.JsonCompare( newportpostdata, result, 'port', 'name' )
+
+        Cmpresult = IDcmpresult and TanantIDcmpresult and NetoworkIDcmpresult and Nameresult
+        utilities.assert_equals(
+                expect=True,
+                actual=Cmpresult,
+                onpass="Compare Success",
+                onfail="Compare Failed:ID compare:" + str( IDcmpresult ) + \
+                       ",Tenant id compare:"+ str( TanantIDcmpresult ) + \
+                       ",Network id compare:" + str( NetoworkIDcmpresult ) + \
+                       ",Name compare:" + str(Nameresult) )
+
+        main.step( "Clean Data via HTTP" )
+        deletestatus,result = main.ONOSrest.send( ctrlip, httpport, network.id, path + 'networks/',
+                                                 'DELETE', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=deletestatus,
+                onpass="Delete Network Success",
+                onfail="Delete Network Failed" )
+
+        if Cmpresult != True:
+            main.log.error( "Update port compare failed" )
+
+    def CASE10( self, main ):
+
+        """
+        Test Delete Port
+        """
+        import os
+
+        try:
+            from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import SubnetData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import VirtualPortData
+        except ImportError:
+            main.log.exception( "Something wrong with import file or code error." )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
+
+        main.log.info( "ONOS Port Delete test Start" )
+        main.case( "Virtual Network NBI Test - Port" )
+        main.caseExplanation = "Test Port Delete NBI " +\
+                                "Verify port delete success"
+
+        ctrlip = os.getenv( main.params['CTRL']['ip1'] )
+        httpport = main.params['HTTP']['port']
+        path = main.params['HTTP']['path']
+
+        main.step( "Generate Post Data" )
+        network = NetworkData()
+        network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
+        network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
+        subnet = SubnetData()
+        subnet.id = "e44bd655-e22c-4aeb-b1e9-ea1606875178"
+        subnet.tenant_id = network.tenant_id
+        subnet.network_id = network.id
+        port = VirtualPortData()
+        port.id = "9352e05c-58b8-4f2c-b4df-c20435ser56466"
+        port.subnet_id = subnet.id
+        port.tenant_id = network.tenant_id
+        port.network_id = network.id
+
+        networkpostdata = network.DictoJson()
+        subnetpostdata = subnet.DictoJson()
+        portpostdata = port.DictoJson()
+
+        main.step( "Post Network Data via HTTP(Post port need post network)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'networks/',
+                                                 'POST', None, networkpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Network Success",
+                onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Subnet Data via HTTP(Post port need post subnet)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/',
+                                                 'POST', None, subnetpostdata )
+        utilities.assert_equals(
+                expect='202',
+                actual=Poststatus,
+                onpass="Post Subnet Success",
+                onfail="Post Subnet Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Port Data via HTTP" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/',
+                                                 'POST', None, portpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Port Success",
+                onfail="Post Port Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Delete Port Data via HTTP" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, httpport, port.id, path + 'ports/',
+                                                 'Delete', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Delete Port Success",
+                onfail="Delete Port Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Get Port Data is NULL" )
+        Getstatus, result = main.ONOSrest.send( ctrlip, httpport, port.id, path + 'ports/',
+                                                 'GET', None, None )
+        utilities.assert_equals(
+                expect='The virtualPort does not exists',
+                actual=result,
+                onpass="Get Port Success",
+                onfail="Get Port Failed " + str( Getstatus ) + "," + str( result ) )
+
+        if result != 'The virtualPort does not exists':
+            main.log.error( "Delete Port failed" )
+
+        main.step( "Clean Data via HTTP" )
+        deletestatus,result = main.ONOSrest.send( ctrlip, httpport, network.id, path + 'networks/',
+                                                 'DELETE', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=deletestatus,
+                onpass="Delete Network Success",
+                onfail="Delete Network Failed" )
\ No newline at end of file
diff --git a/TestON/tests/FUNCvirNetNB/dependencies/Nbdata.py b/TestON/tests/FUNCvirNetNB/dependencies/Nbdata.py
index dadf6b2..df2121e 100644
--- a/TestON/tests/FUNCvirNetNB/dependencies/Nbdata.py
+++ b/TestON/tests/FUNCvirNetNB/dependencies/Nbdata.py
@@ -11,12 +11,12 @@
         self.state = 'ACTIVE'
         self.name = 'onosfw-1'
         self.physicalNetwork = 'none'
-        self.admin_state_up = 'true'
+        self.admin_state_up = True
         self.tenant_id = ''
-        self.routerExternal = 'false'
+        self.routerExternal = False
         self.type ='LOCAL'
         self.segmentationID = '6'
-        self.shared = 'false'
+        self.shared = False
 
     def DictoJson(self):
 
@@ -72,7 +72,7 @@
             Decom = DestiCompareDataDic[FirstPara][SecondPara]
         except KeyError,error:
             print "Key error ,This key is not found:%s"%error
-            return False            
+            return False
 
         if str(Socom).lower()== str(Decom).lower():
             return True
@@ -94,11 +94,11 @@
         self.ipv6_address_mode = 'DHCPV6_STATELESS'
         self.ipv6_ra_mode = 'DHCPV6_STATELESS'
         self.cidr = '192.168.1.1/24'
-        self.enable_dhcp = 'true'
+        self.enable_dhcp = True
         self.dns_nameservers = 'aaa'
         self.gateway_ip = '192.168.2.1'
-        self.ip_version = 'INET'
-        self.shared = 'false'
+        self.ip_version = '4'
+        self.shared = False
         self.name = 'demo-subnet'
 
     def DictoJson(self):
@@ -150,14 +150,14 @@
         self.id = ''
         self.state = 'ACTIVE'
         self.bindingHostId = 'fa:16:3e:76:8e:88'
-        self.allowedAddressPairs = [{'macAddress':'fa:16:3e:76:8e:88','ipAddress':'192.168.1.1'}]
+        self.allowedAddressPairs = [{'mac_address':'fa:16:3e:76:8e:88','ip_address':'192.168.1.1'}]
         self.deviceOwner = 'none'
         self.fixedIp = []
         self.securityGroups = [{'securityGroup':'asd'}]
-        self.adminStateUp = 'true'
-        self.networkId = ''
-        self.tenantId = ''
-        self.subnetId = ''
+        self.adminStateUp = True
+        self.network_id = ''
+        self.tenant_id = ''
+        self.subnet_id = ''
         self.bindingvifDetails = 'port_filter'
         self.bindingvnicType = 'normal'
         self.bindingvifType = 'ovs'
@@ -166,49 +166,47 @@
         self.name = 'u'
 
     def DictoJson(self):
-        if self.id == '' or self.tenant_id == ' ' or self.networkId == '':
+        if self.id == '' or self.tenant_id == ' ' or \
+           self.network_id == '' or self.subnet_id == '':
             print 'Id/tenant id/networkid/subnetId is necessary!'
 
         Dicdata = {}
         fixedIp =[]
-        fixedIp.append({'subnetId':self.subnetId,'ipAddress':'192.168.1.4'})
+        fixedIp.append({'subnet_id':self.subnet_id,'ip_address':'192.168.1.4'})
         allocation_pools = []
 
         if self.id != '':
             Dicdata['id'] = self.id
         if self.state != '':
-            Dicdata['state'] = self.state
+            Dicdata['status'] = self.state
         if self.bindingHostId != '':
-            Dicdata['bindingHostId'] = self.bindingHostId
+            Dicdata['binding:host_id'] = self.bindingHostId
         if self.allowedAddressPairs != '':
-            Dicdata['allowedAddressPairs'] = self.allowedAddressPairs
+            Dicdata['allowed_address_pairs'] = self.allowedAddressPairs
         if self.deviceOwner != '':
-            Dicdata['deviceOwner'] = self.deviceOwner
-        if self.fixedIp != []:
-            Dicdata['fixedIp'] = fixedIp
+            Dicdata['device_owner'] = self.deviceOwner            
         if self.securityGroups != '':
-            Dicdata['securityGroups'] = self.securityGroups
+            Dicdata['security_groups'] = self.securityGroups
         if self.adminStateUp != '':
-            Dicdata['adminStateUp'] = self.adminStateUp
-        if self.networkId != '':
-            Dicdata['networkId'] = self.networkId
-        if self.tenantId != '':
-            Dicdata['tenantId'] = self.tenantId
-        if self.subnetId != '':
-            Dicdata['subnetId'] = self.subnetId
+            Dicdata['admin_state_up'] = self.adminStateUp
+        if self.network_id != '':
+            Dicdata['network_id'] = self.network_id
+        if self.tenant_id != '':
+            Dicdata['tenant_id'] = self.tenant_id
         if self.bindingvifDetails != '':
-            Dicdata['bindingvifDetails'] = self.bindingvifDetails
+            Dicdata['binding:vif_details'] = self.bindingvifDetails
         if self.bindingvnicType != '':
-            Dicdata['bindingvnicType'] = self.bindingvnicType
+            Dicdata['binding:vnic_type'] = self.bindingvnicType
         if self.bindingvifType != '':
-            Dicdata['bindingvifType'] = self.bindingvifType
+            Dicdata['binding:vif_type'] = self.bindingvifType
         if self.macAddress != '':
-            Dicdata['macAddress'] = self.macAddress
+            Dicdata['mac_address'] = self.macAddress
         if self.deviceId != '':
-            Dicdata['deviceId'] = self.deviceId
+            Dicdata['device_id'] = self.deviceId
         if self.name != '':
             Dicdata['name'] = self.name
 
-            Dicdata = {'virtualport': Dicdata}
+        Dicdata['fixed_ips'] = fixedIp
+        Dicdata = {'port': Dicdata}
 
-            return json.dumps(Dicdata,indent=4)
\ No newline at end of file
+        return json.dumps(Dicdata,indent=4)
\ No newline at end of file
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index d1f4133..b5ebe7d 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -2862,6 +2862,11 @@
             onpass="All nodes successfully ran for leadership",
             onfail="At least one node failed to run for leadership" )
 
+        if electionResult == main.FALSE:
+            main.log.error(
+                "Skipping Test Case because Election Test App isn't loaded" )
+            main.skipCase()
+
         main.step( "Check that each node shows the same leader and candidates" )
         sameResult = main.TRUE
         failMessage = "Nodes have different leaders"
diff --git a/TestON/tests/HAminorityRestart/HAminorityRestart.py b/TestON/tests/HAminorityRestart/HAminorityRestart.py
index c16fbb7..855f380 100644
--- a/TestON/tests/HAminorityRestart/HAminorityRestart.py
+++ b/TestON/tests/HAminorityRestart/HAminorityRestart.py
@@ -2808,6 +2808,11 @@
             onpass="All nodes successfully ran for leadership",
             onfail="At least one node failed to run for leadership" )
 
+        if electionResult == main.FALSE:
+            main.log.error(
+                "Skipping Test Case because Election Test App isn't loaded" )
+            main.skipCase()
+
         main.step( "Check that each node shows the same leader and candidates" )
         sameResult = main.TRUE
         failMessage = "Nodes have different leaders"
diff --git a/TestON/tests/HAsanity/HAsanity.py b/TestON/tests/HAsanity/HAsanity.py
index 72381ae..6ceaead 100644
--- a/TestON/tests/HAsanity/HAsanity.py
+++ b/TestON/tests/HAsanity/HAsanity.py
@@ -2739,7 +2739,7 @@
         assert main.CLIs, "main.CLIs not defined"
         assert main.nodes, "main.nodes not defined"
 
-        description = "Check that Leadership Election is still functional"
+        description = "Check that Leadership Election App is still functional"
         main.case( description )
         # NOTE: Need to re-run since being a canidate is not persistant
         # TODO: add check for "Command not found:" in the driver, this
@@ -2771,6 +2771,11 @@
             onpass="All nodes successfully ran for leadership",
             onfail="At least one node failed to run for leadership" )
 
+        if electionResult == main.FALSE:
+            main.log.error(
+                "Skipping Test Case because Election Test isn't loaded" )
+            main.skipCase()
+
         main.step( "Check that each node shows the same leader and candidates" )
         sameResult = main.TRUE
         failMessage = "Nodes have different leaders"
diff --git a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index b5fa9dc..8a86647 100644
--- a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -1929,6 +1929,11 @@
             onpass="All nodes successfully ran for leadership",
             onfail="At least one node failed to run for leadership" )
 
+        if electionResult == main.FALSE:
+            main.log.error(
+                "Skipping Test Case because Election Test App isn't loaded" )
+            main.skipCase()
+
         main.step( "Check that each node shows the same leader and candidates" )
         sameResult = main.TRUE
         failMessage = "Nodes have different leaders"
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/SCPFmaxIntents/SCPFmaxIntents.params b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
index 97e2aab..325ca7f 100755
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
@@ -3,7 +3,8 @@
     # 0-init, 1-setup, 10-null provider setup,
     # 11-mininet setup, 20-pushing intents,
     # 21-rerouting intents
-    <testcases>0,1,10,20,1,11,20,1,10,21,1,11,21,100</testcases>
+    # 0,1,10,20,1,11,20,1,10,21,1,11,21,100
+    <testcases>0,1,11,20,1,11,21,100</testcases>
 
     <SCALE>
         <size>1</size>
@@ -40,10 +41,15 @@
         <timeout>120</timeout>
     </SLEEP>
 
+    <DATABASE>
+        <nic>1gig</nic>
+        <node>baremetal</node>
+    </DATABASE>
+
     <TEST>
         <batch_size>1000</batch_size>
-        <min_intents>800000</min_intents>
-        <max_intents>10000000</max_intents>
+        <min_intents>500000</min_intents>
+        <max_intents>1000000</max_intents>
         <check_interval>10000</check_interval>
     </TEST>
 
diff --git a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
index 867acc7..2fafc1e 100644
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
@@ -154,10 +154,16 @@
         commit = main.ONOSbench.getVersion()
         commit = commit.split(" ")[1]
 
+        main.log.info("Creating DB file")
+        nic = main.params['DATABASE']['nic']
+        node = main.params['DATABASE']['node']
         try:
             dbFileName="/tmp/MaxIntentDB"
             dbfile = open(dbFileName, "w+")
             temp = "'" + commit + "',"
+            temp += "'" + nic + "',"
+            temp += str(main.numCtrls) + ","
+            temp += "'" + node + "1" + "',"
             dbfile.write(temp)
             dbfile.close()
         except IOError:
@@ -170,7 +176,6 @@
         - Install ONOS cluster
         - Connect to cli
         """
-
         main.step( "Uninstalling ONOS package" )
         onosUninstallResult = main.TRUE
         for i in range( main.maxNodes ):
@@ -406,10 +411,12 @@
         main.log.info("Installed intents: " + str(maxIntents) +
                       "\nAdded flows: " + str(maxFlows))
 
+        main.log.info("Writing results to DB file")
         try:
             dbFileName="/tmp/MaxIntentDB"
-            dbfile = open(dbFileName, "a+")
-            temp = "'" + str(maxIntents) + "',"
+            dbfile = open(dbFileName, "a")
+            temp = str(maxIntents) + ","
+            temp += str(maxFlows) + ","
             dbfile.write(temp)
             dbfile.close()
         except IOError:
@@ -543,8 +550,9 @@
 
         try:
             dbFileName="/tmp/MaxIntentDB"
-            dbfile = open(dbFileName, "a+")
-            temp = "'" + str(maxIntents) + "',"
+            dbfile = open(dbFileName, "a")
+            temp = str(maxIntents) + ","
+            temp += str(maxFlows) + "\n"
             dbfile.write(temp)
             dbfile.close()
         except IOError:
diff --git a/TestON/tests/SCPFportLat/SCPFportLat.py b/TestON/tests/SCPFportLat/SCPFportLat.py
index b4c0721..35147ca 100644
--- a/TestON/tests/SCPFportLat/SCPFportLat.py
+++ b/TestON/tests/SCPFportLat/SCPFportLat.py
@@ -521,8 +521,8 @@
             main.log.report(' Port down Link-to-graph' +
                     str(portDownLinkToGraphAvg) + ' ms')
 
-            dbCmdList.append("INSERT INTO port_latency_details VALUES('" +
-                    timeToPost + "','port_latency_results'," + jenkinsBuildNumber +
+            dbCmdList.append(
+                    "'" + timeToPost + "','port_latency_results'," + jenkinsBuildNumber +
                     ',' + str(clusterCount) + ",'baremetal" + str(node + 1) +
                     "'," +
                     str(portUpEndToEndAvg) +',' +
@@ -532,8 +532,7 @@
                     str(portDownEndToEndAvg) + ',' +
                     str(portDownOfpToDevAvg) + ',' +
                     str(portDownDevToLinkAvg) + ',' +
-                    str(portDownLinkToGraphAvg) +
-                    ');')
+                    str(portDownLinkToGraphAvg))
 
         fResult = open(resultPath, 'a')
         for line in dbCmdList:
diff --git a/TestON/tests/SCPFswitchLat/SCPFswitchLat.params b/TestON/tests/SCPFswitchLat/SCPFswitchLat.params
index 64ac34e..ceb184e 100644
--- a/TestON/tests/SCPFswitchLat/SCPFswitchLat.params
+++ b/TestON/tests/SCPFswitchLat/SCPFswitchLat.params
@@ -60,10 +60,10 @@
         </topoConfigName>
 
         #Number of times to iterate each case
-        <numIter>13</numIter>
+        <numIter>25</numIter>
         <numSwitch>2</numSwitch>
         #Number of iterations to ignore initially
-        <iterIgnore>2</iterIgnore>
+        <iterIgnore>5</iterIgnore>
 
         <singleSwThreshold>0,1000</singleSwThreshold>
     
diff --git a/TestON/tests/SCPFswitchLat/SCPFswitchLat.py b/TestON/tests/SCPFswitchLat/SCPFswitchLat.py
index ab6715d..4ad87be 100644
--- a/TestON/tests/SCPFswitchLat/SCPFswitchLat.py
+++ b/TestON/tests/SCPFswitchLat/SCPFswitchLat.py
@@ -830,8 +830,7 @@
 
             # For database schema, refer to Amazon web services
             dbCmdList.append(
-                    "INSERT INTO switch_latency_details VALUES('" +
-                    timeToPost + "','switch_latency_results'," +
+                    "'" + timeToPost + "','switch_latency_results'," +
                     jenkinsBuildNumber + ',' + str(clusterCount) + ",'baremetal" +
                     str(node + 1) + "'," +
                     str(endToEndAvg) + ',' +
@@ -843,8 +842,7 @@
                     str(endToEndDiscAvg) + ',' +
                     str(finAckAvg) + ',' +
                     str(ackToDeviceAvg) + ',' +
-                    str(deviceToGraphDiscAvg) +
-                    ');')
+                    str(deviceToGraphDiscAvg))
 
         if debugMode == 'on':
             main.ONOSbench.cpLogsToDir('/opt/onos/log/karaf.log',
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"
+