diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 7199280..1d41acf 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -32,6 +32,7 @@
 import new
 import xmldict
 import importlib
+import os
 module = new.module("test")
 import openspeak
 global path, drivers_path, core_path, tests_path,logs_path
@@ -164,11 +165,19 @@
         driverClass = getattr(driverModule, driverName)
         driverObject = driverClass()
 
+        try:
+            self.componentDictionary[component]['host'] = os.environ[str( self.componentDictionary[component]['host'])]
+        except KeyError:
+            self.log.info("Missing OC environment variable! Using stored IPs")
+        except Exception as inst:
+            self.log.error("Uncaught exception: " + str(inst))
+
         connect_result = driverObject.connect(user_name = self.componentDictionary[component]['user'] if ('user' in self.componentDictionary[component].keys()) else getpass.getuser(),
                                               ip_address= self.componentDictionary[component]['host'] if ('host' in self.componentDictionary[component].keys()) else 'localhost',
                                               pwd = self.componentDictionary[component]['password'] if ('password' in self.componentDictionary[component].keys()) else 'changeme',
                                               port = self.componentDictionary[component]['port'] if ('port' in self.componentDictionary[component].keys()) else None,
                                               options = driver_options)
+
         if not connect_result:
             self.log.error("Exiting form the test execution because the connecting to the "+component+" component failed.")
             self.exit()
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 820d9ce..3b5a5c7 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1378,20 +1378,30 @@
             response = main.FALSE
         return response
 
-    def arping( self, src, dest, destmac ):
-        self.handle.sendline( '' )
-        self.handle.expect( [ "mininet", pexpect.EOF, pexpect.TIMEOUT ] )
-
-        self.handle.sendline( src + ' arping ' + dest )
+    def arping( self, host="", ip="10.128.20.211" ):
+        """
+        Description:
+            Sends arp message from mininet host for hosts discovery
+        Required:
+            host - hosts name
+        Optional:
+            ip - ip address that does not exist in the network so there would
+                 be no reply.
+        """
+        cmd = " py " + host  + ".cmd(\"arping -c 1 " + ip + "\")"
         try:
-            self.handle.expect( [ destmac, pexpect.EOF, pexpect.TIMEOUT ] )
-            main.log.info( self.name + ": ARP successful" )
-            self.handle.expect( [ "mininet", pexpect.EOF, pexpect.TIMEOUT ] )
+            main.log.warn( "Sending: " + cmd )
+            self.handle.sendline( cmd )
+            response = self.handle.before
+            self.handle.sendline( "" )
+            self.handle.expect( "mininet>" )
             return main.TRUE
-        except Exception:
-            main.log.warn( self.name + ": ARP FAILURE" )
-            self.handle.expect( [ "mininet", pexpect.EOF, pexpect.TIMEOUT ] )
-            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()
 
     def decToHex( self, num ):
         return hex( num ).split( 'x' )[ 1 ]
@@ -1912,6 +1922,7 @@
         hostStr = handlePy.replace( "]", "" )
         hostStr = hostStr.replace( "'", "" )
         hostStr = hostStr.replace( "[", "" )
+        hostStr = hostStr.replace( " ", "" )
         hostList = hostStr.split( "," )
 
         return hostList
diff --git a/TestON/drivers/common/cli/emulator/remotemininetdriver.py b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
index e95e5c1..71bf427 100644
--- a/TestON/drivers/common/cli/emulator/remotemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
@@ -95,6 +95,31 @@
             main.log.warn( outputs )
             return main.TRUE
 
+    def arping( self, host="", ip="10.128.20.211" ):
+        """
+        Description:
+            Sends arp message from mininet host for hosts discovery
+        Required:
+            host - hosts name
+        Optional:
+            ip - ip address that does not exist in the network so there would
+                 be no reply.
+        """
+        cmd = " py " + host  + ".cmd(\"arping -c 1 " + ip + "\")"
+        try:
+            main.log.warn( "Sending: " + cmd )
+            self.handle.sendline( cmd )
+            response = self.handle.before
+            self.handle.sendline( "" )
+            self.handle.expect( "mininet>" )
+            return main.TRUE
+
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            main.cleanup()
+            main.exit()
+
     def pingLong( self, **pingParams ):
         """
         Starts a continuous ping on the mininet host outputting
@@ -344,29 +369,49 @@
             main.cleanup()
             main.exit()
 
-    def runOpticalMnScript( self, ctrllerIP = None ):
+    def runOpticalMnScript( self,name = 'onos', ctrllerIP = None ):
         import time
+        import types
         """
-            This function is only meant for Packet Optical.
-            It runs python script "opticalTest.py" to create the
-            packet layer( mn ) and optical topology
-            
-            TODO: If no ctrllerIP is provided, a default 
+            Description:
+                This function is only meant for Packet Optical.
+                It runs python script "opticalTest.py" to create the
+                packet layer( mn ) and optical topology
+            Optional:
+                name - Name of onos directory. (ONOS | onos)
+            Required:
+                ctrllerIP = Controller(s) IP address
+            TODO: If no ctrllerIP is provided, a default
                 $OC1 can be accepted
         """
         try:
             self.handle.sendline( "" )
             self.handle.expect( "\$" )
-            self.handle.sendline( "cd ~/onos/tools/test/topos" )
+            self.handle.sendline( "cd ~/" + name + "/tools/test/topos" )
             self.handle.expect( "topos\$" )
             if ctrllerIP == None:
                 main.log.info( "You need to specify the IP" )
                 return main.FALSE
             else:
-                cmd = "sudo -E python opticalTest.py " + ctrllerIP
+                controller = ''
+                if isinstance( ctrllerIP, types.ListType ):
+                    for i in xrange( len( ctrllerIP ) ):
+                        controller += ctrllerIP[i] + ' '
+                    main.log.info( "Mininet topology is being loaded with " +
+                                   "controllers: " + controller )
+                elif isinstance( ctrllerIP, types.StringType ):
+                    controller = ctrllerIP
+                    main.log.info( "Mininet topology is being loaded with " +
+                                   "controller: " + controller )
+                else:
+                    main.log.info( "You need to specify a valid IP" )
+                    return main.FALSE
+                cmd = "sudo -E python opticalTest.py " + controller
+                main.log.info( self.name + ": cmd = " + cmd )
                 self.handle.sendline( cmd )
                 self.handle.expect( "Press ENTER to push Topology.json" )
-                time.sleep(15)
+                time.sleep(30)
+                self.handle.sendline( "" )
                 self.handle.sendline( "" )
                 self.handle.expect("mininet>")
                 return main.TRUE
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index a78f4f2..81351ed 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -567,6 +567,8 @@
         # on here.
         appString = "export ONOS_APPS=" + appString
         mnString = "export OCN="
+        if mnIpAddrs == "":
+            mnString = ""
         onosString = "export OC"
         tempCount = 1
 
@@ -1239,8 +1241,8 @@
                 return main.ERROR
             output = ""
             # Is the number of switches is what we expected
-            devices = topology.get( 'deviceCount', False )
-            links = topology.get( 'linkCount', False )
+            devices = topology.get( 'devices', False )
+            links = topology.get( 'links', False )
             if not devices or not links:
                 return main.ERROR
             switchCheck = ( int( devices ) == int( numoswitch ) )
@@ -1901,6 +1903,156 @@
             main.cleanup()
             main.exit()
 
+    def getOnosIps(self):
+
+        import os
+        
+        # reads env for OC variables, also saves file with OC variables. If file and env conflict 
+        # priority goes to env. If file has OCs that are not in the env, the file OCs are used. 
+        # In other words, if the env is set, the test will use those values. 
+
+        # returns a list of ip addresses for the onos nodes, will work with up to 7 nodes + OCN and OCI
+        # returns in format [ OC1 ip, OC2 ...ect. , OCN, OCI ]
+
+        envONOSIps = {}
+
+        x = 1
+        while True:
+            try:
+                temp = os.environ[ 'OC' + str(x) ]
+            except KeyError: 
+                break
+            envONOSIps[ ("OC" + str(x)) ] = temp 
+            x += 1 
+
+        try: 
+            temp = os.environ[ 'OCN' ] 
+            envONOSIps[ "OCN" ] = temp
+        except KeyError: 
+            main.log.info("OCN not set in env")
+
+        try:
+            temp = os.environ[ 'OCI' ]
+            envONOSIps[ "OCI" ] = temp
+        except:
+            main.log.error("OCI not set in env")
+
+        print(str(envONOSIps))
+
+        order = [ "OC1", "OC2", "OC3","OC4","OC5","OC6","OC7","OCN","OCI" ]
+        ONOSIps = []
+
+        try:
+            if os.path.exists("myIps"):
+                ipFile = open("myIps","r+")
+            else:
+                ipFile = open("myIps","w+")
+
+            fileONOSIps = ipFile.readlines()
+            ipFile.close()
+
+            print str(fileONOSIps)
+            
+            if str(fileONOSIps) == "[]": 
+                ipFile = open("myIps","w+")
+                for key in envONOSIps:
+                    ipFile.write(key+ "=" + envONOSIps[key] + "\n")
+                ipFile.close()
+                for i in order: 
+                    if i in envONOSIps: 
+                        ONOSIps.append(envONOSIps[i])
+                
+                return ONOSIps 
+
+            else: 
+                fileDict = {}
+                for line in fileONOSIps: 
+                    line = line.replace("\n","")
+                    line = line.split("=") 
+                    key = line[0]
+                    value = line[1]
+                    fileDict[key] = value 
+
+                for x in envONOSIps: 
+                    if x in fileDict: 
+                        if envONOSIps[x] == fileDict[x]: 
+                            continue
+                        else: 
+                            fileDict[x] = envONOSIps[x]
+                    else: 
+                        fileDict[x] = envONOSIps[x]
+
+                ipFile = open("myIps","w+")
+                for key in order: 
+                    if key in fileDict: 
+                        ipFile.write(key + "=" + fileDict[key] + "\n")
+                        ONOSIps.append(fileDict[key]) 
+                ipFile.close()
+
+                return ONOSIps 
+
+        except IOError as a:
+            main.log.error(a) 
+
+        except Exception as a:
+            main.log.error(a) 
+
+
+    def logReport(self, nodeIp, searchTerms, outputMode="s"):
+        '''
+            - accepts either a list or a string for "searchTerms" these
+              terms will be searched for in the log and have their 
+              instances counted 
+
+            - nodeIp is the ip of the node whos log is to be scanned 
+
+            - output modes: 
+                "s" -   Simple. Quiet output mode that just prints 
+                        the occurances of each search term 
+
+                "d" -   Detailed. Prints occurances as well as the entire
+                        line for each of the last 5 occurances 
+        '''
+        main.log.info("========================== Log Report ===========================\n")
+
+        if type(searchTerms) is str: 
+            searchTerms = [searchTerms]
+
+        logLines = [ [" "] for i in range(len(searchTerms)) ]
+
+        for term in range(len(searchTerms)): 
+            logLines[term][0] = searchTerms[term]
+
+
+        for term in range(len(searchTerms)): 
+            cmd = "onos-ssh " + nodeIp + " cat /opt/onos/log/karaf.log | grep " + searchTerms[term] 
+            self.handle.sendline(cmd)
+            self.handle.expect(":~")
+            before = (self.handle.before).splitlines()
+
+            count = [searchTerms[term],0]
+
+            for line in before:
+                if searchTerms[term] in line and "grep" not in line:
+                    count[1] += 1 
+                    if before.index(line) > ( len(before) - 7 ):
+                        logLines[term].append(line)
+
+            main.log.info( str(count[0]) + ": " + str(count[1]) )
+            if term == len(searchTerms)-1: 
+                print("\n")
+            
+        if outputMode != "s" and outputMode != "S":        
+            outputString = ""
+            for i in logLines:
+                outputString = i[0] + ": \n" 
+                for x in range(1,len(i)): 
+                    outputString += ( i[x] + "\n" )    
+                
+                if outputString != (i[0] + ": \n"):
+                    main.log.info(outputString) 
+                
+        main.log.info("================================================================\n")
 
     def getOnosIpFromEnv(self):
 
@@ -1966,14 +2118,14 @@
 
         return ONOSIps
 
-        
+
     def onosErrorLog(self, nodeIp): 
 
         cmd = "onos-ssh " + nodeIp + " cat /opt/onos/log/karaf.log | grep WARN"
         self.handle.sendline(cmd) 
         self.handle.expect(":~")
         before = (self.handle.before).splitlines() 
-    
+
         warnings = []
 
         for line in before: 
@@ -2044,4 +2196,3 @@
         if len(exceptions) > 0: 
             main.log.info(msg3)
         main.log.info("===============================================================\n")
-        
diff --git a/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py b/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py
new file mode 100644
index 0000000..caaa864
--- /dev/null
+++ b/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py
@@ -0,0 +1,543 @@
+"""
+    Wrapper functions for FuncIntent
+    This functions include Onosclidriver and Mininetclidriver driver functions
+"""
+def __init__( self ):
+    self.default = ''
+
+def hostIntent( main,
+                name="",
+                host1="",
+                host2="",
+                host1Id="",
+                host2Id="",
+                mac1="",
+                mac2="",
+                vlan1="-1",
+                vlan2="-1",
+                sw1="",
+                sw2="",
+                expectedLink=0 ):
+    """
+        Add host intents
+    """
+    import time
+
+    # Assert variables
+    assert main, "There is no main variable"
+    assert name, "variable name is empty"
+    assert host1 and host2, "You must specify hosts"
+
+    global itemName
+    itemName = name
+    h1Name = host1
+    h2Name = host2
+    h1Id = host1Id
+    h2Id = host2Id
+    h1Mac = mac1
+    h2Mac = mac2
+    vlan1 = vlan1
+    vlan2 = vlan2
+    intentsId = []
+    stepResult = main.TRUE
+    pingResult = main.TRUE
+    intentResult = main.TRUE
+    flowResult = main.TRUE
+    topoResult = main.TRUE
+    linkDownResult = main.TRUE
+    linkUpResult = main.TRUE
+
+    if main.hostsData:
+        if not h1Mac:
+            h1Mac = main.hostsData[ h1Name ][ 'mac' ]
+        if not h2Mac:
+            h2Mac = main.hostsData[ h2Name ][ 'mac' ]
+        print '1', main.hostsData[ h1Name ]
+        print '2', main.hostsData[ h2Name ]
+        if main.hostsData[ h1Name ][ 'vlan' ] != '-1':
+            print 'vlan1', main.hostsData[ h1Name ][ 'vlan' ]
+            vlan1 = main.hostsData[ h1Name ][ 'vlan' ]
+        if main.hostsData[ h2Name ][ 'vlan' ] != '-1':
+            print 'vlan2', main.hostsData[ h2Name ][ 'vlan' ]
+            vlan2 = main.hostsData[ h2Name ][ 'vlan' ]
+        if not h1Id:
+            h1Id = main.hostsData[ h1Name ][ 'id' ]
+        if not h2Id:
+            h2Id = main.hostsData[ h2Name ][ 'id' ]
+
+    assert h1Id and h2Id, "You must specify host IDs"
+    if not ( h1Id and h2Id ):
+        main.log.info( "There are no host IDs" )
+        return main.FALSE
+
+    # Discover hosts using arping
+    main.log.info( itemName + ": Discover host using arping" )
+    main.Mininet1.arping( host=h1Name )
+    main.Mininet1.arping( host=h2Name )
+    host1 = main.CLIs[ 0 ].getHost( mac=h1Mac )
+    host2 = main.CLIs[ 0 ].getHost( mac=h2Mac )
+
+    # Adding host intents
+    main.log.info( itemName + ": Adding host intents" )
+    intent1 = main.CLIs[ 0 ].addHostIntent( hostIdOne=h1Id,
+                                           hostIdTwo=h2Id )
+    intentsId.append( intent1 )
+    time.sleep( 5 )
+    intent2 = main.CLIs[ 0 ].addHostIntent( hostIdOne=h2Id,
+                                           hostIdTwo=h1Id )
+    intentsId.append( intent2 )
+
+    # Check intents state
+    time.sleep( 50 )
+    intentResult = checkIntentState( main, intentsId )
+
+    # Verify flows
+    checkFlowsState( main )
+
+    # Ping hosts
+    pingHost( main, h1Name, h2Name )
+    # Ping hosts again...
+    pingResult = pingHost( main, h1Name, h2Name )
+    time.sleep( 5 )
+
+    # Test rerouting if these variables exist
+    if sw1 and sw2 and expectedLink:
+        # link down
+        link( main, sw1, sw2, "down" )
+        intentResult = intentResult and checkIntentState( main, intentsId )
+
+        # Verify flows
+        checkFlowsState( main )
+
+        # Check OnosTopology
+        topoResult = checkTopology( main, expectedLink )
+
+        # Ping hosts
+        pingResult = pingResult and pingHost( main, h1Name, h2Name )
+
+        intentResult = checkIntentState( main, intentsId )
+
+        # link up
+        link( main, sw1, sw2, "up" )
+        time.sleep( 5 )
+
+        # Verify flows
+        checkFlowsState( main )
+
+        # Check OnosTopology
+        topoResult = checkTopology( main, expectedLink )
+
+        # Ping hosts
+        pingResult = pingResult and pingHost( main, h1Name, h2Name )
+
+    # Remove intents
+    for intent in intentsId:
+        main.CLIs[ 0 ].removeIntent( intentId=intent, purge=True )
+
+    print main.CLIs[ 0 ].intents()
+    stepResult = pingResult and linkDownResult and linkUpResult \
+                 and intentResult
+
+    return stepResult
+
+def pointIntent( main,
+                 name="",
+                 host1="",
+                 host2="",
+                 deviceId1="",
+                 deviceId2="",
+                 port1="",
+                 port2="",
+                 ethType="",
+                 mac1="",
+                 mac2="",
+                 bandwidth="",
+                 lambdaAlloc=False,
+                 ipProto="",
+                 ip1="",
+                 ip2="",
+                 tcp1="",
+                 tcp2="",
+                 sw1="",
+                 sw2="",
+                 expectedLink=0 ):
+    """
+        Add Point intents
+    """
+    import time
+    assert main, "There is no main variable"
+    assert name, "variable name is empty"
+    assert host1 and host2, "You must specify hosts"
+
+    global itemName
+    itemName = name
+    h1Name = host1
+    h2Name = host2
+    intentsId = []
+
+    pingResult = main.TRUE
+    intentResult = main.TRUE
+    flowResult = main.TRUE
+    topoResult = main.TRUE
+    linkDownResult = main.TRUE
+    linkUpResult = main.TRUE
+
+    # Adding bidirectional point  intents
+    main.log.info( itemName + ": Adding host intents" )
+    intent1 = main.CLIs[ 0 ].addPointIntent( ingressDevice=deviceId1,
+                                             egressDevice=deviceId2,
+                                             portIngress=port1,
+                                             portEgress=port2,
+                                             ethType=ethType,
+                                             ethSrc=mac1,
+                                             ethDst=mac2,
+                                             bandwidth=bandwidth,
+                                             lambdaAlloc=lambdaAlloc,
+                                             ipProto=ipProto,
+                                             ipSrc=ip1,
+                                             ipDst=ip2,
+                                             tcpSrc=tcp1,
+                                             tcpDst=tcp2 )
+
+    intentsId.append( intent1 )
+    time.sleep( 5 )
+    intent2 = main.CLIs[ 0 ].addPointIntent( ingressDevice=deviceId2,
+                                             egressDevice=deviceId1,
+                                             portIngress=port2,
+                                             portEgress=port1,
+                                             ethType=ethType,
+                                             ethSrc=mac2,
+                                             ethDst=mac1,
+                                             bandwidth=bandwidth,
+                                             lambdaAlloc=lambdaAlloc,
+                                             ipProto=ipProto,
+                                             ipSrc=ip2,
+                                             ipDst=ip1,
+                                             tcpSrc=tcp2,
+                                             tcpDst=tcp1 )
+    intentsId.append( intent2 )
+
+    # Check intents state
+    time.sleep( 50 )
+    intentResult = checkIntentState( main, intentsId )
+
+    # Verify flows
+    checkFlowsState( main )
+
+    # Ping hosts
+    pingHost( main, h1Name, h2Name )
+    # Ping hosts again...
+    pingResult = pingHost( main, h1Name, h2Name )
+    time.sleep( 5 )
+
+    if sw1 and sw2 and expectedLink:
+        # link down
+        link( main, sw1, sw2, "down" )
+        intentResult = intentResult and checkIntentState( main, intentsId )
+
+        # Verify flows
+        checkFlowsState( main )
+
+        # Check OnosTopology
+        topoResult = checkTopology( main, expectedLink )
+
+        # Ping hosts
+        pingResult = pingResult and pingHost( main, h1Name, h2Name )
+
+        intentResult = checkIntentState( main, intentsId )
+
+        # link up
+        link( main, sw1, sw2, "up" )
+        time.sleep( 5 )
+
+        # Verify flows
+        checkFlowsState( main )
+
+        # Check OnosTopology
+        topoResult = checkTopology( main, expectedLink )
+
+        # Ping hosts
+        pingResult = pingResult and pingHost( main, h1Name, h2Name )
+
+    # Remove intents
+    for intent in intentsId:
+        main.CLIs[ 0 ].removeIntent( intentId=intent, purge=True )
+
+    print main.CLIs[ 0 ].intents()
+    stepResult = pingResult and linkDownResult and linkUpResult \
+                 and intentResult
+
+    return stepResult
+
+def singleToMultiIntent( main,
+                         name="",
+                         hostNames="",
+                         devices="",
+                         ports=None,
+                         ethType="",
+                         macs=None,
+                         bandwidth="",
+                         lambdaAlloc=False,
+                         ipProto="",
+                         ipAddresses="",
+                         tcp="",
+                         sw1="",
+                         sw2="",
+                         expectedLink=0 ):
+    """
+        Add Single to Multi Point intents
+        If main.hostsData is not defined, variables data should be passed in the
+        same order index wise.
+        eg. hostName = [ 'h1', 'h2' ,..  ]
+            devices = [ 'of:0000000000000001', 'of:0000000000000002', ...]
+            ports = [ '1', '1', ..]
+            ...
+    """
+    import time
+    assert main, "There is no main variable"
+    assert name, "variable name is empty"
+    assert hostNames, "You must specify hosts"
+    assert devices or main.hostsData, "You must specify devices"
+
+    global itemName
+    itemName = name
+    tempHostsData = {}
+    intentsId = []
+
+    if hostNames and devices:
+        if len( hostNames ) != len( devices ):
+            main.log.error( "hosts and devices does not have the same length" )
+            print "hostNames = ", len( hostNames )
+            print "devices = ", len( devices )
+            return main.FALSE
+        if ports:
+            if len( ports ) != len( devices ):
+                main.log.error( "Ports and devices does " +
+                                "not have the same length" )
+                print "devices = ", len( devices )
+                print "ports = ", len( ports )
+                return main.FALSE
+        else:
+            main.log.info( "Device Ports are not specified" )
+    elif hostNames and not devices and main.hostsData:
+        main.log.info( "singleToMultiIntent function is using main.hostsData" ) 
+        print main.hostsData
+
+    pingResult = main.TRUE
+    intentResult = main.TRUE
+    flowResult = main.TRUE
+    topoResult = main.TRUE
+    linkDownResult = main.TRUE
+    linkUpResult = main.TRUE
+
+    # Adding bidirectional point  intents
+    main.log.info( itemName + ": Adding host intents" )
+    intent1 = main.CLIs[ 0 ].addSinglepointToMultipointIntent(
+                                            ingressDevice=deviceId1,
+                                            egressDevice=deviceId2,
+                                            portIngress=port1,
+                                            portEgress=port2,
+                                            ethType=ethType,
+                                            ethSrc=mac1,
+                                            ethDst=mac2,
+                                            bandwidth=bandwidth,
+                                            lambdaAlloc=lambdaAlloc,
+                                            ipProto=ipProto,
+                                            ipSrc=ip1,
+                                            ipDst=ip2,
+                                            tcpSrc=tcp1,
+                                            tcpDst=tcp2 )
+
+    intentsId.append( intent1 )
+    time.sleep( 5 )
+    intent2 = main.CLIs[ 0 ].addPointIntent( ingressDevice=deviceId2,
+                                             egressDevice=deviceId1,
+                                             portIngress=port2,
+                                             portEgress=port1,
+                                             ethType=ethType,
+                                             ethSrc=mac2,
+                                             ethDst=mac1,
+                                             bandwidth=bandwidth,
+                                             lambdaAlloc=lambdaAlloc,
+                                             ipProto=ipProto,
+                                             ipSrc=ip2,
+                                             ipDst=ip1,
+                                             tcpSrc=tcp2,
+                                             tcpDst=tcp1 )
+    intentsId.append( intent2 )
+
+    # Check intents state
+    time.sleep( 50 )
+    intentResult = checkIntentState( main, intentsId )
+
+    # Verify flows
+    checkFlowsState( main )
+
+    # Ping hosts
+    pingHost( main, h1Name, h2Name )
+    # Ping hosts again...
+    pingResult = pingHost( main, h1Name, h2Name )
+    time.sleep( 5 )
+
+    if sw1 and sw2 and expectedLink:
+        # link down
+        link( main, sw1, sw2, "down" )
+        intentResult = intentResult and checkIntentState( main, intentsId )
+
+        # Verify flows
+        checkFlowsState( main )
+
+        # Check OnosTopology
+        topoResult = checkTopology( main, expectedLink )
+
+        # Ping hosts
+        pingResult = pingResult and pingHost( main, h1Name, h2Name )
+
+        intentResult = checkIntentState( main, intentsId )
+
+        # link up
+        link( main, sw1, sw2, "up" )
+        time.sleep( 5 )
+
+        # Verify flows
+        checkFlowsState( main )
+
+        # Check OnosTopology
+        topoResult = checkTopology( main, expectedLink )
+
+        # Ping hosts
+        pingResult = pingResult and pingHost( main, h1Name, h2Name )
+
+    # Remove intents
+    for intent in intentsId:
+        main.CLIs[ 0 ].removeIntent( intentId=intent, purge=True )
+
+    print main.CLIs[ 0 ].intents()
+    stepResult = pingResult and linkDownResult and linkUpResult \
+                 and intentResult
+
+    return stepResult
+
+def link( main, sw1, sw2, option):
+
+    # link down
+    main.log.info( itemName + ": Bring link " + option + "between " +
+                   sw1 + " and " + sw2 )
+    main.Mininet1.link( end1=sw1, end2=sw2, option=option )
+
+def pingAllHost( main, hosts ):
+    # Ping all host in the hosts list variable
+    import itertools
+
+    main.log.info( itemName + ": Ping host list - " + hosts )
+    hostCombination = itertools.permutation( hosts, 2 )
+    pingResult = main.TRUE
+    for hostPair in hostCombination:
+        pingResult = pingResult and main.Mininet.pingHost(
+                                                    src=hostPair[ 0 ],
+                                                    target=hostPair[ 1 ] )
+    return pingResult
+
+def pingHost( main, h1Name, h2Name ):
+
+    # Ping hosts
+    main.log.info( itemName + ": Ping " + h1Name + " and " +
+                   h2Name )
+    pingResult1 = main.Mininet1.pingHost( src=h1Name , target=h2Name )
+    if not pingResult1:
+        main.log.info( itemName + ": " + h1Name + " cannot ping "
+                       + h2Name )
+    pingResult2 = main.Mininet1.pingHost( src=h2Name , target=h1Name )
+    if not pingResult2:
+        main.log.info( itemName + ": " + h2Name + " cannot ping "
+                       + h1Name )
+    pingResult = pingResult1 and pingResult2
+    if pingResult:
+        main.log.info( itemName + ": Successfully pinged " +
+                       "both hosts" )
+    else:
+        main.log.info( itemName + ": Failed to ping " +
+                       "both hosts" )
+    return pingResult
+
+def getHostsData( main ):
+    """
+        Use fwd app and pingall to discover all the hosts
+    """
+    """
+        hosts json format:
+    """
+    import json
+    activateResult = main.TRUE
+    appCheck = main.TRUE
+    main.log.info( "Activating reactive forwarding app " )
+    activateResult = main.CLIs[ 0 ].activateApp( "org.onosproject.fwd" )
+
+    for i in range( main.numCtrls ):
+        appCheck = appCheck and main.CLIs[ i ].appToIDCheck()
+
+    if appCheck != main.TRUE:
+        main.log.warn( main.CLIs[ 0 ].apps() )
+        main.log.warn( main.CLIs[ 0 ].appIDs() )
+
+    pingResult = main.Mininet1.pingall()
+    hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
+    hosts = main.Mininet1.getHosts()
+    for host in hosts:
+        main.hostsData[ host ] = {}
+        main.hostsData[ host ][ 'mac' ] =  \
+            main.Mininet1.getMacAddress( host ).upper()
+        for hostj in hostsJson:
+            if main.hostsData[ host ][ 'mac' ] == hostj[ 'mac' ]:
+                main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
+                main.hostsData[ host ][ 'vlan' ] = hostj[ 'vlan' ]
+                main.hostsData[ host ][ 'location' ] = \
+                            hostj[ 'location' ][ 'elementId' ] + '/' + \
+                            hostj[ 'location' ][ 'port' ]
+                main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
+
+    main.log.info( "Deactivating reactive forwarding app " )
+    activateResult = main.CLIs[ 0 ].deactivateApp( "org.onosproject.fwd" )
+    print main.hostsData
+    return pingResult
+
+def checkTopology( main, expectedLink ):
+    statusResult = main.TRUE
+    # Check onos topology
+    main.log.info( itemName + ": Checking ONOS topology " )
+
+    for i in range( main.numCtrls ):
+        topologyResult = main.CLIs[ i ].topology()
+        statusResult = main.ONOSbench.checkStatus( topologyResult,
+                                                   main.numSwitch,
+                                                   expectedLink )\
+                       and statusResult
+    if not statusResult:
+        main.log.info( itemName + ": Topology mismatch" )
+    else:
+        main.log.info( itemName + ": Topology match" )
+    return statusResult
+
+def checkIntentState( main, intentsId ):
+
+    main.log.info( itemName + ": Check host intents state" )
+    for i in range( main.numCtrls ):
+        intentResult = main.CLIs[ i ].checkIntentState( intentsId=intentsId )
+    if not intentResult:
+        main.log.info( itemName +  ": Check host intents state again")
+        for i in range( main.numCtrls ):
+            intentResult = main.CLIs[ i ].checkIntentState(
+                                                          intentsId=intentsId )
+    return intentResult
+
+def checkFlowsState( main ):
+
+    main.log.info( itemName + ": Check flows state" )
+    checkFlowsResult = main.CLIs[ 0 ].checkFlowsState()
+    return checkFlowsResult
+
+def printMsg( main, h1Name, h2Name ):
+    main.log.info("PINGING HOST INSIDE printMSG")
+    pingHost( main, itemName, h1Name, h2Name )
+    print 'lala'
+
diff --git a/TestON/tests/TopoPerfNext/__init__.py b/TestON/tests/FuncIntent/Dependency/__init__.py
similarity index 100%
copy from TestON/tests/TopoPerfNext/__init__.py
copy to TestON/tests/FuncIntent/Dependency/__init__.py
diff --git a/TestON/tests/FuncIntent/FuncIntent.params b/TestON/tests/FuncIntent/FuncIntent.params
index 3d2ef8a..6a346bc 100755
--- a/TestON/tests/FuncIntent/FuncIntent.params
+++ b/TestON/tests/FuncIntent/FuncIntent.params
@@ -1,11 +1,11 @@
 <PARAMS>
 
-    <testcases>10,11,12,1001,10,12,1001</testcases>
-    
+    <testcases>10,11,12,13,1001,1002</testcases>
+
     <SCALE>1,3</SCALE>
     <availableNodes>3</availableNodes>
     <ENV>
-        <cellName>single_func</cellName>
+        <cellName>functionality</cellName>
         <cellApps>drivers,openflow,proxyarp,mobility</cellApps>
     </ENV>
     <GIT>
@@ -23,7 +23,7 @@
     </CTRL>
     <BENCH>
         <user>admin</user>
-        <ip1>10.128.10.20</ip1>
+        <ip1>OCN</ip1>
     </BENCH>
     <MININET>
         <switch>7</switch>
diff --git a/TestON/tests/FuncIntent/FuncIntent.py b/TestON/tests/FuncIntent/FuncIntent.py
index 1db5752..d3583e6 100644
--- a/TestON/tests/FuncIntent/FuncIntent.py
+++ b/TestON/tests/FuncIntent/FuncIntent.py
@@ -15,6 +15,7 @@
     def CASE10( self, main ):
         import time
         import os
+        import imp
         """
         Startup sequence:
         cell <name>
