Merge pull request #68 from opennetworkinglab/devl/exception_handling

Refactor exception handling
diff --git a/.gitignore b/.gitignore
index 6cccacc..ae5f64f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 *.swp
+*.swo
 TestON/logs/*
 *.pyc
diff --git a/TestON/dependencies/Jenkins_getresult_HA.py b/TestON/dependencies/Jenkins_getresult_HA.py
new file mode 100755
index 0000000..f3ea459
--- /dev/null
+++ b/TestON/dependencies/Jenkins_getresult_HA.py
@@ -0,0 +1,117 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import re
+import datetime
+import time
+import argparse
+import shutil
+
+parser = argparse.ArgumentParser()
+parser.add_argument("-n", "--name", help="Comma Separated string of test names. Ex: --name='test1, test2, test3'")
+parser.add_argument("-w", "--workspace", help="The name of the Jenkin's job/workspace where csv files will be saved'")
+args = parser.parse_args()
+
+#Pass in test names as a comma separated string argument. 
+#Example: ./Jenkins_getresult.py "Test1,Test2,Test3,Test4"
+name_list = args.name.split(",")
+result_list = map(lambda x: x.strip(), name_list)
+job = args.workspace
+if job is None:
+    job = ""
+print job
+
+#NOTE: testnames list should be in order in which it is run
+testnames = result_list
+output = ''
+header = ''
+graphs = ''
+testdate = datetime.datetime.now()
+#workspace = "/var/lib/jenkins/workspace/ONOS-HA"
+workspace = "/var/lib/jenkins/workspace/"
+workspace = workspace + job
+
+header +="<p>**************************************</p>"
+header +=testdate.strftime('Jenkins test result for %H:%M on %b %d, %Y. %Z')
+
+
+#NOTE: CASE SPECIFIC THINGS
+
+#THIS LINE IS LOUSY FIXME
+if any("HA" in s for s in testnames):
+    ##Graphs
+    graphs += '<ac:structured-macro ac:name="html">\n'
+    graphs += '<ac:plain-text-body><![CDATA[\n'
+    graphs += '<iframe src="https://onos-jenkins.onlab.us/job/'+job+'/plot/getPlot?index=2&width=500&height=300" noborder="0" width="500" height="300" scrolling="yes" seamless="seamless"></iframe>\n'
+    graphs += '<iframe src="https://onos-jenkins.onlab.us/job/'+job+'/plot/getPlot?index=1&width=500&height=300" noborder="0" width="500" height="300" scrolling="yes" seamless="seamless"></iframe>\n'
+    graphs += '<iframe src="https://onos-jenkins.onlab.us/job/'+job+'/plot/getPlot?index=0&width=500&height=300" noborder="0" width="500" height="300" scrolling="yes" seamless="seamless"></iframe>\n'
+    graphs += '<iframe src="https://onos-jenkins.onlab.us/job/'+job+'/plot/getPlot?index=3&width=500&height=300" noborder="0" width="500" height="300" scrolling="yes" seamless="seamless"></iframe>\n'
+    graphs += ']]></ac:plain-text-body>\n'
+    graphs += '</ac:structured-macro>\n'
+    header +="<p> <a href='https://wiki.onosproject.org/display/OST/Test+Plan+-+HA'>Test Plan for HA Test Cases</a></p>"
+
+
+# ***
+
+
+#TestON reporting
+for test in testnames:
+    passes = 0
+    fails = 0
+    name = os.popen("ls /home/admin/ONLabTest/TestON/logs/ -rt | grep %s_ | tail -1" % test).read().split()[0]
+    path = "/home/admin/ONLabTest/TestON/logs/" + name + "/"
+    try:
+        #IF exists, move the csv file to the workspace
+        shutil.copy(path + test + ".csv", workspace)
+    except IOError:
+        #File probably doesn't exist
+        pass
+
+    output +="<p></p>"
+    #output +="   Date: %s, %s %s" % (name.split("_")[2], name.split("_")[1], name.split("_")[3]) + "<p>*******************<p>"
+    #Open the latest log folder 
+    output += "<h2>Test "+str(test)+"</h2><p>************************************</p>"
+
+    f = open(path + name + ".rpt")
+
+    #Parse through each line of logs and look for specific strings to output to wiki.
+    #NOTE: with current implementation, you must specify which output to output to wiki by using
+    #main.log.report("") since it is looking for the [REPORT] tag in the logs
+    for line in f:
+        if re.search("Result summary for Testcase", line):
+            output += "<h3>"+str(line)+"</h3>"
+            #output += "<br>"
+        if re.search("\[REPORT\]", line): 
+            line_split = line.split("] ")
+            #line string is split by bracket, and first two items (log tags) in list are omitted from output
+            #join is used to convert list to string
+            line_str = ''.join(line_split[2:])
+            output += "<p>"
+            output += line_str
+            output += "</p>"
+        if re.search("Result:", line):
+            output += "<p>"
+            output += line
+            output += "</p>"
+            if re.search("Pass", line):
+                passes = passes + 1
+            elif re.search("Fail", line):
+                fails = fails + 1
+    f.close()
+    #https://wiki.onosproject.org/display/OST/Test+Results+-+HA#Test+Results+-+HA
+    #Example anchor on new wiki:        #TestResults-HA-TestHATestSanity
+    page_name = "TestResults-HA-Test"
+
+    header += "<li><a href=\'#" + str(page_name) + str(test) + "\'> " + str(test) + " - Results: " + str(passes) + " Passed, " + str(fails) + " Failed</a></li>"
+
+    #*********************
+    #include any other phrase specific to case you would like to include in wiki here
+    if test == "IntentPerf":
+        output += "URL to Historical Performance results data: <a href='http://10.128.5.54perf.html'>Perf Graph</a>"
+    #*********************
+
+#header_file = open("/tmp/header_ha.txt",'w')
+#header_file.write(header)
+output = header + graphs + output
+print output
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index a45ed20..acef039 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -59,20 +59,51 @@
         """
            Here the main is the TestON instance after creating
            all the log handles."""
-        for key in connectargs:
-            vars( self )[ key ] = connectargs[ key ]
+        try:
+            for key in connectargs:
+                vars( self )[ key ] = connectargs[ key ]
 
-        self.name = self.options[ 'name' ]
-        self.handle = super(
-            MininetCliDriver,
-            self ).connect(
-            user_name=self.user_name,
-            ip_address=self.ip_address,
-            port=None,
-            pwd=self.pwd )
+            self.name = self.options[ 'name' ]
+            self.handle = super(
+                MininetCliDriver,
+                self ).connect(
+                user_name=self.user_name,
+                ip_address=self.ip_address,
+                port=None,
+                pwd=self.pwd )
 
-        self.sshHandle = self.handle
+            if self.handle:
+                main.log.info("Connection successful to the host " +
+                        self.user_name +
+                        "@" +
+                        self.ip_address )
+                return main.TRUE
+            else:
+                main.log.error( "Connection failed to the host " +
+                        self.user_name +
+                        "@" +
+                        self.ip_address )
+                msin.log.error( "Failed to connect to the Mininet CLI" )
+                return main.FALSE
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            main.cleanup()
+            main.exit()
+        except:
+            main.log.info( self.name + ":::::::::::::::::::::::" )
+            main.log.error( traceback.print_exc() )
+            main.log.info( ":::::::::::::::::::::::" )
+            main.cleanup()
+            main.exit()
 
+
+    def startNet( self, topoFile = '', args = '', timeout = 120 ):
+        """
+        Starts Mininet accepts a topology(.py) file and/or an optional
+        arguement ,to start the mininet, as a parameter.
+        Returns true if the mininet starts successfully
+        """
         if self.handle:
             main.log.info(
                 self.name +
@@ -82,7 +113,7 @@
                                       'Cleanup\scomplete',
                                       pexpect.EOF,
                                       pexpect.TIMEOUT ],
-                                    120 )
+                                    timeout )
             if i == 0:
                 main.log.info( self.name + ": Sending sudo password" )
                 self.handle.sendline( self.pwd )
@@ -90,7 +121,7 @@
                                           '\$',
                                           pexpect.EOF,
                                           pexpect.TIMEOUT ],
-                                        120 )
+                                        timeout )
             if i == 1:
                 main.log.info( self.name + ": Clean" )
             elif i == 2:
@@ -99,51 +130,68 @@
                 main.log.error(
                     self.name +
                     ": Something while cleaning MN took too long... " )
+            if topoFile == ''  and  args ==  '':
+                main.log.info( self.name + ": building fresh mininet" )
+                # for reactive/PARP enabled tests
+                cmdString = "sudo mn " + self.options[ 'arg1' ] +\
+                    " " + self.options[ 'arg2' ] +\
+                    " --mac --controller " +\
+                    self.options[ 'controller' ] + " " +\
+                    self.options[ 'arg3' ]
 
-            main.log.info( self.name + ": building fresh mininet" )
-            # for reactive/PARP enabled tests
-            cmdString = "sudo mn " + self.options[ 'arg1' ] +\
-                " " + self.options[ 'arg2' ] +\
-                " --mac --controller " +\
-                self.options[ 'controller' ] + " " +\
-                self.options[ 'arg3' ]
+                argList = self.options[ 'arg1' ].split( "," )
+                global topoArgList
+                topoArgList = argList[ 0 ].split( " " )
+                argList = map( int, argList[ 1: ] )
+                topoArgList = topoArgList[ 1: ] + argList
 
-            argList = self.options[ 'arg1' ].split( "," )
-            global topoArgList
-            topoArgList = argList[ 0 ].split( " " )
-            argList = map( int, argList[ 1: ] )
-            topoArgList = topoArgList[ 1: ] + argList
-
-            self.handle.sendline( cmdString )
-            self.handle.expect( [ "sudo mn", pexpect.EOF, pexpect.TIMEOUT ] )
-            while True:
+                self.handle.sendline( cmdString )
+                self.handle.expect( [ "sudo mn",
+                                    pexpect.EOF,
+                                    pexpect.TIMEOUT ] )
+                while True:
+                    i = self.handle.expect( [ 'mininet>',
+                                              '\*\*\*',
+                                              'Exception',
+                                              pexpect.EOF,
+                                              pexpect.TIMEOUT ],
+                                            timeout )
+                    if i == 0:
+                        main.log.info( self.name + ": mininet built" )
+                        return main.TRUE
+                    if i == 1:
+                        self.handle.expect(
+                            [ "\n", pexpect.EOF, pexpect.TIMEOUT ] )
+                        main.log.info( self.handle.before )
+                    elif i == 2:
+                        main.log.error(
+                            self.name +
+                            ": Launching mininet failed..." )
+                        return main.FALSE
+                    elif i == 3:
+                        main.log.error( self.name + ": Connection timeout" )
+                        return main.FALSE
+                    elif i == 4:  # timeout
+                        main.log.error(
+                            self.name +
+                            ": Something took too long... " )
+                        return main.FALSE
+                return main.TRUE
+            else:
+                main.log.info( "Starting topo file " + topoFile )
+                if args == None:
+                    args = ''
+                else:
+                    main.log.info( "args = " + args)
+                self.handle.sendline( 'sudo ' + topoFile + ' ' + args)
+                i = 1
                 i = self.handle.expect( [ 'mininet>',
-                                          '\*\*\*',
-                                          'Exception',
-                                          pexpect.EOF,
-                                          pexpect.TIMEOUT ],
-                                        300 )
-                if i == 0:
-                    main.log.info( self.name + ": mininet built" )
-                    return main.TRUE
-                if i == 1:
-                    self.handle.expect(
-                        [ "\n", pexpect.EOF, pexpect.TIMEOUT ] )
-                    main.log.info( self.handle.before )
-                elif i == 2:
-                    main.log.error(
-                        self.name +
-                        ": Launching mininet failed..." )
-                    return main.FALSE
-                elif i == 3:
-                    main.log.error( self.name + ": Connection timeout" )
-                    return main.FALSE
-                elif i == 4:  # timeout
-                    main.log.error(
-                        self.name +
-                        ": Something took too long... " )
-                    return main.FALSE
-            return main.TRUE
+                                        pexpect.EOF ,
+                                        pexpect.TIMEOUT ],
+                                        timeout)
+                main.log.info(self.name + ": Network started")
+                return main.TRUE
+
         else:  # if no handle
             main.log.error(
                 self.name +
@@ -367,6 +415,89 @@
         else:
             return main.TRUE
 
+    def moveHost( self, host, oldSw, newSw, ):
+        """
+           Moves a host from one switch to another on the fly
+           Note: The intf between host and oldSw when detached
+                using detach(), will still show up in the 'net'
+                cmd, because switch.detach() doesn't affect switch.intfs[]
+                (which is correct behavior since the interfaces 
+                haven't moved).
+        """
+        if self.handle:
+            try:
+                # Bring link between oldSw-host down
+                cmd = "py net.configLinkStatus('" + oldSw + "'," + "'" + host + "'," +\
+                "'down')"
+                print "cmd1= ", cmd
+                response = self.execute(
+                cmd=cmd,
+                prompt="mininet>",
+                timeout=10 )
+     
+                # Determine hostintf and Oldswitchintf
+                cmd = "px hintf,sintf = " + host + ".connectionsTo(" + oldSw +\
+                ")[0]"
+                print "cmd2= ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )
+
+                # Determine ipaddress of the host-oldSw interface
+                cmd = "px ipaddr = hintf.IP()"
+                print "cmd3= ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )
+                
+                # Detach interface between oldSw-host
+                cmd = "px " + oldSw + ".detach( sintf )"
+                print "cmd4= ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )
+
+                # Add link between host-newSw
+                cmd = "py net.addLink(" + host + "," + newSw + ")"
+                print "cmd5= ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )
+ 
+                # Determine hostintf and Newswitchintf
+                cmd = "px hintf,sintf = " + host + ".connectionsTo(" + newSw +\
+                ")[0]"
+                print "cmd6= ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )                 
+
+                # Attach interface between newSw-host
+                cmd = "px " + newSw + ".attach( sintf )"
+                print "cmd3= ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )
+                
+                # Set ipaddress of the host-newSw interface
+                cmd = "px " + host + ".setIP( ip = ipaddr, intf = hintf)"
+                print "cmd7 = ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )
+                
+                cmd = "net"
+                print "cmd8 = ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )
+                print "output = ", self.handle.before
+
+                # Determine ipaddress of the host-newSw interface
+                cmd = "h1 ifconfig"
+                print "cmd9= ", cmd
+                self.handle.sendline( cmd )
+                self.handle.expect( "mininet>" )
+                print "ifconfig o/p = ", self.handle.before
+                
+                return main.TRUE
+            except pexpect.EOF:
+                main.log.error( self.name + ": EOF exception found" )
+                main.log.error( self.name + ":     " + self.handle.before )
+                return main.FALSE
+
     def changeIP( self, host, intf, newIP, newNetmask ):
         """
            Changes the ip address of a host on the fly
@@ -1108,6 +1239,34 @@
             main.exit()
 
     def disconnect( self ):
+        """
+        Called at the end of the test to stop the mininet and
+        disconnect the handle.
+        """
+        self.handle.sendline('')
+        i = 1
+        i = self.handle.expect( ['mininet>',pexpect.EOF,pexpect.TIMEOUT ], timeout = 2)
+        if i == 0:
+            self.stopNet()
+        response = ''
+        # print "Disconnecting Mininet"
+        if self.handle:
+            self.handle.sendline( "exit" )
+            self.handle.expect( "exit" )
+            self.handle.expect( "(.*)" )
+            main.log.info( "Mininet CLI is successfully disconnected" )
+            response = self.handle.before
+        else:
+            main.log.error( "Connection failed to the host" )
+            response = main.FALSE
+
+        return response
+
+    def stopNet( self ):
+        """
+        Stops mininet. returns true if the mininet succesfully stops.
+        """
+        
         main.log.info( self.name + ": Disconnecting mininet..." )
         response = ''
         if self.handle:
@@ -1116,10 +1275,7 @@
                     cmd="exit",
                     prompt="(.*)",
                     timeout=120 )
-                response = self.execute(
-                    cmd="exit",
-                    prompt="(.*)",
-                    timeout=120 )
+                main.log.info( self.name + ": Disconnected")
                 self.handle.sendline( "sudo mn -c" )
                 response = main.TRUE
             except pexpect.EOF:
@@ -1132,6 +1288,8 @@
             response = main.FALSE
         return response
 
+
+
     def arping( self, src, dest, destmac ):
         self.handle.sendline( '' )
         self.handle.expect( [ "mininet", pexpect.EOF, pexpect.TIMEOUT ] )
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index a9a5a03..50994ee 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -45,7 +45,9 @@
                 if key == "home":
                     self.home = self.options[ 'home' ]
                     break
-
+            if self.home == None or self.home == "":
+                self.home = "~/ONOS"
+            
             self.name = self.options[ 'name' ]
             self.handle = super( OnosDriver, self ).connect(
                 user_name=self.user_name,
@@ -238,7 +240,7 @@
             # main.log.info( self.name + ": Stopping ONOS" )
             # self.stop()
             self.handle.sendline( "cd " + self.home )
-            self.handle.expect( "ONOS\$" )
+            self.handle.expect( self.home + "\$" )
             if comp1 == "":
                 self.handle.sendline( "git pull" )
             else:
@@ -274,7 +276,7 @@
                 main.log.info(
                     self.name +
                     ": Git Pull - pulling repository now" )
-                self.handle.expect( "ONOS\$", 120 )
+                self.handle.expect( self.home + "\$", 120 )
             # So that only when git pull is done, we do mvn clean compile
                 return main.TRUE
             elif i == 3:
@@ -345,7 +347,7 @@
         """
         try:
             self.handle.sendline( "cd " + self.home )
-            self.handle.expect( "ONOS\$" )
+            self.handle.expect( self.home + "\$" )
             main.log.info(
                 self.name +
                 ": Checking out git branch: " +
@@ -385,7 +387,7 @@
                     self.name +
                     ": Git Checkout %s : Already on this branch" %
                     branch )
-                self.handle.expect( "ONOS\$" )
+                self.handle.expect( self.home + "\$" )
                 # main.log.info( "DEBUG: after checkout cmd = "+
                 # self.handle.before )
                 return main.TRUE
@@ -394,7 +396,7 @@
                     self.name +
                     ": Git checkout %s - Switched to this branch" %
                     branch )
-                self.handle.expect( "ONOS\$" )
+                self.handle.expect( self.home + "\$" )
                 # main.log.info( "DEBUG: after checkout cmd = "+
                 # self.handle.before )
                 return main.TRUE
@@ -413,7 +415,7 @@
                             files would be overwritten by checkout:" +
                     str(
                         self.handle.before ) )
-                self.handle.expect( "ONOS\$" )
+                self.handle.expect( self.home + "\$" )
                 return main.ERROR
             elif i == 6:
                 main.log.error( self.name +
@@ -421,7 +423,7 @@
                                 "You need to resolve your\
                                         current index first:" +
                                 str( self.handle.before ) )
-                self.handle.expect( "ONOS\$" )
+                self.handle.expect( self.home + "\$" )
                 return main.ERROR
             else:
                 main.log.error(
diff --git a/TestON/drivers/common/cli/quaggaclidriver.py b/TestON/drivers/common/cli/quaggaclidriver.py
index 8724454..98f83d2 100644
--- a/TestON/drivers/common/cli/quaggaclidriver.py
+++ b/TestON/drivers/common/cli/quaggaclidriver.py
@@ -28,19 +28,14 @@
         # self.handle = super( QuaggaCliDriver,self ).connect(
         # user_name=self.user_name, ip_address=self.ip_address,port=self.port,
         # pwd=self.pwd )
-        self.handle = super(
-            QuaggaCliDriver,
-            self ).connect(
+        self.handle = super( QuaggaCliDriver, self ).connect(
                 user_name=self.user_name,
-            ip_address="1.1.1.1",
-            port=self.port,
-            pwd=self.pwd )
-        main.log.info(
-            "connect parameters:" + str(
-                self.user_name ) + ";" + str(
-                    self.ip_address ) + ";" + str(
-                self.port ) + ";" + str(
-                self.pwd ) )
+                ip_address="1.1.1.1",
+                port=self.port,
+                pwd=self.pwd )
+        main.log.info( "connect parameters:" + str( self.user_name ) + ";"
+                       + str( self.ip_address ) + ";" + str( self.port )
+                       + ";" + str(self.pwd ) )
 
         if self.handle:
             # self.handle.expect( "",timeout=10 )
@@ -64,14 +59,9 @@
         self.handle = super( QuaggaCliDriver, self ).connect(
             user_name=self.user_name, ip_address=ip_address,
             port=self.port, pwd=self.pwd )
-        main.log.info( "connect parameters:" +
-                       str( self.user_name ) +
-                       ";" +
-                       str( self.ip_address ) +
-                       ";" +
-                       str( self.port ) +
-                       ";" +
-                       str( self.pwd ) )
+        main.log.info( "connect parameters:" + str( self.user_name ) + ";"
+                       + str( self.ip_address ) + ";" + str( self.port )
+                       + ";" + str( self.pwd ) )
 
         if self.handle:
             # self.handle.expect( "" )
@@ -85,7 +75,7 @@
             self.handle.sendline( "enable" )
             # self.handle.expect( "bgpd#", timeout=5 )
             self.handle.expect( "bgpd#" )
-            main.log.info( "I in quagga on host " + str( ip_address ) )
+            main.log.info( "I am in quagga on host " + str( ip_address ) )
 
             return self.handle
         else:
@@ -114,8 +104,7 @@
     def generatePrefixes( self, net, numRoutes ):
         main.log.info( "I am in generate_prefixes method!" )
 
-        # each IP prefix will be composed by
-        #"net" + "." + m + "." + n + "." + x
+        # each IP prefix is composed by "net" + "." + m + "." + n + "." + x
         # the length of each IP prefix is 24
         routes = []
         routesGen = 0
@@ -124,10 +113,8 @@
 
         for i in range( 0, m ):
             for j in range( 0, 256 ):
-                network = str(
-                    net ) + "." + str(
-                        i ) + "." + str(
-                            j ) + ".0/24"
+                network = str( net ) + "." + str( i ) + "." + str( j ) \
+                    + ".0/24"
                 routes.append( network )
                 routesGen = routesGen + 1
 
@@ -144,39 +131,36 @@
 
     # This method generates a multiple to single point intent(
     # MultiPointToSinglePointIntent ) for a given route
-    def generateExpectedSingleRouteIntent(
-            self,
-            prefix,
-            nextHop,
-            nextHopMac,
-            sdnipData ):
+    def generateExpectedSingleRouteIntent( self, prefix, nextHop, nextHopMac,
+                                           sdnipData ):
 
-        ingress = []
+        ingresses = []
         egress = ""
         for peer in sdnipData[ 'bgpPeers' ]:
-            if peer[ 'ip_address' ] == nextHop:
-                egress = "of:" + \
-                    str( peer[ 'attachmentDpid' ] ).replace( ":", "" ) + ":" +\
-                    str( peer[ 'attachmentPort' ] )
-            else:
-                ingress.append( "of:" +
-                                str( peer[ 'attachmentDpid' ] ).replace( ":",
-                                     "" ) + ":" +
-                                str( peer[ 'attachmentPort' ] ) )
+            if peer[ 'ipAddress' ] == nextHop:
+                egress = "of:" + str(
+                    peer[ 'attachmentDpid' ] ).replace( ":", "" ) + ":" \
+                    + str( peer[ 'attachmentPort' ] )
+        for peer in sdnipData[ 'bgpPeers' ]:
+            if not peer[ 'ipAddress' ] == nextHop:
+                ingress = "of:" + str(
+                    peer[ 'attachmentDpid' ] ).replace( ":", "" ) + ":" \
+                    + str( peer[ 'attachmentPort' ] )
+                if not ingress == egress and ingress not in ingresses:
+                    ingresses.append( ingress )
+                    # ingresses.append( "of:" + str( peer[ 'attachmentDpid' ]
+                    # ).replace( ":", "" ) + ":" + str( peer[ 'attachmentPort'
+                    # ] ) )
 
         selector = "ETH_TYPE{ethType=800},IPV4_DST{ip=" + prefix + "}"
         treatment = "[ETH_DST{mac=" + str( nextHopMac ) + "}]"
 
-        intent = egress + "/" + \
-            str( sorted( ingress ) ) + "/" + selector + "/" + treatment
+        intent = egress + "/" + str( sorted( ingresses ) ) + "/" + \
+            selector + "/" + treatment
         return intent
 
-    def generateExpectedOnePeerRouteIntents(
-            self,
-            prefixes,
-            nextHop,
-            nextHopMac,
-            sdnipJsonFilePath ):
+    def generateExpectedOnePeerRouteIntents( self, prefixes, nextHop,
+                                             nextHopMac, sdnipJsonFilePath ):
         intents = []
         sdnipJsonFile = open( sdnipJsonFilePath ).read()
 
@@ -185,10 +169,7 @@
         for prefix in prefixes:
             intents.append(
                 self.generateExpectedSingleRouteIntent(
-                    prefix,
-                    nextHop,
-                    nextHopMac,
-                    sdnipData ) )
+                    prefix, nextHop, nextHopMac, sdnipData ) )
         return sorted( intents )
 
     # TODO
@@ -220,14 +201,15 @@
         for intent in intentsJsonObj:
             if intent[ 'appId' ] != "org.onosproject.sdnip":
                 continue
-            if intent[ 'type' ] == "MultiPointToSinglePointIntent" and intent[
-                    'state' ] == 'INSTALLED':
-                egress = str( intent[ 'egress' ][ 'device' ] ) + ":" + str(
-                    intent[ 'egress' ][ 'port' ] )
+            if intent[ 'type' ] == "MultiPointToSinglePointIntent" \
+            and intent[ 'state' ] == 'INSTALLED':
+                egress = str( intent[ 'egress' ][ 'device' ] ) + ":" \
+                    + str( intent[ 'egress' ][ 'port' ] )
                 ingress = []
                 for attachmentPoint in intent[ 'ingress' ]:
-                    ingress.append( str( attachmentPoint[ 'device' ] ) +
-                            ":" + str( attachmentPoint[ 'port' ] ) )
+                    ingress.append(
+                        str( attachmentPoint[ 'device' ] ) + ":"
+                        + str( attachmentPoint[ 'port' ] ) )
 
                 selector = intent[ 'selector' ].replace(
                     "[", "" ).replace( "]", "" ).replace( " ", "" )
@@ -235,8 +217,7 @@
                     str1, str2 = str( selector ).split( "," )
                     selector = str2 + "," + str1
 
-                intent = egress + "/" + \
-                    str( sorted( ingress ) ) + "/" + \
+                intent = egress + "/" + str( sorted( ingress ) ) + "/" + \
                     selector + "/" + intent[ 'treatment' ]
                 intents.append( intent )
         return sorted( intents )
@@ -251,22 +232,16 @@
         for intent in intentsJsonObj:
             if intent[ 'appId' ] != "org.onosproject.sdnip":
                 continue
-            if intent[ 'type' ] == "PointToPointIntent" and "protocol=6"\
-                    in str(  intent[ 'selector' ] ):
-                ingress = str( intent[ 'ingress' ][ 'device' ] ) + ":" + str(
-                    intent[ 'ingress' ][ 'port' ] )
-                egress = str( intent[ 'egress' ][ 'device' ] ) + ":" + str(
-                    intent[ 'egress' ][ 'port' ] )
-                selector = str(
-                    intent[ 'selector' ] ).replace(
-                    " ",
-                    "" ).replace(
-                    "[",
-                    "" ).replace(
-                    "]",
-                    "" ).split( "," )
-                intent = ingress + "/" + egress + \
-                    "/" + str( sorted( selector ) )
+            if intent[ 'type' ] == "PointToPointIntent" \
+            and "protocol=6" in str( intent[ 'selector' ] ):
+                ingress = str( intent[ 'ingress' ][ 'device' ] ) + ":" \
+                    + str( intent[ 'ingress' ][ 'port' ] )
+                egress = str( intent[ 'egress' ][ 'device' ] ) + ":" + \
+                    str( intent[ 'egress' ][ 'port' ] )
+                selector = str( intent[ 'selector' ] ).replace( " ", "" )\
+                    .replace( "[", "" ).replace( "]", "" ).split( "," )
+                intent = ingress + "/" + egress + "/" + \
+                    str( sorted( selector ) )
                 intents.append( intent )
 
         return sorted( intents )
@@ -282,73 +257,72 @@
         intents = []
         bgpPeerAttachmentPoint = ""
         bgpSpeakerAttachmentPoint = "of:" + str(
-            sdnipData[ 'bgpSpeakers' ][ 0 ][ 'attachmentDpid' ] ).replace( ":",
-             "" ) + ":" +\
-                     str( sdnipData[ 'bgpSpeakers' ][ 0 ][ 'attachmentPort' ] )
+            sdnipData[ 'bgpSpeakers' ][ 0 ][ 'attachmentDpid' ] )\
+            .replace( ":", "" ) + ":" \
+            + str( sdnipData[ 'bgpSpeakers' ][ 0 ][ 'attachmentPort' ] )
         for peer in sdnipData[ 'bgpPeers' ]:
-            bgpPeerAttachmentPoint = "of:" + \
-                str( peer[ 'attachmentDpid' ] ).replace( ":", "" ) +\
-                ":" + str( peer[ 'attachmentPort' ] )
+            bgpPeerAttachmentPoint = "of:" \
+                + str( peer[ 'attachmentDpid' ] ).replace( ":", "" ) \
+                + ":" + str( peer[ 'attachmentPort' ] )
             # find out the BGP speaker IP address for this BGP peer
             bgpSpeakerIpAddress = ""
-            for interfaceAddress in sdnipData[
-                    'bgpSpeakers' ][ 0 ][ 'interfaceAddresses' ]:
+            for interfaceAddress in \
+            sdnipData[ 'bgpSpeakers' ][ 0 ][ 'interfaceAddresses' ]:
                 # if eq( interfaceAddress[ 'interfaceDpid' ],sdnipData[
                 # 'bgpSpeakers' ][ 0 ][ 'attachmentDpid' ] ) and eq(
-                # interfaceAddress[ 'interfacePort' ], sdnipData[
-                # 'bgpSpeakers' ][ 0 ][ 'attachmentPort' ] ):
-                if eq(
-                        interfaceAddress[ 'interfaceDpid' ],
-                        peer[ 'attachmentDpid' ] ) and eq(
-                        interfaceAddress[ 'interfacePort' ],
+                # interfaceAddress[ 'interfacePort' ], sdnipData[ 'bgpSpeakers'
+                # ][ 0 ][ 'attachmentPort' ] ):
+                if eq( interfaceAddress[ 'interfaceDpid' ],
+                       peer[ 'attachmentDpid' ] ) \
+                and eq( interfaceAddress[ 'interfacePort' ],
                         peer[ 'attachmentPort' ] ):
-                    bgpSpeakerIpAddress = interfaceAddress[ 'ip_address' ]
+                    bgpSpeakerIpAddress = interfaceAddress[ 'ipAddress' ]
                     break
                 else:
                     continue
 
             # from bgpSpeakerAttachmentPoint to bgpPeerAttachmentPoint
             # direction
-            selectorStr = "IPV4_SRC{ip=" + bgpSpeakerIpAddress +\
-                    "/32}," + "IPV4_DST{ip=" + peer[ 'ip_address' ] + "/32}," +\
-                        "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800},\
-                        TCP_DST{tcpPort=179}"
-            selector = selectorStr.replace( " ", "" ).replace(
-                "[", "" ).replace( "]", "" ).split( "," )
+            selectorStr = "IPV4_SRC{ip=" + bgpSpeakerIpAddress + "/32}," \
+                + "IPV4_DST{ip=" + peer[ 'ipAddress' ] + "/32}," \
+                + "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, \
+                TCP_DST{tcpPort=179}"
+            selector = selectorStr.replace( " ", "" ).replace("[", "" )\
+                .replace( "]", "" ).split( "," )
             intent = bgpSpeakerAttachmentPoint + "/" + \
                 bgpPeerAttachmentPoint + "/" + str( sorted( selector ) )
             intents.append( intent )
 
-            selectorStr = "IPV4_SRC{ip=" + bgpSpeakerIpAddress + "/32}," +\
-                    "IPV4_DST{ip=" + peer[ 'ip_address' ] + "/32}," +\
-                    "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800},\
-                    TCP_SRC{tcpPort=179}"
-            selector = selectorStr.replace( " ", "" ).replace(
-                "[", "" ).replace( "]", "" ).split( "," )
-            intent = bgpSpeakerAttachmentPoint + "/" + \
-                bgpPeerAttachmentPoint + "/" + str( sorted( selector ) )
+            selectorStr = "IPV4_SRC{ip=" + bgpSpeakerIpAddress + "/32}," \
+                + "IPV4_DST{ip=" + peer[ 'ipAddress' ] + "/32}," \
+                + "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, \
+                TCP_SRC{tcpPort=179}"
+            selector = selectorStr.replace( " ", "" ).replace("[", "" )\
+                .replace( "]", "" ).split( "," )
+            intent = bgpSpeakerAttachmentPoint + "/" \
+                + bgpPeerAttachmentPoint + "/" + str( sorted( selector ) )
             intents.append( intent )
 
             # from bgpPeerAttachmentPoint to bgpSpeakerAttachmentPoint
             # direction
-            selectorStr = "IPV4_SRC{ip=" + peer[ 'ip_address' ] + "/32}," +\
-                    "IPV4_DST{ip=" + bgpSpeakerIpAddress + "/32}," + \
-                    "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800},\
-                    TCP_DST{tcpPort=179}"
-            selector = selectorStr.replace( " ", "" ).replace(
-                "[", "" ).replace( "]", "" ).split( "," )
-            intent = bgpPeerAttachmentPoint + "/" + \
-                bgpSpeakerAttachmentPoint + "/" + str( sorted( selector ) )
+            selectorStr = "IPV4_SRC{ip=" + peer[ 'ipAddress' ] + "/32}," \
+                + "IPV4_DST{ip=" + bgpSpeakerIpAddress + "/32}," \
+                + "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, \
+                TCP_DST{tcpPort=179}"
+            selector = selectorStr.replace( " ", "" ).replace("[", "" )\
+                .replace( "]", "" ).split( "," )
+            intent = bgpPeerAttachmentPoint + "/" \
+                + bgpSpeakerAttachmentPoint + "/" + str( sorted( selector ) )
             intents.append( intent )
 
-            selectorStr = "IPV4_SRC{ip=" + peer[ 'ip_address' ] + "/32}," +\
-                    "IPV4_DST{ip=" + bgpSpeakerIpAddress + "/32}," +\
-                    "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800},\
-                     TCP_SRC{tcpPort=179}"
-            selector = selectorStr.replace( " ", "" ).replace(
-                "[", "" ).replace( "]", "" ).split( "," )
-            intent = bgpPeerAttachmentPoint + "/" + \
-                bgpSpeakerAttachmentPoint + "/" + str( sorted( selector ) )
+            selectorStr = "IPV4_SRC{ip=" + peer[ 'ipAddress' ] + "/32}," \
+                + "IPV4_DST{ip=" + bgpSpeakerIpAddress + "/32}," \
+                + "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, \
+                TCP_SRC{tcpPort=179}"
+            selector = selectorStr.replace( " ", "" ).replace( "[", "" )\
+                .replace( "]", "" ).split( "," )
+            intent = bgpPeerAttachmentPoint + "/" \
+                + bgpSpeakerAttachmentPoint + "/" + str( sorted( selector ) )
             intents.append( intent )
 
         return sorted( intents )
@@ -374,8 +348,8 @@
             except:
                 main.log.warn( "Failed to add route" )
                 self.disconnect()
-            waitTimer = 1.00 / routeRate
-            time.sleep( waitTimer )
+            # waitTimer = 1.00 / routeRate
+            # time.sleep( waitTimer )
         if routesAdded == len( routes ):
             main.log.info( "Finished adding routes" )
             return main.TRUE
@@ -400,10 +374,10 @@
                 self.handle.sendline( routeCmd )
                 self.handle.expect( "bgpd", timeout=5 )
             except:
-                main.log.warn( "Failed to add route" )
+                main.log.warn( "Failed to delete route" )
                 self.disconnect()
-            waitTimer = 1.00 / routeRate
-            time.sleep( waitTimer )
+            # waitTimer = 1.00 / routeRate
+            # time.sleep( waitTimer )
         if routesAdded == len( routes ):
             main.log.info( "Finished deleting routes" )
             return main.TRUE
@@ -416,24 +390,15 @@
         self.handle = super( QuaggaCliDriver, self ).connect(
             user_name=self.user_name, ip_address=ip_address,
             port=self.port, pwd=self.pwd )
-        main.log.info( "connect parameters:" +
-                       str( self.user_name ) +
-                       ";" +
-                       str( self.ip_address ) +
-                       ";" +
-                       str( self.port ) +
-                       ";" +
-                       str( self.pwd ) )
+        main.log.info( "connect parameters:" + str( self.user_name ) + ";"
+                       + str( self.ip_address ) + ";" + str( self.port )
+                       + ";" + str( self.pwd ) )
 
         if self.handle:
             # self.handle.expect( "" )
             # self.handle.expect( "\$" )
             main.log.info( "I in host " + str( ip_address ) )
-            main.log.info(
-                pingTestFile +
-                " > " +
-                pingTestResultFile +
-                " &" )
+            main.log.info( pingTestFile + " > " + pingTestResultFile + " &" )
             self.handle.sendline(
                 pingTestFile +
                 " > " +
@@ -447,7 +412,7 @@
             main.log.info( "NO HANDLE" )
             return main.FALSE
 
-    # Please use the generateRoutes plus addRoutes instead of this one
+    # Please use the generateRoutes plus addRoutes instead of this one!
     def addRoute( self, net, numRoutes, routeRate ):
         try:
             self.handle.sendline( "" )
@@ -467,8 +432,8 @@
             numRoutes = 255
         for m in range( 1, j + 1 ):
             for n in range( 1, numRoutes + 1 ):
-                network = str( net ) + "." + str( m ) + \
-                              "." + str( n ) + ".0/24"
+                network = str( net ) + "." + str( m ) + "." + str( n ) \
+                    + ".0/24"
                 routeCmd = "network " + network
                 try:
                     self.handle.sendline( routeCmd )
@@ -481,10 +446,8 @@
                 routesAdded = routesAdded + 1
         for d in range( j + 1, j + 2 ):
             for e in range( 1, k + 1 ):
-                network = str(
-                    net ) + "." + str(
-                        d ) + "." + str(
-                            e ) + ".0/24"
+                network = str( net ) + "." + str( d ) + "." + str( e ) \
+                    + ".0/24"
                 routeCmd = "network " + network
                 try:
                     self.handle.sendline( routeCmd )
@@ -498,7 +461,8 @@
         if routesAdded == numRoutes:
             return main.TRUE
         return main.FALSE
-
+    
+    # Please use deleteRoutes method instead of this one!
     def delRoute( self, net, numRoutes, routeRate ):
         try:
             self.handle.sendline( "" )
@@ -518,8 +482,8 @@
             numRoutes = 255
         for m in range( 1, j + 1 ):
             for n in range( 1, numRoutes + 1 ):
-                network = str( net ) + "." + str( m ) + \
-                              "." + str( n ) + ".0/24"
+                network = str( net ) + "." + str( m ) + "." + str( n ) \
+                    + ".0/24"
                 routeCmd = "no network " + network
                 try:
                     self.handle.sendline( routeCmd )
@@ -532,8 +496,8 @@
                 routesDeleted = routesDeleted + 1
         for d in range( j + 1, j + 2 ):
             for e in range( 1, k + 1 ):
-                network = str( net ) + "." + str( d ) + \
-                              "." + str( e ) + ".0/24"
+                network = str( net ) + "." + str( d ) + "." + str( e ) \
+                    + ".0/24"
                 routeCmd = "no network " + network
                 try:
                     self.handle.sendline( routeCmd )
@@ -554,7 +518,7 @@
             child = pexpect.spawn( "telnet " + ip )
             i = child.expect( [ "login:", "CLI#", pexpect.TIMEOUT ] )
             if i == 0:
-                print "Username and password required. Passing login info."
+                print "user_name and password required. Passing login info."
                 child.sendline( user )
                 child.expect( "Password:" )
                 child.sendline( passwd )
@@ -570,10 +534,8 @@
             child.expect( "Flow table show" )
             count = 0
             while True:
-                i = child.expect(
-                    [ '17\d\.\d{1,3}\.\d{1,3}\.\d{1,3}',
-                      'CLI#',
-                      pexpect.TIMEOUT ] )
+                i = child.expect( [ '17\d\.\d{1,3}\.\d{1,3}\.\d{1,3}', 
+                                   'CLI#', pexpect.TIMEOUT ] )
                 if i == 0:
                     count = count + 1
                 elif i == 1:
@@ -620,3 +582,4 @@
             main.log.error( "Connection failed to the host" )
             response = main.FALSE
         return response
+
diff --git a/TestON/drivers/common/clidriver.py b/TestON/drivers/common/clidriver.py
index 6d7fb2a..1b8998b 100644
--- a/TestON/drivers/common/clidriver.py
+++ b/TestON/drivers/common/clidriver.py
@@ -81,7 +81,7 @@
         while i == 5:
             i = self.handle.expect( [
 				    ssh_newkey,
-                                    'password:',
+                                    'password:|\$',
                                     pexpect.EOF,
                                     pexpect.TIMEOUT,
                                     refused,
diff --git a/TestON/tests/SdnIpTest/SdnIpTest.params b/TestON/tests/SdnIpTest/SdnIpTest.params
index bb5826d..7f7ef2d 100755
--- a/TestON/tests/SdnIpTest/SdnIpTest.params
+++ b/TestON/tests/SdnIpTest/SdnIpTest.params
@@ -1,6 +1,6 @@
 <PARAMS>
     
-    <testcases>1,2</testcases>
+    <testcases>4</testcases>
 
     #Environment variables
     <ENV>
diff --git a/TestON/tests/SdnIpTest/SdnIpTest.py b/TestON/tests/SdnIpTest/SdnIpTest.py
index 53560f3..85ac21e 100644
--- a/TestON/tests/SdnIpTest/SdnIpTest.py
+++ b/TestON/tests/SdnIpTest/SdnIpTest.py
@@ -8,16 +8,26 @@
     def __init__( self ):
         self.default = ''
 
-    def CASE1( self, main ):
+# from cupshelpers.config import prefix
+
+# Testing the basic functionality of SDN-IP
+
+
+class SdnIpTest:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE4( self, main ):
         """
         Test the SDN-IP functionality
         allRoutesExpected: all expected routes for all BGP peers
-        routeIntentsExpected: all expected
-        MultiPointToSinglePointIntent intents
+        routeIntentsExpected: all expected MultiPointToSinglePointIntent \
+        intents
         bgpIntentsExpected: expected PointToPointIntent intents
         allRoutesActual: all routes from ONOS LCI
-        routeIntentsActual: actual MultiPointToSinglePointIntent
-        intents from ONOS CLI
+        routeIntentsActual: actual MultiPointToSinglePointIntent intents from \
+        ONOS CLI
         bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
         """
         import time
@@ -26,9 +36,594 @@
         # from datetime import datetime
         from time import localtime, strftime
 
-        main.case(
-            "The test case is to help to setup the TestON " +
-            "environment and test new drivers" )
+        main.case("The test case is to help to setup the TestON environment \
+            and test new drivers" )
+        # SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
+        SDNIPJSONFILEPATH = \
+            "/home/admin/workspace/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 )
+        # generate route with next hop
+        for prefix in prefixesHost3:
+            allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
+        routeIntentsExpectedHost3 = \
+            main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
+            prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
+            SDNIPJSONFILEPATH )
+
+        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" )
+        routeIntentsExpectedHost4 = \
+            main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
+            prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
+            SDNIPJSONFILEPATH )
+
+        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" )
+        routeIntentsExpectedHost5 = \
+            main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
+            prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
+            SDNIPJSONFILEPATH )
+
+        routeIntentsExpected = routeIntentsExpectedHost3 + \
+            routeIntentsExpectedHost4 + routeIntentsExpectedHost5
+
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+        main.step( "Set cell for ONOS-cli environment" )
+        main.ONOScli.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
+
+        main.log.report( "Removing raft logs" )
+        main.ONOSbench.onosRemoveRaftLogs()
+        main.log.report( "Uninstalling ONOS" )
+        main.ONOSbench.onosUninstall( ONOS1Ip )
+
+        main.step( "Installing ONOS package" )
+        onos1InstallResult = main.ONOSbench.onosInstall(
+            options="-f", node=ONOS1Ip )
+
+        main.step( "Checking if ONOS is up yet" )
+        time.sleep( 150 )
+        onos1Isup = main.ONOSbench.isup( ONOS1Ip )
+        if not onos1Isup:
+            main.log.report( "ONOS1 didn't start!" )
+
+        main.step( "Start ONOS-cli" )
+
+        main.ONOScli.startOnosCli( ONOS1Ip )
+
+        main.step( "Get devices in the network" )
+        listResult = main.ONOScli.devices( jsonFormat=False )
+        main.log.info( listResult )
+        time.sleep( 10 )
+        main.log.info( "Installing sdn-ip feature" )
+        main.ONOScli.featureInstall( "onos-app-sdnip" )
+        time.sleep( 10 )
+        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 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 )
+
+        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 ) )
+
+            routeIntentsExpectedHostX = \
+            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 )
+
+        time.sleep( 60 )
+
+        # get routes inside SDN-IP
+        getRoutesResult = main.ONOScli.routes( jsonFormat=True )
+
+        # parse routes from ONOS CLI
+        allRoutesActual = \
+            main.QuaggaCliHost3.extractActualRoutes( 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!***" )
+        if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
+            main.log.report(
+                "***Routes in SDN-IP after adding routes are correct!***" )
+        else:
+            main.log.report(
+                "***Routes in SDN-IP after adding routes are wrong!***" )
+
+        time.sleep( 20 )
+        getIntentsResult = main.ONOScli.intents( jsonFormat=True )
+
+        main.step( "Check MultiPointToSinglePointIntent intents installed" )
+        # routeIntentsExpected are generated when generating routes
+        # get rpoute intents from ONOS CLI
+        routeIntentsActual = \
+            main.QuaggaCliHost3.extractActualRouteIntents(
+                getIntentsResult )
+        routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
+        routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
+        main.log.info( "MultiPointToSinglePoint intents expected:" )
+        main.log.info( routeIntentsStrExpected )
+        main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
+        main.log.info( routeIntentsStrActual )
+        utilities.assertEquals(
+            expect=True,
+            actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
+            onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
+            correct!***",
+            onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
+            wrong!***" )
+
+        if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
+            main.log.report( "***MultiPointToSinglePoint Intents before \
+            deleting routes correct!***" )
+        else:
+            main.log.report( "***MultiPointToSinglePoint Intents before \
+            deleting routes wrong!***" )
+
+        main.step( "Check BGP PointToPointIntent intents installed" )
+        # bgp intents expected
+        bgpIntentsExpected = \
+            main.QuaggaCliHost3.generateExpectedBgpIntents( SDNIPJSONFILEPATH )
+        # get BGP intents from ONOS CLI
+        bgpIntentsActual = \
+            main.QuaggaCliHost3.extractActualBgpIntents( getIntentsResult )
+
+        bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
+        bgpIntentsStrActual = str( bgpIntentsActual )
+        main.log.info( "PointToPointIntent intents expected:" )
+        main.log.info( bgpIntentsStrExpected )
+        main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
+        main.log.info( bgpIntentsStrActual )
+
+        utilities.assertEquals(
+            expect=True,
+            actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
+            onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
+            onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
+
+        if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
+            main.log.report(
+                "***PointToPointIntent Intents in SDN-IP are correct!***" )
+        else:
+            main.log.report(
+                "***PointToPointIntent Intents in SDN-IP are wrong!***" )
+
+        #============================= Ping Test ========================
+        # wait until all MultiPointToSinglePoint
+        time.sleep( 20 )
+        pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
+        pingTestResultsFile = \
+        "~/SDNIP/SdnIpIntentDemo/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 )
+        time.sleep( 20 )
+
+        #============================= Deleting Routes ==================
+        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 )
+
+        getRoutesResult = main.ONOScli.routes( jsonFormat=True )
+        allRoutesActual = \
+            main.QuaggaCliHost3.extractActualRoutes( 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!***" )
+
+        if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
+            main.log.report( "***Routes in SDN-IP after deleting correct!***" )
+        else:
+            main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
+
+        main.step( "Check intents after deleting routes" )
+        getIntentsResult = main.ONOScli.intents( jsonFormat=True )
+        routeIntentsActual = \
+            main.QuaggaCliHost3.extractActualRouteIntents(
+                getIntentsResult )
+        main.log.info( "main.ONOScli.intents()= " )
+        main.log.info( routeIntentsActual )
+        utilities.assertEquals(
+            expect="[]", actual=str( routeIntentsActual ),
+            onpass="***MultiPointToSinglePoint Intents number in SDN-IP is 0, \
+            correct!***",
+            onfail="***MultiPointToSinglePoint Intents number in SDN-IP is 0, \
+            wrong!***" )
+
+        if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
+            main.log.report( "***MultiPointToSinglePoint Intents after \
+            deleting routes correct!***" )
+        else:
+            main.log.report( "***MultiPointToSinglePoint Intents after \
+            deleting routes wrong!***" )
+
+        time.sleep( 20 )
+        pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
+        pingTestResultsFile = \
+        "~/SDNIP/SdnIpIntentDemo/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 )
+        time.sleep( 100 )
+
+        # main.step( "Test whether Mininet is started" )
+        # main.Mininet2.handle.sendline( "xterm host1" )
+        # main.Mininet2.handle.expect( "mininet>" )
+
+    def CASE3( self, main ):
+        """
+        Test the SDN-IP functionality
+        allRoutesExpected: all expected routes for all BGP peers
+        routeIntentsExpected: all expected MultiPointToSinglePointIntent intents
+        bgpIntentsExpected: expected PointToPointIntent intents
+        allRoutesActual: all routes from ONOS LCI
+        routeIntentsActual: actual MultiPointToSinglePointIntent intents from \
+        ONOS CLI
+        bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
+        """
+        import time
+        import json
+        from operator import eq
+        # from datetime import datetime
+        from time import localtime, strftime
+
+        main.case( "The test case is to help to setup the TestON \
+            environment and test new drivers" )
+        # SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
+        SDNIPJSONFILEPATH = \
+            "/home/admin/workspace/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 )
+        # generate route with next hop
+        for prefix in prefixesHost3:
+            allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
+        routeIntentsExpectedHost3 = \
+            main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
+            prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
+            SDNIPJSONFILEPATH )
+
+        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" )
+        routeIntentsExpectedHost4 = \
+            main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
+            prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
+            SDNIPJSONFILEPATH )
+
+        routeIntentsExpected = routeIntentsExpectedHost3 + \
+            routeIntentsExpectedHost4
+
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+        main.step( "Set cell for ONOS-cli environment" )
+        main.ONOScli.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
+
+        main.log.report( "Removing raft logs" )
+        main.ONOSbench.onosRemoveRaftLogs()
+        main.log.report( "Uninstalling ONOS" )
+        main.ONOSbench.onosUninstall( ONOS1Ip )
+
+        main.step( "Installing ONOS package" )
+        onos1InstallResult = main.ONOSbench.onosInstall(
+            options="-f", node=ONOS1Ip )
+
+        main.step( "Checking if ONOS is up yet" )
+        time.sleep( 60 )
+        onos1Isup = main.ONOSbench.isup( ONOS1Ip )
+        if not onos1Isup:
+            main.log.report( "ONOS1 didn't start!" )
+
+        main.step( "Start ONOS-cli" )
+
+        main.ONOScli.startOnosCli( ONOS1Ip )
+
+        main.step( "Get devices in the network" )
+        listResult = main.ONOScli.devices( jsonFormat=False )
+        main.log.info( listResult )
+        time.sleep( 10 )
+        main.log.info( "Installing sdn-ip feature" )
+        main.ONOScli.featureInstall( "onos-app-sdnip" )
+        time.sleep( 10 )
+        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 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 )
+
+        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 ) )
+
+            routeIntentsExpectedHostX = \
+                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 )
+
+        time.sleep( 60 )
+
+        # get routes inside SDN-IP
+        getRoutesResult = main.ONOScli.routes( jsonFormat=True )
+
+        # parse routes from ONOS CLI
+        allRoutesActual = \
+            main.QuaggaCliHost3.extractActualRoutes( 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!***" )
+        if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
+            main.log.report(
+                "***Routes in SDN-IP after adding routes are correct!***" )
+        else:
+            main.log.report(
+                "***Routes in SDN-IP after adding routes are wrong!***" )
+
+        time.sleep( 20 )
+        getIntentsResult = main.ONOScli.intents( jsonFormat=True )
+
+        main.step( "Check MultiPointToSinglePointIntent intents installed" )
+        # routeIntentsExpected are generated when generating routes
+        # get rpoute intents from ONOS CLI
+        routeIntentsActual = \
+            main.QuaggaCliHost3.extractActualRouteIntents(
+                getIntentsResult )
+        routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
+        routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
+        main.log.info( "MultiPointToSinglePoint intents expected:" )
+        main.log.info( routeIntentsStrExpected )
+        main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
+        main.log.info( routeIntentsStrActual )
+        utilities.assertEquals(
+            expect=True,
+            actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
+            onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
+            correct!***",
+            onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
+            wrong!***" )
+
+        if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
+            main.log.report(
+                "***MultiPointToSinglePoint Intents before deleting routes \
+                correct!***" )
+        else:
+            main.log.report(
+                "***MultiPointToSinglePoint Intents before deleting routes \
+                wrong!***" )
+
+        main.step( "Check BGP PointToPointIntent intents installed" )
+        # bgp intents expected
+        bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
+            SDNIPJSONFILEPATH )
+        # get BGP intents from ONOS CLI
+        bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
+            getIntentsResult )
+
+        bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
+        bgpIntentsStrActual = str( bgpIntentsActual )
+        main.log.info( "PointToPointIntent intents expected:" )
+        main.log.info( bgpIntentsStrExpected )
+        main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
+        main.log.info( bgpIntentsStrActual )
+
+        utilities.assertEquals(
+            expect=True,
+            actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
+            onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
+            onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
+
+        if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
+            main.log.report(
+                "***PointToPointIntent Intents in SDN-IP are correct!***" )
+        else:
+            main.log.report(
+                "***PointToPointIntent Intents in SDN-IP are wrong!***" )
+
+        #============================= Ping Test ========================
+        # wait until all MultiPointToSinglePoint
+        time.sleep( 20 )
+        pingTestScript = "~/SDNIP/test-tools/CASE3-ping-as2host.sh"
+        pingTestResultsFile = \
+        "~/SDNIP/SdnIpIntentDemo/log/CASE3-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 )
+        time.sleep( 20 )
+
+        #============================= Deleting Routes ==================
+        main.step( "Check deleting routes installed" )
+        main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
+        main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 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 )
+
+        getRoutesResult = main.ONOScli.routes( jsonFormat=True )
+        allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
+            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!***" )
+
+        if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
+            main.log.report(
+                "***Routes in SDN-IP after deleting correct!***" )
+        else:
+            main.log.report(
+                "***Routes in SDN-IP after deleting wrong!***" )
+
+        main.step( "Check intents after deleting routes" )
+        getIntentsResult = main.ONOScli.intents( jsonFormat=True )
+        routeIntentsActual = \
+            main.QuaggaCliHost3.extractActualRouteIntents(
+                getIntentsResult )
+        main.log.info( "main.ONOScli.intents()= " )
+        main.log.info( routeIntentsActual )
+        utilities.assertEquals(
+            expect="[]", actual=str( routeIntentsActual ),
+            onpass="***MultiPointToSinglePoint Intents number in SDN-IP is \
+            0, correct!***",
+            onfail="***MultiPointToSinglePoint Intents number in SDN-IP is \
+            0, wrong!***" )
+
+        if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
+            main.log.report(
+                "***MultiPointToSinglePoint Intents after deleting routes \
+                correct!***" )
+        else:
+            main.log.report(
+                "***MultiPointToSinglePoint Intents after deleting routes \
+                wrong!***" )
+
+        time.sleep( 20 )
+        pingTestScript = "~/SDNIP/test-tools/CASE3-ping-as2host.sh"
+        pingTestResultsFile = \
+        "~/SDNIP/SdnIpIntentDemo/log/CASE3-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 )
+        time.sleep( 100 )
+
+        # main.step( "Test whether Mininet is started" )
+        # main.Mininet2.handle.sendline( "xterm host1" )
+        # main.Mininet2.handle.expect( "mininet>" )
+
+    def CASE1( self, main ):
+        """
+        Test the SDN-IP functionality
+        allRoutesExpected: all expected routes for all BGP peers
+        routeIntentsExpected: all expected MultiPointToSinglePointIntent \
+        intents
+        bgpIntentsExpected: expected PointToPointIntent intents
+        allRoutesActual: all routes from ONOS LCI
+        routeIntentsActual: actual MultiPointToSinglePointIntent intents \
+        from ONOS CLI
+        bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
+        """
+        import time
+        import json
+        from operator import eq
+        # from datetime import datetime
+        from time import localtime, strftime
+
+        main.case("The test case is to help to setup the TestON environment \
+            and test new drivers" )
         SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
         # all expected routes for all BGP peers
         allRoutesExpected = []
@@ -39,22 +634,21 @@
         # main.log.info( "BGP Peer Hosts are:" + bgpPeerHosts )
 
         # for i in range( 3, 5 ):
-        #   QuaggaCliHost = "QuaggaCliHost" + str( i )
-        #  prefixes = main.QuaggaCliHost.generatePrefixes( 3, 10 )
+         #   QuaggaCliHost = "QuaggaCliHost" + str( i )
+          #  prefixes = main.QuaggaCliHost.generatePrefixes( 3, 10 )
 
-        # main.log.info( prefixes )
-        # allRoutesExpected.append( prefixes )
+           # main.log.info( prefixes )
+            # allRoutesExpected.append( prefixes )
         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" )
-        routeIntentsExpectedHost3 = main.QuaggaCliHost3.\
-                generateExpectedOnePeerRouteIntents( prefixesHost3,
-                                                     "192.168.20.1",
-                                                     "00:00:00:00:02:02",
-                                                     SDNIPJSONFILEPATH )
+        routeIntentsExpectedHost3 = \
+            main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
+            prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
+            SDNIPJSONFILEPATH )
 
         main.log.info( "Generate prefixes for host4" )
         prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
@@ -62,11 +656,10 @@
         # generate route with next hop
         for prefix in prefixesHost4:
             allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
-        routeIntentsExpectedHost4 = main.QuaggaCliHost4.\
-                generateExpectedOnePeerRouteIntents( prefixesHost4,
-                                                     "192.168.30.1",
-                                                     "00:00:00:00:03:01",
-                                                     SDNIPJSONFILEPATH )
+        routeIntentsExpectedHost4 = \
+            main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
+            prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
+            SDNIPJSONFILEPATH )
 
         routeIntentsExpected = routeIntentsExpectedHost3 + \
             routeIntentsExpectedHost4
@@ -88,8 +681,7 @@
         # startResult = main.ONOSbench.onosStart( "127.0.0.1" )
         main.step( "Installing ONOS package" )
         onos1InstallResult = main.ONOSbench.onosInstall(
-            options="-f",
-            node=ONOS1Ip )
+            options="-f", node=ONOS1Ip )
 
         main.step( "Checking if ONOS is up yet" )
         time.sleep( 60 )
@@ -129,8 +721,8 @@
         getRoutesResult = main.ONOScli.routes( jsonFormat=True )
 
         # parse routes from ONOS CLI
-        allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
-            getRoutesResult )
+        allRoutesActual = \
+            main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
 
         allRoutesStrExpected = str( sorted( allRoutesExpected ) )
         allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
@@ -140,8 +732,7 @@
         main.log.info( "Routes get from ONOS CLI:" )
         main.log.info( allRoutesStrActual )
         utilities.assertEquals(
-            expect=allRoutesStrExpected,
-            actual=allRoutesStrActual,
+            expect=allRoutesStrExpected, actual=allRoutesStrActual,
             onpass="***Routes in SDN-IP are correct!***",
             onfail="***Routes in SDN-IP are wrong!***" )
         if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
@@ -157,8 +748,9 @@
         main.step( "Check MultiPointToSinglePointIntent intents installed" )
         # routeIntentsExpected are generated when generating routes
         # get rpoute intents from ONOS CLI
-        routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
-            getIntentsResult )
+        routeIntentsActual = \
+            main.QuaggaCliHost3.extractActualRouteIntents(
+                getIntentsResult )
         routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
         routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
         main.log.info( "MultiPointToSinglePoint intents expected:" )
@@ -167,27 +759,25 @@
         main.log.info( routeIntentsStrActual )
         utilities.assertEquals(
             expect=True,
-            actual=eq(
-                routeIntentsStrExpected,
-                routeIntentsStrActual ),
-            onpass= "***MultiPointToSinglePoint " +
-                    "Intents in SDN-IP are correct!***",
-            onfail= "***MultiPointToSinglePoint Intents" +
-                    " in SDN-IP are wrong!***" )
+            actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
+            onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
+            correct!***",
+            onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
+            wrong!***" )
 
         if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
             main.log.report(
-                "***MultiPointToSinglePoint Intents " +
-                "before deleting routes correct!***" )
+                "***MultiPointToSinglePoint Intents before deleting routes \
+                correct!***" )
         else:
             main.log.report(
-                "***MultiPointToSinglePoint Intents" +
-                "before deleting routes wrong!***" )
+                "***MultiPointToSinglePoint Intents before deleting routes \
+                wrong!***" )
 
         main.step( "Check BGP PointToPointIntent intents installed" )
         # bgp intents expected
-        bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
-            SDNIPJSONFILEPATH )
+        bgpIntentsExpected = \
+            main.QuaggaCliHost3.generateExpectedBgpIntents( SDNIPJSONFILEPATH )
         # get BGP intents from ONOS CLI
         bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
             getIntentsResult )
@@ -201,9 +791,7 @@
 
         utilities.assertEquals(
             expect=True,
-            actual=eq(
-                bgpIntentsStrExpected,
-                bgpIntentsStrActual ),
+            actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
             onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
             onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
 
@@ -214,22 +802,20 @@
             main.log.report(
                 "***PointToPointIntent Intents in SDN-IP are wrong!***" )
 
-        # ============================= Ping Test ========================
+        #============================= Ping Test ========================
         # wait until all MultiPointToSinglePoint
         time.sleep( 20 )
         pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
-        pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/" +\
-                "CASE1-ping-results-before-delete-routes-" + \
-                strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
+        pingTestResultsFile = \
+        "~/SDNIP/SdnIpIntentDemo/log/CASE1-ping-results-before-delete-routes-" \
+             + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
         pingTestResults = main.QuaggaCliHost.pingTest(
-            "1.168.30.100",
-            pingTestScript,
-            pingTestResultsFile )
+            "1.168.30.100", pingTestScript, pingTestResultsFile )
         main.log.info( pingTestResults )
 
         # ping test
 
-        # ============================= Deleting Routes ==================
+        #============================= Deleting Routes ==================
         main.step( "Check deleting routes installed" )
         main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
         main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
@@ -239,55 +825,53 @@
         # utilities.assertEquals( expect="Total SDN-IP routes = 1", actual=
         # main.ONOScli.getRoutesNum(),
         getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-        allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
-            getRoutesResult )
+        allRoutesActual = \
+            main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
         main.log.info( "allRoutes_actual = " )
         main.log.info( allRoutesActual )
 
         utilities.assertEquals(
-            expect="[]",
-            actual=str( allRoutesActual ),
+            expect="[]", actual=str( allRoutesActual ),
             onpass="***Route number in SDN-IP is 0, correct!***",
             onfail="***Routes number in SDN-IP is not 0, wrong!***" )
 
         if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
-            main.log.report( "***Routes in SDN-IP after deleting correct!***" )
+            main.log.report(
+                "***Routes in SDN-IP after deleting correct!***" )
         else:
-            main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
+            main.log.report(
+                "***Routes in SDN-IP after deleting wrong!***" )
 
         main.step( "Check intents after deleting routes" )
         getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-        routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
-            getIntentsResult )
+        routeIntentsActual = \
+            main.QuaggaCliHost3.extractActualRouteIntents(
+                getIntentsResult )
         main.log.info( "main.ONOScli.intents()= " )
         main.log.info( routeIntentsActual )
         utilities.assertEquals(
-            expect="[]",
-            actual=str( routeIntentsActual ),
-            onpass="***MultiPointToSinglePoint Intents" +
-            " number in SDN-IP is 0, correct!***",
-            onfail="***MultiPointToSinglePoint Intents " +
-            "number in SDN-IP is 0, wrong!***" )
+            expect="[]", actual=str( routeIntentsActual ),
+            onpass="***MultiPointToSinglePoint Intents number in SDN-IP is \
+            0, correct!***",
+            onfail="***MultiPointToSinglePoint Intents number in SDN-IP is \
+            0, wrong!***" )
 
         if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
             main.log.report(
-                "***MultiPointToSinglePoint Intents" +
-                " after deleting routes correct!***" )
+                "***MultiPointToSinglePoint Intents after deleting routes \
+                correct!***" )
         else:
             main.log.report(
-                "***MultiPointToSinglePoint Intents " +
-                "after deleting routes wrong!***" )
+                "***MultiPointToSinglePoint Intents after deleting routes \
+                wrong!***" )
 
         time.sleep( 20 )
         pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
-        pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/" +\
-                              "CASE1-ping-results-after-delete-routes-" +\
-                              strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) +\
-                              ".txt"
+        pingTestResultsFile = \
+        "~/SDNIP/SdnIpIntentDemo/log/CASE1-ping-results-after-delete-routes-" \
+             + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
         pingTestResults = main.QuaggaCliHost.pingTest(
-            "1.168.30.100",
-            pingTestScript,
-            pingTestResultsFile )
+            "1.168.30.100", pingTestScript, pingTestResultsFile )
         main.log.info( pingTestResults )
         time.sleep( 30 )
 
@@ -299,12 +883,12 @@
         """
         Test the SDN-IP functionality
         allRoutesExpected: all expected routes for all BGP peers
-        routeIntentsExpected: all expected MultiPointToSinglePointIntent
+        routeIntentsExpected: all expected MultiPointToSinglePointIntent \
         intents
         bgpIntentsExpected: expected PointToPointIntent intents
         allRoutesActual: all routes from ONOS LCI
-        routeIntentsActual: actual MultiPointToSinglePointIntent intents from
-        ONOS CLI
+        routeIntentsActual: actual MultiPointToSinglePointIntent intents \
+        from ONOS CLI
         bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
         """
         import time
@@ -313,8 +897,8 @@
         from time import localtime, strftime
 
         main.case(
-            "The test case is to help to setup the " +
-            "TestON environment and test new drivers" )
+            "The test case is to help to setup the TestON environment and \
+            test new drivers" )
         SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
         # all expected routes for all BGP peers
         allRoutesExpected = []
@@ -326,11 +910,10 @@
         # generate route with next hop
         for prefix in prefixesHost3:
             allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
-        routeIntentsExpectedHost3 = main.QuaggaCliHost3.\
-                generateExpectedOnePeerRouteIntents( prefixesHost3,
-                                                     "192.168.20.1",
-                                                     "00:00:00:00:02:02",
-                                                     SDNIPJSONFILEPATH )
+        routeIntentsExpectedHost3 = \
+            main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
+            prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
+            SDNIPJSONFILEPATH )
 
         main.log.info( "Generate prefixes for host4" )
         prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
@@ -338,11 +921,10 @@
         # generate route with next hop
         for prefix in prefixesHost4:
             allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
-        routeIntentsExpectedHost4 = main.QuaggaCliHost4.\
-                generateExpectedOnePeerRouteIntents( prefixesHost4,
-                                                     "192.168.30.1",
-                                                     "00:00:00:00:03:01",
-                                                     SDNIPJSONFILEPATH )
+        routeIntentsExpectedHost4 = \
+            main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
+            prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
+            SDNIPJSONFILEPATH )
 
         routeIntentsExpected = routeIntentsExpectedHost3 + \
             routeIntentsExpectedHost4
@@ -362,15 +944,14 @@
         # main.log.report( "Uninstalling ONOS" )
         # main.ONOSbench.onosUninstall( ONOS1Ip )
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
+        # packageResult = main.ONOSbench.onosPackage()
 
         main.step( "Installing ONOS package" )
-        onos1InstallResult = main.ONOSbench.onosInstall(
-            options="-f",
-            node=ONOS1Ip )
+        # onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
+        # node=ONOS1Ip )
 
         main.step( "Checking if ONOS is up yet" )
-        time.sleep( 60 )
+        # time.sleep( 60 )
         onos1Isup = main.ONOSbench.isup( ONOS1Ip )
         if not onos1Isup:
             main.log.report( "ONOS1 didn't start!" )
@@ -404,9 +985,7 @@
 
         utilities.assertEquals(
             expect=True,
-            actual=eq(
-                bgpIntentsStrExpected,
-                bgpIntentsStrActual ),
+            actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
             onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
             onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
 
@@ -424,22 +1003,22 @@
         # while( True ):
         for roundNum in range( 1, 6 ):
             # round = round + 1;
-            main.log.report(
-                "The Round " +
-                str( roundNum ) +
-                " test starts........................................" )
+            main.log.report( "The Round " + str( roundNum ) +
+                             " test starts................................" )
 
             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.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.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 )
@@ -449,8 +1028,8 @@
             getRoutesResult = main.ONOScli.routes( jsonFormat=True )
 
             # parse routes from ONOS CLI
-            allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
-                getRoutesResult )
+            allRoutesActual = \
+                main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
 
             # allRoutesStrExpected = str( sorted( allRoutesExpected ) )
             allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
@@ -460,15 +1039,15 @@
             main.log.info( "Routes get from ONOS CLI:" )
             main.log.info( allRoutesStrActual )
             utilities.assertEquals(
-                expect=allRoutesStrExpected,
-                actual=allRoutesStrActual,
+                expect=allRoutesStrExpected, actual=allRoutesStrActual,
                 onpass="***Routes in SDN-IP are correct!***",
                 onfail="***Routes in SDN-IP are wrong!***" )
             if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
                 main.log.report(
                     "***Routes in SDN-IP after adding correct!***" )
             else:
-                main.log.report( "***Routes in SDN-IP after adding wrong!***" )
+                main.log.report(
+                    "***Routes in SDN-IP after adding wrong!***" )
 
             time.sleep( 20 )
             getIntentsResult = main.ONOScli.intents( jsonFormat=True )
@@ -477,8 +1056,9 @@
                 "Check MultiPointToSinglePointIntent intents installed" )
             # routeIntentsExpected are generated when generating routes
             # get route intents from ONOS CLI
-            routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
-                getIntentsResult )
+            routeIntentsActual = \
+                main.QuaggaCliHost3.extractActualRouteIntents(
+                    getIntentsResult )
             # routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
             routeIntentsStrActual = str(
                 routeIntentsActual ).replace( 'u', "" )
@@ -489,38 +1069,35 @@
             main.log.info( routeIntentsStrActual )
             utilities.assertEquals(
                 expect=True,
-                actual=eq(
-                    routeIntentsStrExpected,
-                    routeIntentsStrActual ),
-                onpass= "***MultiPointToSinglePoint " +
-                        "Intents in SDN-IP are correct!***",
-                onfail= "***MultiPointToSinglePoint Intents " +
-                        "in SDN-IP are wrong!***" )
+                actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
+                onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
+                correct!***",
+                onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
+                wrong!***" )
 
             if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
                 main.log.report(
-                    "***MultiPointToSinglePoint Intents" +
-                    " after adding routes correct!***" )
+                    "***MultiPointToSinglePoint Intents after adding routes \
+                    correct!***" )
             else:
                 main.log.report(
-                    "***MultiPointToSinglePoint Intents" +
-                    " after adding routes wrong!***" )
+                    "***MultiPointToSinglePoint Intents after adding routes \
+                    wrong!***" )
 
-            # ============================= Ping Test ========================
+            #============================= Ping Test ========================
             # wait until all MultiPointToSinglePoint
             time.sleep( 20 )
             # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
-            pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" + \
-                str( roundNum ) + "-ping-results-before-delete-routes-" +\
-                strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
+            pingTestResultsFile = \
+                "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" \
+                + str( roundNum ) + "-ping-results-before-delete-routes-" \
+                + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
             pingTestResults = main.QuaggaCliHost.pingTest(
-                "1.168.30.100",
-                pingTestScript,
-                pingTestResultsFile )
+                "1.168.30.100", pingTestScript, pingTestResultsFile )
             main.log.info( pingTestResults )
             # ping test
 
-            # ============================= Deleting Routes ==================
+            #============================= Deleting Routes ==================
             main.step( "Check deleting routes installed" )
             main.log.info( "Delete routes to Quagga on host3" )
             main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
@@ -528,14 +1105,13 @@
             main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
 
             getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-            allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
-                getRoutesResult )
+            allRoutesActual = \
+                main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
             main.log.info( "allRoutes_actual = " )
             main.log.info( allRoutesActual )
 
             utilities.assertEquals(
-                expect="[]",
-                actual=str( allRoutesActual ),
+                expect="[]", actual=str( allRoutesActual ),
                 onpass="***Route number in SDN-IP is 0, correct!***",
                 onfail="***Routes number in SDN-IP is not 0, wrong!***" )
 
@@ -548,35 +1124,36 @@
 
             main.step( "Check intents after deleting routes" )
             getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-            routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
-                getIntentsResult )
+            routeIntentsActual = \
+                main.QuaggaCliHost3.extractActualRouteIntents(
+                    getIntentsResult )
             main.log.info( "main.ONOScli.intents()= " )
             main.log.info( routeIntentsActual )
             utilities.assertEquals(
-                expect="[]",
-                actual=str( routeIntentsActual ),
-                onpass="***MultiPointToSinglePoint Intents " +
-                "number in SDN-IP is 0, correct!***",
-                onfail="***MultiPointToSinglePoint Intents " +
-                "number in SDN-IP is 0, wrong!***" )
+                expect="[]", actual=str( routeIntentsActual ),
+                onpass=
+                "***MultiPointToSinglePoint Intents number in SDN-IP \
+                is 0, correct!***",
+                onfail="***MultiPointToSinglePoint Intents number in SDN-IP \
+                is 0, wrong!***" )
 
             if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
                 main.log.report(
-                    "***MultiPointToSinglePoint Intents " +
-                    "after deleting routes correct!***" )
+                    "***MultiPointToSinglePoint Intents after deleting \
+                    routes correct!***" )
             else:
                 main.log.report(
-                    "***MultiPointToSinglePoint Intents " +
-                    "after deleting routes wrong!***" )
+                    "***MultiPointToSinglePoint Intents after deleting \
+                    routes wrong!***" )
 
             time.sleep( 20 )
             # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
-            pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" + \
-                str( roundNum ) + "-ping-results-after-delete-routes-" +\
-                strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
+            pingTestResultsFile = \
+                "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" \
+                + str( roundNum ) + "-ping-results-after-delete-routes-" \
+                + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
             pingTestResults = main.QuaggaCliHost.pingTest(
-                "1.168.30.100",
-                pingTestScript,
-                pingTestResultsFile )
+                "1.168.30.100", pingTestScript, pingTestResultsFile )
             main.log.info( pingTestResults )
             time.sleep( 30 )
+
diff --git a/TestON/tests/SdnIpTest/SdnIpTest.topo b/TestON/tests/SdnIpTest/SdnIpTest.topo
index 6df1975..fe9d1bb 100755
--- a/TestON/tests/SdnIpTest/SdnIpTest.topo
+++ b/TestON/tests/SdnIpTest/SdnIpTest.topo
@@ -33,7 +33,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>QuaggaCliDriver</type>
-            <connect_order>5</connect_order>
+            <connect_order>4</connect_order>
             <COMPONENTS> </COMPONENTS>
         </QuaggaCliHost3>
         <QuaggaCliHost4>
@@ -44,14 +44,827 @@
             <connect_order>5</connect_order>
             <COMPONENTS> </COMPONENTS>
         </QuaggaCliHost4>
+        <QuaggaCliHost5>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost5>
+
         <QuaggaCliHost>
             <host>127.0.0.1</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>QuaggaCliDriver</type>
-            <connect_order>5</connect_order>
+            <connect_order>7</connect_order>
             <COMPONENTS> </COMPONENTS>
         </QuaggaCliHost>
 
+        <QuaggaCliHost101>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>101</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost101>
+        <QuaggaCliHost102>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>102</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost102>
+        <QuaggaCliHost103>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>103</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost103>
+        <QuaggaCliHost104>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>104</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost104>
+        <QuaggaCliHost105>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>105</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost105>
+        <QuaggaCliHost106>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>106</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost106>
+        <QuaggaCliHost107>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>107</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost107>
+        <QuaggaCliHost108>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>108</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost108>
+        <QuaggaCliHost109>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>109</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost109>
+        <QuaggaCliHost110>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>110</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost110>
+        <QuaggaCliHost111>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>111</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost111>
+        <QuaggaCliHost112>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>112</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost112>
+        <QuaggaCliHost113>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>113</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost113>
+        <QuaggaCliHost114>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>114</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost114>
+        <QuaggaCliHost115>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>115</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost115>
+        <QuaggaCliHost116>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>116</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost116>
+        <QuaggaCliHost117>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>117</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost117>
+        <QuaggaCliHost118>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>118</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost118>
+        <QuaggaCliHost119>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>119</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost119>
+        <QuaggaCliHost120>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>120</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost120>
+        <QuaggaCliHost121>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>121</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost121>
+        <QuaggaCliHost122>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>122</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost122>
+        <QuaggaCliHost123>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>123</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost123>
+        <QuaggaCliHost124>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>124</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost124>
+        <QuaggaCliHost125>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>125</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost125>
+        <QuaggaCliHost126>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>126</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost126>
+        <QuaggaCliHost127>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>127</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost127>
+        <QuaggaCliHost128>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>128</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost128>
+        <QuaggaCliHost129>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>129</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost129>
+        <QuaggaCliHost130>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>130</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost130>
+        <QuaggaCliHost131>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>131</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost131>
+        <QuaggaCliHost132>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>132</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost132>
+        <QuaggaCliHost133>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>133</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost133>
+        <QuaggaCliHost134>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>134</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost134>
+        <QuaggaCliHost135>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>135</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost135>
+        <QuaggaCliHost136>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>136</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost136>
+        <QuaggaCliHost137>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>137</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost137>
+        <QuaggaCliHost138>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>138</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost138>
+        <QuaggaCliHost139>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>139</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost139>
+        <QuaggaCliHost140>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>140</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost140>
+        <QuaggaCliHost141>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>141</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost141>
+        <QuaggaCliHost142>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>142</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost142>
+        <QuaggaCliHost143>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>143</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost143>
+        <QuaggaCliHost144>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>144</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost144>
+        <QuaggaCliHost145>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>145</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost145>
+        <QuaggaCliHost146>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>146</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost146>
+        <QuaggaCliHost147>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>147</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost147>
+        <QuaggaCliHost148>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>148</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost148>
+        <QuaggaCliHost149>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>149</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost149>
+        <QuaggaCliHost150>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>150</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost150>
+        <QuaggaCliHost151>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>151</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost151>
+        <QuaggaCliHost152>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>152</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost152>
+        <QuaggaCliHost153>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>153</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost153>
+        <QuaggaCliHost154>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>154</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost154>
+        <QuaggaCliHost155>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>155</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost155>
+        <QuaggaCliHost156>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>156</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost156>
+        <QuaggaCliHost157>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>157</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost157>
+        <QuaggaCliHost158>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>158</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost158>
+        <QuaggaCliHost159>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>159</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost159>
+        <QuaggaCliHost160>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>160</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost160>
+        <QuaggaCliHost161>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>161</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost161>
+        <QuaggaCliHost162>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>162</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost162>
+        <QuaggaCliHost163>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>163</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost163>
+        <QuaggaCliHost164>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>164</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost164>
+        <QuaggaCliHost165>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>165</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost165>
+        <QuaggaCliHost166>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>166</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost166>
+        <QuaggaCliHost167>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>167</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost167>
+        <QuaggaCliHost168>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>168</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost168>
+        <QuaggaCliHost169>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>169</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost169>
+        <QuaggaCliHost170>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>170</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost170>
+        <QuaggaCliHost171>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>171</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost171>
+        <QuaggaCliHost172>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>172</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost172>
+        <QuaggaCliHost173>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>173</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost173>
+        <QuaggaCliHost174>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>174</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost174>
+        <QuaggaCliHost175>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>175</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost175>
+        <QuaggaCliHost176>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>176</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost176>
+        <QuaggaCliHost177>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>177</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost177>
+        <QuaggaCliHost178>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>178</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost178>
+        <QuaggaCliHost179>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>179</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost179>
+        <QuaggaCliHost180>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>180</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost180>
+        <QuaggaCliHost181>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>181</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost181>
+        <QuaggaCliHost182>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>182</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost182>
+        <QuaggaCliHost183>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>183</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost183>
+        <QuaggaCliHost184>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>184</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost184>
+        <QuaggaCliHost185>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>185</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost185>
+        <QuaggaCliHost186>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>186</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost186>
+        <QuaggaCliHost187>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>187</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost187>
+        <QuaggaCliHost188>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>188</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost188>
+        <QuaggaCliHost189>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>189</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost189>
+        <QuaggaCliHost190>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>190</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost190>
+        <QuaggaCliHost191>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>191</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost191>
+        <QuaggaCliHost192>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>192</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost192>
+        <QuaggaCliHost193>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>193</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost193>
+
+        <QuaggaCliHost194>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>194</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost194>
+        <QuaggaCliHost195>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>195</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost195>
+        <QuaggaCliHost196>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>196</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost196>
+        <QuaggaCliHost197>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>197</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost197>
+        <QuaggaCliHost198>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>198</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost198>
+        <QuaggaCliHost199>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>199</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost199>
+        <QuaggaCliHost200>
+            <host>127.0.0.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>QuaggaCliDriver</type>
+            <connect_order>200</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </QuaggaCliHost200>
+
+
     </COMPONENT>
 </TOPOLOGY>
+
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.params b/TestON/tests/TopoPerfNext/TopoPerfNext.params
index 45de48d..e17d6bd 100644
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.params
+++ b/TestON/tests/TopoPerfNext/TopoPerfNext.params
@@ -52,7 +52,7 @@
         </topoConfigName>
 
         #Number of times to iterate each case
-        <numIter>5</numIter>
+        <numIter>10</numIter>
         <numSwitch>2</numSwitch>
         #Number of iterations to ignore initially
         <iterIgnore>2</iterIgnore>
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.py b/TestON/tests/TopoPerfNext/TopoPerfNext.py
index 12e53e5..d0b66c9 100644
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.py
+++ b/TestON/tests/TopoPerfNext/TopoPerfNext.py
@@ -69,7 +69,7 @@
         main.ONOSbench.onosUninstall( nodeIp=ONOS4Ip )
         main.ONOSbench.onosUninstall( nodeIp=ONOS5Ip )
         main.ONOSbench.onosUninstall( nodeIp=ONOS6Ip )
-        #main.ONOSbench.onosUninstall( nodeIp=ONOS7Ip )
+        main.ONOSbench.onosUninstall( nodeIp=ONOS7Ip )
 
         main.step( "Creating cell file" )
         cellFileResult = main.ONOSbench.createCellFile(
@@ -201,6 +201,12 @@
         latencyT0ToDeviceList = []
         latencyTcpToOfpList = []
 
+        # Initialize 2d array for [node][iteration] storage
+        endToEndLatNodeIter = numpy.zeros(( clusterCount, int(numIter) ))
+        ofpToGraphLatNodeIter = numpy.zeros(( clusterCount, int(numIter) ))
+        # tcp-to-ofp measurements are same throughout each iteration 
+        tcpToOfpLatIter = [] 
+
         # Directory/file to store tshark results
         tsharkOfOutput = "/tmp/tshark_of_topo.txt"
         tsharkTcpOutput = "/tmp/tshark_tcp_topo.txt"
@@ -343,15 +349,44 @@
 
             # t0 to device processing latency
             deltaDevice1 = int( deviceTimestamp1 ) - int( t0Tcp )
-
             # t0 to graph processing latency ( end-to-end )
             deltaGraph1 = int( graphTimestamp1 ) - int( t0Tcp )
-
             # ofp to graph processing latency ( ONOS processing )
             deltaOfpGraph1 = int( graphTimestamp1 ) - int( t0Ofp )
-
             # ofp to device processing latency ( ONOS processing )
             deltaOfpDevice1 = float( deviceTimestamp1 ) - float( t0Ofp )
+            # tcp to ofp processing latency ( switch connection )
+            deltaTcpOfp1 = int(t0Ofp) - int(t0Tcp)
+
+            if deltaTcpOfp1 > thresholdMin and deltaTcpOfp1 < thresholdMax\
+               and i >= iterIgnore:
+                tcpToOfpLatIter.append(deltaTcpOfp1)
+                main.log.info("iter"+str(i)+" tcp-to-ofp: "+
+                          str(deltaTcpOfp1)+" ms")
+            else:
+                tcpToOfpLatIter.append(0)
+                main.log.info("iter"+str(i)+" tcp-to-ofp: "+
+                          str(deltaTcpOfp1)+" ms - ignored this iteration")
+
+            # Store initial measurements in data array
+            #This measurement is for node 1
+           
+            if deltaGraph1 > thresholdMin and deltaGraph1 < thresholdMax\
+               and i >= iterIgnore:
+                endToEndLatNodeIter[0][i] = deltaGraph1
+                main.log.info("ONOS1 iter"+str(i)+" end-to-end: "+
+                          str(deltaGraph1)+" ms")
+            else:
+                main.log.info("ONOS1 iter"+str(i)+" end-to-end: "+
+                          str(deltaGraph1)+" ms - ignored this iteration")
+
+
+            if deltaOfpGraph1 > thresholdMin and deltaOfpGraph1 < thresholdMax\
+               and i >= iterIgnore:
+                ofpToGraphLatNodeIter[0][i] = deltaOfpGraph1
+             
+            main.log.info("ONOS1 iter"+str(i)+" ofp-to-graph: "+
+                          str(deltaOfpGraph1)+" ms")
 
             # TODO: Create even cluster number events
 
@@ -379,16 +414,31 @@
                     float( t0Ofp )
                 deltaOfpDevice3 = float( deviceTimestamp3 ) -\
                     float( t0Ofp )
-            else:
-                deltaDevice2 = 0
-                deltaDevice3 = 0
-                deltaGraph2 = 0
-                deltaGraph3 = 0
-                deltaOfpGraph2 = 0
-                deltaOfpGraph3 = 0
-                deltaOfpDevice2 = 0
-                deltaOfpDevice3 = 0
 
+                if deltaGraph2 > thresholdMin and\
+                   deltaGraph2 < thresholdMax and i >= iterIgnore:
+                    endToEndLatNodeIter[1][i] = deltaGraph2
+                    main.log.info("ONOS2 iter"+str(i)+" end-to-end: "+
+                            str(deltaGraph2)+" ms")
+                
+                if deltaOfpGraph2 > thresholdMin and\
+                   deltaOfpGraph2 < thresholdMax and i >= iterIgnore:
+                    ofpToGraphLatNodeIter[1][i] = deltaOfpGraph2
+                    main.log.info("ONOS2 iter"+str(i)+" ofp-to-graph: "+
+                            str(deltaOfpGraph2)+" ms")
+
+                if deltaGraph3 > thresholdMin and\
+                   deltaGraph3 < thresholdMax and i >= iterIgnore:
+                    endToEndLatNodeIter[2][i] = deltaGraph3
+                    main.log.info("ONOS3 iter"+str(i)+" end-to-end: "+
+                            str(deltaGraph3)+" ms")
+                
+                if deltaOfpGraph3 > thresholdMin and\
+                   deltaOfpGraph3 < thresholdMax and i >= iterIgnore:
+                    ofpToGraphLatNodeIter[2][i] = deltaOfpGraph3
+                    main.log.info("ONOS3 iter"+str(i)+" ofp-to-graph: "+
+                            str(deltaOfpGraph3)+" ms")
+                
             if clusterCount >= 5:
                 jsonStr4 = main.ONOS4cli.topologyEventsMetrics()
                 jsonStr5 = main.ONOS5cli.topologyEventsMetrics()
@@ -412,16 +462,32 @@
                     float( t0Ofp )
                 deltaOfpDevice5 = float( deviceTimestamp5 ) -\
                     float( t0Ofp )
-            else:
-                deltaDevice4 = 0
-                deltaDevice5 = 0
-                deltaGraph4 = 0
-                deltaGraph5 = 0
-                deltaOfpGraph4 = 0
-                deltaOfpGraph5 = 0
-                deltaOfpDevice4 = 0
-                deltaOfpDevice5 = 0
+                
+                if deltaGraph4 > thresholdMin and\
+                   deltaGraph4 < thresholdMax and i >= iterIgnore:
+                    endToEndLatNodeIter[3][i] = deltaGraph4
+                    main.log.info("ONOS4 iter"+str(i)+" end-to-end: "+
+                            str(deltaGraph4)+" ms")
+                
+                    #TODO:
+                if deltaOfpGraph4 > thresholdMin and\
+                   deltaOfpGraph4 < thresholdMax and i >= iterIgnore:
+                    ofpToGraphLatNodeIter[3][i] = deltaOfpGraph4
+                    main.log.info("ONOS4 iter"+str(i)+" ofp-to-graph: "+
+                            str(deltaOfpGraph4)+" ms")
 
+                if deltaGraph5 > thresholdMin and\
+                   deltaGraph5 < thresholdMax and i >= iterIgnore:
+                    endToEndLatNodeIter[4][i] = deltaGraph5
+                    main.log.info("ONOS5 iter"+str(i)+" end-to-end: "+
+                            str(deltaGraph5)+" ms")
+                
+                if deltaOfpGraph5 > thresholdMin and\
+                   deltaOfpGraph5 < thresholdMax and i >= iterIgnore:
+                    ofpToGraphLatNodeIter[4][i] = deltaOfpGraph5
+                    main.log.info("ONOS5 iter"+str(i)+" ofp-to-graph: "+
+                            str(deltaOfpGraph5)+" ms")
+                
             if clusterCount >= 7:
                 jsonStr6 = main.ONOS6cli.topologyEventsMetrics()
                 jsonStr7 = main.ONOS7cli.topologyEventsMetrics()
@@ -445,119 +511,31 @@
                     float( t0Ofp )
                 deltaOfpDevice7 = float( deviceTimestamp7 ) -\
                     float( t0Ofp )
-            else:
-                deltaDevice6 = 0
-                deltaDevice7 = 0
-                deltaGraph6 = 0
-                deltaGraph7 = 0
-                deltaOfpGraph6 = 0
-                deltaOfpGraph7 = 0
-                deltaOfpDevice6 = 0
-                deltaOfpDevice7 = 0
+                
+                if deltaGraph6 > thresholdMin and\
+                   deltaGraph6 < thresholdMax and i >= iterIgnore:
+                    endToEndLatNodeIter[5][i] = deltaGraph6
+                    main.log.info("ONOS6 iter"+str(i)+" end-to-end: "+
+                            str(deltaGraph6)+" ms")
+                
+                    #TODO:
+                if deltaOfpGraph6 > thresholdMin and\
+                   deltaOfpGraph6 < thresholdMax and i >= iterIgnore:
+                    ofpToGraphLatNodeIter[5][i] = deltaOfpGraph6
+                    main.log.info("ONOS6 iter"+str(i)+" ofp-to-graph: "+
+                            str(deltaOfpGraph6)+" ms")
 
-            # Get average of delta from all instances
-            avgDeltaDevice = \
-                ( int( deltaDevice1 ) +
-                  int( deltaDevice2 ) +
-                  int( deltaDevice3 ) +
-                  int( deltaDevice4 ) +
-                  int( deltaDevice5 ) +
-                  int( deltaDevice6 ) +
-                  int( deltaDevice7 ) ) / clusterCount
-
-            # Ensure avg delta meets the threshold before appending
-            if avgDeltaDevice > 0.0 and avgDeltaDevice < 10000\
-                    and int( i ) > iterIgnore:
-                latencyT0ToDeviceList.append( avgDeltaDevice )
-            else:
-                main.log.info(
-                    "Results for t0-to-device ignored" +
-                    "due to excess in threshold / warmup iteration." )
-
-            # Get average of delta from all instances
-            # TODO: use max delta graph
-            #maxDeltaGraph = max( three )
-            avgDeltaGraph = \
-                ( int( deltaGraph1 ) +
-                  int( deltaGraph2 ) +
-                  int( deltaGraph3 ) +
-                  int( deltaGraph4 ) +
-                  int( deltaGraph5 ) +
-                  int( deltaGraph6 ) +
-                  int( deltaGraph7 ) ) / clusterCount
-
-            # Ensure avg delta meets the threshold before appending
-            if avgDeltaGraph > 0.0 and avgDeltaGraph < 10000\
-                    and int( i ) > iterIgnore:
-                latencyEndToEndList.append( avgDeltaGraph )
-            else:
-                main.log.info( "Results for end-to-end ignored" +
-                               "due to excess in threshold" )
-
-            avgDeltaOfpGraph = \
-                ( int( deltaOfpGraph1 ) +
-                  int( deltaOfpGraph2 ) +
-                  int( deltaOfpGraph3 ) +
-                  int( deltaOfpGraph4 ) +
-                  int( deltaOfpGraph5 ) +
-                  int( deltaOfpGraph6 ) +
-                  int( deltaOfpGraph7 ) ) / clusterCount
-
-            if avgDeltaOfpGraph > thresholdMin \
-                    and avgDeltaOfpGraph < thresholdMax\
-                    and int( i ) > iterIgnore:
-                latencyOfpToGraphList.append( avgDeltaOfpGraph )
-            elif avgDeltaOfpGraph > ( -10 ) and \
-                    avgDeltaOfpGraph < 0.0 and\
-                    int( i ) > iterIgnore:
-                main.log.info( "Sub-millisecond result likely; " +
-                               "negative result was rounded to 0" )
-                # NOTE: Current metrics framework does not
-                # support sub-millisecond accuracy. Therefore,
-                # if the result is negative, we can reasonably
-                # conclude sub-millisecond results and just
-                # append the best rounded effort - 0 ms.
-                latencyOfpToGraphList.append( 0 )
-            else:
-                main.log.info( "Results for ofp-to-graph " +
-                               "ignored due to excess in threshold" )
-
-            avgDeltaOfpDevice = \
-                ( float( deltaOfpDevice1 ) +
-                  float( deltaOfpDevice2 ) +
-                  float( deltaOfpDevice3 ) +
-                  float( deltaOfpDevice4 ) +
-                  float( deltaOfpDevice5 ) +
-                  float( deltaOfpDevice6 ) +
-                  float( deltaOfpDevice7 ) ) / clusterCount
-
-            # NOTE: ofp - delta measurements are occasionally negative
-            #      due to system time misalignment.
-            latencyOfpToDeviceList.append( avgDeltaOfpDevice )
-
-            deltaOfpTcp = int( t0Ofp ) - int( t0Tcp )
-            if deltaOfpTcp > thresholdMin \
-                    and deltaOfpTcp < thresholdMax and\
-                    int( i ) > iterIgnore:
-                latencyTcpToOfpList.append( deltaOfpTcp )
-            else:
-                main.log.info( "Results fo tcp-to-ofp " +
-                               "ignored due to excess in threshold" )
-
-            # TODO:
-            # Fetch logs upon threshold excess
-
-            main.log.info( "ONOS1 delta end-to-end: " +
-                           str( deltaGraph1 ) + " ms" )
-
-            main.log.info( "ONOS1 delta OFP - graph: " +
-                           str( deltaOfpGraph1 ) + " ms" )
-
-            main.log.info( "ONOS1 delta device - t0: " +
-                           str( deltaDevice1 ) + " ms" )
-
-            main.log.info( "TCP to OFP delta: " +
-                           str( deltaOfpTcp ) + " ms" )
+                if deltaGraph7 > thresholdMin and\
+                   deltaGraph7 < thresholdMax and i >= iterIgnore:
+                    endToEndLatNodeIter[6][i] = deltaGraph7
+                    main.log.info("ONOS7 iter"+str(i)+" end-to-end: "+
+                            str(deltaGraph7)+" ms")
+                
+                if deltaOfpGraph7 > thresholdMin and\
+                   deltaOfpGraph7 < thresholdMax and i >= iterIgnore:
+                    ofpToGraphLatNodeIter[6][i] = deltaOfpGraph7
+                    main.log.info("ONOS7 iter"+str(i)+" ofp-to-graph: "+
+                            str(deltaOfpGraph7)+" ms")
 
             main.step( "Remove switch from controller" )
             main.Mininet1.deleteSwController( "s1" )
@@ -566,103 +544,50 @@
 
         # END of for loop iteration
 
-        # If there is at least 1 element in each list,
-        # pass the test case
-        if len( latencyEndToEndList ) > 0 and\
-           len( latencyOfpToGraphList ) > 0 and\
-           len( latencyOfpToDeviceList ) > 0 and\
-           len( latencyT0ToDeviceList ) > 0 and\
-           len( latencyTcpToOfpList ) > 0:
-            assertion = main.TRUE
-        elif len( latencyEndToEndList ) == 0:
-            # The appending of 0 here is to prevent
-            # the min,max,sum functions from failing
-            # below
-            latencyEndToEndList.append( 0 )
-            assertion = main.FALSE
-        elif len( latencyOfpToGraphList ) == 0:
-            latencyOfpToGraphList.append( 0 )
-            assertion = main.FALSE
-        elif len( latencyOfpToDeviceList ) == 0:
-            latencyOfpToDeviceList.append( 0 )
-            assertion = main.FALSE
-        elif len( latencyT0ToDeviceList ) == 0:
-            latencyT0ToDeviceList.append( 0 )
-            assertion = main.FALSE
-        elif len( latencyTcpToOfpList ) == 0:
-            latencyTcpToOfpList.append( 0 )
-            assertion = main.FALSE
+        #str( round( numpy.std( latencyT0ToDeviceList ), 1 ) )
 
-        # Calculate min, max, avg of latency lists
-        latencyEndToEndMax = \
-            int( max( latencyEndToEndList ) )
-        latencyEndToEndMin = \
-            int( min( latencyEndToEndList ) )
-        latencyEndToEndAvg = \
-            ( int( sum( latencyEndToEndList ) ) /
-              len( latencyEndToEndList ) )
-        latencyEndToEndStdDev = \
-            str( round( numpy.std( latencyEndToEndList ), 1 ) )
+        endToEndAvg = 0
+        ofpToGraphAvg = 0
+        endToEndList = []
+        ofpToGraphList = []
 
-        latencyOfpToGraphMax = \
-            int( max( latencyOfpToGraphList ) )
-        latencyOfpToGraphMin = \
-            int( min( latencyOfpToGraphList ) )
-        latencyOfpToGraphAvg = \
-            ( int( sum( latencyOfpToGraphList ) ) /
-              len( latencyOfpToGraphList ) )
-        latencyOfpToGraphStdDev = \
-            str( round( numpy.std( latencyOfpToGraphList ), 1 ) )
+        for node in range( 0, clusterCount ):
+            # The latency 2d array was initialized to 0. 
+            # If an iteration was ignored, then we have some 0's in
+            # our calculation. To avoid having this interfere with our 
+            # results, we must delete any index where 0 is found...
+            # WARN: Potentially, we could have latency that hovers at
+            # 0 ms once we have optimized code. FIXME for when this is
+            # the case. Being able to obtain sub-millisecond accuracy
+            # can prevent this from happening
+            for item in endToEndLatNodeIter[node]:
+                if item > 0.0:
+                    endToEndList.append(item)
+            for item in ofpToGraphLatNodeIter[node]:
+                if item > 0.0:
+                    ofpToGraphList.append(item)
 
-        latencyOfpToDeviceMax = \
-            int( max( latencyOfpToDeviceList ) )
-        latencyOfpToDeviceMin = \
-            int( min( latencyOfpToDeviceList ) )
-        latencyOfpToDeviceAvg = \
-            ( int( sum( latencyOfpToDeviceList ) ) /
-              len( latencyOfpToDeviceList ) )
-        latencyOfpToDeviceStdDev = \
-            str( round( numpy.std( latencyOfpToDeviceList ), 1 ) )
+            endToEndAvg = numpy.mean(endToEndList)
+            ofpToGraphAvg = numpy.mean(ofpToGraphList)
 
-        latencyT0ToDeviceMax = \
-            int( max( latencyT0ToDeviceList ) )
-        latencyT0ToDeviceMin = \
-            int( min( latencyT0ToDeviceList ) )
-        latencyT0ToDeviceAvg = \
-            ( int( sum( latencyT0ToDeviceList ) ) /
-              len( latencyT0ToDeviceList ) )
-        latencyOfpToDeviceStdDev = \
-            str( round( numpy.std( latencyT0ToDeviceList ), 1 ) )
-
-        latencyTcpToOfpMax = \
-            int( max( latencyTcpToOfpList ) )
-        latencyTcpToOfpMin = \
-            int( min( latencyTcpToOfpList ) )
-        latencyTcpToOfpAvg = \
-            ( int( sum( latencyTcpToOfpList ) ) /
-              len( latencyTcpToOfpList ) )
-        latencyTcpToOfpStdDev = \
-            str( round( numpy.std( latencyTcpToOfpList ), 1 ) )
-
-        main.log.report( "Cluster size: " + str( clusterCount ) +
-                         " node(s)" )
-        main.log.report( "Switch add - End-to-end latency: " +
-                         "Avg: " + str( latencyEndToEndAvg ) + " ms " +
-                         "Std Deviation: " + latencyEndToEndStdDev + " ms" )
-        main.log.report(
-            "Switch add - OFP-to-Graph latency: " +
-            "Note: results are not accurate to sub-millisecond. " +
-            "Any sub-millisecond results are rounded to 0 ms. " )
-        main.log.report( "Avg: " + str( latencyOfpToGraphAvg ) + " ms " +
-                         "Std Deviation: " + latencyOfpToGraphStdDev + " ms" )
-        main.log.report( "Switch add - TCP-to-OFP latency: " +
-                         "Avg: " + str( latencyTcpToOfpAvg ) + " ms " +
-                         "Std Deviation: " + latencyTcpToOfpStdDev + " ms" )
+            main.log.report( " - Node "+str(node+1)+" Summary - " )
+            main.log.report( " End-to-end Avg: "+
+                             str(round(endToEndAvg,2))+" ms"+
+                             " End-to-end Std dev: "+
+                             str(round(numpy.std(endToEndList),2))+" ms")
+            #main.log.report( " Ofp-to-graph Avg: "+
+            #                 str(round(ofpToGraphAvg,2))+" ms"+
+            #                 " Ofp-to-graph Std dev: "+
+            #                 str(round(numpy.std(ofpToGraphList),2))+
+            #                 " ms")
 
         if debugMode == 'on':
             main.ONOS1.cpLogsToDir( "/opt/onos/log/karaf.log",
                                       "/tmp/", copyFileName="sw_lat_karaf" )
 
+        #TODO: correct assert
+        assertion = main.TRUE
+
         utilities.assert_equals( expect=main.TRUE, actual=assertion,
                                 onpass="Switch latency test successful",
                                 onfail="Switch latency test failed" )
@@ -694,6 +619,7 @@
         assertion = main.TRUE
         # Number of iterations of case
         numIter = main.params[ 'TEST' ][ 'numIter' ]
+        iterIgnore = int( main.params[ 'TEST' ][ 'iterIgnore' ] )
 
         # Timestamp 'keys' for json metrics output.
         # These are subject to change, hence moved into params
@@ -751,6 +677,13 @@
         portUpGraphToOfpList = []
         portDownDeviceToOfpList = []
         portDownGraphToOfpList = []
+       
+        # Initialize 2d array filled with 0's
+        # arraySizeFormat[clusterCount][numIter]
+        portUpDevNodeIter = numpy.zeros(( clusterCount, int(numIter) ))
+        portUpGraphNodeIter = numpy.zeros(( clusterCount, int(numIter) ))
+        portDownDevNodeIter = numpy.zeros(( clusterCount, int(numIter) ))
+        portDownGraphNodeIter = numpy.zeros(( clusterCount, int(numIter) ))
 
         for i in range( 0, int( numIter ) ):
             main.step( "Starting wireshark capture for port status down" )
@@ -818,6 +751,23 @@
             ptDownDeviceToOfp1 = int( deviceTimestamp1 ) -\
                 int( timestampBeginPtDown )
 
+            if ptDownGraphToOfp1 > downThresholdMin and\
+               ptDownGraphToOfp1 < downThresholdMax and i > iterIgnore:
+                portDownGraphNodeIter[0][i] = ptDownGraphToOfp1
+                main.log.info("iter"+str(i)+" port down graph-to-ofp: "+
+                              str(ptDownGraphToOfp1)+" ms")
+            else:
+                main.log.info("iter"+str(i)+" skipped. Result: "+
+                              str(ptDownGraphToOfp1)+" ms")
+            if ptDownDeviceToOfp1 > downThresholdMin and\
+               ptDownDeviceToOfp1 < downThresholdMax and i > iterIgnore:
+                portDownDevNodeIter[0][i] = ptDownDeviceToOfp1
+                main.log.info("iter"+str(i)+" port down device-to-ofp: "+
+                              str(ptDownDeviceToOfp1)+" ms")
+            else:
+                main.log.info("iter"+str(i)+" skipped. Result: "+
+                              str(ptDownDeviceToOfp1)+" ms")
+
             if clusterCount >= 3:
                 jsonStrUp2 = main.ONOS2cli.topologyEventsMetrics()
                 jsonStrUp3 = main.ONOS3cli.topologyEventsMetrics()
@@ -839,11 +789,30 @@
                     int( timestampBeginPtDown )
                 ptDownDeviceToOfp3 = int( deviceTimestamp3 ) -\
                     int( timestampBeginPtDown )
-            else:
-                ptDownGraphToOfp2 = 0
-                ptDownGraphToOfp3 = 0
-                ptDownDeviceToOfp2 = 0
-                ptDownDeviceToOfp3 = 0
+
+                if ptDownGraphToOfp2 > downThresholdMin and\
+                   ptDownGraphToOfp2 < downThresholdMax and i > iterIgnore:
+                    portDownGraphNodeIter[1][i] = ptDownGraphToOfp2
+                    main.log.info("ONOS2 iter"+str(i)+" graph-to-ofp: "+
+                                  str(ptDownGraphToOfp2)+" ms")
+
+                if ptDownDeviceToOfp2 > downThresholdMin and\
+                   ptDownDeviceToOfp2 < downThresholdMax and i > iterIgnore:
+                    portDownDevNodeIter[1][i] = ptDownDeviceToOfp2
+                    main.log.info("ONOS2 iter"+str(i)+" device-to-ofp: "+
+                                  str(ptDownDeviceToOfp2)+" ms")
+
+                if ptDownGraphToOfp3 > downThresholdMin and\
+                   ptDownGraphToOfp3 < downThresholdMax and i > iterIgnore:
+                    portDownGraphNodeIter[2][i] = ptDownGraphToOfp3
+                    main.log.info("ONOS3 iter"+str(i)+" graph-to-ofp: "+
+                                  str(ptDownGraphToOfp3)+" ms")
+
+                if ptDownDeviceToOfp3 > downThresholdMin and\
+                   ptDownDeviceToOfp3 < downThresholdMax and i > iterIgnore:
+                    portDownDevNodeIter[2][i] = ptDownDeviceToOfp3
+                    main.log.info("ONOS3 iter"+str(i)+" device-to-ofp: "+
+                                  str(ptDownDeviceToOfp3)+" ms")
 
             if clusterCount >= 5:
                 jsonStrUp4 = main.ONOS4cli.topologyEventsMetrics()
@@ -866,11 +835,30 @@
                     int( timestampBeginPtDown )
                 ptDownDeviceToOfp5 = int( deviceTimestamp5 ) -\
                     int( timestampBeginPtDown )
-            else:
-                ptDownGraphToOfp4 = 0
-                ptDownGraphToOfp5 = 0
-                ptDownDeviceToOfp4 = 0
-                ptDownDeviceToOfp5 = 0
+                
+                if ptDownGraphToOfp4 > downThresholdMin and\
+                   ptDownGraphToOfp4 < downThresholdMax and i > iterIgnore:
+                    portDownGraphNodeIter[3][i] = ptDownGraphToOfp4
+                    main.log.info("ONOS4 iter"+str(i)+" graph-to-ofp: "+
+                                  str(ptDownGraphToOfp4)+" ms")
+
+                if ptDownDeviceToOfp4 > downThresholdMin and\
+                   ptDownDeviceToOfp4 < downThresholdMax and i > iterIgnore:
+                    portDownDevNodeIter[3][i] = ptDownDeviceToOfp4
+                    main.log.info("ONOS4 iter"+str(i)+" device-to-ofp: "+
+                                  str(ptDownDeviceToOfp4)+" ms")
+
+                if ptDownGraphToOfp5 > downThresholdMin and\
+                   ptDownGraphToOfp5 < downThresholdMax and i > iterIgnore:
+                    portDownGraphNodeIter[4][i] = ptDownGraphToOfp5
+                    main.log.info("ONOS5 iter"+str(i)+" graph-to-ofp: "+
+                                  str(ptDownGraphToOfp5)+" ms")
+                
+                if ptDownDeviceToOfp5 > downThresholdMin and\
+                   ptDownDeviceToOfp5 < downThresholdMax and i > iterIgnore:
+                    portDownDevNodeIter[4][i] = ptDownDeviceToOfp5
+                    main.log.info("ONOS5 iter"+str(i)+" device-to-ofp: "+
+                                  str(ptDownDeviceToOfp5)+" ms")
 
             if clusterCount >= 7:
                 jsonStrUp6 = main.ONOS6cli.topologyEventsMetrics()
@@ -893,54 +881,33 @@
                     int( timestampBeginPtDown )
                 ptDownDeviceToOfp7 = int( deviceTimestamp7 ) -\
                     int( timestampBeginPtDown )
-            else:
-                ptDownGraphToOfp6 = 0
-                ptDownGraphToOfp7 = 0
-                ptDownDeviceToOfp6 = 0
-                ptDownDeviceToOfp7 = 0
+                
+                if ptDownGraphToOfp6 > downThresholdMin and\
+                   ptDownGraphToOfp6 < downThresholdMax and i > iterIgnore:
+                    portDownGraphNodeIter[5][i] = ptDownGraphToOfp6
+                    main.log.info("ONOS6 iter"+str(i)+" graph-to-ofp: "+
+                                  str(ptDownGraphToOfp6)+" ms")
+
+                if ptDownDeviceToOfp6 > downThresholdMin and\
+                   ptDownDeviceToOfp6 < downThresholdMax and i > iterIgnore:
+                    portDownDevNodeIter[5][i] = ptDownDeviceToOfp6
+                    main.log.info("ONOS6 iter"+str(i)+" device-to-ofp: "+
+                                  str(ptDownDeviceToOfp6)+" ms")
+
+                if ptDownGraphToOfp7 > downThresholdMin and\
+                   ptDownGraphToOfp7 < downThresholdMax and i > iterIgnore:
+                    portDownGraphNodeIter[6][i] = ptDownGraphToOfp7
+                    main.log.info("ONOS7 iter"+str(i)+" graph-to-ofp: "+
+                                  str(ptDownGraphToOfp7)+" ms")
+                
+                if ptDownDeviceToOfp7 > downThresholdMin and\
+                   ptDownDeviceToOfp7 < downThresholdMax and i > iterIgnore:
+                    portDownDevNodeIter[6][i] = ptDownDeviceToOfp7
+                    main.log.info("ONOS7 iter"+str(i)+" device-to-ofp: "+
+                                  str(ptDownDeviceToOfp7)+" ms")
 
             time.sleep( 3 )
 
-            # Caluclate average across clusters
-            ptDownGraphToOfpAvg =\
-                ( int( ptDownGraphToOfp1 ) +
-                  int( ptDownGraphToOfp2 ) +
-                  int( ptDownGraphToOfp3 ) +
-                  int( ptDownGraphToOfp4 ) +
-                  int( ptDownGraphToOfp5 ) +
-                  int( ptDownGraphToOfp6 ) +
-                  int( ptDownGraphToOfp7 ) ) / clusterCount
-            ptDownDeviceToOfpAvg = \
-                ( int( ptDownDeviceToOfp1 ) +
-                  int( ptDownDeviceToOfp2 ) +
-                  int( ptDownDeviceToOfp3 ) +
-                  int( ptDownDeviceToOfp4 ) +
-                  int( ptDownDeviceToOfp5 ) +
-                  int( ptDownDeviceToOfp6 ) +
-                  int( ptDownDeviceToOfp7 ) ) / clusterCount
-
-            if ptDownGraphToOfpAvg > downThresholdMin and \
-                    ptDownGraphToOfpAvg < downThresholdMax:
-                portDownGraphToOfpList.append(
-                    ptDownGraphToOfpAvg )
-                main.log.info( "Port down: graph to ofp avg: " +
-                               str( ptDownGraphToOfpAvg ) + " ms" )
-            else:
-                main.log.info( "Average port down graph-to-ofp result" +
-                               " exceeded the threshold: " +
-                               str( ptDownGraphToOfpAvg ) )
-
-            if ptDownDeviceToOfpAvg > 0 and \
-                    ptDownDeviceToOfpAvg < 1000:
-                portDownDeviceToOfpList.append(
-                    ptDownDeviceToOfpAvg )
-                main.log.info( "Port down: device to ofp avg: " +
-                               str( ptDownDeviceToOfpAvg ) + " ms" )
-            else:
-                main.log.info( "Average port down device-to-ofp result" +
-                               " exceeded the threshold: " +
-                               str( ptDownDeviceToOfpAvg ) )
-
             # Port up events
             main.step( "Enable port and obtain timestamp" )
             main.step( "Starting wireshark capture for port status up" )
@@ -992,6 +959,24 @@
             # Get delta between device event and OFP
             ptUpDeviceToOfp1 = int( deviceTimestamp1 ) -\
                 int( timestampBeginPtUp )
+            
+            if ptUpGraphToOfp1 > upThresholdMin and\
+               ptUpGraphToOfp1 < upThresholdMax and i > iterIgnore:
+                portUpGraphNodeIter[0][i] = ptUpGraphToOfp1
+                main.log.info("iter"+str(i)+" port up graph-to-ofp: "+
+                              str(ptUpGraphToOfp1)+" ms")
+            else:
+                main.log.info("iter"+str(i)+" skipped. Result: "+
+                              str(ptUpGraphToOfp1)+" ms")
+            
+            if ptUpDeviceToOfp1 > upThresholdMin and\
+               ptUpDeviceToOfp1 < upThresholdMax and i > iterIgnore:
+                portUpDevNodeIter[0][i] = ptUpDeviceToOfp1
+                main.log.info("iter"+str(i)+" port up device-to-ofp: "+
+                              str(ptUpDeviceToOfp1)+" ms")
+            else:
+                main.log.info("iter"+str(i)+" skipped. Result: "+
+                              str(ptUpDeviceToOfp1)+" ms")
 
             if clusterCount >= 3:
                 jsonStrUp2 = main.ONOS2cli.topologyEventsMetrics()
@@ -1014,11 +999,30 @@
                     int( timestampBeginPtUp )
                 ptUpDeviceToOfp3 = int( deviceTimestamp3 ) -\
                     int( timestampBeginPtUp )
-            else:
-                ptUpGraphToOfp2 = 0
-                ptUpGraphToOfp3 = 0
-                ptUpDeviceToOfp2 = 0
-                ptUpDeviceToOfp3 = 0
+            
+                if ptUpGraphToOfp2 > upThresholdMin and\
+                   ptUpGraphToOfp2 < upThresholdMax and i > iterIgnore:
+                    portUpGraphNodeIter[1][i] = ptUpGraphToOfp2
+                    main.log.info("iter"+str(i)+" port up graph-to-ofp: "+
+                              str(ptUpGraphToOfp2)+" ms")
+            
+                if ptUpDeviceToOfp2 > upThresholdMin and\
+                   ptUpDeviceToOfp2 < upThresholdMax and i > iterIgnore:
+                    portUpDevNodeIter[1][i] = ptUpDeviceToOfp2
+                    main.log.info("iter"+str(i)+" port up device-to-ofp: "+
+                              str(ptUpDeviceToOfp2)+" ms")
+                
+                if ptUpGraphToOfp3 > upThresholdMin and\
+                   ptUpGraphToOfp3 < upThresholdMax and i > iterIgnore:
+                    portUpGraphNodeIter[2][i] = ptUpGraphToOfp3
+                    main.log.info("iter"+str(i)+" port up graph-to-ofp: "+
+                              str(ptUpGraphToOfp3)+" ms")
+            
+                if ptUpDeviceToOfp3 > upThresholdMin and\
+                   ptUpDeviceToOfp3 < upThresholdMax and i > iterIgnore:
+                    portUpDevNodeIter[2][i] = ptUpDeviceToOfp3
+                    main.log.info("iter"+str(i)+" port up device-to-ofp: "+
+                              str(ptUpDeviceToOfp3)+" ms")
 
             if clusterCount >= 5:
                 jsonStrUp4 = main.ONOS4cli.topologyEventsMetrics()
@@ -1041,11 +1045,30 @@
                     int( timestampBeginPtUp )
                 ptUpDeviceToOfp5 = int( deviceTimestamp5 ) -\
                     int( timestampBeginPtUp )
-            else:
-                ptUpGraphToOfp4 = 0
-                ptUpGraphToOfp5 = 0
-                ptUpDeviceToOfp4 = 0
-                ptUpDeviceToOfp5 = 0
+                
+                if ptUpGraphToOfp4 > upThresholdMin and\
+                   ptUpGraphToOfp4 < upThresholdMax and i > iterIgnore:
+                    portUpGraphNodeIter[3][i] = ptUpGraphToOfp4
+                    main.log.info("iter"+str(i)+" port up graph-to-ofp: "+
+                              str(ptUpGraphToOfp4)+" ms")
+            
+                if ptUpDeviceToOfp4 > upThresholdMin and\
+                   ptUpDeviceToOfp4 < upThresholdMax and i > iterIgnore:
+                    portUpDevNodeIter[3][i] = ptUpDeviceToOfp4
+                    main.log.info("iter"+str(i)+" port up device-to-ofp: "+
+                              str(ptUpDeviceToOfp4)+" ms")
+                
+                if ptUpGraphToOfp5 > upThresholdMin and\
+                   ptUpGraphToOfp5 < upThresholdMax and i > iterIgnore:
+                    portUpGraphNodeIter[4][i] = ptUpGraphToOfp5
+                    main.log.info("iter"+str(i)+" port up graph-to-ofp: "+
+                              str(ptUpGraphToOfp5)+" ms")
+            
+                if ptUpDeviceToOfp5 > upThresholdMin and\
+                   ptUpDeviceToOfp5 < upThresholdMax and i > iterIgnore:
+                    portUpDevNodeIter[4][i] = ptUpDeviceToOfp5
+                    main.log.info("iter"+str(i)+" port up device-to-ofp: "+
+                              str(ptUpDeviceToOfp5)+" ms")
 
             if clusterCount >= 7:
                 jsonStrUp6 = main.ONOS6cli.topologyEventsMetrics()
@@ -1068,119 +1091,83 @@
                     int( timestampBeginPtUp )
                 ptUpDeviceToOfp7 = int( deviceTimestamp7 ) -\
                     int( timestampBeginPtUp )
-            else:
-                ptUpGraphToOfp6 = 0
-                ptUpGraphToOfp7 = 0
-                ptUpDeviceToOfp6 = 0
-                ptUpDeviceToOfp7 = 0
-
-            ptUpGraphToOfpAvg = \
-                ( int( ptUpGraphToOfp1 ) +
-                  int( ptUpGraphToOfp2 ) +
-                  int( ptUpGraphToOfp3 ) +
-                  int( ptUpGraphToOfp4 ) +
-                  int( ptUpGraphToOfp5 ) +
-                  int( ptUpGraphToOfp6 ) +
-                  int( ptUpGraphToOfp7 ) ) / clusterCount
-
-            ptUpDeviceToOfpAvg = \
-                ( int( ptUpDeviceToOfp1 ) +
-                  int( ptUpDeviceToOfp2 ) +
-                  int( ptUpDeviceToOfp3 ) +
-                  int( ptUpDeviceToOfp4 ) +
-                  int( ptUpDeviceToOfp5 ) +
-                  int( ptUpDeviceToOfp6 ) +
-                  int( ptUpDeviceToOfp7 ) ) / clusterCount
-
-            if ptUpGraphToOfpAvg > upThresholdMin and \
-                    ptUpGraphToOfpAvg < upThresholdMax:
-                portUpGraphToOfpList.append(
-                    ptUpGraphToOfpAvg )
-                main.log.info( "Port down: graph to ofp avg: " +
-                               str( ptUpGraphToOfpAvg ) + " ms" )
-            else:
-                main.log.info( "Average port up graph-to-ofp result" +
-                               " exceeded the threshold: " +
-                               str( ptUpGraphToOfpAvg ) )
-
-            if ptUpDeviceToOfpAvg > upThresholdMin and \
-                    ptUpDeviceToOfpAvg < upThresholdMax:
-                portUpDeviceToOfpList.append(
-                    ptUpDeviceToOfpAvg )
-                main.log.info( "Port up: device to ofp avg: " +
-                               str( ptUpDeviceToOfpAvg ) + " ms" )
-            else:
-                main.log.info( "Average port up device-to-ofp result" +
-                               " exceeded the threshold: " +
-                               str( ptUpDeviceToOfpAvg ) )
+                
+                if ptUpGraphToOfp6 > upThresholdMin and\
+                   ptUpGraphToOfp6 < upThresholdMax and i > iterIgnore:
+                    portUpGraphNodeIter[5][i] = ptUpGraphToOfp6
+                    main.log.info("iter"+str(i)+" port up graph-to-ofp: "+
+                              str(ptUpGraphToOfp6)+" ms")
+            
+                if ptUpDeviceToOfp6 > upThresholdMin and\
+                   ptUpDeviceToOfp6 < upThresholdMax and i > iterIgnore:
+                    portUpDevNodeIter[5][i] = ptUpDeviceToOfp6
+                    main.log.info("iter"+str(i)+" port up device-to-ofp: "+
+                              str(ptUpDeviceToOfp6)+" ms")
+                
+                if ptUpGraphToOfp7 > upThresholdMin and\
+                   ptUpGraphToOfp7 < upThresholdMax and i > iterIgnore:
+                    portUpGraphNodeIter[6][i] = ptUpGraphToOfp7
+                    main.log.info("iter"+str(i)+" port up graph-to-ofp: "+
+                              str(ptUpGraphToOfp7)+" ms")
+            
+                if ptUpDeviceToOfp7 > upThresholdMin and\
+                   ptUpDeviceToOfp7 < upThresholdMax and i > iterIgnore:
+                    portUpDevNodeIter[6][i] = ptUpDeviceToOfp7
+                    main.log.info("iter"+str(i)+" port up device-to-ofp: "+
+                              str(ptUpDeviceToOfp7)+" ms")
 
             # END ITERATION FOR LOOP
+        
+        portUpDevList = []
+        portUpGraphList = []
+        portDownDevList = []
+        portDownGraphList = []
 
-        # Check all list for latency existence and set assertion
-        if ( portDownGraphToOfpList and portDownDeviceToOfpList
-                and portUpGraphToOfpList and portUpDeviceToOfpList ):
-            assertion = main.TRUE
+        portUpDevAvg = 0
+        portUpGraphAvg = 0
+        portDownDevAvg = 0
+        portDownGraphAvg = 0
 
-        main.log.report( "Cluster size: " + str( clusterCount ) +
-                         " node(s)" )
-        # Calculate and report latency measurements
-        portDownGraphToOfpMin = min( portDownGraphToOfpList )
-        portDownGraphToOfpMax = max( portDownGraphToOfpList )
-        portDownGraphToOfpAvg = \
-            ( sum( portDownGraphToOfpList ) /
-              len( portDownGraphToOfpList ) )
-        portDownGraphToOfpStdDev = \
-            str( round( numpy.std( portDownGraphToOfpList ), 1 ) )
+        for node in range( 0, clusterCount ):
 
-        main.log.report( "Port down graph-to-ofp " +
-                         "Avg: " + str( portDownGraphToOfpAvg ) + " ms " +
-                         "Std Deviation: " + portDownGraphToOfpStdDev + " ms" )
+            # NOTE: 
+            # Currently the 2d array is initialized with 0's. 
+            # We want to avoid skewing our results if the array
+            # was not modified with the correct latency.
+            for item in portUpDevNodeIter[node]:
+                if item > 0.0:
+                    portUpDevList.append(item)
+            for item in portUpGraphNodeIter[node]:
+                if item > 0.0:
+                    portUpGraphList.append(item)
+            for item in portDownDevNodeIter[node]:
+                if item > 0.0:
+                    portDownDevList.append(item)
+            for item in portDownGraphNodeIter[node]:
+                if item > 0.0:
+                    portDownGraphList.append(item)
+       
+            portUpDevAvg = numpy.mean(portUpDevList)
+            portUpGraphAvg = numpy.mean(portUpGraphList)
+            portDownDevAvg = numpy.mean(portDownDevList)
+            portDownGraphAvg = numpy.mean(portDownGraphList)
 
-        portDownDeviceToOfpMin = min( portDownDeviceToOfpList )
-        portDownDeviceToOfpMax = max( portDownDeviceToOfpList )
-        portDownDeviceToOfpAvg = \
-            ( sum( portDownDeviceToOfpList ) /
-              len( portDownDeviceToOfpList ) )
-        portDownDeviceToOfpStdDev = \
-            str( round( numpy.std( portDownDeviceToOfpList ), 1 ) )
-
-        main.log.report(
-            "Port down device-to-ofp " +
-            "Avg: " +
-            str( portDownDeviceToOfpAvg ) +
-            " ms " +
-            "Std Deviation: " +
-            portDownDeviceToOfpStdDev +
-            " ms" )
-
-        portUpGraphToOfpMin = min( portUpGraphToOfpList )
-        portUpGraphToOfpMax = max( portUpGraphToOfpList )
-        portUpGraphToOfpAvg = \
-            ( sum( portUpGraphToOfpList ) /
-              len( portUpGraphToOfpList ) )
-        portUpGraphToOfpStdDev = \
-            str( round( numpy.std( portUpGraphToOfpList ), 1 ) )
-
-        main.log.report( "Port up graph-to-ofp " +
-                         "Avg: " + str( portUpGraphToOfpAvg ) + " ms " +
-                         "Std Deviation: " + portUpGraphToOfpStdDev + " ms" )
-
-        portUpDeviceToOfpMin = min( portUpDeviceToOfpList )
-        portUpDeviceToOfpMax = max( portUpDeviceToOfpList )
-        portUpDeviceToOfpAvg = \
-            ( sum( portUpDeviceToOfpList ) /
-              len( portUpDeviceToOfpList ) )
-        portUpDeviceToOfpStdDev = \
-            str( round( numpy.std( portUpDeviceToOfpList ), 1 ) )
-
-        main.log.report( "Port up device-to-ofp " +
-                         "Avg: " + str( portUpDeviceToOfpAvg ) + " ms " +
-                         "Std Deviation: " + portUpDeviceToOfpStdDev + " ms" )
+            main.log.report( " - Node "+str(node+1)+" Summary - " )
+            #main.log.report( " Port up ofp-to-device "+
+            #                 str(round(portUpDevAvg, 2))+" ms")
+            main.log.report( " Port up ofp-to-graph "+
+                             str(round(portUpGraphAvg, 2))+" ms")
+            #main.log.report( " Port down ofp-to-device "+
+            #                 str(round(portDownDevAvg, 2))+" ms")
+            main.log.report( " Port down ofp-to-graph "+
+                             str(round(portDownGraphAvg, 2))+" ms")
 
         # Remove switches from controller for next test
         main.Mininet1.deleteSwController( "s1" )
         main.Mininet1.deleteSwController( "s2" )
 
+        #TODO: correct assertion
+
         utilities.assert_equals(
             expect=main.TRUE,
             actual=assertion,
@@ -1938,7 +1925,7 @@
             main.ONOS5cli.startOnosCli( ONOS5Ip )
 
         elif clusterCount == 7:
-            main.log.info( "Installing nodes 4 and 5" )
+            main.log.info( "Installing nodes 6 and 7" )
             node6Result = \
                 main.ONOSbench.onosInstall( node=ONOS6Ip )
             node7Result = \
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.topo b/TestON/tests/TopoPerfNext/TopoPerfNext.topo
index fc70784..f12d192 100644
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.topo
+++ b/TestON/tests/TopoPerfNext/TopoPerfNext.topo
@@ -24,7 +24,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
+            <connect_order>3</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS2cli>
         
@@ -33,7 +33,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
+            <connect_order>4</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS3cli>
         
@@ -42,7 +42,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
+            <connect_order>5</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS4cli>
         
@@ -51,7 +51,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
+            <connect_order>6</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS5cli>
         
@@ -60,7 +60,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
+            <connect_order>7</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS6cli>
         
@@ -69,7 +69,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
+            <connect_order>8</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS7cli>
 
@@ -78,7 +78,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
-            <connect_order>3</connect_order>
+            <connect_order>9</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS1>
 
@@ -87,7 +87,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
-            <connect_order>3</connect_order>
+            <connect_order>10</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS2>
 
@@ -96,7 +96,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
-            <connect_order>3</connect_order>
+            <connect_order>11</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS3>
         
@@ -105,7 +105,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
-            <connect_order>3</connect_order>
+            <connect_order>12</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS4>
         
@@ -114,7 +114,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
-            <connect_order>3</connect_order>
+            <connect_order>13</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS5>
         
@@ -123,7 +123,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
-            <connect_order>3</connect_order>
+            <connect_order>14</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS6>
         
@@ -132,7 +132,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
-            <connect_order>3</connect_order>
+            <connect_order>15</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS7>
 
@@ -141,7 +141,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>MininetCliDriver</type>
-            <connect_order>4</connect_order>
+            <connect_order>16</connect_order>
             <COMPONENTS>
                 <arg1> --custom topo-perf-2sw.py </arg1>
                 <arg2> --arp --mac --topo mytopo</arg2>
@@ -155,7 +155,7 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>RemoteMininetDriver</type>
-            <connect_order>5</connect_order>
+            <connect_order>17</connect_order>
             <COMPONENTS> </COMPONENTS>
         </Mininet2>