@@ -27,22 +28,29 @@
         onos-wait-for-start
         """
         global init
+        global globalONOSip
         try:
             if type(init) is not bool:
                 init = False
         except NameError:
             init = False
+
+        main.wrapper = imp.load_source( 'FuncIntentFunction',
+                                    '/home/admin/ONLabTest/TestON/tests/' +
+                                    'FuncIntent/Dependency/' +
+                                    'FuncIntentFunction.py' )
         #Local variables
         cellName = main.params[ 'ENV' ][ 'cellName' ]
         apps = main.params[ 'ENV' ][ 'cellApps' ]
         gitBranch = main.params[ 'GIT' ][ 'branch' ]
-        #benchIp = main.params[ 'BENCH' ][ 'ip1' ]
+        benchIp = os.environ[ 'OCN' ]
         benchUser = main.params[ 'BENCH' ][ 'user' ]
         topology = main.params[ 'MININET' ][ 'topo' ]
-        #maxNodes = int( main.params[ 'availableNodes' ] )
         main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
         main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
         main.numCtrls = main.params[ 'CTRL' ][ 'num' ]
+        main.ONOSport = []
+        main.hostsData = {}
         PULLCODE = False
         if main.params[ 'GIT' ][ 'pull' ] == 'True':
             PULLCODE = True
@@ -50,13 +58,12 @@
         main.CLIs = []
         for i in range( 1, int( main.numCtrls ) + 1 ):
             main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+            main.ONOSport.append( main.params[ 'CTRL' ][ 'port' + str( i ) ] )
 
         # -- INIT SECTION, ONLY RUNS ONCE -- #
         if init == False:
             init = True
 
-            #main.ONOSip = []
-            main.ONOSport = []
             main.scale = ( main.params[ 'SCALE' ] ).split( "," )
             main.numCtrls = int( main.scale[ 0 ] )
 
@@ -78,42 +85,24 @@
             else:
                 main.log.warn( "Did not pull new code so skipping mvn " +
                                "clean install" )
-            # Populate main.ONOSip with ips from params
-            #for i in range( 1, maxNodes + 1):
-            #    main.ONOSip.append( main.params[ 'CTRL' ][ 'ip' + str( i ) ] )
-            #    main.ONOSport.append( main.params[ 'CTRL' ][ 'port' +
-            #                          str( i ) ])
-        
-            ONOSip = main.ONOSbench.getOnosIpFromEnv()
-            main.log.info("\t\t CLUSTER IPs: \n\n" + str(ONOSip) + "\n\n") 
+
+            globalONOSip = main.ONOSbench.getOnosIps()
+
+        maxNodes = ( len(globalONOSip) - 2 )
 
         main.numCtrls = int( main.scale[ 0 ] )
         main.scale.remove( main.scale[ 0 ] )
-        
+
+        main.ONOSip = []
+        for i in range( maxNodes ):
+            main.ONOSip.append( globalONOSip[i] )
+
         #kill off all onos processes
         main.log.info( "Safety check, killing all ONOS processes" +
                        " before initiating enviornment setup" )
-        for i in range( maxNodes ):
-            main.ONOSbench.onosDie( main.ONOSip[ i ] )
-        """
-        main.step( "Apply cell to environment" )
-        cellResult = main.ONOSbench.setCell( cellName )
-        verifyResult = main.ONOSbench.verifyCell()
-        stepResult = cellResult and verifyResult
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully applied cell to " + \
-                                        "environment",
-                                 onfail="Failed to apply cell to environment " )
-        """
-        """main.step( "Removing raft logs" )
-        removeRaftResult = main.ONOSbench.onosRemoveRaftLogs()
-        stepResult = removeRaftResult
-        utilities.assert_equals( expect=main.TRUE,
-                                 actual=stepResult,
-                                 onpass="Successfully removed raft logs",
-                                 onfail="Failed to remove raft logs" )
-        """
+        for i in range(maxNodes):
+            main.ONOSbench.onosDie( globalONOSip[ i ] )
+
         print "NODE COUNT = ", main.numCtrls
         main.log.info( "Creating cell file" )
         cellIp = []
@@ -143,7 +132,7 @@
 
         main.step( "Uninstalling ONOS package" )
         onosUninstallResult = main.TRUE
-        for i in range( main.numCtrls):
+        for i in range( main.numCtrls ):
             onosUninstallResult = onosUninstallResult and \
                     main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
         stepResult = onosUninstallResult
@@ -154,7 +143,7 @@
         time.sleep( 5 )
         main.step( "Installing ONOS package" )
         onosInstallResult = main.TRUE
-        for i in range( main.numCtrls):
+        for i in range( main.numCtrls ):
             onosInstallResult = onosInstallResult and \
                     main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
         stepResult = onosInstallResult
@@ -163,7 +152,7 @@
                                  onpass="Successfully installed ONOS package",
                                  onfail="Failed to install ONOS package" )
 
-        time.sleep( 5 )
+        time.sleep( 20 )
         main.step( "Starting ONOS service" )
         stopResult = main.TRUE
         startResult = main.TRUE
@@ -186,7 +175,7 @@
                                  actual=stepResult,
                                  onpass="ONOS service is ready",
                                  onfail="ONOS service did not start properly" )
-        
+
         main.step( "Start ONOS cli" )
         cliResult = main.TRUE
         for i in range( main.numCtrls ):
@@ -198,6 +187,16 @@
                                  onpass="Successfully start ONOS cli",
                                  onfail="Failed to start ONOS cli" )
 
+    def CASE9( self, main ):
+        '''
+            Report errors/warnings/exceptions
+        '''
+        main.log.info( "Error report: \n" )
+        main.ONOSbench.logReport( globalONOSip[0],
+                [ "INFO", "FOLLOWER", "WARN", "flow", "ERROR" , "Except" ],
+                "s" )
+        #main.ONOSbench.logReport( globalONOSip[1], [ "INFO" ], "d" )
+
     def CASE11( self, main ):
         """
             Start mininet
@@ -223,6 +222,7 @@
         """
         import re
 
+        main.case( "Assign switches to controllers" )
         main.step( "Assigning switches to controllers" )
         assignResult = main.TRUE
         for i in range( 1, ( main.numSwitch + 1 ) ):
@@ -244,6 +244,19 @@
                                         "to controller",
                                  onfail="Failed to assign switches to " +
                                         "controller" )
+    def CASE13( self, main ):
+        """
+            Discover all hosts and store its data to a dictionary
+        """
+        main.case( "Discover all hosts" )
+
+        stepResult = main.TRUE
+        main.step( "Discover all hosts using pingall " )
+        stepResult = main.wrapper.getHostsData( main )
+        utilities.assert_equals( expect=main.FALSE,
+                                 actual=stepResult,
+                                 onpass="Successfully discovered hosts",
+                                 onfail="Failed to discover hosts" )
 
     def CASE1001( self, main ):
         """
@@ -251,12 +264,16 @@
                 - Discover hosts
                 - Add host intents
                 - Check intents
-                - Check flows
+                - Verify flows
                 - Ping hosts
                 - Reroute
                     - Link down
+                    - Verify flows
+                    - Check topology
                     - Ping hosts
                     - Link up
+                    - Verify flows
+                    - Check topology
                     - Ping hosts
                 - Remove intents
         """
@@ -270,203 +287,146 @@
                        'id':'00:00:00:00:00:0X/-X' } , 'host2':
                      { 'name': '', 'MAC': '00:00:00:00:00:0X',
                        'id':'00:00:00:00:00:0X/-X'}, 'link': { 'switch1': '',
-                       'switch2': '', 'num':'' } }
+                       'switch2': '', 'expect':'' } }
         """
-        # Local variables
-        items = []
-        ipv4 = { 'name': 'IPV4', 'host1':
-                 { 'name': 'h1', 'MAC': '00:00:00:00:00:01',
-                   'id':'00:00:00:00:00:01/-1' } , 'host2':
-                 { 'name': 'h9', 'MAC': '00:00:00:00:00:09',
-                   'id':'00:00:00:00:00:09/-1'}, 'link': { 'switch1': 's5',
-                   'switch2': 's2', 'num':'18' } }
-        dualStack1 = { 'name': 'DUALSTACK1', 'host1':
-                 { 'name': 'h3', 'MAC': '00:00:00:00:00:03',
-                   'id':'00:00:00:00:00:03/-1' } , 'host2':
-                 { 'name': 'h11', 'MAC': '00:00:00:00:00:0B',
-                   'id':'00:00:00:00:00:0B/-1'}, 'link': { 'switch1': 's5',
-                   'switch2': 's2', 'num':'18' } }
-        items.append( ipv4 )
-        items.append( dualStack1 )
-        # Global variables
-        
-        main.log.case( "Add host intents between 2 host" )
-        
-        for item in items:
-            stepResult = main.TRUE
-            itemName = item[ 'name' ]
-            h1Name = item[ 'host1' ][ 'name' ]
-            h2Name = item[ 'host2' ][ 'name' ]
-            h1Mac = item[ 'host1' ][ 'MAC' ]
-            h2Mac = item[ 'host2' ][ 'MAC' ]
-            h1Id = item[ 'host1' ][ 'id']
-            h2Id = item[ 'host2' ][ 'id']
-            # Link down/up for rerouting
-            sw1 = item[ 'link' ][ 'switch1' ]
-            sw2 = item[ 'link' ][ 'switch2' ]
-            remLink = item[ 'link' ][ 'num' ]
-            pingResult = main.TRUE
-            statusResult = main.TRUE
-            linkDownResult = main.TRUE
-            linkUpResult = main.TRUE
-            intentsId = []
-            main.step( itemName + ": Add host intents between " + h1Name
-                        + " and " + h2Name )
-            main.log.info( itemName + ": Discover host using arping" )
-            main.Mininet1.arping( host=h1Name )
-            main.Mininet1.arping( host=h2Name )
-            host1 = main.CLIs[ 0 ].getHost( mac=h1Mac )
-            host2 = main.CLIs[ 0 ].getHost( mac=h2Mac )
-            print host1
-            print host2
-            # Adding intents
-            main.log.info( itemName + ": Adding host intents" )
-            intent1 = main.CLIs[ 0 ].addHostIntent( hostIdOne=h1Id,
-                                                   hostIdTwo=h2Id )
-            intentsId.append( intent1 )
-            time.sleep( 5 )
-            intent2 = main.CLIs[ 0 ].addHostIntent( hostIdOne=h2Id,
-                                                   hostIdTwo=h1Id )
-            intentsId.append( intent2 )
-            # Checking intents
-            main.log.info( itemName + ": Check host intents state" )
-            time.sleep( 30 )
-            for i in range( main.numCtrls ):
-                intentResult = main.CLIs[ i ].checkIntentState(
-                                                          intentsId=intentsId )
-            if not intentResult:
-                main.log.info( itemName +  ": Check host intents state" +
-                               " again")
-                for i in range( main.numCtrls ):
-                    intentResult = main.CLIs[ i ].checkIntentState(
-                                                          intentsId=intentsId )
-            # Ping hosts
-            time.sleep( 10 )
-            main.log.info( itemName + ": Ping " + h1Name + " and " +
-                           h2Name )
-            pingResult1 = main.Mininet1.pingHost( src=h1Name , target=h2Name )
-            if not pingResult1:
-                main.log.info( itemName + ": " + h1Name + " cannot ping "
-                               + h2Name )
-            pingResult2 = main.Mininet1.pingHost( src=h2Name , target=h1Name )
-            if not pingResult2:
-                main.log.info( itemName + ": " + h2Name + " cannot ping "
-                               + h1Name )
-            pingResult = pingResult1 and pingResult2
-            if pingResult:
-                main.log.info( itemName + ": Successfully pinged " +
-                               "both hosts" )
-            else:
-                main.log.info( itemName + ": Failed to ping " +
-                               "both hosts" )
-            # Rerouting ( link down )
-            main.log.info( itemName + ": Bring link down between " +
-                           sw1 + " and " + sw2 )
-            main.Mininet1.link( end1=sw1,
-                                end2=sw2,
-                                option="down" )
-            time.sleep( 5 )
 
-            # Check onos topology
-            main.log.info( itemName + ": Checking ONOS topology " )
+        # Assert variables - These variable's name|format must be followed
+        # if you want to use the wrapper function
+        assert main, "There is no main"
+        assert main.CLIs, "There is no main.CLIs"
+        assert main.Mininet1, "Mininet handle should be named Mininet1"
+        assert main.numSwitch, "Placed the total number of switch topology in \
+                                main.numSwitch"
 
-            for i in range( main.numCtrls ):
-                topologyResult = main.CLIs[ i ].topology()
-                linkDownResult = main.ONOSbench.checkStatus( topologyResult,
-                                                           main.numSwitch,
-                                                           remLink )\
-                               and linkDownResult
-            if not linkDownResult:
-                main.log.info( itemName + ": Topology mismatch" )
-            else:
-                main.log.info( itemName + ": Topology match" )
+        main.case( "Add host intents between 2 host" )
 
-            # Ping hosts
-            main.log.info( itemName + ": Ping " + h1Name + " and " +
-                           h2Name )
-            pingResult1 = main.Mininet1.pingHost( src=h1Name , target=h2Name )
-            if not pingResult1:
-                main.log.info( itemName + ": " + h1Name + " cannot ping "
-                               + h2Name )
-            pingResult2 = main.Mininet1.pingHost( src=h2Name , target=h1Name )
-            if not pingResult2:
-                main.log.info( itemName + ": " + h2Name + " cannot ping "
-                               + h1Name )
-            pingResult = pingResult1 and pingResult2
-            if pingResult:
-                main.log.info( itemName + ": Successfully pinged " +
-                               "both hosts" )
-            else:
-                main.log.info( itemName + ": Failed to ping " +
-                               "both hosts" )
-            # link up
-            main.log.info( itemName + ": Bring link up between " +
-                           sw1 + " and " + sw2 )
-            main.Mininet1.link( end1=sw1,
-                                end2=sw2,
-                                option="up" )
-            time.sleep( 5 )
+        stepResult = main.TRUE
+        main.step( "IPV4: Add host intents between h1 and h9" )
+        stepResult = main.wrapper.hostIntent( main,
+                                              name='IPV4',
+                                              host1='h1',
+                                              host2='h9',
+                                              host1Id='00:00:00:00:00:01/-1',
+                                              host2Id='00:00:00:00:00:09/-1',
+                                              sw1='s5',
+                                              sw2='s2',
+                                              expectedLink=18 )
 
-            # Check onos topology
-            main.log.info( itemName + ": Checking ONOS topology " )
-            for i in range( main.numCtrls ):
-                topologyResult = main.CLIs[ i ].topology()
-                linkUpResult = main.ONOSbench.checkStatus( topologyResult,
-                                                           main.numSwitch,
-                                                           main.numLinks )\
-                               and linkUpResult
-            if not linkUpResult:
-                main.log.info( itemName + ": Topology mismatch" )
-            else:
-                main.log.info( itemName + ": Topology match" )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="IPV4: Add host intent successful",
+                                 onfail="IPV4: Add host intent failed" )
+        stepResult = main.TRUE
 
-            # Ping hosts
-            main.log.info( itemName + ": Ping " + h1Name + " and " +
-                           h2Name )
-            pingResult1 = main.Mininet1.pingHost( src=h1Name , target=h2Name )
-            if not pingResult1:
-                main.log.info( itemName + ": " + h1Name + " cannot ping "
-                               + h2Name )
-            pingResult2 = main.Mininet1.pingHost( src=h2Name , target=h1Name )
-            if not pingResult2:
-                main.log.info( itemName + ": " + h2Name + " cannot ping "
-                               + h1Name )
-            pingResult = pingResult1 and pingResult2
-            if pingResult:
-                main.log.info( itemName + ": Successfully pinged " +
-                               "both hosts" )
-            else:
-                main.log.info( itemName + ": Failed to ping " +
-                               "both hosts" )
+        main.step( "DUALSTACK: Add host intents between h3 and h11" )
+        stepResult = main.wrapper.hostIntent( main,
+                                              name='DUALSTACK',
+                                              host1='h3',
+                                              host2='h11',
+                                              host1Id='00:00:00:00:00:03/-1',
+                                              host2Id='00:00:00:00:00:0B/-1',
+                                              sw1='s5',
+                                              sw2='s2',
+                                              expectedLink=18 )
 
-            # Remove intents
-            for intent in intentsId:
-                main.CLIs[ 0 ].removeIntent( intentId=intent, purge=True )
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="DUALSTACK: Add host intent successful",
+                                 onfail="DUALSTACK: Add host intent failed" )
 
-            print main.CLIs[ 0 ].intents()
-            stepResult = pingResult and linkDownResult and linkUpResult \
-                         and intentResult
-            utilities.assert_equals( expect=main.TRUE,
-                                     actual=stepResult,
-                                     onpass=itemName +
-                                            ": host intent successful",
-                                     onfail=itemName +
-                                            ": Add host intent failed" )
     def CASE1002( self, main ):
         """
             Add point intents between 2 hosts:
-                - Get device ids
+                - Get device ids | ports
                 - Add point intents
                 - Check intents
-                - Check flows
+                - Verify flows
                 - Ping hosts
                 - Reroute
                     - Link down
+                    - Verify flows
+                    - Check topology
                     - Ping hosts
                     - Link up
+                    - Verify flows
+                    - Check topology
                     - Ping hosts
                 - Remove intents
         """
+        import time
+        import json
+        import re
+        """
+            Create your item(s) here
+            item = { 'name':'', 'host1': { 'name': '' },
+                     'host2': { 'name': '' },
+                     'ingressDevice':'' , 'egressDevice':'',
+                     'ingressPort':'', 'egressPort':'',
+                     'option':{ 'ethType':'', 'ethSrc':'', 'ethDst':'' } ,
+                     'link': { 'switch1': '', 'switch2':'', 'expect':'' } }
+
+        """
+
+        # Assert variables - These variable's name|format must be followed
+        # if you want to use the wrapper function
+        assert main, "There is no main"
+        assert main.CLIs, "There is no main.CLIs"
+        assert main.Mininet1, "Mininet handle should be named Mininet1"
+        assert main.numSwitch, "Placed the total number of switch topology in \
+                                main.numSwitch"
+
+        ipv4 = { 'name':'IPV4', 'ingressDevice':'of:0000000000000005/1' ,
+                 'host1': { 'name': 'h1' }, 'host2': { 'name': 'h9' },
+                 'egressDevice':'of:0000000000000006/1', 'option':
+                 { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:01',
+                   'ethDst':'00:00:00:00:00:09' }, 'link': { 'switch1':'s5',
+                 'switch2':'s2', 'expect':'18' } }
+
+        """
+        ipv4 = { 'name':'IPV4', 'ingressDevice':'of:0000000000000005/1' ,
+                 'host1': { 'name': 'h1' }, 'host2': { 'name': 'h9' },
+                 'egressDevice':'of:0000000000000006/1', 'option':
+                 { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:01' },
+                 'link': { 'switch1':'s5', 'switch2':'s2', 'expect':'18' } }
+        """
+        dualStack1 = { 'name':'IPV4', 'ingressDevice':'0000000000000005/3' ,
+                       'host1': { 'name': 'h3' }, 'host2': { 'name': 'h11' },
+                       'egressDevice':'0000000000000006/3', 'option':
+                       { 'ethType':'IPV4', 'ethSrc':'00:00:00:00:00:03',
+                       'ethDst':'00:00:00:00:00:0B' }, 'link': { 'switch1':'s5',
+                       'switch2':'s2', 'expect':'18' } }
+
+        main.case( "Add point intents between 2 devices" )
+
+        stepResult = main.TRUE
+        main.step( "IPV4: Add point intents between h1 and h9" )
+        stepResult = main.wrapper.pointIntent(
+                                       main,
+                                       name="IPV4",
+                                       host1="h1",
+                                       host2="h9",
+                                       deviceId1="of:0000000000000005/1",
+                                       deviceId2="of:0000000000000006/1",
+                                       port1="",
+                                       port2="",
+                                       ethType="IPV4",
+                                       mac1="00:00:00:00:00:01",
+                                       mac2="00:00:00:00:00:09",
+                                       bandwidth="",
+                                       lambdaAlloc=False,
+                                       ipProto="",
+                                       ip1="",
+                                       ip2="",
+                                       tcp1="",
+                                       tcp2="",
+                                       sw1="s5",
+                                       sw2="s2",
+                                       expectedLink=18 )
+
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="IPV4: Add point intent successful",
+                                 onfail="IPV4: Add point intent failed" )
 
     def CASE1003( self, main ):
         """
@@ -474,12 +434,16 @@
                 - Get device ids
                 - Add single point to multi point intents
                 - Check intents
-                - Check flows
+                - Verify flows
                 - Ping hosts
                 - Reroute
                     - Link down
+                    - Verify flows
+                    - Check topology
                     - Ping hosts
                     - Link up
+                    - Verify flows
+                    - Check topology
                     - Ping hosts
                 - Remove intents
         """
@@ -490,12 +454,16 @@
                 - Get device ids
                 - Add multi point to single point intents
                 - Check intents
-                - Check flows
+                - Verify flows
                 - Ping hosts
                 - Reroute
                     - Link down
+                    - Verify flows
+                    - Check topology
                     - Ping hosts
                     - Link up
+                    - Verify flows
+                    - Check topology
                     - Ping hosts
                 - Remove intents
         """
diff --git a/TestON/tests/FuncIntent/FuncIntent.topo b/TestON/tests/FuncIntent/FuncIntent.topo
index e85b397..e6613de 100755
--- a/TestON/tests/FuncIntent/FuncIntent.topo
+++ b/TestON/tests/FuncIntent/FuncIntent.topo
@@ -2,7 +2,7 @@
     <COMPONENT>
 
         <ONOSbench>
-            <host>10.128.5.55</host>
+            <host>OCN</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
@@ -13,7 +13,7 @@
         </ONOSbench>
 
         <ONOScli1>
-            <host>10.128.5.55</host>
+            <host>OCN</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -22,7 +22,7 @@
         </ONOScli1>
 
         <ONOScli2>
-            <host>10.128.5.55</host>
+            <host>OCN</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -31,7 +31,7 @@
         </ONOScli2>
 
          <ONOScli3>
-            <host>10.128.5.55</host>
+            <host>OCN</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -40,7 +40,7 @@
         </ONOScli3>
 
         <Mininet1>
-            <host>10.128.10.20</host>
+            <host>OCN</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>MininetCliDriver</type>
diff --git a/TestON/tests/TopoPerfNext/__init__.py b/TestON/tests/FuncIntent/__init__.py
similarity index 100%
copy from TestON/tests/TopoPerfNext/__init__.py
copy to TestON/tests/FuncIntent/__init__.py
diff --git a/TestON/tests/FuncStartTemplate/FuncStartTemplate.params b/TestON/tests/FuncStartTemplate/FuncStartTemplate.params
new file mode 100755
index 0000000..310e5f8
--- /dev/null
+++ b/TestON/tests/FuncStartTemplate/FuncStartTemplate.params
@@ -0,0 +1,34 @@
+<PARAMS>
+
+    <testcases>10,9,10,9</testcases>
+
+    <SCALE>3,1</SCALE>
+    <availableNodes>3</availableNodes>
+    <ENV>
+        <cellName>single_func</cellName>
+        <cellApps>drivers,openflow,proxyarp,mobility</cellApps>
+    </ENV>
+    <GIT>
+        <pull>False</pull>
+        <branch>master</branch>
+    </GIT>
+    <CTRL>
+        <num>3</num>
+        <ip1>OC1</ip1>
+        <port1>6633</port1>
+        <ip2>OC2</ip2>
+        <port2>6633</port2>
+        <ip3>OC3</ip3>
+        <port3>6633</port3>
+    </CTRL>
+    <BENCH>
+        <user>admin</user>
+        <ip1>OCN</ip1>
+    </BENCH>
+    <MININET>
+        <switch>7</switch>
+        <links>20</links>
+        <topo>~/mininet/custom/newFuncTopo.py</topo>
+    </MININET>
+
+</PARAMS>
diff --git a/TestON/tests/FuncStartTemplate/FuncStartTemplate.py b/TestON/tests/FuncStartTemplate/FuncStartTemplate.py
new file mode 100644
index 0000000..4beefae
--- /dev/null
+++ b/TestON/tests/FuncStartTemplate/FuncStartTemplate.py
@@ -0,0 +1,231 @@
+
+# Testing the basic functionality of ONOS Next
+# For sanity and driver functionality excercises only.
+
+import time
+import json
+
+time.sleep( 1 )
+
+class FuncStartTemplate:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE10( self, main ):
+        import time
+        import os
+        """
+        Startup sequence:
+        cell <name>
+        onos-verify-cell
+        onos-remove-raft-log
+        git pull
+        mvn clean install
+        onos-package
+        onos-install -f
+        onos-wait-for-start
+        """
+        global init
+        global globalONOSip
+        try:
+            if type(init) is not bool:
+                init = False
+        except NameError:
+            init = False
+
+        #Local variables
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        apps = main.params[ 'ENV' ][ 'cellApps' ]
+        gitBranch = main.params[ 'GIT' ][ 'branch' ]
+        benchIp = os.environ[ 'OCN' ]
+        benchUser = main.params[ 'BENCH' ][ 'user' ]
+        topology = main.params[ 'MININET' ][ 'topo' ]
+        main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
+        main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
+        main.numCtrls = main.params[ 'CTRL' ][ 'num' ]
+        PULLCODE = False
+        if main.params[ 'GIT' ][ 'pull' ] == 'True':
+            PULLCODE = True
+        main.case( "Setting up test environment" )
+        main.CLIs = []
+        for i in range( 1, int( main.numCtrls ) + 1 ):
+            main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+
+        # -- INIT SECTION, ONLY RUNS ONCE -- #
+        if init == False:
+            init = True
+
+            main.ONOSport = []
+            main.scale = ( main.params[ 'SCALE' ] ).split( "," )
+            main.numCtrls = int( main.scale[ 0 ] )
+
+            if PULLCODE:
+                main.step( "Git checkout and pull " + gitBranch )
+                main.ONOSbench.gitCheckout( gitBranch )
+                gitPullResult = main.ONOSbench.gitPull()
+                if gitPullResult == main.ERROR:
+                    main.log.error( "Error pulling git branch" )
+                main.step( "Using mvn clean & install" )
+                cleanInstallResult = main.ONOSbench.cleanInstall()
+                stepResult = cleanInstallResult
+                utilities.assert_equals( expect=main.TRUE,
+                                         actual=stepResult,
+                                         onpass="Successfully compiled " +
+                                                "latest ONOS",
+                                         onfail="Failed to compile " +
+                                                "latest ONOS" )
+            else:
+                main.log.warn( "Did not pull new code so skipping mvn " +
+                               "clean install" )
+
+            globalONOSip = main.ONOSbench.getOnosIps()
+        
+        maxNodes = ( len(globalONOSip) - 2 )
+
+        main.numCtrls = int( main.scale[ 0 ] )
+        main.scale.remove( main.scale[ 0 ] )
+
+        main.ONOSip = []
+        for i in range( maxNodes ): 
+            main.ONOSip.append( globalONOSip[i] )
+
+
+        
+        #kill off all onos processes
+        main.log.info( "Safety check, killing all ONOS processes" +
+                       " before initiating enviornment setup" )
+        for i in range(maxNodes):
+            main.ONOSbench.onosDie( globalONOSip[ i ] )
+        
+        """
+        main.step( "Apply cell to environment" )
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
+        stepResult = cellResult and verifyResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully applied cell to " + \
+                                        "environment",
+                                 onfail="Failed to apply cell to environment " )
+        """
+        """main.step( "Removing raft logs" )
+        removeRaftResult = main.ONOSbench.onosRemoveRaftLogs()
+        stepResult = removeRaftResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully removed raft logs",
+                                 onfail="Failed to remove raft logs" )
+        """
+
+        print "NODE COUNT = ", main.numCtrls
+        main.log.info( "Creating cell file" )
+        cellIp = []
+        for i in range( main.numCtrls ):
+            cellIp.append( str( main.ONOSip[ i ] ) )
+        print cellIp
+        main.ONOSbench.createCellFile( benchIp, cellName, "",
+                                       str( apps ), *cellIp )
+
+        main.step( "Apply cell to environment" )
+        cellResult = main.ONOSbench.setCell( cellName )
+        verifyResult = main.ONOSbench.verifyCell()
+        stepResult = cellResult and verifyResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully applied cell to " + \
+                                        "environment",
+                                 onfail="Failed to apply cell to environment " )
+
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage()
+        stepResult = packageResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully created ONOS package",
+                                 onfail="Failed to create ONOS package" )
+
+        main.step( "Uninstalling ONOS package" )
+        onosUninstallResult = main.TRUE
+        for i in range( main.numCtrls ):
+            onosUninstallResult = onosUninstallResult and \
+                    main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
+        stepResult = onosUninstallResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully uninstalled ONOS package",
+                                 onfail="Failed to uninstall ONOS package" )
+        time.sleep( 5 )
+        main.step( "Installing ONOS package" )
+        onosInstallResult = main.TRUE
+        for i in range( main.numCtrls ):
+            onosInstallResult = onosInstallResult and \
+                    main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
+        stepResult = onosInstallResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully installed ONOS package",
+                                 onfail="Failed to install ONOS package" )
+
+        time.sleep( 20 )
+        main.step( "Starting ONOS service" )
+        stopResult = main.TRUE
+        startResult = main.TRUE
+        onosIsUp = main.TRUE
+        for i in range( main.numCtrls ):
+            onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
+        if onosIsUp == main.TRUE:
+            main.log.report( "ONOS instance is up and ready" )
+        else:
+            main.log.report( "ONOS instance may not be up, stop and " +
+                             "start ONOS again " )
+            for i in range( main.numCtrls ):
+                stopResult = stopResult and \
+                        main.ONOSbench.onosStop( main.ONOSip[ i ] )
+            for i in range( main.numCtrls ):
+                startResult = startResult and \
+                        main.ONOSbench.onosStart( main.ONOSip[ i ] )
+        stepResult = onosIsUp and stopResult and startResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="ONOS service is ready",
+                                 onfail="ONOS service did not start properly" )
+        
+        main.step( "Start ONOS cli" )
+        cliResult = main.TRUE
+        for i in range( main.numCtrls ):
+            cliResult = cliResult and \
+                        main.CLIs[i].startOnosCli( main.ONOSip[ i ] )
+        stepResult = cliResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully start ONOS cli",
+                                 onfail="Failed to start ONOS cli" )
+    
+    def CASE9( self, main ): 
+        '''
+            Report errors/warnings/exceptions 
+        '''
+        main.log.info("Error report: \n") 
+        main.ONOSbench.logReport( globalONOSip[0], [ "INFO","FOLLOWER","WARN","flow","ERROR","Except" ], "s" )  
+        #main.ONOSbench.logReport( globalONOSip[1], [ "INFO" ], "d" )
+
+    def CASE11( self, main ):
+        """
+            Start mininet
+        """
+        main.log.report( "Start Mininet topology" )
+        main.log.case( "Start Mininet topology" )
+
+        main.step( "Starting Mininet Topology" )
+        topoResult = main.Mininet1.startNet( topoFile=topology )
+        stepResult = topoResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully loaded topology",
+                                 onfail="Failed to load topology" )
+        # Exit if topology did not load properly
+        if not topoResult:
+            main.cleanup()
+            main.exit()
+
diff --git a/TestON/tests/FuncStartTemplate/FuncStartTemplate.topo b/TestON/tests/FuncStartTemplate/FuncStartTemplate.topo
new file mode 100755
index 0000000..2321da0
--- /dev/null
+++ b/TestON/tests/FuncStartTemplate/FuncStartTemplate.topo
@@ -0,0 +1,52 @@
+<TOPOLOGY>
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>OCN</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+                <home>~/onos</home>
+            </COMPONENTS>
+        </ONOSbench>
+
+        <ONOScli1>
+            <host>OCN</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli1>
+
+        <ONOScli2>
+            <host>OCN</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli2>
+
+         <ONOScli3>
+            <host>OCN</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOScli3>
+
+        <Mininet1>
+            <host>OCN</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>MininetCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </Mininet1>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/TopoPerfNext/__init__.py b/TestON/tests/FuncStartTemplate/__init__.py
similarity index 100%
copy from TestON/tests/TopoPerfNext/__init__.py
copy to TestON/tests/FuncStartTemplate/__init__.py
diff --git a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
deleted file mode 100644
index 4400262..0000000
--- a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# ScaleOutTemplate
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
-
-import sys
-import os.path
-
-
-class ScaleOutTemplate:
-
-    def __init__( self ):
-        self.default = ''
-
-    def CASE1( self, main ):           
-                                        
-        import time                     
-        global init       
-        try: 
-            if type(init) is not bool: 
-                init = False  
-        except NameError: 
-            init = False 
-       
-        #Load values from params file
-        checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
-        gitPull = main.params[ 'GIT' ][ 'autopull' ]
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-        Apps = main.params[ 'ENV' ][ 'cellApps' ]
-        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
-        BENCHUser = main.params[ 'BENCH' ][ 'user' ]
-        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
-        maxNodes = int(main.params[ 'availableNodes' ])
-        skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
-        cellName = main.params[ 'ENV' ][ 'cellName' ]        
-
-        # -- INIT SECTION, ONLY RUNS ONCE -- # 
-        if init == False: 
-            init = True
-            global clusterCount             #number of nodes running
-            global ONOSIp                   #list of ONOS IP addresses
-            global scale 
-            
-            clusterCount = 0
-            ONOSIp = [ 0 ]
-            scale = (main.params[ 'SCALE' ]).split(",")            
-            clusterCount = int(scale[0])
-
-            #Populate ONOSIp with ips from params 
-            for i in range(1, maxNodes + 1): 
-                ipString = 'ip' + str(i) 
-                ONOSIp.append(main.params[ 'CTRL' ][ ipString ])   
-            
-            #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
-            if skipMvn != "yes":
-                mvnResult = main.ONOSbench.cleanInstall()
-
-            #git
-            main.step( "Git checkout and pull " + checkoutBranch )
-            if gitPull == 'on':
-                checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
-                pullResult = main.ONOSbench.gitPull()
-
-            else:
-                checkoutResult = main.TRUE
-                pullResult = main.TRUE
-                main.log.info( "Skipped git checkout and pull" )
-        
-        # -- END OF INIT SECTION --#
-         
-        clusterCount = int(scale[0])
-        scale.remove(scale[0])       
-        
-        #kill off all onos processes 
-        main.log.step("Safety check, killing all ONOS processes")
-        main.log.step("before initiating enviornment setup")
-        for node in range(1, maxNodes + 1):
-            main.ONOSbench.onosDie(ONOSIp[node])
-        
-        #Uninstall everywhere
-        main.log.step( "Cleaning Enviornment..." )
-        for i in range(1, maxNodes + 1):
-            main.log.info(" Uninstalling ONOS " + str(i) )
-            main.ONOSbench.onosUninstall( ONOSIp[i] )
-       
-        #construct the cell file
-        main.log.info("Creating cell file")
-        cellIp = []
-        for node in range (1, clusterCount + 1):
-            cellIp.append(ONOSIp[node])
-
-        main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
-
-        main.step( "Set Cell" )
-        main.ONOSbench.setCell(cellName)
-        
-        main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()  
-
-        main.step( "verify cells" )
-        verifyCellResult = main.ONOSbench.verifyCell()
-      
-        main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
-        for node in range(1, clusterCount + 1):
-            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
-            main.ONOSbench.onosInstall( ONOSIp[node])
-
-        for node in range(1, clusterCount + 1):
-            for i in range( 2 ):
-                isup = main.ONOSbench.isup( ONOSIp[node] )
-                if isup:
-                    main.log.info("ONOS " + str(node) + " is up\n")
-                    break
-            if not isup:
-                main.log.report( "ONOS " + str(node) + " didn't start!" )
-        main.log.info("Startup sequence complete")
-
-    def CASE2( self, main ):
-         
-        print ("clusterCount: " + str(clusterCount)) 
-        print ("scale: " + str(scale)) 
-        print ("ONOSIp: " + str(ONOSIp)) 
-        print ("INIT: " + str(init)) 
-        
diff --git a/TestON/tests/TopoPerfNext/Backup/TopoPerfNext.py b/TestON/tests/TopoPerfNext/Backup/TopoPerfNext.py
deleted file mode 100644
index cc40b94..0000000
--- a/TestON/tests/TopoPerfNext/Backup/TopoPerfNext.py
+++ /dev/null
@@ -1,1710 +0,0 @@
-#TopoPerfNext
-#
-#Topology Performance test for ONOS-next
-#
-#andrew@onlab.us
-#
-#If your machine does not come with numpy
-#run the following command:
-#sudo apt-get install python-numpy python-scipy 
-
-import time
-import sys
-import os
-import re
-
-class TopoPerfNext:
-    def __init__(self):
-        self.default = ''
-
-    def CASE1(self, main):
-        '''
-        ONOS startup sequence
-        '''
-        import time
-        
-        ## Global cluster count for scale-out purposes
-        global cluster_count
-        #Set initial cluster count
-        cluster_count = 1 
-        ##
-
-        cell_name = main.params['ENV']['cellName']
-
-        git_pull = main.params['GIT']['autoPull']
-        checkout_branch = main.params['GIT']['checkout']
-
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        
-        #### Hardcoded ONOS nodes particular to my env ####
-        ONOS4_ip = "10.128.174.4"
-        ONOS5_ip = "10.128.174.5"
-        ONOS6_ip = "10.128.174.6"
-        ONOS7_ip = "10.128.174.7"
-        #### ####
-
-        MN1_ip = main.params['MN']['ip1']
-        BENCH_ip = main.params['BENCH']['ip']
-
-        topo_cfg_file = main.params['TEST']['topo_config_file']
-        topo_cfg_name = main.params['TEST']['topo_config_name']
-        
-        main.case("Setting up test environment")
-        main.log.info("Copying topology event accumulator config"+\
-            " to ONOS /package/etc")
-        main.ONOSbench.handle.sendline("cp ~/"+\
-            topo_cfg_file+\
-            " ~/ONOS/tools/package/etc/"+\
-            topo_cfg_name)
-        main.ONOSbench.handle.expect("\$")
-
-        main.log.report("Setting up test environment")
-
-        main.step("Cleaning previously installed ONOS if any")
-        main.ONOSbench.onos_uninstall(node_ip=ONOS2_ip)
-        main.ONOSbench.onos_uninstall(node_ip=ONOS3_ip)
-        main.ONOSbench.onos_uninstall(node_ip=ONOS4_ip)
-        main.ONOSbench.onos_uninstall(node_ip=ONOS5_ip)
-        main.ONOSbench.onos_uninstall(node_ip=ONOS6_ip)
-        main.ONOSbench.onos_uninstall(node_ip=ONOS7_ip)
-
-        main.step("Creating cell file")
-        cell_file_result = main.ONOSbench.create_cell_file(
-                BENCH_ip, cell_name, MN1_ip, "onos-core,onos-app-metrics",
-                ONOS1_ip)
-
-        main.step("Applying cell file to environment")
-        cell_apply_result = main.ONOSbench.set_cell(cell_name)
-        verify_cell_result = main.ONOSbench.verify_cell()
-        
-        #NOTE: This step may be removed after proper 
-        #      copy cat log functionality
-        main.step("Removing raft/copy-cat logs from ONOS nodes")
-        main.ONOSbench.onos_remove_raft_logs()
-        time.sleep(30)
-
-        main.step("Git checkout and pull "+checkout_branch)
-        if git_pull == 'on':
-            checkout_result = \
-                    main.ONOSbench.git_checkout(checkout_branch)
-            pull_result = main.ONOSbench.git_pull()
-        else:
-            checkout_result = main.TRUE
-            pull_result = main.TRUE
-            main.log.info("Skipped git checkout and pull")
-
-        main.log.report("Commit information - ")
-        main.ONOSbench.get_version(report=True)
-
-        main.step("Using mvn clean & install")
-        mvn_result = main.ONOSbench.clean_install()
-        mvn_result = main.TRUE
-
-        main.step("Set cell for ONOS cli env")
-        main.ONOS1cli.set_cell(cell_name)
-        #main.ONOS2cli.set_cell(cell_name)
-        #main.ONOS3cli.set_cell(cell_name)
-
-        main.step("Creating ONOS package")
-        package_result = main.ONOSbench.onos_package()
-
-        main.step("Installing ONOS package")
-        install1_result = main.ONOSbench.onos_install(node=ONOS1_ip)
-        #install2_result = main.ONOSbench.onos_install(node=ONOS2_ip)
-        #install3_result = main.ONOSbench.onos_install(node=ONOS3_ip)
-
-        time.sleep(10)
-
-        main.step("Start onos cli")
-        cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip)
-        #cli2 = main.ONOS2cli.start_onos_cli(ONOS2_ip)
-        #cli3 = main.ONOS3cli.start_onos_cli(ONOS3_ip)
-
-        utilities.assert_equals(expect=main.TRUE,
-                actual= cell_file_result and cell_apply_result and\
-                        verify_cell_result and checkout_result and\
-                        pull_result and mvn_result and\
-                        install1_result, #and install2_result and\
-                        #install3_result,
-                onpass="Test Environment setup successful",
-                onfail="Failed to setup test environment")
-
-    def CASE2(self, main):
-        '''
-        Assign s1 to ONOS1 and measure latency
-        
-        There are 4 levels of latency measurements to this test:
-        1) End-to-end measurement: Complete end-to-end measurement
-           from TCP (SYN/ACK) handshake to Graph change
-        2) OFP-to-graph measurement: 'ONOS processing' snippet of
-           measurement from OFP Vendor message to Graph change
-        3) OFP-to-device measurement: 'ONOS processing without 
-           graph change' snippet of measurement from OFP vendor
-           message to Device change timestamp
-        4) T0-to-device measurement: Measurement that includes
-           the switch handshake to devices timestamp without 
-           the graph view change. (TCP handshake -> Device 
-           change)
-        '''
-        import time
-        import subprocess
-        import json
-        import requests
-        import os
-        import numpy
-        global cluster_count
-
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        ONOS4_ip = main.params['CTRL']['ip4']
-        ONOS5_ip = main.params['CTRL']['ip5']
-        ONOS6_ip = main.params['CTRL']['ip6']
-        ONOS7_ip = main.params['CTRL']['ip7']
-
-        ONOS_user = main.params['CTRL']['user']
-
-        default_sw_port = main.params['CTRL']['port1']
-       
-        #Number of iterations of case
-        num_iter = main.params['TEST']['numIter']
-        #Number of first 'x' iterations to ignore:
-        iter_ignore = int(main.params['TEST']['iterIgnore'])
-
-        #Timestamp 'keys' for json metrics output.
-        #These are subject to change, hence moved into params
-        deviceTimestamp = main.params['JSON']['deviceTimestamp']
-        graphTimestamp = main.params['JSON']['graphTimestamp']
-
-        debug_mode = main.params['TEST']['debugMode']
-        onos_log = main.params['TEST']['onosLogFile']
-
-        #Threshold for the test
-        threshold_str = main.params['TEST']['singleSwThreshold']
-        threshold_obj = threshold_str.split(",")
-        threshold_min = int(threshold_obj[0])
-        threshold_max = int(threshold_obj[1])
-
-        #List of switch add latency collected from
-        #all iterations
-        latency_end_to_end_list = []
-        latency_ofp_to_graph_list = []
-        latency_ofp_to_device_list = []
-        latency_t0_to_device_list = []
-        latency_tcp_to_ofp_list = []
-
-        #Directory/file to store tshark results
-        tshark_of_output = "/tmp/tshark_of_topo.txt"
-        tshark_tcp_output = "/tmp/tshark_tcp_topo.txt"
-
-        #String to grep in tshark output
-        tshark_tcp_string = "TCP 74 "+default_sw_port
-        tshark_of_string = "OFP 86 Vendor"
-     
-        #Initialize assertion to TRUE
-        assertion = main.TRUE
-      
-        local_time = time.strftime('%x %X')
-        local_time = local_time.replace("/","")
-        local_time = local_time.replace(" ","_")
-        local_time = local_time.replace(":","")
-        if debug_mode == 'on':
-            main.ONOS1.tshark_pcap("eth0",
-                    "/tmp/single_sw_lat_pcap_"+local_time) 
-
-            main.log.info("Debug mode is on")
-
-        main.log.report("Latency of adding one switch to controller")
-        main.log.report("First "+str(iter_ignore)+" iterations ignored"+
-                " for jvm warmup time")
-        main.log.report("Total iterations of test: "+str(num_iter))
-
-        for i in range(0, int(num_iter)):
-            main.log.info("Starting tshark capture")
-
-            #* TCP [ACK, SYN] is used as t0_a, the
-            #  very first "exchange" between ONOS and 
-            #  the switch for end-to-end measurement
-            #* OFP [Stats Reply] is used for t0_b
-            #  the very last OFP message between ONOS
-            #  and the switch for ONOS measurement
-            main.ONOS1.tshark_grep(tshark_tcp_string,
-                    tshark_tcp_output)
-            main.ONOS1.tshark_grep(tshark_of_string,
-                    tshark_of_output)
-
-            #Wait and ensure tshark is started and 
-            #capturing
-            time.sleep(10)
-
-            main.log.info("Assigning s1 to controller")
-
-            main.Mininet1.assign_sw_controller(sw="1",
-                    ip1=ONOS1_ip, port1=default_sw_port)
-
-            #Wait and ensure switch is assigned
-            #before stopping tshark
-            time.sleep(30)
-   
-            main.log.info("Stopping all Tshark processes")
-            main.ONOS1.stop_tshark()
-
-            #tshark output is saved in ONOS. Use subprocess
-            #to copy over files to TestON for parsing
-            main.log.info("Copying over tshark files")
-            
-            #TCP CAPTURE ****
-            #Copy the tshark output from ONOS machine to
-            #TestON machine in tshark_tcp_output directory>file
-            os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+
-                    tshark_tcp_output+" /tmp/") 
-            tcp_file = open(tshark_tcp_output, 'r')
-            temp_text = tcp_file.readline()
-            temp_text = temp_text.split(" ")
-
-            main.log.info("Object read in from TCP capture: "+
-                    str(temp_text))
-            if len(temp_text) > 1:
-                t0_tcp = float(temp_text[1])*1000.0
-            else:
-                main.log.error("Tshark output file for TCP"+
-                        " returned unexpected results")
-                t0_tcp = 0
-                assertion = main.FALSE
-            
-            tcp_file.close()
-            #****************
-
-            #OF CAPTURE ****
-            os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+
-                    tshark_of_output+" /tmp/")
-            of_file = open(tshark_of_output, 'r')
-           
-            line_ofp = ""
-            #Read until last line of file
-            while True:
-                temp_text = of_file.readline()
-                if temp_text !='':
-                    line_ofp = temp_text
-                else:
-                    break 
-            obj = line_ofp.split(" ")
-            
-            main.log.info("Object read in from OFP capture: "+
-                    str(line_ofp))
-    
-            if len(line_ofp) > 1:
-                t0_ofp = float(obj[1])*1000.0
-            else:
-                main.log.error("Tshark output file for OFP"+
-                        " returned unexpected results")
-                t0_ofp = 0
-                assertion = main.FALSE
-            
-            of_file.close()
-            #****************
-           
-            json_str_1 = main.ONOS1cli.topology_events_metrics()
-            #Initialize scale-out variables 
-            json_str_2 = "" 
-            json_str_3 = ""
-            json_str_4 = ""
-            json_str_5 = ""
-            json_str_6 = ""
-            json_str_7 = ""
-
-            json_obj_1 = json.loads(json_str_1)
-            json_obj_2 = json.loads(json_str_2)
-            json_obj_3 = json.loads(json_str_3)
-            #Initialize scale-out variables
-            json_obj_4 = ""
-            json_obj_5 = ""
-            json_obj_6 = ""
-            json_obj_7 = ""
-
-            #Include scale-out measurements when applicable
-            if cluster_count == 5:
-                json_str_4 = main.ONOS4cli.topology_events_metrics()
-                json_str_5 = main.ONOS5cli.topology_events_metrics()
-                
-                json_obj_4 = json.loads(json_str_4)
-                json_obj_5 = json.loads(json_str_5)
-            elif cluster_count == 6:
-                main.log.info("TODO: create even number cluster events")
-            elif cluster_count == 7:
-                json_str_6 = main.ONOS6cli.topology_events_metrics()
-                json_str_7 = main.ONOS7cli.topology_events_metrics()
-
-                json_obj_6 = json.loads(json_str_6)
-                json_obj_7 = json.loads(json_str_7)
-
-            #Obtain graph timestamp. This timestsamp captures
-            #the epoch time at which the topology graph was updated.
-            graph_timestamp_1 = \
-                    json_obj_1[graphTimestamp]['value']
-            graph_timestamp_2 = \
-                    json_obj_2[graphTimestamp]['value']
-            graph_timestamp_3 = \
-                    json_obj_3[graphTimestamp]['value']
-
-            #Obtain device timestamp. This timestamp captures
-            #the epoch time at which the device event happened
-            device_timestamp_1 = \
-                    json_obj_1[deviceTimestamp]['value'] 
-            device_timestamp_2 = \
-                    json_obj_2[deviceTimestamp]['value'] 
-            device_timestamp_3 = \
-                    json_obj_3[deviceTimestamp]['value'] 
-
-            #t0 to device processing latency 
-            delta_device_1 = int(device_timestamp_1) - int(t0_tcp)
-            delta_device_2 = int(device_timestamp_2) - int(t0_tcp)
-            delta_device_3 = int(device_timestamp_3) - int(t0_tcp)
-        
-            #Get average of delta from all instances
-            avg_delta_device = \
-                    (int(delta_device_1)+\
-                     int(delta_device_2)+\
-                     int(delta_device_3)) / 3
-
-            #Ensure avg delta meets the threshold before appending
-            if avg_delta_device > 0.0 and avg_delta_device < 10000\
-                    and int(i) > iter_ignore:
-                latency_t0_to_device_list.append(avg_delta_device)
-            else:
-                main.log.info("Results for t0-to-device ignored"+\
-                        "due to excess in threshold / warmup iteration.")
-
-            #t0 to graph processing latency (end-to-end)
-            delta_graph_1 = int(graph_timestamp_1) - int(t0_tcp)
-            delta_graph_2 = int(graph_timestamp_2) - int(t0_tcp)
-            delta_graph_3 = int(graph_timestamp_3) - int(t0_tcp)
-        
-            #Get average of delta from all instances
-            #TODO: use max delta graph
-            #max_delta_graph = max(three)
-            avg_delta_graph = \
-                    (int(delta_graph_1)+\
-                     int(delta_graph_2)+\
-                     int(delta_graph_3)) / 3
-
-            #Ensure avg delta meets the threshold before appending
-            if avg_delta_graph > 0.0 and avg_delta_graph < 10000\
-                    and int(i) > iter_ignore:
-                latency_end_to_end_list.append(avg_delta_graph)
-            else:
-                main.log.info("Results for end-to-end ignored"+\
-                        "due to excess in threshold")
-
-            #ofp to graph processing latency (ONOS processing)
-            delta_ofp_graph_1 = int(graph_timestamp_1) - int(t0_ofp)
-            delta_ofp_graph_2 = int(graph_timestamp_2) - int(t0_ofp)
-            delta_ofp_graph_3 = int(graph_timestamp_3) - int(t0_ofp)
-            
-            avg_delta_ofp_graph = \
-                    (int(delta_ofp_graph_1)+\
-                     int(delta_ofp_graph_2)+\
-                     int(delta_ofp_graph_3)) / 3
-            
-            if avg_delta_ofp_graph > threshold_min \
-                    and avg_delta_ofp_graph < threshold_max\
-                    and int(i) > iter_ignore:
-                latency_ofp_to_graph_list.append(avg_delta_ofp_graph)
-            elif avg_delta_ofp_graph > (-10) and \
-                    avg_delta_ofp_graph < 0.0 and\
-                    int(i) > iter_ignore:
-                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. 
-                latency_ofp_to_graph_list.append(0)
-            else:
-                main.log.info("Results for ofp-to-graph "+\
-                        "ignored due to excess in threshold")
-
-            #ofp to device processing latency (ONOS processing)
-            delta_ofp_device_1 = float(device_timestamp_1) - float(t0_ofp)
-            delta_ofp_device_2 = float(device_timestamp_2) - float(t0_ofp)
-            delta_ofp_device_3 = float(device_timestamp_3) - float(t0_ofp)
-            
-            avg_delta_ofp_device = \
-                    (float(delta_ofp_device_1)+\
-                     float(delta_ofp_device_2)+\
-                     float(delta_ofp_device_3)) / 3
-            
-            #NOTE: ofp - delta measurements are occasionally negative
-            #      due to system time misalignment.
-            latency_ofp_to_device_list.append(avg_delta_ofp_device)
-
-            delta_ofp_tcp = int(t0_ofp) - int(t0_tcp)
-            if delta_ofp_tcp > threshold_min \
-                    and delta_ofp_tcp < threshold_max and\
-                    int(i) > iter_ignore:
-                latency_tcp_to_ofp_list.append(delta_ofp_tcp)
-            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(delta_graph_1) + " ms")
-            main.log.info("ONOS2 delta end-to-end: "+
-                    str(delta_graph_2) + " ms")
-            main.log.info("ONOS3 delta end-to-end: "+
-                    str(delta_graph_3) + " ms")
-
-            main.log.info("ONOS1 delta OFP - graph: "+
-                    str(delta_ofp_graph_1) + " ms")
-            main.log.info("ONOS2 delta OFP - graph: "+
-                    str(delta_ofp_graph_2) + " ms")
-            main.log.info("ONOS3 delta OFP - graph: "+
-                    str(delta_ofp_graph_3) + " ms")
-            
-            main.log.info("ONOS1 delta device - t0: "+
-                    str(delta_device_1) + " ms")
-            main.log.info("ONOS2 delta device - t0: "+
-                    str(delta_device_2) + " ms")
-            main.log.info("ONOS3 delta device - t0: "+
-                    str(delta_device_3) + " ms")
-         
-            main.log.info("TCP to OFP delta: "+
-                    str(delta_ofp_tcp) + " ms")
-            #main.log.info("ONOS1 delta OFP - device: "+
-            #        str(delta_ofp_device_1) + " ms")
-            #main.log.info("ONOS2 delta OFP - device: "+
-            #        str(delta_ofp_device_2) + " ms")
-            #main.log.info("ONOS3 delta OFP - device: "+
-            #        str(delta_ofp_device_3) + " ms")
-
-            main.step("Remove switch from controller")
-            main.Mininet1.delete_sw_controller("s1")
-
-            time.sleep(5)
-
-        #END of for loop iteration
-
-        #If there is at least 1 element in each list,
-        #pass the test case
-        if len(latency_end_to_end_list) > 0 and\
-           len(latency_ofp_to_graph_list) > 0 and\
-           len(latency_ofp_to_device_list) > 0 and\
-           len(latency_t0_to_device_list) > 0 and\
-           len(latency_tcp_to_ofp_list) > 0:
-            assertion = main.TRUE
-        elif len(latency_end_to_end_list) == 0:
-            #The appending of 0 here is to prevent 
-            #the min,max,sum functions from failing 
-            #below
-            latency_end_to_end_list.append(0)
-            assertion = main.FALSE
-        elif len(latency_ofp_to_graph_list) == 0:
-            latency_ofp_to_graph_list.append(0)
-            assertion = main.FALSE
-        elif len(latency_ofp_to_device_list) == 0:
-            latency_ofp_to_device_list.append(0)
-            assertion = main.FALSE
-        elif len(latency_t0_to_device_list) == 0:
-            latency_t0_to_device_list.append(0)
-            assertion = main.FALSE
-        elif len(latency_tcp_to_ofp_list) == 0:
-            latency_tcp_to_ofp_list.append(0)
-            assertion = main.FALSE
-
-        #Calculate min, max, avg of latency lists
-        latency_end_to_end_max = \
-                int(max(latency_end_to_end_list))
-        latency_end_to_end_min = \
-                int(min(latency_end_to_end_list))
-        latency_end_to_end_avg = \
-                (int(sum(latency_end_to_end_list)) / \
-                 len(latency_end_to_end_list))
-        latency_end_to_end_std_dev = \
-                str(round(numpy.std(latency_end_to_end_list),1))
-
-        latency_ofp_to_graph_max = \
-                int(max(latency_ofp_to_graph_list))
-        latency_ofp_to_graph_min = \
-                int(min(latency_ofp_to_graph_list))
-        latency_ofp_to_graph_avg = \
-                (int(sum(latency_ofp_to_graph_list)) / \
-                 len(latency_ofp_to_graph_list))
-        latency_ofp_to_graph_std_dev = \
-                str(round(numpy.std(latency_ofp_to_graph_list),1))
-
-        latency_ofp_to_device_max = \
-                int(max(latency_ofp_to_device_list))
-        latency_ofp_to_device_min = \
-                int(min(latency_ofp_to_device_list))
-        latency_ofp_to_device_avg = \
-                (int(sum(latency_ofp_to_device_list)) / \
-                 len(latency_ofp_to_device_list))
-        latency_ofp_to_device_std_dev = \
-                str(round(numpy.std(latency_ofp_to_device_list),1))
-
-        latency_t0_to_device_max = \
-                int(max(latency_t0_to_device_list))
-        latency_t0_to_device_min = \
-                int(min(latency_t0_to_device_list))
-        latency_t0_to_device_avg = \
-                (int(sum(latency_t0_to_device_list)) / \
-                 len(latency_t0_to_device_list))
-        latency_ofp_to_device_std_dev = \
-                str(round(numpy.std(latency_t0_to_device_list),1))
-
-        latency_tcp_to_ofp_max = \
-                int(max(latency_tcp_to_ofp_list))
-        latency_tcp_to_ofp_min = \
-                int(min(latency_tcp_to_ofp_list))
-        latency_tcp_to_ofp_avg = \
-                (int(sum(latency_tcp_to_ofp_list)) / \
-                 len(latency_tcp_to_ofp_list))
-        latency_tcp_to_ofp_std_dev = \
-                str(round(numpy.std(latency_tcp_to_ofp_list),1))
-
-        main.log.report("Switch add - End-to-end latency: "+\
-                "Avg: "+str(latency_end_to_end_avg)+" ms "+
-                "Std Deviation: "+latency_end_to_end_std_dev+" 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(latency_ofp_to_graph_avg)+" ms "+
-                "Std Deviation: "+latency_ofp_to_graph_std_dev+" ms")
-        main.log.report("Switch add - TCP-to-OFP latency: "+\
-                "Avg: "+str(latency_tcp_to_ofp_avg)+" ms "+
-                "Std Deviation: "+latency_tcp_to_ofp_std_dev+" ms")
-
-        if debug_mode == 'on':
-            main.ONOS1.cp_logs_to_dir("/opt/onos/log/karaf.log",
-                    "/tmp/", copy_file_name="sw_lat_karaf")
-
-        utilities.assert_equals(expect=main.TRUE, actual=assertion,
-                onpass="Switch latency test successful",
-                onfail="Switch latency test failed")
-
-    def CASE3(self, main):
-        '''
-        Bring port up / down and measure latency.
-        Port enable / disable is simulated by ifconfig up / down
-        
-        In ONOS-next, we must ensure that the port we are 
-        manipulating is connected to another switch with a valid
-        connection. Otherwise, graph view will not be updated.
-        '''
-        import time
-        import subprocess
-        import os
-        import requests
-        import json
-        import numpy
-
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        ONOS_user = main.params['CTRL']['user']
-
-        default_sw_port = main.params['CTRL']['port1']
-      
-        assertion = main.TRUE
-        #Number of iterations of case
-        num_iter = main.params['TEST']['numIter']
-       
-        #Timestamp 'keys' for json metrics output.
-        #These are subject to change, hence moved into params
-        deviceTimestamp = main.params['JSON']['deviceTimestamp']
-        graphTimestamp = main.params['JSON']['graphTimestamp']
-        
-        debug_mode = main.params['TEST']['debugMode']
-
-        local_time = time.strftime('%x %X')
-        local_time = local_time.replace("/","")
-        local_time = local_time.replace(" ","_")
-        local_time = local_time.replace(":","")
-        if debug_mode == 'on':
-            main.ONOS1.tshark_pcap("eth0",
-                    "/tmp/port_lat_pcap_"+local_time) 
-
-        #Threshold for this test case
-        up_threshold_str = main.params['TEST']['portUpThreshold']
-        down_threshold_str = main.params['TEST']['portDownThreshold']
-        
-        up_threshold_obj = up_threshold_str.split(",")
-        down_threshold_obj = down_threshold_str.split(",")
-
-        up_threshold_min = int(up_threshold_obj[0])
-        up_threshold_max = int(up_threshold_obj[1])
-
-        down_threshold_min = int(down_threshold_obj[0])
-        down_threshold_max = int(down_threshold_obj[1])
-
-        #NOTE: Some hardcoded variables you may need to configure
-        #      besides the params
-            
-        tshark_port_status = "OFP 130 Port Status"
-
-        tshark_port_up = "/tmp/tshark_port_up.txt"
-        tshark_port_down = "/tmp/tshark_port_down.txt"
-        interface_config = "s1-eth1"
-
-        main.log.report("Port enable / disable latency")
-        main.log.report("Simulated by ifconfig up / down")
-        main.log.report("Total iterations of test: "+str(num_iter))
-
-        main.step("Assign switches s1 and s2 to controller 1")
-        main.Mininet1.assign_sw_controller(sw="1",ip1=ONOS1_ip,
-                port1=default_sw_port)
-        main.Mininet1.assign_sw_controller(sw="2",ip1=ONOS1_ip,
-                port1=default_sw_port)
-
-        #Give enough time for metrics to propagate the 
-        #assign controller event. Otherwise, these events may
-        #carry over to our measurements
-        time.sleep(15)
-
-        port_up_device_to_ofp_list = []
-        port_up_graph_to_ofp_list = []
-        port_down_device_to_ofp_list = []
-        port_down_graph_to_ofp_list = []
-
-        for i in range(0, int(num_iter)):
-            main.step("Starting wireshark capture for port status down")
-            main.ONOS1.tshark_grep(tshark_port_status,
-                    tshark_port_down)
-            
-            time.sleep(5)
-
-            #Disable interface that is connected to switch 2
-            main.step("Disable port: "+interface_config)
-            main.Mininet1.handle.sendline("sh ifconfig "+
-                    interface_config+" down")
-            main.Mininet1.handle.expect("mininet>")
-
-            time.sleep(3)
-            main.ONOS1.tshark_stop()
-            
-            main.step("Obtain t1 by metrics call")
-            json_str_up_1 = main.ONOS1cli.topology_events_metrics()
-            json_str_up_2 = main.ONOS2cli.topology_events_metrics()
-            json_str_up_3 = main.ONOS3cli.topology_events_metrics()
-
-            json_obj_1 = json.loads(json_str_up_1)
-            json_obj_2 = json.loads(json_str_up_2)
-            json_obj_3 = json.loads(json_str_up_3)
-            
-            #Copy tshark output file from ONOS to TestON instance
-            #/tmp directory
-            os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+
-                    tshark_port_down+" /tmp/")
-
-            f_port_down = open(tshark_port_down, 'r')
-            #Get first line of port down event from tshark
-            f_line = f_port_down.readline()
-            obj_down = f_line.split(" ")
-            if len(f_line) > 0:
-                timestamp_begin_pt_down = int(float(obj_down[1])*1000)
-                main.log.info("Port down begin timestamp: "+
-                        str(timestamp_begin_pt_down))
-            else:
-                main.log.info("Tshark output file returned unexpected"+
-                        " results: "+str(obj_down))
-                timestamp_begin_pt_down = 0
-            
-            f_port_down.close()
-
-            main.log.info("TEST tshark obj: "+str(obj_down))
-
-            time.sleep(3)
-
-            #Obtain graph timestamp. This timestsamp captures
-            #the epoch time at which the topology graph was updated.
-            graph_timestamp_1 = \
-                    json_obj_1[graphTimestamp]['value']
-            graph_timestamp_2 = \
-                    json_obj_2[graphTimestamp]['value']
-            graph_timestamp_3 = \
-                    json_obj_3[graphTimestamp]['value']
-
-            main.log.info("TEST graph timestamp ONOS1: "+
-                    str(graph_timestamp_1))
-
-            #Obtain device timestamp. This timestamp captures
-            #the epoch time at which the device event happened
-            device_timestamp_1 = \
-                    json_obj_1[deviceTimestamp]['value'] 
-            device_timestamp_2 = \
-                    json_obj_2[deviceTimestamp]['value'] 
-            device_timestamp_3 = \
-                    json_obj_3[deviceTimestamp]['value'] 
-
-            #Get delta between graph event and OFP 
-            pt_down_graph_to_ofp_1 = int(graph_timestamp_1) -\
-                    int(timestamp_begin_pt_down)
-            pt_down_graph_to_ofp_2 = int(graph_timestamp_2) -\
-                    int(timestamp_begin_pt_down)
-            pt_down_graph_to_ofp_3 = int(graph_timestamp_3) -\
-                    int(timestamp_begin_pt_down)
-
-            #Get delta between device event and OFP
-            pt_down_device_to_ofp_1 = int(device_timestamp_1) -\
-                    int(timestamp_begin_pt_down)
-            pt_down_device_to_ofp_2 = int(device_timestamp_2) -\
-                    int(timestamp_begin_pt_down)
-            pt_down_device_to_ofp_3 = int(device_timestamp_3) -\
-                    int(timestamp_begin_pt_down)
-       
-            #Caluclate average across clusters
-            pt_down_graph_to_ofp_avg =\
-                    (int(pt_down_graph_to_ofp_1) +
-                     int(pt_down_graph_to_ofp_2) + 
-                     int(pt_down_graph_to_ofp_3)) / 3
-            pt_down_device_to_ofp_avg = \
-                    (int(pt_down_device_to_ofp_1) + 
-                     int(pt_down_device_to_ofp_2) +
-                     int(pt_down_device_to_ofp_3)) / 3
-
-            if pt_down_graph_to_ofp_avg > down_threshold_min and \
-                    pt_down_graph_to_ofp_avg < down_threshold_max:
-                port_down_graph_to_ofp_list.append(
-                    pt_down_graph_to_ofp_avg)
-                main.log.info("Port down: graph to ofp avg: "+
-                    str(pt_down_graph_to_ofp_avg) + " ms")
-            else:
-                main.log.info("Average port down graph-to-ofp result" +
-                        " exceeded the threshold: "+
-                        str(pt_down_graph_to_ofp_avg))
-
-            if pt_down_device_to_ofp_avg > 0 and \
-                    pt_down_device_to_ofp_avg < 1000:
-                port_down_device_to_ofp_list.append(
-                    pt_down_device_to_ofp_avg)
-                main.log.info("Port down: device to ofp avg: "+
-                    str(pt_down_device_to_ofp_avg) + " ms")
-            else:
-                main.log.info("Average port down device-to-ofp result" +
-                        " exceeded the threshold: "+
-                        str(pt_down_device_to_ofp_avg))
-
-            #Port up events 
-            main.step("Enable port and obtain timestamp")
-            main.step("Starting wireshark capture for port status up")
-            main.ONOS1.tshark_grep(tshark_port_status, tshark_port_up)
-            time.sleep(5)
-
-            main.Mininet1.handle.sendline("sh ifconfig "+
-                    interface_config+" up")
-            main.Mininet1.handle.expect("mininet>")
-            
-            #Allow time for tshark to capture event
-            time.sleep(3)
-            main.ONOS1.tshark_stop()
-
-            #Obtain metrics shortly afterwards
-            #This timestsamp captures
-            #the epoch time at which the topology graph was updated.
-            main.step("Obtain t1 by REST call")
-            json_str_up_1 = main.ONOS1cli.topology_events_metrics()
-            json_str_up_2 = main.ONOS2cli.topology_events_metrics()
-            json_str_up_3 = main.ONOS3cli.topology_events_metrics()
-            
-            json_obj_1 = json.loads(json_str_up_1)
-            json_obj_2 = json.loads(json_str_up_2)
-            json_obj_3 = json.loads(json_str_up_3)
-
-            os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+
-                    tshark_port_up+" /tmp/")
-
-            f_port_up = open(tshark_port_up, 'r')
-            f_line = f_port_up.readline()
-            obj_up = f_line.split(" ")
-            if len(f_line) > 0:
-                timestamp_begin_pt_up = int(float(obj_up[1])*1000)
-                main.log.info("Port up begin timestamp: "+
-                        str(timestamp_begin_pt_up))
-            else:
-                main.log.info("Tshark output file returned unexpected"+
-                        " results.")
-                timestamp_begin_pt_up = 0
-            
-            f_port_up.close()
-
-            graph_timestamp_1 = \
-                    json_obj_1[graphTimestamp]['value']
-            graph_timestamp_2 = \
-                    json_obj_2[graphTimestamp]['value']
-            graph_timestamp_3 = \
-                    json_obj_3[graphTimestamp]['value']
-
-            #Obtain device timestamp. This timestamp captures
-            #the epoch time at which the device event happened
-            device_timestamp_1 = \
-                    json_obj_1[deviceTimestamp]['value'] 
-            device_timestamp_2 = \
-                    json_obj_2[deviceTimestamp]['value'] 
-            device_timestamp_3 = \
-                    json_obj_3[deviceTimestamp]['value'] 
-
-            #Get delta between graph event and OFP 
-            pt_up_graph_to_ofp_1 = int(graph_timestamp_1) -\
-                    int(timestamp_begin_pt_up)
-            pt_up_graph_to_ofp_2 = int(graph_timestamp_2) -\
-                    int(timestamp_begin_pt_up)
-            pt_up_graph_to_ofp_3 = int(graph_timestamp_3) -\
-                    int(timestamp_begin_pt_up)
-
-            #Get delta between device event and OFP
-            pt_up_device_to_ofp_1 = int(device_timestamp_1) -\
-                    int(timestamp_begin_pt_up)
-            pt_up_device_to_ofp_2 = int(device_timestamp_2) -\
-                    int(timestamp_begin_pt_up)
-            pt_up_device_to_ofp_3 = int(device_timestamp_3) -\
-                    int(timestamp_begin_pt_up)
-
-            main.log.info("ONOS1 delta G2O: "+str(pt_up_graph_to_ofp_1))
-            main.log.info("ONOS2 delta G2O: "+str(pt_up_graph_to_ofp_2))
-            main.log.info("ONOS3 delta G2O: "+str(pt_up_graph_to_ofp_3))
-
-            main.log.info("ONOS1 delta D2O: "+str(pt_up_device_to_ofp_1))
-            main.log.info("ONOS2 delta D2O: "+str(pt_up_device_to_ofp_2)) 
-            main.log.info("ONOS3 delta D2O: "+str(pt_up_device_to_ofp_3)) 
-
-            pt_up_graph_to_ofp_avg = \
-                    (int(pt_up_graph_to_ofp_1) + 
-                     int(pt_up_graph_to_ofp_2) +
-                     int(pt_up_graph_to_ofp_3)) / 3
-
-            pt_up_device_to_ofp_avg = \
-                    (int(pt_up_device_to_ofp_1) + 
-                     int(pt_up_device_to_ofp_2) +
-                     int(pt_up_device_to_ofp_3)) / 3
-
-            if pt_up_graph_to_ofp_avg > up_threshold_min and \
-                    pt_up_graph_to_ofp_avg < up_threshold_max: 
-                port_up_graph_to_ofp_list.append(
-                        pt_up_graph_to_ofp_avg)
-                main.log.info("Port down: graph to ofp avg: "+
-                    str(pt_up_graph_to_ofp_avg) + " ms")
-            else:
-                main.log.info("Average port up graph-to-ofp result"+
-                        " exceeded the threshold: "+
-                        str(pt_up_graph_to_ofp_avg))
-            
-            if pt_up_device_to_ofp_avg > up_threshold_min and \
-                    pt_up_device_to_ofp_avg < up_threshold_max:
-                port_up_device_to_ofp_list.append(
-                        pt_up_device_to_ofp_avg)
-                main.log.info("Port up: device to ofp avg: "+
-                    str(pt_up_device_to_ofp_avg) + " ms")
-            else:
-                main.log.info("Average port up device-to-ofp result"+
-                        " exceeded the threshold: "+
-                        str(pt_up_device_to_ofp_avg))
-            
-            #END ITERATION FOR LOOP
-        
-        #Check all list for latency existence and set assertion
-        if (port_down_graph_to_ofp_list and port_down_device_to_ofp_list\
-           and port_up_graph_to_ofp_list and port_up_device_to_ofp_list):
-            assertion = main.TRUE
-
-        #Calculate and report latency measurements
-        port_down_graph_to_ofp_min = min(port_down_graph_to_ofp_list)
-        port_down_graph_to_ofp_max = max(port_down_graph_to_ofp_list)
-        port_down_graph_to_ofp_avg = \
-                (sum(port_down_graph_to_ofp_list) / 
-                 len(port_down_graph_to_ofp_list))
-        port_down_graph_to_ofp_std_dev = \
-                str(round(numpy.std(port_down_graph_to_ofp_list),1))
-        
-        main.log.report("Port down graph-to-ofp "+
-                "Avg: "+str(port_down_graph_to_ofp_avg)+" ms "+
-                "Std Deviation: "+port_down_graph_to_ofp_std_dev+" ms")
-        
-        port_down_device_to_ofp_min = min(port_down_device_to_ofp_list)
-        port_down_device_to_ofp_max = max(port_down_device_to_ofp_list)
-        port_down_device_to_ofp_avg = \
-                (sum(port_down_device_to_ofp_list) /\
-                 len(port_down_device_to_ofp_list))
-        port_down_device_to_ofp_std_dev = \
-                str(round(numpy.std(port_down_device_to_ofp_list),1))
-        
-        main.log.report("Port down device-to-ofp "+
-                "Avg: "+str(port_down_device_to_ofp_avg)+" ms "+
-                "Std Deviation: "+port_down_device_to_ofp_std_dev+" ms")
-        
-        port_up_graph_to_ofp_min = min(port_up_graph_to_ofp_list)
-        port_up_graph_to_ofp_max = max(port_up_graph_to_ofp_list)
-        port_up_graph_to_ofp_avg = \
-                (sum(port_up_graph_to_ofp_list) /\
-                 len(port_up_graph_to_ofp_list))
-        port_up_graph_to_ofp_std_dev = \
-                str(round(numpy.std(port_up_graph_to_ofp_list),1))
-        
-        main.log.report("Port up graph-to-ofp "+
-                "Avg: "+str(port_up_graph_to_ofp_avg)+" ms "+
-                "Std Deviation: "+port_up_graph_to_ofp_std_dev+" ms")
-          
-        port_up_device_to_ofp_min = min(port_up_device_to_ofp_list)
-        port_up_device_to_ofp_max = max(port_up_device_to_ofp_list)
-        port_up_device_to_ofp_avg = \
-                (sum(port_up_device_to_ofp_list) /\
-                 len(port_up_device_to_ofp_list))
-        port_up_device_to_ofp_std_dev = \
-                str(round(numpy.std(port_up_device_to_ofp_list),1))
-        
-        main.log.report("Port up device-to-ofp "+
-                "Avg: "+str(port_up_device_to_ofp_avg)+" ms "+
-                "Std Deviation: "+port_up_device_to_ofp_std_dev+" ms")
-
-        utilities.assert_equals(expect=main.TRUE, actual=assertion,
-                onpass="Port discovery latency calculation successful",
-                onfail="Port discovery test failed")
-
-    def CASE4(self, main):
-        '''
-        Link down event using loss rate 100%
-        
-        Important:
-            Use a simple 2 switch topology with 1 link between
-            the two switches. Ensure that mac addresses of the 
-            switches are 1 / 2 respectively
-        '''
-        import time
-        import subprocess
-        import os
-        import requests
-        import json
-        import numpy 
-    
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        ONOS_user = main.params['CTRL']['user']
-
-        default_sw_port = main.params['CTRL']['port1']
-       
-        #Number of iterations of case
-        num_iter = main.params['TEST']['numIter']
-       
-        #Timestamp 'keys' for json metrics output.
-        #These are subject to change, hence moved into params
-        deviceTimestamp = main.params['JSON']['deviceTimestamp']
-        linkTimestamp = main.params['JSON']['linkTimestamp'] 
-        graphTimestamp = main.params['JSON']['graphTimestamp']
-        
-        debug_mode = main.params['TEST']['debugMode']
-
-        local_time = time.strftime('%x %X')
-        local_time = local_time.replace("/","")
-        local_time = local_time.replace(" ","_")
-        local_time = local_time.replace(":","")
-        if debug_mode == 'on':
-            main.ONOS1.tshark_pcap("eth0",
-                    "/tmp/link_lat_pcap_"+local_time) 
-
-        #Threshold for this test case
-        up_threshold_str = main.params['TEST']['linkUpThreshold']
-        down_threshold_str = main.params['TEST']['linkDownThreshold']
-
-        up_threshold_obj = up_threshold_str.split(",")
-        down_threshold_obj = down_threshold_str.split(",")
-
-        up_threshold_min = int(up_threshold_obj[0])
-        up_threshold_max = int(up_threshold_obj[1])
-
-        down_threshold_min = int(down_threshold_obj[0])
-        down_threshold_max = int(down_threshold_obj[1])
-
-        assertion = main.TRUE
-        #Link event timestamp to system time list
-        link_down_link_to_system_list = []
-        link_up_link_to_system_list = []
-        #Graph event timestamp to system time list
-        link_down_graph_to_system_list = []
-        link_up_graph_to_system_list = [] 
-
-        main.log.report("Link up / down discovery latency between "+
-                "two switches")
-        main.log.report("Simulated by setting loss-rate 100%")
-        main.log.report("'tc qdisc add dev <intfs> root netem loss 100%'") 
-        main.log.report("Total iterations of test: "+str(num_iter))
-
-        main.step("Assign all switches")
-        main.Mininet1.assign_sw_controller(sw="1",
-                ip1=ONOS1_ip, port1=default_sw_port)
-        main.Mininet1.assign_sw_controller(sw="2",
-                ip1=ONOS1_ip, port1=default_sw_port)
-
-        main.step("Verifying switch assignment")
-        result_s1 = main.Mininet1.get_sw_controller(sw="s1")
-        result_s2 = main.Mininet1.get_sw_controller(sw="s2")
-          
-        #Allow time for events to finish before taking measurements
-        time.sleep(10)
-
-        link_down1 = False
-        link_down2 = False
-        link_down3 = False
-        #Start iteration of link event test
-        for i in range(0, int(num_iter)):
-            main.step("Getting initial system time as t0")
-        
-            #System time in epoch ms
-            timestamp_link_down_t0 = time.time() * 1000
-            #Link down is simulated by 100% loss rate using traffic 
-            #control command
-            main.Mininet1.handle.sendline(
-                    "sh tc qdisc add dev s1-eth1 root netem loss 100%")
-
-            #TODO: Iterate through 'links' command to verify that
-            #      link s1 -> s2 went down (loop timeout 30 seconds) 
-            #      on all 3 ONOS instances
-            main.log.info("Checking ONOS for link update")
-            loop_count = 0
-            while( not (link_down1 and link_down2 and link_down3)\
-                    and loop_count < 30 ):
-                json_str1 = main.ONOS1cli.links()
-                json_str2 = main.ONOS2cli.links()
-                json_str3 = main.ONOS3cli.links()
-                
-                if not (json_str1 and json_str2 and json_str3):
-                    main.log.error("CLI command returned error ")
-                    break
-                else:
-                    json_obj1 = json.loads(json_str1)
-                    json_obj2 = json.loads(json_str2)
-                    json_obj3 = json.loads(json_str3)
-                for obj1 in json_obj1:
-                    if '01' not in obj1['src']['device']:
-                        link_down1 = True
-                        main.log.info("Link down from "+
-                                "s1 -> s2 on ONOS1 detected")
-                for obj2 in json_obj2:
-                    if '01' not in obj2['src']['device']:
-                        link_down2 = True
-                        main.log.info("Link down from "+
-                                "s1 -> s2 on ONOS2 detected")
-                for obj3 in json_obj3:
-                    if '01' not in obj3['src']['device']:
-                        link_down3 = True
-                        main.log.info("Link down from "+
-                                "s1 -> s2 on ONOS3 detected")
-                
-                loop_count += 1
-                #If CLI doesn't like the continuous requests
-                #and exits in this loop, increase the sleep here.
-                #Consequently, while loop timeout will increase
-                time.sleep(1)
-    
-            #Give time for metrics measurement to catch up
-            #NOTE: May need to be configured more accurately
-            time.sleep(10)
-            #If we exited the while loop and link down 1,2,3 are still 
-            #false, then ONOS has failed to discover link down event
-            if not (link_down1 and link_down2 and link_down3):
-                main.log.info("Link down discovery failed")
-                
-                link_down_lat_graph1 = 0
-                link_down_lat_graph2 = 0
-                link_down_lat_graph3 = 0
-                link_down_lat_device1 = 0
-                link_down_lat_device2 = 0
-                link_down_lat_device3 = 0
-                
-                assertion = main.FALSE
-            else:
-                json_topo_metrics_1 =\
-                        main.ONOS1cli.topology_events_metrics()
-                json_topo_metrics_2 =\
-                        main.ONOS2cli.topology_events_metrics()
-                json_topo_metrics_3 =\
-                        main.ONOS3cli.topology_events_metrics()
-                json_topo_metrics_1 = json.loads(json_topo_metrics_1)
-                json_topo_metrics_2 = json.loads(json_topo_metrics_2)
-                json_topo_metrics_3 = json.loads(json_topo_metrics_3)
-
-                main.log.info("Obtaining graph and device timestamp")
-                graph_timestamp_1 = \
-                    json_topo_metrics_1[graphTimestamp]['value']
-                graph_timestamp_2 = \
-                    json_topo_metrics_2[graphTimestamp]['value']
-                graph_timestamp_3 = \
-                    json_topo_metrics_3[graphTimestamp]['value']
-
-                link_timestamp_1 = \
-                    json_topo_metrics_1[linkTimestamp]['value']
-                link_timestamp_2 = \
-                    json_topo_metrics_2[linkTimestamp]['value']
-                link_timestamp_3 = \
-                    json_topo_metrics_3[linkTimestamp]['value']
-
-                if graph_timestamp_1 and graph_timestamp_2 and\
-                        graph_timestamp_3 and link_timestamp_1 and\
-                        link_timestamp_2 and link_timestamp_3:
-                    link_down_lat_graph1 = int(graph_timestamp_1) -\
-                            int(timestamp_link_down_t0)
-                    link_down_lat_graph2 = int(graph_timestamp_2) -\
-                            int(timestamp_link_down_t0)
-                    link_down_lat_graph3 = int(graph_timestamp_3) -\
-                            int(timestamp_link_down_t0)
-                
-                    link_down_lat_link1 = int(link_timestamp_1) -\
-                            int(timestamp_link_down_t0)
-                    link_down_lat_link2 = int(link_timestamp_2) -\
-                            int(timestamp_link_down_t0)
-                    link_down_lat_link3 = int(link_timestamp_3) -\
-                            int(timestamp_link_down_t0)
-                else:
-                    main.log.error("There was an error calculating"+
-                        " the delta for link down event")
-                    link_down_lat_graph1 = 0
-                    link_down_lat_graph2 = 0
-                    link_down_lat_graph3 = 0
-                    
-                    link_down_lat_device1 = 0
-                    link_down_lat_device2 = 0
-                    link_down_lat_device3 = 0
-        
-            main.log.info("Link down latency ONOS1 iteration "+
-                    str(i)+" (end-to-end): "+
-                    str(link_down_lat_graph1)+" ms")
-            main.log.info("Link down latency ONOS2 iteration "+
-                    str(i)+" (end-to-end): "+
-                    str(link_down_lat_graph2)+" ms")
-            main.log.info("Link down latency ONOS3 iteration "+
-                    str(i)+" (end-to-end): "+
-                    str(link_down_lat_graph3)+" ms")
-            
-            main.log.info("Link down latency ONOS1 iteration "+
-                    str(i)+" (link-event-to-system-timestamp): "+
-                    str(link_down_lat_link1)+" ms")
-            main.log.info("Link down latency ONOS2 iteration "+
-                    str(i)+" (link-event-to-system-timestamp): "+
-                    str(link_down_lat_link2)+" ms")
-            main.log.info("Link down latency ONOS3 iteration "+
-                    str(i)+" (link-event-to-system-timestamp): "+
-                    str(link_down_lat_link3))
-      
-            #Calculate avg of node calculations
-            link_down_lat_graph_avg =\
-                    (link_down_lat_graph1 +
-                     link_down_lat_graph2 +
-                     link_down_lat_graph3) / 3
-            link_down_lat_link_avg =\
-                    (link_down_lat_link1 +
-                     link_down_lat_link2 +
-                     link_down_lat_link3) / 3
-
-            #Set threshold and append latency to list
-            if link_down_lat_graph_avg > down_threshold_min and\
-               link_down_lat_graph_avg < down_threshold_max:
-                link_down_graph_to_system_list.append(
-                        link_down_lat_graph_avg)
-            else:
-                main.log.info("Link down latency exceeded threshold")
-                main.log.info("Results for iteration "+str(i)+
-                        "have been omitted")
-            if link_down_lat_link_avg > down_threshold_min and\
-               link_down_lat_link_avg < down_threshold_max:
-                link_down_link_to_system_list.append(
-                        link_down_lat_link_avg)
-            else:
-                main.log.info("Link down latency exceeded threshold")
-                main.log.info("Results for iteration "+str(i)+
-                        "have been omitted")
-
-            #NOTE: To remove loss rate and measure latency:
-            #       'sh tc qdisc del dev s1-eth1 root'
-            timestamp_link_up_t0 = time.time() * 1000
-            main.Mininet1.handle.sendline("sh tc qdisc del dev "+
-                    "s1-eth1 root")
-            main.Mininet1.handle.expect("mininet>")
-            
-            main.log.info("Checking ONOS for link update")
-            
-            link_down1 = True
-            link_down2 = True
-            link_down3 = True
-            loop_count = 0
-            while( (link_down1 and link_down2 and link_down3)\
-                    and loop_count < 30 ):
-                json_str1 = main.ONOS1cli.links()
-                json_str2 = main.ONOS2cli.links()
-                json_str3 = main.ONOS3cli.links()
-                if not (json_str1 and json_str2 and json_str3):
-                    main.log.error("CLI command returned error ")
-                    break
-                else:
-                    json_obj1 = json.loads(json_str1)
-                    json_obj2 = json.loads(json_str2)
-                    json_obj3 = json.loads(json_str3)
-                
-                for obj1 in json_obj1:
-                    if '01' in obj1['src']['device']:
-                        link_down1 = False 
-                        main.log.info("Link up from "+
-                            "s1 -> s2 on ONOS1 detected")
-                for obj2 in json_obj2:
-                    if '01' in obj2['src']['device']:
-                        link_down2 = False 
-                        main.log.info("Link up from "+
-                            "s1 -> s2 on ONOS2 detected")
-                for obj3 in json_obj3:
-                    if '01' in obj3['src']['device']:
-                        link_down3 = False 
-                        main.log.info("Link up from "+
-                            "s1 -> s2 on ONOS3 detected")
-                
-                loop_count += 1
-                time.sleep(1)
-            
-            if (link_down1 and link_down2 and link_down3):
-                main.log.info("Link up discovery failed")
-                
-                link_up_lat_graph1 = 0
-                link_up_lat_graph2 = 0
-                link_up_lat_graph3 = 0
-                link_up_lat_device1 = 0
-                link_up_lat_device2 = 0
-                link_up_lat_device3 = 0
-                
-                assertion = main.FALSE
-            else:
-                json_topo_metrics_1 =\
-                        main.ONOS1cli.topology_events_metrics()
-                json_topo_metrics_2 =\
-                        main.ONOS2cli.topology_events_metrics()
-                json_topo_metrics_3 =\
-                        main.ONOS3cli.topology_events_metrics()
-                json_topo_metrics_1 = json.loads(json_topo_metrics_1)
-                json_topo_metrics_2 = json.loads(json_topo_metrics_2)
-                json_topo_metrics_3 = json.loads(json_topo_metrics_3)
-
-                main.log.info("Obtaining graph and device timestamp")
-                graph_timestamp_1 = \
-                    json_topo_metrics_1[graphTimestamp]['value']
-                graph_timestamp_2 = \
-                    json_topo_metrics_2[graphTimestamp]['value']
-                graph_timestamp_3 = \
-                    json_topo_metrics_3[graphTimestamp]['value']
-
-                link_timestamp_1 = \
-                    json_topo_metrics_1[linkTimestamp]['value']
-                link_timestamp_2 = \
-                    json_topo_metrics_2[linkTimestamp]['value']
-                link_timestamp_3 = \
-                    json_topo_metrics_3[linkTimestamp]['value']
-
-                if graph_timestamp_1 and graph_timestamp_2 and\
-                        graph_timestamp_3 and link_timestamp_1 and\
-                        link_timestamp_2 and link_timestamp_3:
-                    link_up_lat_graph1 = int(graph_timestamp_1) -\
-                            int(timestamp_link_up_t0)
-                    link_up_lat_graph2 = int(graph_timestamp_2) -\
-                            int(timestamp_link_up_t0)
-                    link_up_lat_graph3 = int(graph_timestamp_3) -\
-                            int(timestamp_link_up_t0)
-                
-                    link_up_lat_link1 = int(link_timestamp_1) -\
-                            int(timestamp_link_up_t0)
-                    link_up_lat_link2 = int(link_timestamp_2) -\
-                            int(timestamp_link_up_t0)
-                    link_up_lat_link3 = int(link_timestamp_3) -\
-                            int(timestamp_link_up_t0)
-                else:
-                    main.log.error("There was an error calculating"+
-                        " the delta for link down event")
-                    link_up_lat_graph1 = 0
-                    link_up_lat_graph2 = 0
-                    link_up_lat_graph3 = 0
-                    
-                    link_up_lat_device1 = 0
-                    link_up_lat_device2 = 0
-                    link_up_lat_device3 = 0
-       
-            if debug_mode == 'on':
-                main.log.info("Link up latency ONOS1 iteration "+
-                    str(i)+" (end-to-end): "+
-                    str(link_up_lat_graph1)+" ms")
-                main.log.info("Link up latency ONOS2 iteration "+
-                    str(i)+" (end-to-end): "+
-                    str(link_up_lat_graph2)+" ms")
-                main.log.info("Link up latency ONOS3 iteration "+
-                    str(i)+" (end-to-end): "+
-                    str(link_up_lat_graph3)+" ms")
-            
-                main.log.info("Link up latency ONOS1 iteration "+
-                    str(i)+" (link-event-to-system-timestamp): "+
-                    str(link_up_lat_link1)+" ms")
-                main.log.info("Link up latency ONOS2 iteration "+
-                    str(i)+" (link-event-to-system-timestamp): "+
-                    str(link_up_lat_link2)+" ms")
-                main.log.info("Link up latency ONOS3 iteration "+
-                    str(i)+" (link-event-to-system-timestamp): "+
-                    str(link_up_lat_link3))
-      
-            #Calculate avg of node calculations
-            link_up_lat_graph_avg =\
-                    (link_up_lat_graph1 +
-                     link_up_lat_graph2 +
-                     link_up_lat_graph3) / 3
-            link_up_lat_link_avg =\
-                    (link_up_lat_link1 +
-                     link_up_lat_link2 +
-                     link_up_lat_link3) / 3
-
-            #Set threshold and append latency to list
-            if link_up_lat_graph_avg > up_threshold_min and\
-               link_up_lat_graph_avg < up_threshold_max:
-                link_up_graph_to_system_list.append(
-                        link_up_lat_graph_avg)
-            else:
-                main.log.info("Link up latency exceeded threshold")
-                main.log.info("Results for iteration "+str(i)+
-                        "have been omitted")
-            if link_up_lat_link_avg > up_threshold_min and\
-               link_up_lat_link_avg < up_threshold_max:
-                link_up_link_to_system_list.append(
-                        link_up_lat_link_avg)
-            else:
-                main.log.info("Link up latency exceeded threshold")
-                main.log.info("Results for iteration "+str(i)+
-                        "have been omitted")
-
-        #Calculate min, max, avg of list and report
-        link_down_min = min(link_down_graph_to_system_list)
-        link_down_max = max(link_down_graph_to_system_list)
-        link_down_avg = sum(link_down_graph_to_system_list) / \
-                        len(link_down_graph_to_system_list)
-        link_up_min = min(link_up_graph_to_system_list)
-        link_up_max = max(link_up_graph_to_system_list)
-        link_up_avg = sum(link_up_graph_to_system_list) / \
-                        len(link_up_graph_to_system_list)
-        link_down_std_dev = \
-                str(round(numpy.std(link_down_graph_to_system_list),1))
-        link_up_std_dev = \
-                str(round(numpy.std(link_up_graph_to_system_list),1))
-
-        main.log.report("Link down latency " +
-                "Avg: "+str(link_down_avg)+" ms "+
-                "Std Deviation: "+link_down_std_dev+" ms")
-        main.log.report("Link up latency "+
-                "Avg: "+str(link_up_avg)+" ms "+
-                "Std Deviation: "+link_up_std_dev+" ms")
-
-        utilities.assert_equals(expect=main.TRUE, actual=assertion,
-                onpass="Link discovery latency calculation successful",
-                onfail="Link discovery latency case failed")
-
-    def CASE5(self, main):
-        '''
-        100 Switch discovery latency
-
-        Important:
-            This test case can be potentially dangerous if 
-            your machine has previously set iptables rules.
-            One of the steps of the test case will flush
-            all existing iptables rules.
-        Note:
-            You can specify the number of switches in the 
-            params file to adjust the switch discovery size
-            (and specify the corresponding topology in Mininet1 
-            .topo file)
-        '''
-        import time
-        import subprocess
-        import os
-        import requests
-        import json
-
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        MN1_ip = main.params['MN']['ip1']
-        ONOS_user = main.params['CTRL']['user']
-
-        default_sw_port = main.params['CTRL']['port1']
-       
-        #Number of iterations of case
-        num_iter = main.params['TEST']['numIter']
-        num_sw = main.params['TEST']['numSwitch']
-
-        #Timestamp 'keys' for json metrics output.
-        #These are subject to change, hence moved into params
-        deviceTimestamp = main.params['JSON']['deviceTimestamp']
-        graphTimestamp = main.params['JSON']['graphTimestamp']
-        
-        debug_mode = main.params['TEST']['debugMode']
-
-        local_time = time.strftime('%X')
-        local_time = local_time.replace("/","")
-        local_time = local_time.replace(" ","_")
-        local_time = local_time.replace(":","")
-        if debug_mode == 'on':
-            main.ONOS1.tshark_pcap("eth0",
-                    "/tmp/100_sw_lat_pcap_"+local_time) 
- 
-        #Threshold for this test case
-        sw_disc_threshold_str = main.params['TEST']['swDisc100Threshold']
-        sw_disc_threshold_obj = sw_disc_threshold_str.split(",")
-        sw_disc_threshold_min = int(sw_disc_threshold_obj[0])
-        sw_disc_threshold_max = int(sw_disc_threshold_obj[1])
-
-        tshark_ofp_output = "/tmp/tshark_ofp_"+num_sw+"sw.txt"
-        tshark_tcp_output = "/tmp/tshark_tcp_"+num_sw+"sw.txt"
-
-        tshark_ofp_result_list = []
-        tshark_tcp_result_list = []
-
-        sw_discovery_lat_list = []
-
-        main.case(num_sw+" Switch discovery latency")
-        main.step("Assigning all switches to ONOS1")
-        for i in range(1, int(num_sw)+1):
-            main.Mininet1.assign_sw_controller(
-                    sw=str(i),
-                    ip1=ONOS1_ip,
-                    port1=default_sw_port)
-        
-        #Ensure that nodes are configured with ptpd
-        #Just a warning message
-        main.log.info("Please check ptpd configuration to ensure"+\
-                " All nodes' system times are in sync")
-        time.sleep(5)
-
-        for i in range(0, int(num_iter)):
-            
-            main.step("Set iptables rule to block incoming sw connections")
-            #Set iptables rule to block incoming switch connections
-            #The rule description is as follows:
-            #   Append to INPUT rule,
-            #   behavior DROP that matches following:
-            #       * packet type: tcp
-            #       * source IP: MN1_ip
-            #       * destination PORT: 6633
-            main.ONOS1.handle.sendline(
-                    "sudo iptables -A INPUT -p tcp -s "+MN1_ip+
-                    " --dport "+default_sw_port+" -j DROP")
-            main.ONOS1.handle.expect("\$") 
-            #   Append to OUTPUT rule, 
-            #   behavior DROP that matches following:
-            #       * packet type: tcp
-            #       * source IP: MN1_ip
-            #       * destination PORT: 6633
-            main.ONOS1.handle.sendline(
-                    "sudo iptables -A OUTPUT -p tcp -s "+MN1_ip+
-                    " --dport "+default_sw_port+" -j DROP")
-            main.ONOS1.handle.expect("\$")
-            #Give time to allow rule to take effect
-            #NOTE: Sleep period may need to be configured 
-            #      based on the number of switches in the topology
-            main.log.info("Please wait for switch connection to "+
-                    "time out")
-            time.sleep(60)
-            
-            #Gather vendor OFP with tshark
-            main.ONOS1.tshark_grep("OFP 86 Vendor", 
-                    tshark_ofp_output)
-            main.ONOS1.tshark_grep("TCP 74 ",
-                    tshark_tcp_output)
-
-            #NOTE: Remove all iptables rule quickly (flush)
-            #      Before removal, obtain TestON timestamp at which 
-            #      removal took place
-            #      (ensuring nodes are configured via ptp)
-            #      sudo iptables -F
-            
-            t0_system = time.time() * 1000
-            main.ONOS1.handle.sendline(
-                    "sudo iptables -F")
-
-            #Counter to track loop count
-            counter_loop = 0
-            counter_avail1 = 0
-            counter_avail2 = 0
-            counter_avail3 = 0
-            onos1_dev = False
-            onos2_dev = False
-            onos3_dev = False
-            while counter_loop < 60:
-                #Continue to check devices for all device 
-                #availability. When all devices in all 3
-                #ONOS instances indicate that devices are available
-                #obtain graph event timestamp for t1.
-                device_str_obj1 = main.ONOS1cli.devices()
-                device_str_obj2 = main.ONOS2cli.devices()
-                device_str_obj3 = main.ONOS3cli.devices()
-
-                device_json1 = json.loads(device_str_obj1)                
-                device_json2 = json.loads(device_str_obj2)                
-                device_json3 = json.loads(device_str_obj3)           
-                
-                for device1 in device_json1:
-                    if device1['available'] == True:
-                        counter_avail1 += 1
-                        if counter_avail1 == int(num_sw):
-                            onos1_dev = True
-                            main.log.info("All devices have been "+
-                                    "discovered on ONOS1")
-                    else:
-                        counter_avail1 = 0
-                for device2 in device_json2:
-                    if device2['available'] == True:
-                        counter_avail2 += 1
-                        if counter_avail2 == int(num_sw):
-                            onos2_dev = True
-                            main.log.info("All devices have been "+
-                                    "discovered on ONOS2")
-                    else:
-                        counter_avail2 = 0
-                for device3 in device_json3:
-                    if device3['available'] == True:
-                        counter_avail3 += 1
-                        if counter_avail3 == int(num_sw):
-                            onos3_dev = True
-                            main.log.info("All devices have been "+
-                                    "discovered on ONOS3")
-                    else:
-                        counter_avail3 = 0
-
-                if onos1_dev and onos2_dev and onos3_dev:
-                    main.log.info("All devices have been discovered "+
-                            "on all ONOS instances")
-                    json_str_topology_metrics_1 =\
-                        main.ONOS1cli.topology_events_metrics()
-                    json_str_topology_metrics_2 =\
-                        main.ONOS2cli.topology_events_metrics()
-                    json_str_topology_metrics_3 =\
-                        main.ONOS3cli.topology_events_metrics()
-                   
-                    #Exit while loop if all devices discovered
-                    break 
-                
-                counter_loop += 1
-                #Give some time in between CLI calls
-                #(will not affect measurement)
-                time.sleep(3)
-
-            main.ONOS1.tshark_stop()
-            
-            os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+
-                    tshark_ofp_output+" /tmp/") 
-            os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+
-                    tshark_tcp_output+" /tmp/")
-
-            #TODO: Automate OFP output analysis
-            #Debug mode - print out packets captured at runtime     
-            if debug_mode == 'on': 
-                ofp_file = open(tshark_ofp_output, 'r')
-                main.log.info("Tshark OFP Vendor output: ")
-                for line in ofp_file:
-                    tshark_ofp_result_list.append(line)
-                    main.log.info(line)
-                ofp_file.close()
-
-                tcp_file = open(tshark_tcp_output, 'r')
-                main.log.info("Tshark TCP 74 output: ")
-                for line in tcp_file:
-                    tshark_tcp_result_list.append(line)
-                    main.log.info(line)
-                tcp_file.close()
-
-            json_obj_1 = json.loads(json_str_topology_metrics_1)
-            json_obj_2 = json.loads(json_str_topology_metrics_2)
-            json_obj_3 = json.loads(json_str_topology_metrics_3)
-
-            graph_timestamp_1 = \
-                    json_obj_1[graphTimestamp]['value']
-            graph_timestamp_2 = \
-                    json_obj_2[graphTimestamp]['value']
-            graph_timestamp_3 = \
-                    json_obj_3[graphTimestamp]['value']
-
-            graph_lat_1 = int(graph_timestamp_1) - int(t0_system)
-            graph_lat_2 = int(graph_timestamp_2) - int(t0_system)
-            graph_lat_3 = int(graph_timestamp_3) - int(t0_system)
-
-            avg_graph_lat = \
-                    (int(graph_lat_1) +\
-                     int(graph_lat_2) +\
-                     int(graph_lat_3)) / 3
-    
-            if avg_graph_lat > sw_disc_threshold_min \
-                    and avg_graph_lat < sw_disc_threshold_max:
-                sw_discovery_lat_list.append(
-                        avg_graph_lat)
-            else:
-                main.log.info("100 Switch discovery latency "+
-                        "exceeded the threshold.")
-            
-            #END ITERATION FOR LOOP
-
-        sw_lat_min = min(sw_discovery_lat_list)
-        sw_lat_max = max(sw_discovery_lat_list)
-        sw_lat_avg = sum(sw_discovery_lat_list) /\
-                     len(sw_discovery_lat_list)
-
-        main.log.report("100 Switch discovery lat "+\
-                "Min: "+str(sw_lat_min)+" ms"+\
-                "Max: "+str(sw_lat_max)+" ms"+\
-                "Avg: "+str(sw_lat_avg)+" ms")
-
-    def CASE6(self, main):
-        '''
-        Increase number of nodes and initiate CLI
-        '''
-        import time
-        
-        ONOS1_ip = main.params['CTRL']['ip1']
-        ONOS2_ip = main.params['CTRL']['ip2']
-        ONOS3_ip = main.params['CTRL']['ip3']
-        ONOS4_ip = main.params['CTRL']['ip4']
-        ONOS5_ip = main.params['CTRL']['ip5']
-        ONOS6_ip = main.params['CTRL']['ip6']
-        ONOS7_ip = main.params['CTRL']['ip7']
-
-        cell_name = main.params['ENV']['cellName']
-    
-        global cluster_count
-        
-        #Cluster size increased everytime the case is defined
-        cluster_count += 2 
-
-        main.log.report("Increasing cluster size to "+
-                str(cluster_count))
-
-        install_result = main.FALSE
-        if cluster_count == 5:
-            main.log.info("Installing nodes 4 and 5")
-            node4_result = \
-                main.ONOSbench.onos_install(node=ONOS4_ip)
-            node5_result = \
-                main.ONOSbench.onos_install(node=ONOS5_ip)
-            install_result = node4_result and node5_result
-
-            time.sleep(5)
-
-            main.ONOS4cli.start_onos_cli(ONOS4_ip)
-            main.ONOS5cli.start_onos_cli(ONOS5_ip)
-
-        elif cluster_count == 7:
-            main.log.info("Installing nodes 4 and 5")
-            node6_result = \
-                main.ONOSbench.onos_install(node=ONOS6_ip)
-            node7_result = \
-                main.ONOSbench.onos_install(node=ONOS7_ip)
-            install_result = node6_result and node7_result
-
-            time.sleep(5)
-
-            main.ONOS6cli.start_onos_cli(ONOS6_ip)
-            main.ONOS7cli.start_onos_cli(ONOS7_ip)
-
-
-
-
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.py b/TestON/tests/TopoPerfNext/TopoPerfNext.py
deleted file mode 100644
index 0f37909..0000000
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.py
+++ /dev/null
@@ -1,2006 +0,0 @@
-# TopoPerfNext
-#
-# Topology Performance test for ONOS-next
-#
-# andrew@onlab.us
-#
-# If your machine does not come with numpy
-# run the following command:
-# sudo apt-get install python-numpy python-scipy
-
-import time
-import sys
-import os
-import re
-
-
-class TopoPerfNext:
-
-    def __init__( self ):
-        self.default = ''
-
-    def CASE1( self, main ):
-        """
-        ONOS startup sequence
-        """
-        import time
-
-        # Global cluster count for scale-out purposes
-        global clusterCount
-        #TODO: fix run number implementation
-        global runNum 
-        global timeToPost
-
-        #Test run time
-        timeToPost = time.strftime("%Y-%m-%d %H:%M:%S")
-        # Set initial cluster count
-        clusterCount = 1
-        ##
-
-        runNum = time.strftime("%d%H%M%S")
-
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-
-        gitPull = main.params[ 'GIT' ][ 'autoPull' ]
-        checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
-
-        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
-        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-        ONOS4Ip = main.params[ 'CTRL' ][ 'ip4' ] 
-        ONOS5Ip = main.params[ 'CTRL' ][ 'ip5' ]
-        ONOS6Ip = main.params[ 'CTRL' ][ 'ip6' ]
-        ONOS7Ip = main.params[ 'CTRL' ][ 'ip7' ] 
-
-        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
-        BENCHIp = main.params[ 'BENCH' ][ 'ip' ]
-
-        topoCfgFile = main.params[ 'TEST' ][ 'topoConfigFile' ]
-        topoCfgName = main.params[ 'TEST' ][ 'topoConfigName' ]
-
-        portEventResultPath = main.params[ 'DB' ][ 'portEventResultPath' ]
-        switchEventResultPath = main.params[ 'DB' ][ 'switchEventResultPath' ]
-
-        mvnCleanInstall = main.params[ 'TEST' ][ 'mci' ]
-        
-        main.case( "Setting up test environment" )
-        main.log.info( "Copying topology event accumulator config" +
-                       " to ONOS /package/etc" )
-        main.ONOSbench.handle.sendline( "cp ~/" +
-                                        topoCfgFile +
-                                        " ~/ONOS/tools/package/etc/" +
-                                        topoCfgName )
-        main.ONOSbench.handle.expect( "\$" )
-
-        main.log.report( "Setting up test environment" )
-
-        main.step( "Starting mininet topology " )
-        main.Mininet1.startNet()
-
-        main.step( "Cleaning previously installed ONOS if any" )
-        main.ONOSbench.onosUninstall( nodeIp=ONOS2Ip )
-        main.ONOSbench.onosUninstall( nodeIp=ONOS3Ip )
-        main.ONOSbench.onosUninstall( nodeIp=ONOS4Ip )
-        main.ONOSbench.onosUninstall( nodeIp=ONOS5Ip )
-        main.ONOSbench.onosUninstall( nodeIp=ONOS6Ip )
-        main.ONOSbench.onosUninstall( nodeIp=ONOS7Ip )
-
-        main.step( "Clearing previous DB log files" )
-        fPortLog = open(portEventResultPath, 'w')
-        fPortLog.write('')
-        fPortLog.close()
-        fSwitchLog = open(switchEventResultPath, 'w')
-        fSwitchLog.write('')
-        fSwitchLog.close()
-        
-        main.step( "Creating cell file" )
-        cellFileResult = main.ONOSbench.createCellFile(
-            BENCHIp, cellName, MN1Ip,
-            ("onos-core,onos-api,webconsole,onos-app-metrics,onos-app-gui,"
-            "onos-cli,onos-openflow"),
-            ONOS1Ip )
-
-        main.step( "Applying cell file to environment" )
-        cellApplyResult = main.ONOSbench.setCell( cellName )
-        verifyCellResult = main.ONOSbench.verifyCell()
-
-        # NOTE: This step may be removed after proper
-        #      copy cat log functionality
-        main.step( "Removing raft/copy-cat logs from ONOS nodes" )
-        main.ONOSbench.onosRemoveRaftLogs()
-        time.sleep( 30 )
-
-        main.step( "Git checkout and pull " + checkoutBranch )
-        if gitPull == 'on':
-            # checkoutResult = \
-                    #        main.ONOSbench.gitCheckout( checkoutBranch )
-            checkoutResult = main.TRUE
-            pullResult = main.ONOSbench.gitPull()
-        else:
-            checkoutResult = main.TRUE
-            pullResult = main.TRUE
-            main.log.info( "Skipped git checkout and pull" )
-
-        main.log.report( "Commit information - " )
-        main.ONOSbench.getVersion( report=True )
-
-        main.step( "Using mvn clean & install" )
-        if mvnCleanInstall == 'on':
-            mvnResult = main.ONOSbench.cleanInstall()
-        elif mvnCleanInstall == 'off':
-            main.log.info("mci turned off by settings")
-            mvnResult = main.TRUE
-
-        main.step( "Set cell for ONOS cli env" )
-        main.ONOS1cli.setCell( cellName )
-
-        main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()
-
-        main.step( "Installing ONOS package" )
-        install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
-
-        time.sleep( 10 )
-
-        main.step( "Start onos cli" )
-        cli1 = main.ONOS1cli.startOnosCli( ONOS1Ip )
-
-        utilities.assert_equals( expect=main.TRUE,
-                                actual=cellFileResult and cellApplyResult and
-                                verifyCellResult and checkoutResult and
-                                pullResult and mvnResult and
-                                install1Result,  # and install2Result and
-                                # install3Result,
-                                onpass="Test Environment setup successful",
-                                onfail="Failed to setup test environment" )
-
-    def CASE2( self, main ):
-        """
-        Assign s1 to ONOS1 and measure latency
-
-        There are 4 levels of latency measurements to this test:
-        1 ) End-to-end measurement: Complete end-to-end measurement
-           from TCP ( SYN/ACK ) handshake to Graph change
-        2 ) OFP-to-graph measurement: 'ONOS processing' snippet of
-           measurement from OFP Vendor message to Graph change
-        3 ) OFP-to-device measurement: 'ONOS processing without
-           graph change' snippet of measurement from OFP vendor
-           message to Device change timestamp
-        4 ) T0-to-device measurement: Measurement that includes
-           the switch handshake to devices timestamp without
-           the graph view change. ( TCP handshake -> Device
-           change )
-        """
-        import time
-        import subprocess
-        import json
-        import requests
-        import os
-        import numpy
-        global clusterCount
-        global timeToPost
-
-        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
-        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-        ONOS4Ip = main.params[ 'CTRL' ][ 'ip4' ]
-        ONOS5Ip = main.params[ 'CTRL' ][ 'ip5' ]
-        ONOS6Ip = main.params[ 'CTRL' ][ 'ip6' ]
-        ONOS7Ip = main.params[ 'CTRL' ][ 'ip7' ]
-
-        ONOSUser = main.params[ 'CTRL' ][ 'user' ]
-
-        defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
-
-        # Number of iterations of case
-        numIter = main.params[ 'TEST' ][ 'numIter' ]
-        # Number of first 'x' iterations to ignore:
-        iterIgnore = int( main.params[ 'TEST' ][ 'iterIgnore' ] )
-
-        # Timestamp 'keys' for json metrics output.
-        # These are subject to change, hence moved into params
-        deviceTimestamp = main.params[ 'JSON' ][ 'deviceTimestamp' ]
-        graphTimestamp = main.params[ 'JSON' ][ 'graphTimestamp' ]
-
-        debugMode = main.params[ 'TEST' ][ 'debugMode' ]
-        onosLog = main.params[ 'TEST' ][ 'onosLogFile' ]
-        resultPath = main.params[ 'DB' ][ 'switchEventResultPath' ]
-
-        # Threshold for the test
-        thresholdStr = main.params[ 'TEST' ][ 'singleSwThreshold' ]
-        thresholdObj = thresholdStr.split( "," )
-        thresholdMin = int( thresholdObj[ 0 ] )
-        thresholdMax = int( thresholdObj[ 1 ] )
-
-        # List of switch add latency collected from
-        # all iterations
-        latencyEndToEndList = []
-        latencyOfpToGraphList = []
-        latencyOfpToDeviceList = []
-        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"
-
-        # String to grep in tshark output
-        tsharkTcpString = "TCP 74 " + defaultSwPort
-        tsharkOfString = "OFP 86 Vendor"
-
-        # Initialize assertion to TRUE
-        assertion = main.TRUE
-
-        localTime = time.strftime( '%x %X' )
-        localTime = localTime.replace( "/", "" )
-        localTime = localTime.replace( " ", "_" )
-        localTime = localTime.replace( ":", "" )
-        if debugMode == 'on':
-            main.ONOS1.tsharkPcap( "eth0",
-                                   "/tmp/single_sw_lat_pcap_" + localTime )
-
-            main.log.info( "Debug mode is on" )
-
-        main.log.report( "Latency of adding one switch to controller" )
-        main.log.report( "First " + str( iterIgnore ) + " iterations ignored" +
-                         " for jvm warmup time" )
-        main.log.report( "Total iterations of test: " + str( numIter ) )
-
-        for i in range( 0, int( numIter ) ):
-            main.log.info( "Starting tshark capture" )
-
-            #* TCP [ ACK, SYN ] is used as t0A, the
-            #  very first "exchange" between ONOS and
-            #  the switch for end-to-end measurement
-            #* OFP [ Stats Reply ] is used for t0B
-            #  the very last OFP message between ONOS
-            #  and the switch for ONOS measurement
-            main.ONOS1.tsharkGrep( tsharkTcpString,
-                                   tsharkTcpOutput )
-            main.ONOS1.tsharkGrep( tsharkOfString,
-                                   tsharkOfOutput )
-
-            # Wait and ensure tshark is started and
-            # capturing
-            time.sleep( 10 )
-
-            main.log.info( "Assigning s1 to controller" )
-
-            main.Mininet1.assignSwController(
-                sw="1",
-                ip1=ONOS1Ip,
-                port1=defaultSwPort )
-
-            # Wait and ensure switch is assigned
-            # before stopping tshark
-            time.sleep( 30 )
-
-            main.log.info( "Stopping all Tshark processes" )
-            main.ONOS1.stopTshark()
-
-            # tshark output is saved in ONOS. Use subprocess
-            # to copy over files to TestON for parsing
-            main.log.info( "Copying over tshark files" )
-
-            # TCP CAPTURE ****
-            # Copy the tshark output from ONOS machine to
-            # TestON machine in tsharkTcpOutput directory>file
-            os.system( "scp " + ONOSUser + "@" + ONOS1Ip + ":" +
-                       tsharkTcpOutput + " /tmp/" )
-            tcpFile = open( tsharkTcpOutput, 'r' )
-            tempText = tcpFile.readline()
-            tempText = tempText.split( " " )
-
-            main.log.info( "Object read in from TCP capture: " +
-                           str( tempText ) )
-            if len( tempText ) > 1:
-                t0Tcp = float( tempText[ 1 ] ) * 1000.0
-            else:
-                main.log.error( "Tshark output file for TCP" +
-                                " returned unexpected results" )
-                t0Tcp = 0
-                assertion = main.FALSE
-
-            tcpFile.close()
-            #****************
-
-            # OF CAPTURE ****
-            os.system( "scp " + ONOSUser + "@" + ONOS1Ip + ":" +
-                       tsharkOfOutput + " /tmp/" )
-            ofFile = open( tsharkOfOutput, 'r' )
-
-            lineOfp = ""
-            # Read until last line of file
-            while True:
-                tempText = ofFile.readline()
-                if tempText != '':
-                    lineOfp = tempText
-                else:
-                    break
-            obj = lineOfp.split( " " )
-
-            main.log.info( "Object read in from OFP capture: " +
-                           str( lineOfp ) )
-
-            if len( obj ) > 1:
-                t0Ofp = float( obj[ 1 ] ) * 1000.0
-            else:
-                main.log.error( "Tshark output file for OFP" +
-                                " returned unexpected results" )
-                t0Ofp = 0
-                assertion = main.FALSE
-
-            ofFile.close()
-            #****************
-
-            jsonStr1 = main.ONOS1cli.topologyEventsMetrics()
-            # Initialize scale-out variables
-            jsonStr2 = ""
-            jsonStr3 = ""
-            jsonStr4 = ""
-            jsonStr5 = ""
-            jsonStr6 = ""
-            jsonStr7 = ""
-
-            jsonObj1 = json.loads( jsonStr1 )
-            # Initialize scale-out variables
-            jsonObj2 = ""
-            jsonObj3 = ""
-            jsonObj4 = ""
-            jsonObj5 = ""
-            jsonObj6 = ""
-            jsonObj7 = ""
-
-            # Obtain graph timestamp. This timestsamp captures
-            # the epoch time at which the topology graph was updated.
-            graphTimestamp1 = \
-                jsonObj1[ graphTimestamp ][ 'value' ]
-            # Obtain device timestamp. This timestamp captures
-            # the epoch time at which the device event happened
-            deviceTimestamp1 = \
-                jsonObj1[ deviceTimestamp ][ 'value' ]
-
-            # 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
-
-            # Include scale-out measurements when applicable
-            if clusterCount >= 3:
-                jsonStr2 = main.ONOS2cli.topologyEventsMetrics()
-                jsonStr3 = main.ONOS3cli.topologyEventsMetrics()
-                jsonObj2 = json.loads( jsonStr2 )
-                jsonObj3 = json.loads( jsonStr3 )
-                graphTimestamp2 = \
-                    jsonObj2[ graphTimestamp ][ 'value' ]
-                graphTimestamp3 = \
-                    jsonObj3[ graphTimestamp ][ 'value' ]
-                deviceTimestamp2 = \
-                    jsonObj2[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp3 = \
-                    jsonObj3[ deviceTimestamp ][ 'value' ]
-                deltaDevice2 = int( deviceTimestamp2 ) - int( t0Tcp )
-                deltaDevice3 = int( deviceTimestamp3 ) - int( t0Tcp )
-                deltaGraph2 = int( graphTimestamp2 ) - int( t0Tcp )
-                deltaGraph3 = int( graphTimestamp3 ) - int( t0Tcp )
-                deltaOfpGraph2 = int( graphTimestamp2 ) - int( t0Ofp )
-                deltaOfpGraph3 = int( graphTimestamp3 ) - int( t0Ofp )
-                deltaOfpDevice2 = float( deviceTimestamp2 ) -\
-                    float( t0Ofp )
-                deltaOfpDevice3 = float( deviceTimestamp3 ) -\
-                    float( t0Ofp )
-
-                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()
-                jsonObj4 = json.loads( jsonStr4 )
-                jsonObj5 = json.loads( jsonStr5 )
-                graphTimestamp4 = \
-                    jsonObj4[ graphTimestamp ][ 'value' ]
-                graphTimestamp5 = \
-                    jsonObj5[ graphTimestamp ][ 'value' ]
-                deviceTimestamp4 = \
-                    jsonObj4[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp5 = \
-                    jsonObj5[ deviceTimestamp ][ 'value' ]
-                deltaDevice4 = int( deviceTimestamp4 ) - int( t0Tcp )
-                deltaDevice5 = int( deviceTimestamp5 ) - int( t0Tcp )
-                deltaGraph4 = int( graphTimestamp4 ) - int( t0Tcp )
-                deltaGraph5 = int( graphTimestamp5 ) - int( t0Tcp )
-                deltaOfpGraph4 = int( graphTimestamp4 ) - int( t0Ofp )
-                deltaOfpGraph5 = int( graphTimestamp5 ) - int( t0Ofp )
-                deltaOfpDevice4 = float( deviceTimestamp4 ) -\
-                    float( t0Ofp )
-                deltaOfpDevice5 = float( deviceTimestamp5 ) -\
-                    float( t0Ofp )
-                
-                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()
-                jsonObj6 = json.loads( jsonStr6 )
-                jsonObj7 = json.loads( jsonStr7 )
-                graphTimestamp6 = \
-                    jsonObj6[ graphTimestamp ][ 'value' ]
-                graphTimestamp7 = \
-                    jsonObj7[ graphTimestamp ][ 'value' ]
-                deviceTimestamp6 = \
-                    jsonObj6[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp7 = \
-                    jsonObj7[ deviceTimestamp ][ 'value' ]
-                deltaDevice6 = int( deviceTimestamp6 ) - int( t0Tcp )
-                deltaDevice7 = int( deviceTimestamp7 ) - int( t0Tcp )
-                deltaGraph6 = int( graphTimestamp6 ) - int( t0Tcp )
-                deltaGraph7 = int( graphTimestamp7 ) - int( t0Tcp )
-                deltaOfpGraph6 = int( graphTimestamp6 ) - int( t0Ofp )
-                deltaOfpGraph7 = int( graphTimestamp7 ) - int( t0Ofp )
-                deltaOfpDevice6 = float( deviceTimestamp6 ) -\
-                    float( t0Ofp )
-                deltaOfpDevice7 = float( deviceTimestamp7 ) -\
-                    float( t0Ofp )
-                
-                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")
-
-                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.log.info("Switch up discovery latency")
-                
-            main.log.info("Starting tshark capture")
-
-            main.step( "Remove switch from controller" )
-            main.Mininet1.deleteSwController( "s1" )
-
-            #TODO: del controller does not have an OFP message.
-            #      However, we can capture TCP Fin,Ack as T0
-
-            time.sleep( 5 )
-
-        # END of for loop iteration
-
-        #str( round( numpy.std( latencyT0ToDeviceList ), 1 ) )
-
-        endToEndAvg = 0
-        ofpToGraphAvg = 0
-        endToEndList = []
-        ofpToGraphList = []
-        dbCmdList = []
-
-        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)
-
-            endToEndAvg = round(numpy.mean(endToEndList), 2)
-            ofpToGraphAvg = numpy.mean(ofpToGraphList)
-            endToEndStd = round(numpy.std(endToEndList), 2)
-
-            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(endToEndStd,2))+" ms")
-            
-            dbCmdList.append(
-                "INSERT INTO switch_latency_tests VALUES("
-                   "'"+timeToPost+"','switch_latency_results',"
-                   ""+runNum+","+str(clusterCount)+",'baremetal"+str(node+1)+"',"
-                   ""+str(endToEndAvg)+","+str(endToEndStd)+",0,0);"
-            )
-            #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" )
-        
-        #Write to file for posting to DB
-        fResult = open(resultPath, 'a')
-        for line in dbCmdList:
-            if line:
-                fResult.write(line+"\n")
-        fResult.close()
-
-        #TODO: correct assert
-        assertion = main.TRUE
-
-        utilities.assert_equals( expect=main.TRUE, actual=assertion,
-                                onpass="Switch latency test successful",
-                                onfail="Switch latency test failed" )
-
-    def CASE3( self, main ):
-        """
-        Bring port up / down and measure latency.
-        Port enable / disable is simulated by ifconfig up / down
-
-        In ONOS-next, we must ensure that the port we are
-        manipulating is connected to another switch with a valid
-        connection. Otherwise, graph view will not be updated.
-        """
-        import time
-        import subprocess
-        import os
-        import requests
-        import json
-        import numpy
-        global clusterCount
-        global runNum
-        global timeToPost
-
-        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
-        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-        ONOSUser = main.params[ 'CTRL' ][ 'user' ]
-
-        defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
-
-        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
-        deviceTimestamp = main.params[ 'JSON' ][ 'deviceTimestamp' ]
-        graphTimestamp = main.params[ 'JSON' ][ 'graphTimestamp' ]
-
-        debugMode = main.params[ 'TEST' ][ 'debugMode' ]
-        postToDB = main.params[ 'DB' ][ 'postToDB' ]
-        resultPath = main.params[ 'DB' ][ 'portEventResultPath' ]
-
-        localTime = time.strftime( '%x %X' )
-        localTime = localTime.replace( "/", "" )
-        localTime = localTime.replace( " ", "_" )
-        localTime = localTime.replace( ":", "" )
-        if debugMode == 'on':
-            main.ONOS1.tsharkPcap( "eth0",
-                                   "/tmp/port_lat_pcap_" + localTime )
-
-        # Threshold for this test case
-        upThresholdStr = main.params[ 'TEST' ][ 'portUpThreshold' ]
-        downThresholdStr = main.params[ 'TEST' ][ 'portDownThreshold' ]
-
-        upThresholdObj = upThresholdStr.split( "," )
-        downThresholdObj = downThresholdStr.split( "," )
-
-        upThresholdMin = int( upThresholdObj[ 0 ] )
-        upThresholdMax = int( upThresholdObj[ 1 ] )
-
-        downThresholdMin = int( downThresholdObj[ 0 ] )
-        downThresholdMax = int( downThresholdObj[ 1 ] )
-
-        # NOTE: Some hardcoded variables you may need to configure
-        #      besides the params
-
-        tsharkPortStatus = "OFP 130 Port Status"
-
-        tsharkPortUp = "/tmp/tshark_port_up.txt"
-        tsharkPortDown = "/tmp/tshark_port_down.txt"
-        interfaceConfig = "s1-eth1"
-
-        main.log.report( "Port enable / disable latency" )
-        main.log.report( "Simulated by ifconfig up / down" )
-        main.log.report( "Total iterations of test: " + str( numIter ) )
-
-        main.step( "Assign switches s1 and s2 to controller 1" )
-        main.Mininet1.assignSwController( sw="1", ip1=ONOS1Ip,
-                                           port1=defaultSwPort )
-        main.Mininet1.assignSwController( sw="2", ip1=ONOS1Ip,
-                                           port1=defaultSwPort )
-
-        # Give enough time for metrics to propagate the
-        # assign controller event. Otherwise, these events may
-        # carry over to our measurements
-        time.sleep( 15 )
-
-        portUpDeviceToOfpList = []
-        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" )
-            main.ONOS1.tsharkGrep( tsharkPortStatus,
-                                   tsharkPortDown )
-
-            time.sleep( 5 )
-
-            # Disable interface that is connected to switch 2
-            main.step( "Disable port: " + interfaceConfig )
-            main.Mininet1.handle.sendline( "sh ifconfig " +
-                                           interfaceConfig + " down" )
-            main.Mininet1.handle.expect( "mininet>" )
-
-            time.sleep( 3 )
-            main.ONOS1.tsharkStop()
-
-            # Copy tshark output file from ONOS to TestON instance
-            #/tmp directory
-            os.system( "scp " + ONOSUser + "@" + ONOS1Ip + ":" +
-                       tsharkPortDown + " /tmp/" )
-
-            fPortDown = open( tsharkPortDown, 'r' )
-            # Get first line of port down event from tshark
-            fLine = fPortDown.readline()
-            objDown = fLine.split( " " )
-            if len( fLine ) > 0:
-                # NOTE: objDown[ 1 ] is a very unreliable
-                #      way to determine the timestamp. If
-                #      results seem way off, check the object
-                #      itself by printing it out
-                timestampBeginPtDown = int( float( objDown[ 1 ] ) * 1000 )
-                # For some reason, wireshark decides to record the
-                # timestamp at the 3rd object position instead of
-                # 2nd at unpredictable times. This statement is
-                # used to capture that odd behavior and use the
-                # correct epoch time
-                if timestampBeginPtDown < 1400000000000:
-                    timestampBeginPtDown = \
-                        int( float( objDown[ 2 ] ) * 1000 )
-
-                main.log.info( "Port down begin timestamp: " +
-                               str( timestampBeginPtDown ) )
-            else:
-                main.log.info( "Tshark output file returned unexpected" +
-                               " results: " + str( objDown ) )
-                timestampBeginPtDown = 0
-            fPortDown.close()
-
-            main.step( "Obtain t1 by metrics call" )
-            jsonStrUp1 = main.ONOS1cli.topologyEventsMetrics()
-            jsonObj1 = json.loads( jsonStrUp1 )
-            # Obtain graph timestamp. This timestsamp captures
-            # the epoch time at which the topology graph was updated.
-            graphTimestamp1 = \
-                jsonObj1[ graphTimestamp ][ 'value' ]
-            # Obtain device timestamp. This timestamp captures
-            # the epoch time at which the device event happened
-            deviceTimestamp1 = \
-                jsonObj1[ deviceTimestamp ][ 'value' ]
-            # Get delta between graph event and OFP
-            ptDownGraphToOfp1 = int( graphTimestamp1 ) -\
-                int( timestampBeginPtDown )
-            # Get delta between device event and OFP
-            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()
-                jsonObj2 = json.loads( jsonStrUp2 )
-                jsonObj3 = json.loads( jsonStrUp3 )
-                graphTimestamp2 = \
-                    jsonObj2[ graphTimestamp ][ 'value' ]
-                graphTimestamp3 = \
-                    jsonObj3[ graphTimestamp ][ 'value' ]
-                deviceTimestamp2 = \
-                    jsonObj2[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp3 = \
-                    jsonObj3[ deviceTimestamp ][ 'value' ]
-                ptDownGraphToOfp2 = int( graphTimestamp2 ) -\
-                    int( timestampBeginPtDown )
-                ptDownGraphToOfp3 = int( graphTimestamp3 ) -\
-                    int( timestampBeginPtDown )
-                ptDownDeviceToOfp2 = int( deviceTimestamp2 ) -\
-                    int( timestampBeginPtDown )
-                ptDownDeviceToOfp3 = int( deviceTimestamp3 ) -\
-                    int( timestampBeginPtDown )
-
-                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()
-                jsonStrUp5 = main.ONOS5cli.topologyEventsMetrics()
-                jsonObj4 = json.loads( jsonStrUp4 )
-                jsonObj5 = json.loads( jsonStrUp5 )
-                graphTimestamp4 = \
-                    jsonObj4[ graphTimestamp ][ 'value' ]
-                graphTimestamp5 = \
-                    jsonObj5[ graphTimestamp ][ 'value' ]
-                deviceTimestamp4 = \
-                    jsonObj4[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp5 = \
-                    jsonObj5[ deviceTimestamp ][ 'value' ]
-                ptDownGraphToOfp4 = int( graphTimestamp4 ) -\
-                    int( timestampBeginPtDown )
-                ptDownGraphToOfp5 = int( graphTimestamp5 ) -\
-                    int( timestampBeginPtDown )
-                ptDownDeviceToOfp4 = int( deviceTimestamp4 ) -\
-                    int( timestampBeginPtDown )
-                ptDownDeviceToOfp5 = int( deviceTimestamp5 ) -\
-                    int( timestampBeginPtDown )
-                
-                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()
-                jsonStrUp7 = main.ONOS7cli.topologyEventsMetrics()
-                jsonObj6 = json.loads( jsonStrUp6 )
-                jsonObj7 = json.loads( jsonStrUp7 )
-                graphTimestamp6 = \
-                    jsonObj6[ graphTimestamp ][ 'value' ]
-                graphTimestamp7 = \
-                    jsonObj7[ graphTimestamp ][ 'value' ]
-                deviceTimestamp6 = \
-                    jsonObj6[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp7 = \
-                    jsonObj7[ deviceTimestamp ][ 'value' ]
-                ptDownGraphToOfp6 = int( graphTimestamp6 ) -\
-                    int( timestampBeginPtDown )
-                ptDownGraphToOfp7 = int( graphTimestamp7 ) -\
-                    int( timestampBeginPtDown )
-                ptDownDeviceToOfp6 = int( deviceTimestamp6 ) -\
-                    int( timestampBeginPtDown )
-                ptDownDeviceToOfp7 = int( deviceTimestamp7 ) -\
-                    int( timestampBeginPtDown )
-                
-                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 )
-
-            # Port up events
-            main.step( "Enable port and obtain timestamp" )
-            main.step( "Starting wireshark capture for port status up" )
-            main.ONOS1.tsharkGrep( tsharkPortStatus, tsharkPortUp )
-            time.sleep( 5 )
-
-            main.Mininet1.handle.sendline( "sh ifconfig " +
-                                           interfaceConfig + " up" )
-            main.Mininet1.handle.expect( "mininet>" )
-
-            # Allow time for tshark to capture event
-            time.sleep( 5 )
-            main.ONOS1.tsharkStop()
-
-            time.sleep( 3 )
-            os.system( "scp " + ONOSUser + "@" + ONOS1Ip + ":" +
-                       tsharkPortUp + " /tmp/" )
-            fPortUp = open( tsharkPortUp, 'r' )
-            fLine = fPortUp.readline()
-            objUp = fLine.split( " " )
-            if len( fLine ) > 0:
-                timestampBeginPtUp = int( float( objUp[ 1 ] ) * 1000 )
-                if timestampBeginPtUp < 1400000000000:
-                    timestampBeginPtUp = \
-                        int( float( objUp[ 2 ] ) * 1000 )
-                main.log.info( "Port up begin timestamp: " +
-                               str( timestampBeginPtUp ) )
-            else:
-                main.log.info( "Tshark output file returned unexpected" +
-                               " results." )
-                timestampBeginPtUp = 0
-            fPortUp.close()
-
-            # Obtain metrics shortly afterwards
-            # This timestsamp captures
-            # the epoch time at which the topology graph was updated.
-            main.step( "Obtain t1 by REST call" )
-            jsonStrUp1 = main.ONOS1cli.topologyEventsMetrics()
-            jsonObj1 = json.loads( jsonStrUp1 )
-            graphTimestamp1 = \
-                jsonObj1[ graphTimestamp ][ 'value' ]
-            # Obtain device timestamp. This timestamp captures
-            # the epoch time at which the device event happened
-            deviceTimestamp1 = \
-                jsonObj1[ deviceTimestamp ][ 'value' ]
-            # Get delta between graph event and OFP
-            ptUpGraphToOfp1 = int( graphTimestamp1 ) -\
-                int( timestampBeginPtUp )
-            # 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()
-                jsonStrUp3 = main.ONOS3cli.topologyEventsMetrics()
-                jsonObj2 = json.loads( jsonStrUp2 )
-                jsonObj3 = json.loads( jsonStrUp3 )
-                graphTimestamp2 = \
-                    jsonObj2[ graphTimestamp ][ 'value' ]
-                graphTimestamp3 = \
-                    jsonObj3[ graphTimestamp ][ 'value' ]
-                deviceTimestamp2 = \
-                    jsonObj2[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp3 = \
-                    jsonObj3[ deviceTimestamp ][ 'value' ]
-                ptUpGraphToOfp2 = int( graphTimestamp2 ) -\
-                    int( timestampBeginPtUp )
-                ptUpGraphToOfp3 = int( graphTimestamp3 ) -\
-                    int( timestampBeginPtUp )
-                ptUpDeviceToOfp2 = int( deviceTimestamp2 ) -\
-                    int( timestampBeginPtUp )
-                ptUpDeviceToOfp3 = int( deviceTimestamp3 ) -\
-                    int( timestampBeginPtUp )
-            
-                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()
-                jsonStrUp5 = main.ONOS5cli.topologyEventsMetrics()
-                jsonObj4 = json.loads( jsonStrUp4 )
-                jsonObj5 = json.loads( jsonStrUp5 )
-                graphTimestamp4 = \
-                    jsonObj4[ graphTimestamp ][ 'value' ]
-                graphTimestamp5 = \
-                    jsonObj5[ graphTimestamp ][ 'value' ]
-                deviceTimestamp4 = \
-                    jsonObj4[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp5 = \
-                    jsonObj5[ deviceTimestamp ][ 'value' ]
-                ptUpGraphToOfp4 = int( graphTimestamp4 ) -\
-                    int( timestampBeginPtUp )
-                ptUpGraphToOfp5 = int( graphTimestamp5 ) -\
-                    int( timestampBeginPtUp )
-                ptUpDeviceToOfp4 = int( deviceTimestamp4 ) -\
-                    int( timestampBeginPtUp )
-                ptUpDeviceToOfp5 = int( deviceTimestamp5 ) -\
-                    int( timestampBeginPtUp )
-                
-                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()
-                jsonStrUp7 = main.ONOS7cli.topologyEventsMetrics()
-                jsonObj6 = json.loads( jsonStrUp6 )
-                jsonObj7 = json.loads( jsonStrUp7 )
-                graphTimestamp6 = \
-                    jsonObj6[ graphTimestamp ][ 'value' ]
-                graphTimestamp7 = \
-                    jsonObj7[ graphTimestamp ][ 'value' ]
-                deviceTimestamp6 = \
-                    jsonObj6[ deviceTimestamp ][ 'value' ]
-                deviceTimestamp7 = \
-                    jsonObj7[ deviceTimestamp ][ 'value' ]
-                ptUpGraphToOfp6 = int( graphTimestamp6 ) -\
-                    int( timestampBeginPtUp )
-                ptUpGraphToOfp7 = int( graphTimestamp7 ) -\
-                    int( timestampBeginPtUp )
-                ptUpDeviceToOfp6 = int( deviceTimestamp6 ) -\
-                    int( timestampBeginPtUp )
-                ptUpDeviceToOfp7 = int( deviceTimestamp7 ) -\
-                    int( timestampBeginPtUp )
-                
-                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 = []
-
-        portUpDevAvg = 0
-        portUpGraphAvg = 0
-        portDownDevAvg = 0
-        portDownGraphAvg = 0
-
-        dbCmdList = []
-
-        for node in range( 0, clusterCount ):
-
-            # 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 = round(numpy.mean(portUpDevList), 2)
-            portUpGraphAvg = round(numpy.mean(portUpGraphList), 2)
-            portDownDevAvg = round(numpy.mean(portDownDevList), 2)
-            portDownGraphAvg = round(numpy.mean(portDownGraphList), 2)
-
-            portUpStdDev = round(numpy.std(portUpGraphList),2)
-            portDownStdDev = round(numpy.std(portDownGraphList),2)
-
-            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(portUpGraphAvg)+" ms")
-            #main.log.report( " Port down ofp-to-device "+
-            #                 str(round(portDownDevAvg, 2))+" ms")
-            main.log.report( " Port down ofp-to-graph "+
-                             str(portDownGraphAvg)+" ms")
-       
-            dbCmdList.append(
-                "INSERT INTO port_latency_tests VALUES("
-                   "'"+timeToPost+"','port_latency_results',"
-                   ""+runNum+","+str(clusterCount)+",'baremetal"+str(node+1)+"',"
-                   ""+str(portUpGraphAvg)+","+str(portUpStdDev)+
-                   ","+str(portDownGraphAvg)+","+str(portDownStdDev)+");"
-            )
-        
-        #Write to file for posting to DB
-        fResult = open(resultPath, 'a')
-        for line in dbCmdList:
-            if line:
-                fResult.write(line+"\n")
-        fResult.close()
-
-        print dbCmdList
-
-        # 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,
-            onpass="Port discovery latency calculation successful",
-            onfail="Port discovery test failed" )
-
-    def CASE4( self, main ):
-        """
-        Link down event using loss rate 100%
-
-        Important:
-            Use a simple 2 switch topology with 1 link between
-            the two switches. Ensure that mac addresses of the
-            switches are 1 / 2 respectively
-        """
-        import time
-        import subprocess
-        import os
-        import requests
-        import json
-        import numpy
-
-        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
-        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-        ONOSUser = main.params[ 'CTRL' ][ 'user' ]
-
-        defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
-
-        # Number of iterations of case
-        numIter = main.params[ 'TEST' ][ 'numIter' ]
-
-        # Timestamp 'keys' for json metrics output.
-        # These are subject to change, hence moved into params
-        deviceTimestamp = main.params[ 'JSON' ][ 'deviceTimestamp' ]
-        linkTimestamp = main.params[ 'JSON' ][ 'linkTimestamp' ]
-        graphTimestamp = main.params[ 'JSON' ][ 'graphTimestamp' ]
-
-        debugMode = main.params[ 'TEST' ][ 'debugMode' ]
-
-        localTime = time.strftime( '%x %X' )
-        localTime = localTime.replace( "/", "" )
-        localTime = localTime.replace( " ", "_" )
-        localTime = localTime.replace( ":", "" )
-        if debugMode == 'on':
-            main.ONOS1.tsharkPcap( "eth0",
-                                   "/tmp/link_lat_pcap_" + localTime )
-
-        # Threshold for this test case
-        upThresholdStr = main.params[ 'TEST' ][ 'linkUpThreshold' ]
-        downThresholdStr = main.params[ 'TEST' ][ 'linkDownThreshold' ]
-
-        upThresholdObj = upThresholdStr.split( "," )
-        downThresholdObj = downThresholdStr.split( "," )
-
-        upThresholdMin = int( upThresholdObj[ 0 ] )
-        upThresholdMax = int( upThresholdObj[ 1 ] )
-
-        downThresholdMin = int( downThresholdObj[ 0 ] )
-        downThresholdMax = int( downThresholdObj[ 1 ] )
-
-        assertion = main.TRUE
-        # Link event timestamp to system time list
-        linkDownLinkToSystemList = []
-        linkUpLinkToSystemList = []
-        # Graph event timestamp to system time list
-        linkDownGraphToSystemList = []
-        linkUpGraphToSystemList = []
-
-        main.log.report( "Link up / down discovery latency between " +
-                         "two switches" )
-        main.log.report( "Simulated by setting loss-rate 100%" )
-        main.log.report( "'tc qdisc add dev <intfs> root netem loss 100%'" )
-        main.log.report( "Total iterations of test: " + str( numIter ) )
-
-        main.step( "Assign all switches" )
-        main.Mininet1.assignSwController( sw="1",
-                                           ip1=ONOS1Ip, port1=defaultSwPort )
-        main.Mininet1.assignSwController( sw="2",
-                                           ip1=ONOS1Ip, port1=defaultSwPort )
-
-        main.step( "Verifying switch assignment" )
-        resultS1 = main.Mininet1.getSwController( sw="s1" )
-        resultS2 = main.Mininet1.getSwController( sw="s2" )
-
-        # Allow time for events to finish before taking measurements
-        time.sleep( 10 )
-
-        linkDown1 = False
-        linkDown2 = False
-        linkDown3 = False
-        # Start iteration of link event test
-        for i in range( 0, int( numIter ) ):
-            main.step( "Getting initial system time as t0" )
-
-            # System time in epoch ms
-            timestampLinkDownT0 = time.time() * 1000
-            # Link down is simulated by 100% loss rate using traffic
-            # control command
-            main.Mininet1.handle.sendline(
-                "sh tc qdisc add dev s1-eth1 root netem loss 100%" )
-
-            # TODO: Iterate through 'links' command to verify that
-            #      link s1 -> s2 went down ( loop timeout 30 seconds )
-            #      on all 3 ONOS instances
-            main.log.info( "Checking ONOS for link update" )
-            loopCount = 0
-            while( not ( linkDown1 and linkDown2 and linkDown3 )
-                    and loopCount < 30 ):
-                jsonStr1 = main.ONOS1cli.links()
-                jsonStr2 = main.ONOS2cli.links()
-                jsonStr3 = main.ONOS3cli.links()
-
-                if not ( jsonStr1 and jsonStr2 and jsonStr3 ):
-                    main.log.error( "CLI command returned error " )
-                    break
-                else:
-                    jsonObj1 = json.loads( jsonStr1 )
-                    jsonObj2 = json.loads( jsonStr2 )
-                    jsonObj3 = json.loads( jsonStr3 )
-                for obj1 in jsonObj1:
-                    if '01' not in obj1[ 'src' ][ 'device' ]:
-                        linkDown1 = True
-                        main.log.info( "Link down from " +
-                                       "s1 -> s2 on ONOS1 detected" )
-                for obj2 in jsonObj2:
-                    if '01' not in obj2[ 'src' ][ 'device' ]:
-                        linkDown2 = True
-                        main.log.info( "Link down from " +
-                                       "s1 -> s2 on ONOS2 detected" )
-                for obj3 in jsonObj3:
-                    if '01' not in obj3[ 'src' ][ 'device' ]:
-                        linkDown3 = True
-                        main.log.info( "Link down from " +
-                                       "s1 -> s2 on ONOS3 detected" )
-
-                loopCount += 1
-                # If CLI doesn't like the continuous requests
-                # and exits in this loop, increase the sleep here.
-                # Consequently, while loop timeout will increase
-                time.sleep( 1 )
-
-            # Give time for metrics measurement to catch up
-            # NOTE: May need to be configured more accurately
-            time.sleep( 10 )
-            # If we exited the while loop and link down 1,2,3 are still
-            # false, then ONOS has failed to discover link down event
-            if not ( linkDown1 and linkDown2 and linkDown3 ):
-                main.log.info( "Link down discovery failed" )
-
-                linkDownLatGraph1 = 0
-                linkDownLatGraph2 = 0
-                linkDownLatGraph3 = 0
-                linkDownLatDevice1 = 0
-                linkDownLatDevice2 = 0
-                linkDownLatDevice3 = 0
-
-                assertion = main.FALSE
-            else:
-                jsonTopoMetrics1 =\
-                    main.ONOS1cli.topologyEventsMetrics()
-                jsonTopoMetrics2 =\
-                    main.ONOS2cli.topologyEventsMetrics()
-                jsonTopoMetrics3 =\
-                    main.ONOS3cli.topologyEventsMetrics()
-                jsonTopoMetrics1 = json.loads( jsonTopoMetrics1 )
-                jsonTopoMetrics2 = json.loads( jsonTopoMetrics2 )
-                jsonTopoMetrics3 = json.loads( jsonTopoMetrics3 )
-
-                main.log.info( "Obtaining graph and device timestamp" )
-                graphTimestamp1 = \
-                    jsonTopoMetrics1[ graphTimestamp ][ 'value' ]
-                graphTimestamp2 = \
-                    jsonTopoMetrics2[ graphTimestamp ][ 'value' ]
-                graphTimestamp3 = \
-                    jsonTopoMetrics3[ graphTimestamp ][ 'value' ]
-
-                linkTimestamp1 = \
-                    jsonTopoMetrics1[ linkTimestamp ][ 'value' ]
-                linkTimestamp2 = \
-                    jsonTopoMetrics2[ linkTimestamp ][ 'value' ]
-                linkTimestamp3 = \
-                    jsonTopoMetrics3[ linkTimestamp ][ 'value' ]
-
-                if graphTimestamp1 and graphTimestamp2 and\
-                        graphTimestamp3 and linkTimestamp1 and\
-                        linkTimestamp2 and linkTimestamp3:
-                    linkDownLatGraph1 = int( graphTimestamp1 ) -\
-                        int( timestampLinkDownT0 )
-                    linkDownLatGraph2 = int( graphTimestamp2 ) -\
-                        int( timestampLinkDownT0 )
-                    linkDownLatGraph3 = int( graphTimestamp3 ) -\
-                        int( timestampLinkDownT0 )
-
-                    linkDownLatLink1 = int( linkTimestamp1 ) -\
-                        int( timestampLinkDownT0 )
-                    linkDownLatLink2 = int( linkTimestamp2 ) -\
-                        int( timestampLinkDownT0 )
-                    linkDownLatLink3 = int( linkTimestamp3 ) -\
-                        int( timestampLinkDownT0 )
-                else:
-                    main.log.error( "There was an error calculating" +
-                                    " the delta for link down event" )
-                    linkDownLatGraph1 = 0
-                    linkDownLatGraph2 = 0
-                    linkDownLatGraph3 = 0
-
-                    linkDownLatDevice1 = 0
-                    linkDownLatDevice2 = 0
-                    linkDownLatDevice3 = 0
-
-            main.log.info( "Link down latency ONOS1 iteration " +
-                           str( i ) + " (end-to-end): " +
-                           str( linkDownLatGraph1 ) + " ms" )
-            main.log.info( "Link down latency ONOS2 iteration " +
-                           str( i ) + " (end-to-end): " +
-                           str( linkDownLatGraph2 ) + " ms" )
-            main.log.info( "Link down latency ONOS3 iteration " +
-                           str( i ) + " (end-to-end): " +
-                           str( linkDownLatGraph3 ) + " ms" )
-
-            main.log.info( "Link down latency ONOS1 iteration " +
-                           str( i ) + " (link-event-to-system-timestamp): " +
-                           str( linkDownLatLink1 ) + " ms" )
-            main.log.info( "Link down latency ONOS2 iteration " +
-                           str( i ) + " (link-event-to-system-timestamp): " +
-                           str( linkDownLatLink2 ) + " ms" )
-            main.log.info( "Link down latency ONOS3 iteration " +
-                           str( i ) + " (link-event-to-system-timestamp): " +
-                           str( linkDownLatLink3 ) )
-
-            # Calculate avg of node calculations
-            linkDownLatGraphAvg =\
-                ( linkDownLatGraph1 +
-                  linkDownLatGraph2 +
-                  linkDownLatGraph3 ) / 3
-            linkDownLatLinkAvg =\
-                ( linkDownLatLink1 +
-                  linkDownLatLink2 +
-                  linkDownLatLink3 ) / 3
-
-            # Set threshold and append latency to list
-            if linkDownLatGraphAvg > downThresholdMin and\
-               linkDownLatGraphAvg < downThresholdMax:
-                linkDownGraphToSystemList.append(
-                    linkDownLatGraphAvg )
-            else:
-                main.log.info( "Link down latency exceeded threshold" )
-                main.log.info( "Results for iteration " + str( i ) +
-                               "have been omitted" )
-            if linkDownLatLinkAvg > downThresholdMin and\
-               linkDownLatLinkAvg < downThresholdMax:
-                linkDownLinkToSystemList.append(
-                    linkDownLatLinkAvg )
-            else:
-                main.log.info( "Link down latency exceeded threshold" )
-                main.log.info( "Results for iteration " + str( i ) +
-                               "have been omitted" )
-
-            # NOTE: To remove loss rate and measure latency:
-            #       'sh tc qdisc del dev s1-eth1 root'
-            timestampLinkUpT0 = time.time() * 1000
-            main.Mininet1.handle.sendline( "sh tc qdisc del dev " +
-                                           "s1-eth1 root" )
-            main.Mininet1.handle.expect( "mininet>" )
-
-            main.log.info( "Checking ONOS for link update" )
-
-            linkDown1 = True
-            linkDown2 = True
-            linkDown3 = True
-            loopCount = 0
-            while( ( linkDown1 and linkDown2 and linkDown3 )
-                    and loopCount < 30 ):
-                jsonStr1 = main.ONOS1cli.links()
-                jsonStr2 = main.ONOS2cli.links()
-                jsonStr3 = main.ONOS3cli.links()
-                if not ( jsonStr1 and jsonStr2 and jsonStr3 ):
-                    main.log.error( "CLI command returned error " )
-                    break
-                else:
-                    jsonObj1 = json.loads( jsonStr1 )
-                    jsonObj2 = json.loads( jsonStr2 )
-                    jsonObj3 = json.loads( jsonStr3 )
-
-                for obj1 in jsonObj1:
-                    if '01' in obj1[ 'src' ][ 'device' ]:
-                        linkDown1 = False
-                        main.log.info( "Link up from " +
-                                       "s1 -> s2 on ONOS1 detected" )
-                for obj2 in jsonObj2:
-                    if '01' in obj2[ 'src' ][ 'device' ]:
-                        linkDown2 = False
-                        main.log.info( "Link up from " +
-                                       "s1 -> s2 on ONOS2 detected" )
-                for obj3 in jsonObj3:
-                    if '01' in obj3[ 'src' ][ 'device' ]:
-                        linkDown3 = False
-                        main.log.info( "Link up from " +
-                                       "s1 -> s2 on ONOS3 detected" )
-
-                loopCount += 1
-                time.sleep( 1 )
-
-            if ( linkDown1 and linkDown2 and linkDown3 ):
-                main.log.info( "Link up discovery failed" )
-
-                linkUpLatGraph1 = 0
-                linkUpLatGraph2 = 0
-                linkUpLatGraph3 = 0
-                linkUpLatDevice1 = 0
-                linkUpLatDevice2 = 0
-                linkUpLatDevice3 = 0
-
-                assertion = main.FALSE
-            else:
-                jsonTopoMetrics1 =\
-                    main.ONOS1cli.topologyEventsMetrics()
-                jsonTopoMetrics2 =\
-                    main.ONOS2cli.topologyEventsMetrics()
-                jsonTopoMetrics3 =\
-                    main.ONOS3cli.topologyEventsMetrics()
-                jsonTopoMetrics1 = json.loads( jsonTopoMetrics1 )
-                jsonTopoMetrics2 = json.loads( jsonTopoMetrics2 )
-                jsonTopoMetrics3 = json.loads( jsonTopoMetrics3 )
-
-                main.log.info( "Obtaining graph and device timestamp" )
-                graphTimestamp1 = \
-                    jsonTopoMetrics1[ graphTimestamp ][ 'value' ]
-                graphTimestamp2 = \
-                    jsonTopoMetrics2[ graphTimestamp ][ 'value' ]
-                graphTimestamp3 = \
-                    jsonTopoMetrics3[ graphTimestamp ][ 'value' ]
-
-                linkTimestamp1 = \
-                    jsonTopoMetrics1[ linkTimestamp ][ 'value' ]
-                linkTimestamp2 = \
-                    jsonTopoMetrics2[ linkTimestamp ][ 'value' ]
-                linkTimestamp3 = \
-                    jsonTopoMetrics3[ linkTimestamp ][ 'value' ]
-
-                if graphTimestamp1 and graphTimestamp2 and\
-                        graphTimestamp3 and linkTimestamp1 and\
-                        linkTimestamp2 and linkTimestamp3:
-                    linkUpLatGraph1 = int( graphTimestamp1 ) -\
-                        int( timestampLinkUpT0 )
-                    linkUpLatGraph2 = int( graphTimestamp2 ) -\
-                        int( timestampLinkUpT0 )
-                    linkUpLatGraph3 = int( graphTimestamp3 ) -\
-                        int( timestampLinkUpT0 )
-
-                    linkUpLatLink1 = int( linkTimestamp1 ) -\
-                        int( timestampLinkUpT0 )
-                    linkUpLatLink2 = int( linkTimestamp2 ) -\
-                        int( timestampLinkUpT0 )
-                    linkUpLatLink3 = int( linkTimestamp3 ) -\
-                        int( timestampLinkUpT0 )
-                else:
-                    main.log.error( "There was an error calculating" +
-                                    " the delta for link down event" )
-                    linkUpLatGraph1 = 0
-                    linkUpLatGraph2 = 0
-                    linkUpLatGraph3 = 0
-
-                    linkUpLatDevice1 = 0
-                    linkUpLatDevice2 = 0
-                    linkUpLatDevice3 = 0
-
-            if debugMode == 'on':
-                main.log.info( "Link up latency ONOS1 iteration " +
-                               str( i ) + " (end-to-end): " +
-                               str( linkUpLatGraph1 ) + " ms" )
-                main.log.info( "Link up latency ONOS2 iteration " +
-                               str( i ) + " (end-to-end): " +
-                               str( linkUpLatGraph2 ) + " ms" )
-                main.log.info( "Link up latency ONOS3 iteration " +
-                               str( i ) + " (end-to-end): " +
-                               str( linkUpLatGraph3 ) + " ms" )
-
-                main.log.info(
-                    "Link up latency ONOS1 iteration " +
-                    str( i ) +
-                    " (link-event-to-system-timestamp): " +
-                    str( linkUpLatLink1 ) +
-                    " ms" )
-                main.log.info(
-                    "Link up latency ONOS2 iteration " +
-                    str( i ) +
-                    " (link-event-to-system-timestamp): " +
-                    str( linkUpLatLink2 ) +
-                    " ms" )
-                main.log.info(
-                    "Link up latency ONOS3 iteration " +
-                    str( i ) +
-                    " (link-event-to-system-timestamp): " +
-                    str( linkUpLatLink3 ) )
-
-            # Calculate avg of node calculations
-            linkUpLatGraphAvg =\
-                ( linkUpLatGraph1 +
-                  linkUpLatGraph2 +
-                  linkUpLatGraph3 ) / 3
-            linkUpLatLinkAvg =\
-                ( linkUpLatLink1 +
-                  linkUpLatLink2 +
-                  linkUpLatLink3 ) / 3
-
-            # Set threshold and append latency to list
-            if linkUpLatGraphAvg > upThresholdMin and\
-               linkUpLatGraphAvg < upThresholdMax:
-                linkUpGraphToSystemList.append(
-                    linkUpLatGraphAvg )
-            else:
-                main.log.info( "Link up latency exceeded threshold" )
-                main.log.info( "Results for iteration " + str( i ) +
-                               "have been omitted" )
-            if linkUpLatLinkAvg > upThresholdMin and\
-               linkUpLatLinkAvg < upThresholdMax:
-                linkUpLinkToSystemList.append(
-                    linkUpLatLinkAvg )
-            else:
-                main.log.info( "Link up latency exceeded threshold" )
-                main.log.info( "Results for iteration " + str( i ) +
-                               "have been omitted" )
-
-        # Calculate min, max, avg of list and report
-        linkDownMin = min( linkDownGraphToSystemList )
-        linkDownMax = max( linkDownGraphToSystemList )
-        linkDownAvg = sum( linkDownGraphToSystemList ) / \
-            len( linkDownGraphToSystemList )
-        linkUpMin = min( linkUpGraphToSystemList )
-        linkUpMax = max( linkUpGraphToSystemList )
-        linkUpAvg = sum( linkUpGraphToSystemList ) / \
-            len( linkUpGraphToSystemList )
-        linkDownStdDev = \
-            str( round( numpy.std( linkDownGraphToSystemList ), 1 ) )
-        linkUpStdDev = \
-            str( round( numpy.std( linkUpGraphToSystemList ), 1 ) )
-
-        main.log.report( "Link down latency " +
-                         "Avg: " + str( linkDownAvg ) + " ms " +
-                         "Std Deviation: " + linkDownStdDev + " ms" )
-        main.log.report( "Link up latency " +
-                         "Avg: " + str( linkUpAvg ) + " ms " +
-                         "Std Deviation: " + linkUpStdDev + " ms" )
-
-        utilities.assert_equals(
-            expect=main.TRUE,
-            actual=assertion,
-            onpass="Link discovery latency calculation successful",
-            onfail="Link discovery latency case failed" )
-
-    def CASE5( self, main ):
-        """
-        100 Switch discovery latency
-
-        Important:
-            This test case can be potentially dangerous if
-            your machine has previously set iptables rules.
-            One of the steps of the test case will flush
-            all existing iptables rules.
-        Note:
-            You can specify the number of switches in the
-            params file to adjust the switch discovery size
-            ( and specify the corresponding topology in Mininet1
-            .topo file )
-        """
-        import time
-        import subprocess
-        import os
-        import requests
-        import json
-
-        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
-        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
-        ONOSUser = main.params[ 'CTRL' ][ 'user' ]
-
-        defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
-
-        # Number of iterations of case
-        numIter = main.params[ 'TEST' ][ 'numIter' ]
-        numSw = main.params[ 'TEST' ][ 'numSwitch' ]
-
-        # Timestamp 'keys' for json metrics output.
-        # These are subject to change, hence moved into params
-        deviceTimestamp = main.params[ 'JSON' ][ 'deviceTimestamp' ]
-        graphTimestamp = main.params[ 'JSON' ][ 'graphTimestamp' ]
-
-        debugMode = main.params[ 'TEST' ][ 'debugMode' ]
-
-        localTime = time.strftime( '%X' )
-        localTime = localTime.replace( "/", "" )
-        localTime = localTime.replace( " ", "_" )
-        localTime = localTime.replace( ":", "" )
-        if debugMode == 'on':
-            main.ONOS1.tsharkPcap( "eth0",
-                                   "/tmp/100_sw_lat_pcap_" + localTime )
-
-        # Threshold for this test case
-        swDiscThresholdStr = main.params[ 'TEST' ][ 'swDisc100Threshold' ]
-        swDiscThresholdObj = swDiscThresholdStr.split( "," )
-        swDiscThresholdMin = int( swDiscThresholdObj[ 0 ] )
-        swDiscThresholdMax = int( swDiscThresholdObj[ 1 ] )
-
-        tsharkOfpOutput = "/tmp/tshark_ofp_" + numSw + "sw.txt"
-        tsharkTcpOutput = "/tmp/tshark_tcp_" + numSw + "sw.txt"
-
-        tsharkOfpResultList = []
-        tsharkTcpResultList = []
-
-        swDiscoveryLatList = []
-
-        main.case( numSw + " Switch discovery latency" )
-        main.step( "Assigning all switches to ONOS1" )
-        for i in range( 1, int( numSw ) + 1 ):
-            main.Mininet1.assignSwController(
-                sw=str( i ),
-                ip1=ONOS1Ip,
-                port1=defaultSwPort )
-
-        # Ensure that nodes are configured with ptpd
-        # Just a warning message
-        main.log.info( "Please check ptpd configuration to ensure" +
-                       " All nodes' system times are in sync" )
-        time.sleep( 5 )
-
-        for i in range( 0, int( numIter ) ):
-
-            main.step( "Set iptables rule to block incoming sw connections" )
-            # Set iptables rule to block incoming switch connections
-            # The rule description is as follows:
-            #   Append to INPUT rule,
-            #   behavior DROP that matches following:
-            #       * packet type: tcp
-            #       * source IP: MN1Ip
-            #       * destination PORT: 6633
-            main.ONOS1.handle.sendline(
-                "sudo iptables -A INPUT -p tcp -s " + MN1Ip +
-                " --dport " + defaultSwPort + " -j DROP" )
-            main.ONOS1.handle.expect( "\$" )
-            #   Append to OUTPUT rule,
-            #   behavior DROP that matches following:
-            #       * packet type: tcp
-            #       * source IP: MN1Ip
-            #       * destination PORT: 6633
-            main.ONOS1.handle.sendline(
-                "sudo iptables -A OUTPUT -p tcp -s " + MN1Ip +
-                " --dport " + defaultSwPort + " -j DROP" )
-            main.ONOS1.handle.expect( "\$" )
-            # Give time to allow rule to take effect
-            # NOTE: Sleep period may need to be configured
-            #      based on the number of switches in the topology
-            main.log.info( "Please wait for switch connection to " +
-                           "time out" )
-            time.sleep( 60 )
-
-            # Gather vendor OFP with tshark
-            main.ONOS1.tsharkGrep( "OFP 86 Vendor",
-                                   tsharkOfpOutput )
-            main.ONOS1.tsharkGrep( "TCP 74 ",
-                                   tsharkTcpOutput )
-
-            # NOTE: Remove all iptables rule quickly ( flush )
-            #      Before removal, obtain TestON timestamp at which
-            #      removal took place
-            #      ( ensuring nodes are configured via ptp )
-            #      sudo iptables -F
-
-            t0System = time.time() * 1000
-            main.ONOS1.handle.sendline(
-                "sudo iptables -F" )
-
-            # Counter to track loop count
-            counterLoop = 0
-            counterAvail1 = 0
-            counterAvail2 = 0
-            counterAvail3 = 0
-            onos1Dev = False
-            onos2Dev = False
-            onos3Dev = False
-            while counterLoop < 60:
-                # Continue to check devices for all device
-                # availability. When all devices in all 3
-                # ONOS instances indicate that devices are available
-                # obtain graph event timestamp for t1.
-                deviceStrObj1 = main.ONOS1cli.devices()
-                deviceStrObj2 = main.ONOS2cli.devices()
-                deviceStrObj3 = main.ONOS3cli.devices()
-
-                deviceJson1 = json.loads( deviceStrObj1 )
-                deviceJson2 = json.loads( deviceStrObj2 )
-                deviceJson3 = json.loads( deviceStrObj3 )
-
-                for device1 in deviceJson1:
-                    if device1[ 'available' ]:
-                        counterAvail1 += 1
-                        if counterAvail1 == int( numSw ):
-                            onos1Dev = True
-                            main.log.info( "All devices have been " +
-                                           "discovered on ONOS1" )
-                    else:
-                        counterAvail1 = 0
-                for device2 in deviceJson2:
-                    if device2[ 'available' ]:
-                        counterAvail2 += 1
-                        if counterAvail2 == int( numSw ):
-                            onos2Dev = True
-                            main.log.info( "All devices have been " +
-                                           "discovered on ONOS2" )
-                    else:
-                        counterAvail2 = 0
-                for device3 in deviceJson3:
-                    if device3[ 'available' ]:
-                        counterAvail3 += 1
-                        if counterAvail3 == int( numSw ):
-                            onos3Dev = True
-                            main.log.info( "All devices have been " +
-                                           "discovered on ONOS3" )
-                    else:
-                        counterAvail3 = 0
-
-                if onos1Dev and onos2Dev and onos3Dev:
-                    main.log.info( "All devices have been discovered " +
-                                   "on all ONOS instances" )
-                    jsonStrTopologyMetrics1 =\
-                        main.ONOS1cli.topologyEventsMetrics()
-                    jsonStrTopologyMetrics2 =\
-                        main.ONOS2cli.topologyEventsMetrics()
-                    jsonStrTopologyMetrics3 =\
-                        main.ONOS3cli.topologyEventsMetrics()
-
-                    # Exit while loop if all devices discovered
-                    break
-
-                counterLoop += 1
-                # Give some time in between CLI calls
-                #( will not affect measurement )
-                time.sleep( 3 )
-
-            main.ONOS1.tsharkStop()
-
-            os.system( "scp " + ONOSUser + "@" + ONOS1Ip + ":" +
-                       tsharkOfpOutput + " /tmp/" )
-            os.system( "scp " + ONOSUser + "@" + ONOS1Ip + ":" +
-                       tsharkTcpOutput + " /tmp/" )
-
-            # TODO: Automate OFP output analysis
-            # Debug mode - print out packets captured at runtime
-            if debugMode == 'on':
-                ofpFile = open( tsharkOfpOutput, 'r' )
-                main.log.info( "Tshark OFP Vendor output: " )
-                for line in ofpFile:
-                    tsharkOfpResultList.append( line )
-                    main.log.info( line )
-                ofpFile.close()
-
-                tcpFile = open( tsharkTcpOutput, 'r' )
-                main.log.info( "Tshark TCP 74 output: " )
-                for line in tcpFile:
-                    tsharkTcpResultList.append( line )
-                    main.log.info( line )
-                tcpFile.close()
-
-            jsonObj1 = json.loads( jsonStrTopologyMetrics1 )
-            jsonObj2 = json.loads( jsonStrTopologyMetrics2 )
-            jsonObj3 = json.loads( jsonStrTopologyMetrics3 )
-
-            graphTimestamp1 = \
-                jsonObj1[ graphTimestamp ][ 'value' ]
-            graphTimestamp2 = \
-                jsonObj2[ graphTimestamp ][ 'value' ]
-            graphTimestamp3 = \
-                jsonObj3[ graphTimestamp ][ 'value' ]
-
-            graphLat1 = int( graphTimestamp1 ) - int( t0System )
-            graphLat2 = int( graphTimestamp2 ) - int( t0System )
-            graphLat3 = int( graphTimestamp3 ) - int( t0System )
-
-            avgGraphLat = \
-                ( int( graphLat1 ) +
-                  int( graphLat2 ) +
-                  int( graphLat3 ) ) / 3
-
-            if avgGraphLat > swDiscThresholdMin \
-                    and avgGraphLat < swDiscThresholdMax:
-                swDiscoveryLatList.append(
-                    avgGraphLat )
-            else:
-                main.log.info( "100 Switch discovery latency " +
-                               "exceeded the threshold." )
-
-            # END ITERATION FOR LOOP
-
-        swLatMin = min( swDiscoveryLatList )
-        swLatMax = max( swDiscoveryLatList )
-        swLatAvg = sum( swDiscoveryLatList ) /\
-            len( swDiscoveryLatList )
-
-        main.log.report( "100 Switch discovery lat " +
-                         "Min: " + str( swLatMin ) + " ms" +
-                         "Max: " + str( swLatMax ) + " ms" +
-                         "Avg: " + str( swLatAvg ) + " ms" )
-
-    def CASE6( self, main ):
-        """
-        Increase number of nodes and initiate CLI
-        """
-        import time
-
-        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
-        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-        ONOS4Ip = main.params[ 'CTRL' ][ 'ip4' ]
-        ONOS5Ip = main.params[ 'CTRL' ][ 'ip5' ]
-        ONOS6Ip = main.params[ 'CTRL' ][ 'ip6' ]
-        ONOS7Ip = main.params[ 'CTRL' ][ 'ip7' ]
-
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-
-        global clusterCount
-
-        # Cluster size increased everytime the case is defined
-        clusterCount += 2
-
-        main.log.report( "Increasing cluster size to " +
-                         str( clusterCount ) )
-
-        installResult = main.FALSE
-        if clusterCount == 3:
-            main.log.info( "Installing nodes 2 and 3" )
-            node2Result = \
-                main.ONOSbench.onosInstall( node=ONOS2Ip )
-            node3Result = \
-                main.ONOSbench.onosInstall( node=ONOS3Ip )
-            installResult = node2Result and node3Result
-
-            time.sleep( 5 )
-
-            main.ONOS2cli.startOnosCli( ONOS2Ip )
-            main.ONOS3cli.startOnosCli( ONOS3Ip )
-
-        elif clusterCount == 5:
-            main.log.info( "Installing nodes 4 and 5" )
-            node4Result = \
-                main.ONOSbench.onosInstall( node=ONOS4Ip )
-            node5Result = \
-                main.ONOSbench.onosInstall( node=ONOS5Ip )
-            installResult = node4Result and node5Result
-
-            time.sleep( 5 )
-
-            main.ONOS4cli.startOnosCli( ONOS4Ip )
-            main.ONOS5cli.startOnosCli( ONOS5Ip )
-
-        elif clusterCount == 7:
-            main.log.info( "Installing nodes 6 and 7" )
-            node6Result = \
-                main.ONOSbench.onosInstall( node=ONOS6Ip )
-            node7Result = \
-                main.ONOSbench.onosInstall( node=ONOS7Ip )
-            installResult = node6Result and node7Result
-
-            time.sleep( 5 )
-
-            main.ONOS6cli.startOnosCli( ONOS6Ip )
-            main.ONOS7cli.startOnosCli( ONOS7Ip )
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.topo b/TestON/tests/TopoPerfNext/TopoPerfNext.topo
deleted file mode 100644
index f12d192..0000000
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.topo
+++ /dev/null
@@ -1,163 +0,0 @@
-<TOPOLOGY>
-    <COMPONENT>
-        
-        <ONOSbench>
-            <host>10.128.174.10</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosDriver</type>
-            <connect_order>1</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOSbench>
-
-        <ONOS1cli>
-            <host>10.128.174.10</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosCliDriver</type>
-            <connect_order>2</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS1cli>
-
-        <ONOS2cli>
-            <host>10.128.174.10</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosCliDriver</type>
-            <connect_order>3</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS2cli>
-        
-        <ONOS3cli>
-            <host>10.128.174.10</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosCliDriver</type>
-            <connect_order>4</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS3cli>
-        
-        <ONOS4cli>
-            <host>10.128.174.10</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosCliDriver</type>
-            <connect_order>5</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS4cli>
-        
-        <ONOS5cli>
-            <host>10.128.174.10</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosCliDriver</type>
-            <connect_order>6</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS5cli>
-        
-        <ONOS6cli>
-            <host>10.128.174.10</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosCliDriver</type>
-            <connect_order>7</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS6cli>
-        
-        <ONOS7cli>
-            <host>10.128.174.10</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosCliDriver</type>
-            <connect_order>8</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS7cli>
-
-        <ONOS1>
-            <host>10.128.174.1</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosDriver</type>
-            <connect_order>9</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS1>
-
-        <ONOS2>
-            <host>10.128.174.2</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosDriver</type>
-            <connect_order>10</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS2>
-
-        <ONOS3>
-            <host>10.128.174.3</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosDriver</type>
-            <connect_order>11</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS3>
-        
-        <ONOS4>
-            <host>10.128.174.4</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosDriver</type>
-            <connect_order>12</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS4>
-        
-        <ONOS5>
-            <host>10.128.174.5</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosDriver</type>
-            <connect_order>13</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS5>
-        
-        <ONOS6>
-            <host>10.128.174.6</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosDriver</type>
-            <connect_order>14</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS6>
-        
-        <ONOS7>
-            <host>10.128.174.7</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>OnosDriver</type>
-            <connect_order>15</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </ONOS7>
-
-        <Mininet1>
-            <host>10.128.10.90</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>MininetCliDriver</type>
-            <connect_order>16</connect_order>
-            <COMPONENTS>
-                <arg1> --custom topo-perf-2sw.py </arg1>
-                <arg2> --arp --mac --topo mytopo</arg2>
-                <arg3> </arg3>
-                <controller> remote </controller>
-            </COMPONENTS>
-        </Mininet1>
-
-        <Mininet2>
-            <host>10.128.10.90</host>
-            <user>admin</user>
-            <password>onos_test</password>
-            <type>RemoteMininetDriver</type>
-            <connect_order>17</connect_order>
-            <COMPONENTS> </COMPONENTS>
-        </Mininet2>
-
-    </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params
index ab215e9..eba319c 100644
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params
+++ b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params
@@ -3,7 +3,7 @@
 
     <ENV>
         <cellName>topo_perf_test</cellName>
-        <cellFeatures>"org.onosproject.metrics,org.onosproject.openflow"</cellFeatures>
+        <cellFeatures>"drivers,metrics,openflow"</cellFeatures>
     </ENV>
 
     <GIT>
@@ -13,7 +13,7 @@
     </GIT>
 
     <CTRL>
-        <user>sdn</user>
+        <user>admin</user>
         <ip1>10.254.1.201</ip1>
         <port1>6633</port1>
         <ip2>10.254.1.202</ip2>
@@ -62,7 +62,7 @@
         </topoConfigName>
 
         #Number of times to iterate each case
-        <numIter>35</numIter>
+        <numIter>13</numIter>
         <numSwitch>2</numSwitch>
         #Number of iterations to ignore initially
         <iterIgnore>2</iterIgnore>
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
index 0f0fe55..e2245ba 100644
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
+++ b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
@@ -272,10 +272,10 @@
                 metricsSwUp = CLIs[node].topologyEventsMetrics()
                 jsonStr.append(metricsSwUp)
            
-            time.sleep(1)
-            
             main.log.info('Stopping all Tshark processes')
             main.ONOS1.tsharkStop()
+           
+            time.sleep(5)
             
             main.log.info('Copying over tshark files')
             os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
@@ -288,7 +288,8 @@
                       nodeIpList[0] + ':' + tsharkOfOutput + ' /tmp/')
            
             # Get tcp syn / ack output
-            # time.sleep(1)
+            time.sleep(1)
+
             tcpFile = open(tsharkTcpOutput, 'r')
             tempText = tcpFile.readline()
             tempText = tempText.split(' ')
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo
index 6a70f60..570dece 100644
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo
+++ b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo
@@ -2,7 +2,7 @@
     <COMPONENT>
         
         <ONOSbench>
-            <host>10.128.174.10</host>
+            <host>10.254.1.200</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
@@ -11,7 +11,7 @@
         </ONOSbench>
 
         <ONOS1cli>
-            <host>10.128.174.10</host>
+            <host>10.254.1.200</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -20,7 +20,7 @@
         </ONOS1cli>
 
         <ONOS2cli>
-            <host>10.128.174.10</host>
+            <host>10.254.1.200</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -29,7 +29,7 @@
         </ONOS2cli>
         
         <ONOS3cli>
-            <host>10.128.174.10</host>
+            <host>10.254.1.200</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -38,7 +38,7 @@
         </ONOS3cli>
         
         <ONOS4cli>
-            <host>10.128.174.10</host>
+            <host>10.254.1.200</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -47,7 +47,7 @@
         </ONOS4cli>
         
         <ONOS5cli>
-            <host>10.128.174.10</host>
+            <host>10.254.1.200</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -56,7 +56,7 @@
         </ONOS5cli>
         
         <ONOS6cli>
-            <host>10.128.174.10</host>
+            <host>10.254.1.200</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -65,7 +65,7 @@
         </ONOS6cli>
         
         <ONOS7cli>
-            <host>10.128.174.10</host>
+            <host>10.254.1.200</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -74,9 +74,9 @@
         </ONOS7cli>
 
         <ONOS1>
-            <host>10.128.174.1</host>
-            <user>sdn</user>
-            <password>rocks</password>
+            <host>10.254.1.201</host>
+            <user>admin</user>
+            <password>onos_test</password>
             <type>OnosDriver</type>
             <connect_order>9</connect_order>
             <COMPONENTS> </COMPONENTS>
@@ -84,8 +84,8 @@
 
         <ONOS2>
             <host>10.254.1.202</host>
-            <user>sdn</user>
-            <password>rocks</password>
+            <user>admin</user>
+            <password>onos_test</password>
             <type>OnosDriver</type>
             <connect_order>10</connect_order>
             <COMPONENTS> </COMPONENTS>
@@ -93,8 +93,8 @@
 
         <ONOS3>
             <host>10.254.1.203</host>
-            <user>sdn</user>
-            <password>rocks</password>
+            <user>admin</user>
+            <password>onos_test</password>
             <type>OnosDriver</type>
             <connect_order>11</connect_order>
             <COMPONENTS> </COMPONENTS>
@@ -102,8 +102,8 @@
         
         <ONOS4>
             <host>10.254.1.204</host>
-            <user>sdn</user>
-            <password>rocks</password>
+            <user>admin</user>
+            <password>onos_test</password>
             <type>OnosDriver</type>
             <connect_order>12</connect_order>
             <COMPONENTS> </COMPONENTS>
@@ -111,8 +111,8 @@
         
         <ONOS5>
             <host>10.254.1.205</host>
-            <user>sdn</user>
-            <password>rocks</password>
+            <user>admin</user>
+            <password>onos_test</password>
             <type>OnosDriver</type>
             <connect_order>13</connect_order>
             <COMPONENTS> </COMPONENTS>
@@ -120,8 +120,8 @@
         
         <ONOS6>
             <host>10.254.1.206</host>
-            <user>sdn</user>
-            <password>rocks</password>
+            <user>admin</user>
+            <password>onos_test</password>
             <type>OnosDriver</type>
             <connect_order>14</connect_order>
             <COMPONENTS> </COMPONENTS>
@@ -129,8 +129,8 @@
         
         <ONOS7>
             <host>10.254.1.207</host>
-            <user>sdn</user>
-            <password>rocks</password>
+            <user>admin</user>
+            <password>onos_test</password>
             <type>OnosDriver</type>
             <connect_order>15</connect_order>
             <COMPONENTS> </COMPONENTS>
@@ -144,7 +144,7 @@
             <connect_order>16</connect_order>
             <COMPONENTS>
                 <arg1> --custom topo-perf-2sw.py </arg1>
-                <arg2> --arp --mac --topo mytopo</arg2>
+                <arg2> --topo mytopo</arg2>
                 <arg3> </arg3>
                 <controller> remote </controller>
             </COMPONENTS>
diff --git a/TestON/tests/TopoPerfNext/__init__.py b/TestON/tests/TopoPerfNextBM/__init__.py
similarity index 100%
rename from TestON/tests/TopoPerfNext/__init__.py
rename to TestON/tests/TopoPerfNextBM/__init__.py
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.params b/TestON/tests/TopoPerfNextBM/backup/TopoPerfNextBM.params
similarity index 77%
rename from TestON/tests/TopoPerfNext/TopoPerfNext.params
rename to TestON/tests/TopoPerfNextBM/backup/TopoPerfNextBM.params
index dc2d519..d681433 100644
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.params
+++ b/TestON/tests/TopoPerfNextBM/backup/TopoPerfNextBM.params
@@ -1,8 +1,9 @@
 <PARAMS>
-    <testcases>1,2,3,6,2,3,6,2,3,6,2,3</testcases>
+    <testcases>1,2,3,4,2,3,4,2,3,4,2,3</testcases>
 
     <ENV>
         <cellName>topo_perf_test</cellName>
+        <cellFeatures>"org.onosproject.metrics,org.onosproject.openflow"</cellFeatures>
     </ENV>
 
     <GIT>
@@ -12,7 +13,7 @@
     </GIT>
 
     <CTRL>
-        <user>admin</user>
+        <user>sdn</user>
         <ip1>10.128.174.1</ip1>
         <port1>6633</port1>
         <ip2>10.128.174.2</ip2>
@@ -35,6 +36,15 @@
         <ip>10.128.174.10</ip>
     </BENCH>
 
+    <TSHARK>
+        <ofpPortStatus>OF 1.3 146</ofpPortStatus>
+        <ofpRoleReply>OF 1.3 90 of_role_reply</ofpRoleReply>
+        <featureReply>OF 1.3 98 of_features_reply</featureReply>
+        <roleRequest>OF 1.3 90 of_role_request</roleRequest>
+        <tcpSynAck>TCP 74 6633</tcpSynAck>
+        <finAckSequence>FIN</finAckSequence>
+    </TSHARK>
+
     <TEST>
         #'on' or 'off' debug mode.
         #If on, logging will be more verbose and
@@ -70,10 +80,10 @@
     <DB>
         <postToDB>on</postToDB>
         <portEventResultPath>
-        /home/admin/ONLabTest/TestON/tests/TopoPerfNext/portEventResultDb.log
+        /home/admin/ONLabTest/TestON/tests/TopoPerfNextBM/portEventResultDb.log
         </portEventResultPath>
         <switchEventResultPath>
-        /home/admin/ONLabTest/TestON/tests/TopoPerfNext/switchEventResultDb.log
+        /home/admin/ONLabTest/TestON/tests/TopoPerfNextBM/switchEventResultDb.log
         </switchEventResultPath>
     </DB>
 
diff --git a/TestON/tests/TopoPerfNext/__init__.py b/TestON/tests/TopoPerfNextBM/portEventResultDb.log
similarity index 100%
copy from TestON/tests/TopoPerfNext/__init__.py
copy to TestON/tests/TopoPerfNextBM/portEventResultDb.log
diff --git a/TestON/tests/TopoPerfNext/__init__.py b/TestON/tests/TopoPerfNextBM/switchEventResultDb.log
similarity index 100%
copy from TestON/tests/TopoPerfNext/__init__.py
copy to TestON/tests/TopoPerfNextBM/switchEventResultDb.log
