Updated script
diff --git a/TestON/tests/LinkEventTP/.IntentsLoad.py.swo b/TestON/tests/LinkEventTP/.IntentsLoad.py.swo
deleted file mode 100644
index fe9088a..0000000
--- a/TestON/tests/LinkEventTP/.IntentsLoad.py.swo
+++ /dev/null
Binary files differ
diff --git a/TestON/tests/LinkEventTP/LinkEventTP.params b/TestON/tests/LinkEventTP/LinkEventTP.params
index 95d0be3..83a1180 100644
--- a/TestON/tests/LinkEventTP/LinkEventTP.params
+++ b/TestON/tests/LinkEventTP/LinkEventTP.params
@@ -1,12 +1,14 @@
 <PARAMS>
 
-    <testcases>1,3,2,4,2,5</testcases>
+    <testcases>1,2,3,2,3,2,3</testcases>
 
     <ENV>
     <cellName>network_tp_test</cellName>
+    <cellFeatures>"webconsole,onos-core,onos-api,onos-cli,onos-null,onos-rest,onos-app-metrics,onos-app-metrics-intent,onos-app-metrics-topology"</cellFeatures>
     </ENV>
-
-    <SCALE>1</SCALE>
+    
+    <SCALE>2</SCALE>
+    <availableNodes>7</availableNodes>
 
     <GIT>
         <autopull>off</autopull>
@@ -21,22 +23,35 @@
         <port2>6633</port2>
         <ip3>10.128.5.53</ip3>
         <port3>6633</port3>
-    </CTRL>
+        <ip4>10.128.5.54</ip4>
+        <port4>6633</port4>
+        <ip5>10.128.5.65</ip5>
+        <port5>6633</port5>
+	    <ip6>10.128.5.66</ip6>
+        <port6>6633</port6>
+	    <ip7>10.128.5.67</ip7>
+        <port7>6633</port7>
+        </CTRL>
 
     <BENCH>
         <user>admin</user>
-        <ip1>10.128.5.55</ip1>
+        <ip1>localhost</ip1>
     </BENCH>
 
-    <TEST>                              #   duration =      time the test loop runs
-                                        #   log_interval =  how often the data is reported 
-                                        #   wait =          time between tests, used to let the averages run down 
-                                         
-    <metric1>topologyLinkEventRate</metric1>
-    <flickerRate>1</flickerRate>
-    <duration>600</duration>
-    <log_interval>30</log_interval>
-    <wait>30</wait>
+    <TEST>          #   duration =      time the test loop runs
+                    #   log_interval =  how often the data is reported 
+                    #   wait =          time between tests, used to let the averages run down 
+               
+        <flickerRates>1000,0,0,0,0,0,0</flickerRates>
+        <devicesPerNode>20,0,0,0,0,0,0</devicesPerNode>
+        <flickerRate>1000</flickerRate>
+        <linkgraphdif>.03</linkgraphdif>          # 0-1 indicated link/graph rate dif tolerance
+        <duration>120</duration>
+        <log_interval>15</log_interval>
+        <wait>60</wait>
+        <skipCleanInstall>yes</skipCleanInstall>
+        <MN>localhost</MN>
+	    <logFile>link_event_tp_results_LOG</logFile>
     </TEST>
 
     <JSON>
diff --git a/TestON/tests/LinkEventTP/LinkEventTP.py b/TestON/tests/LinkEventTP/LinkEventTP.py
index 0e327a3..ab490a9 100644
--- a/TestON/tests/LinkEventTP/LinkEventTP.py
+++ b/TestON/tests/LinkEventTP/LinkEventTP.py
@@ -1,4 +1,4 @@
-# ScaleOutTemplate --> LinkEventTp
+# ScaleOutTemplate --> LinkEventTP
 #
 # CASE1 starts number of nodes specified in param file
 #
@@ -13,27 +13,69 @@
     def __init__( self ):
         self.default = ''
 
-    def CASE1( self, main ):
-        import os.path
-        global clusterCount
-        clusterCount = 1
+    def CASE1( self, main ):            #This is the initialization case
+        import os.path                  #this case will clean up all nodes 
+                                        #but only node 1 isnodestarted in this case
+        
+        global clusterCount             #number of nodes running
+        global ONOSIp                   #list of ONOS IP addresses 
 
+        clusterCount = 1
+        ONOSIp = [ 0 ]
+
+        #Load values from params file
         checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
         gitPull = main.params[ 'GIT' ][ 'autopull' ]
         cellName = main.params[ 'ENV' ][ 'cellName' ]
+        Features= main.params[ 'ENV' ][ 'cellFeatures' ]
         BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
         BENCHUser = main.params[ 'BENCH' ][ 'user' ]
-        ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-        ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
-        ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
+        maxNodes = int(main.params[ 'availableNodes' ])
+        Features = main.params[ 'ENV' ][ 'cellFeatures' ]
+        skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
         flickerRate = main.params[ 'TEST' ][ 'flickerRate']
+        deviceDistribution = (main.params[ 'TEST' ][ 'devicesPerNode']).split(",")    
+        MNip = main.params[ 'TEST' ][ 'MN' ]
+      
+        main.ONOSbench.handle.sendline("export TERM=vt100")
+        main.ONOSbench.handle.expect(":~") 	    
+
+        #Populate ONOSIp with ips from params 
+        for i in range(1, maxNodes + 1): 
+ 	    ipString = 'ip' + str(i) 
+     	    ONOSIp.append(main.params[ 'CTRL' ][ ipString ]) 
         
+	    #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])
 
+        #construct the cell file
+        main.log.step("Creating cell file")
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+            	cellIp.append(ONOSIp[node]) 
+        main.ONOSbench.createCellFile(BENCHIp,cellName,MNip,str(Features), *cellIp)
+
+        main.step( "Set Cell" )
+        main.ONOSbench.setCell(cellName)
+
+        #Uninstall everywhere
         main.log.step( "Cleaning Enviornment..." )
-        main.ONOSbench.onosUninstall( ONOS1Ip )
-        main.ONOSbench.onosUninstall( ONOS2Ip )
-        main.ONOSbench.onosUninstall( ONOS3Ip )
+        for i in range(1, maxNodes + 1):
+            main.log.info(" Uninstalling ONOS " + str(i) )
+            main.ONOSbench.onosUninstall( ONOSIp[i] )
 
+        myDistribution = []
+        for node in range (1, clusterCount + 1): 
+            myDistribution.append(deviceDistribution[node-1]) 
+
+        main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution) 
+        main.ONOSbench.createNullDevProviderFile( BENCHIp, cellIp, myDistribution) 
+        main.ONOSbench.createNullLinkProviderFile(BENCHIp)
+        
+        #git step - skipable 
         main.step( "Git checkout and pull " + checkoutBranch )
         if gitPull == 'on':
             checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
@@ -43,245 +85,219 @@
             checkoutResult = main.TRUE
             pullResult = main.TRUE
             main.log.info( "Skipped git checkout and pull" )
-
-        #mvnResult = main.ONOSbench.cleanInstall()
-
-        main.step( "Set cell for ONOS cli env" )
-        main.ONOS1cli.setCell( cellName )
-        main.ONOS2cli.setCell( cellName )
-        main.ONOS3cli.setCell( cellName )
         
-        ### configuring file to enable flicker ###
-        main.log.info(" Configuring null provider to enable flicker. Flicker Rate = " + flickerRate ) 
-        homeDir = os.path.expanduser('~')
-        main.log.info(homeDir)
-        localPath = "/ONOS/tools/package/etc/org.onosproject.provider.nil.link.impl.NullLinkProvider.cfg"
-        filePath = homeDir + localPath
-        main.log.info(filePath)
-
-        configFile = open(filePath, 'w+')
-        main.log.info("file opened")
-        configFile.write("# Sample configurations for the NullLinkProvider.\n")
-        configFile.write("# \n")
-        configFile.write("# If enabled, generates LinkDetected and LinkVanished events\n")
-        configFile.write("# to make the link appear to be flapping.\n")
-        configFile.write("#\n")
-        configFile.write("flicker = true\n")
-        configFile.write("#\n")
-        configFile.write("# If enabled, sets the time between LinkEvent generation,\n")
-        configFile.write("# in milliseconds.\n")
-        configFile.write("#\n")
-        configFile.write("eventRate = " + flickerRate)
-        configFile.close()
-        main.log.info("Configuration completed")
-        ###             ###
+        #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+        if skipMvn != "yes":
+            mvnResult = main.ONOSbench.cleanInstall()
+           
+        logFileName = main.params[ 'TEST' ][ 'logFile' ]
+        logFile = open(logFileName, 'w+')
+        main.log.info("Created log File")
+        logFile.close()
 
         main.step( "Creating ONOS package" )
-        packageResult = main.ONOSbench.onosPackage()  # no file or directory
+        packageResult = main.ONOSbench.onosPackage()  
 
         main.step( "Installing ONOS package" )
-        install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
+        install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] )
 
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-        main.step( "Applying cell file to environment" )
-        cellApplyResult = main.ONOSbench.setCell( cellName )
-        main.step( "verify cells" )
+        main.step( "Verify cells" )
         verifyCellResult = main.ONOSbench.verifyCell()
 
-        main.step( "Set cell for ONOS cli env" )
-        main.ONOS1cli.setCell( cellName )
-
-        cli1 = main.ONOS1cli.startOnosCli( ONOS1Ip )
-
+        main.step( "Enviornment setup and verification complete." )
+        main.ONOS1cli.startOnosCli( ONOSIp[1] )
+        main.step( "ONOS 1 is up and running." )
+        main.ONOSbench.handle.expect(":~") #there is a dangling sendline somewhere...	
+        
     def CASE2( self, main ):
-        """
-        Increase number of nodes and initiate CLI
-        """
+        # This case increases the cluster size by whatever scale is
+        # Note: 'scale' is the size of the step
+        # if scaling is not a part of your test, simply run this case
+        # once after CASE1 to set up your enviornment for your desired 
+        # cluster size. If scaling is a part of you test call this case each time 
+        # you want to increase cluster size
+
+        ''                                                         
+        'Increase number of nodes and initiate CLI'
+        ''
         import time
-
         global clusterCount
-
-        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' ]
-        scale = int( main.params[ 'SCALE' ] )
+        Features= main.params[ 'ENV' ][ 'cellFeatures' ]
+        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+        MNip = main.params[ 'TEST' ][ 'MN' ]        
+        deviceDistribution = (main.params[ 'TEST' ][ 'devicesPerNode']).split(",")
 
-        # Cluster size increased everytime the case is defined
+        scale = int( main.params[ 'SCALE' ] )
         clusterCount += scale
 
-        main.log.report( "Increasing cluster size to " +
-                         str( clusterCount ) )
-        installResult = main.FALSE
+        main.log.step( "Cleaning Enviornment..." )
+        for i in range(1, maxNodes + 1):
+            main.ONOSbench.onosDie(ONOSIp[i])
+            main.log.info(" Uninstalling ONOS " + str(i) )
+            main.ONOSbench.onosUninstall( ONOSIp[i] )
 
-        if scale == 2:
-            if clusterCount == 3:
-                main.log.info( "Installing nodes 2 and 3" )
-                install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
-                install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
-                cli2 = main.ONOS2cli.startOnosCli( ONOS2Ip )
-                cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
-              
-        if scale == 1:
-            if clusterCount == 2:
-                main.log.info( "Installing node 2" )
-                install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
-                cli2 = main.ONOS2cli.startOnosCli( ONOS2Ip )
+        myDistribution = []
+        for node in range (1, clusterCount + 1):
+            myDistribution.append(deviceDistribution[node-1])
 
-            if clusterCount == 3:
-                main.log.info( "Installing node 3" )
-                install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
-                cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
+        main.log.step("Creating cell file")
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+                cellIp.append(ONOSIp[node])
+        main.ONOSbench.createCellFile(BENCHIp,cellName,MNip,str(Features), *cellIp)
 
+        main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution)
+        main.ONOSbench.createNullDevProviderFile( BENCHIp, cellIp, myDistribution)
+        main.ONOSbench.createNullLinkProviderFile(BENCHIp)
 
-    def CASE3( self, main ):
+        main.step( "Set Cell" )
+        main.ONOSbench.setCell(cellName)
+
+        main.log.report( "Increasing cluster size to " + str( clusterCount ) )
+        for node in range(1, clusterCount + 1):
+            time.sleep(10)
+            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+            main.ONOSbench.onosInstall( ONOSIp[node] )
+            exec "a = main.ONOS%scli.startOnosCli" %str(node)
+            a(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!" )
+    
+    def CASE3( self, main ):   
         import time
         import json
-        import string
+        import string 
         import csv
+        import os.path
+        import requests
+        import numpy
+
+        sustainability = float(main.params[ 'TEST' ][ 'linkgraphdif' ])
+        flickerRates = (main.params[ 'TEST' ][ 'flickerRates']).split(",")        
+        homeDir = os.path.expanduser('~')     
+
+        linkResult = main.FALSE
+        scale = int( main.params[ 'SCALE' ] )
 
         testDelay = main.params[ 'TEST' ][ 'wait']
         time.sleep( float( testDelay ) )
+                
+        for node in range(1, clusterCount + 1): 
+            main.log.info("Writing flicker file to node " + str(node))
+            main.ONOSbench.createNullLinkProviderFile( ONOSIp[node], eventRate=flickerRates[node-1], onNode=True  )     
 
-        getMetric = main.params[ 'TEST' ][ 'metric1' ]
-        testDuration = main.params[ 'TEST' ][ 'duration' ]
-        stop = time.time() + float( testDuration )
-    
-        main.ONOS1cli.featureInstall("onos-null")
-
-        msg = ( "Starting test loop for " + str(testDuration) + " seconds" )
-        main.log.info( msg )
-        logInterval = main.params[ 'TEST' ][ 'log_interval' ]
-
-        while time.time() < stop:
-            time.sleep( float( logInterval ) )
-
-            JsonStr1 = main.ONOS1cli.topologyEventsMetrics() 
-            JsonObj1 = json.loads( JsonStr1 ) 
-            msg = ( "Node 1 TP: " + str( JsonObj1[ getMetric  ][ 'm1_rate' ] ) )
-            main.log.info( msg ) 
-            lastRate1 = round(JsonObj1[ getMetric  ][ 'm1_rate' ],2)
-
-        msg = ( "Final TP on node 1: " + str( lastRate1 ) )
-        main.log.report( msg )
-        
-        
-
-        jenkinsReport = open('NetworkTPnode.csv', 'w')
-        jenkinsReport.write("T1 - Node 1, T2 - Node 1, T2 - Node 2, T3 - Node 1, T3 - Node 2, T3 - Node 3\n")
-        jenkinsReport.write(str(lastRate1))
-        jenkinsReport.write(", ")
-        jenkinsReport.close()
-        
-
-
-    def CASE4( self, main ):
-        import time
-        import json
-        import string
-
-        testDelay = main.params[ 'TEST' ][ 'wait']
-        time.sleep( float( testDelay ) )
-
-        getMetric = main.params[ 'TEST' ][ 'metric1' ]
         testDuration = main.params[ 'TEST' ][ 'duration' ]
         stop = time.time() + float( testDuration )
 
-        main.ONOS2cli.featureInstall("onos-null")
-
-        msg = ( "Starting test loop for " + str(testDuration) + " seconds" )
+        msg = ( "Starting test loop for " + str(testDuration) + " seconds on a " + str(clusterCount) + " node cluster" )
         main.log.info( msg )
         logInterval = main.params[ 'TEST' ][ 'log_interval' ]
 
-        while time.time() < stop:
-            time.sleep( float( logInterval ) )
-
-            JsonStr1 = main.ONOS1cli.topologyEventsMetrics() 
-            JsonObj1 = json.loads( JsonStr1 )
-            msg = ( "Node 1 TP: " + str( JsonObj1[ getMetric  ][ 'm1_rate' ] ) )
-            main.log.info( msg )
-            lastRate1 = round(JsonObj1[ getMetric  ][ 'm1_rate' ],2)
-
-
-            JsonStr2 = main.ONOS2cli.topologyEventsMetrics() 
-            JsonObj2 = json.loads( JsonStr2 )
-            msg = ( "Node 2 TP: " + str( JsonObj2[ getMetric  ][ 'm1_rate' ] ) )
-            main.log.info( msg )
-            lastRate2 = round(JsonObj2[ getMetric  ][ 'm1_rate' ],2)
-
-
-        msg = ( "Final TP on node 1: " + str( lastRate1 ) )
-        main.log.report( msg )
-
-        msg = ( "Final TP on node 2: " + str( lastRate2 ) )
-        main.log.report( msg )
-
-
-        jenkinsReport = open('NetworkTPnode.csv', 'a')
-        jenkinsReport.write(str(lastRate1))
-        jenkinsReport.write(", ")
-        jenkinsReport.write(str(lastRate2))
-        jenkinsReport.write(", ")
-        jenkinsReport.close()
-
-
-    def CASE5( self, main ):
-        import time
-        import json
-        import string
-
-        testDelay = main.params[ 'TEST' ][ 'wait']
-        time.sleep( float( testDelay ) )
-
-        getMetric = main.params[ 'TEST' ][ 'metric1' ]
-        testDuration = main.params[ 'TEST' ][ 'duration' ]
-        stop = time.time() + float( testDuration )
-
-        main.ONOS3cli.featureInstall("onos-null")
-
-        msg = ( "Starting test loop for " + str(testDuration) + " seconds" )
-        main.log.info( msg )
-        logInterval = main.params[ 'TEST' ][ 'log_interval' ]
-
-        while time.time() < stop:
-            time.sleep( float( logInterval ) )
-
-            JsonStr1 = main.ONOS1cli.topologyEventsMetrics()
-            JsonObj1 = json.loads( JsonStr1 )
-            msg = ( "Node 1 TP: " + str( JsonObj1[ getMetric  ][ 'm1_rate' ] ) )
-            main.log.info( msg )
-            lastRate1 = round(JsonObj1[ getMetric  ][ 'm1_rate' ],2)
-
-            JsonStr2 = main.ONOS2cli.topologyEventsMetrics()
-            JsonObj2 = json.loads( JsonStr2 )
-            msg = ( "Node 2 TP: " + str( JsonObj2[ getMetric  ][ 'm1_rate' ] ) )
-            main.log.info( msg )
-            lastRate2 = round(JsonObj2[ getMetric  ][ 'm1_rate' ],2)
-    
-            JsonStr3 = main.ONOS3cli.topologyEventsMetrics()
-            JsonObj3 = json.loads( JsonStr3 )
-            msg = ( "Node 3 TP: " + str( JsonObj3[ getMetric  ][ 'm1_rate' ] ) )
-            main.log.info( msg )
-            lastRate3 = round(JsonObj3[ getMetric  ][ 'm1_rate' ],2)
-
-        msg = ( "Final TP on node 1: " + str( lastRate1 ) )
-        main.log.report( msg )
-
-        msg = ( "Final TP on node 2: " + str( lastRate2 ) )
-        main.log.report( msg )
-
-        msg = ( "Final TP on node 3: " + str( lastRate3 ) )
-        main.log.report( msg )
-
-        jenkinsReport = open('NetworkTPnode.csv', 'a')
-        jenkinsReport.write(str(lastRate1))
-        jenkinsReport.write(", ")
-        jenkinsReport.write(str(lastRate2))
-        jenkinsReport.write(", ")
-        jenkinsReport.write(str(lastRate3))
-        jenkinsReport.close()
+        linkResults = [0,0,0,0,0,0,0,0]
+        graphResults = [0,0,0,0,0,0,0,0]
+        JsonStr = [ 0,0,0,0,0,0,0,0 ]
+        JsonObj = [ 0,0,0,0,0,0,0,0 ]
         
+        while time.time() < stop:
+            time.sleep( float( logInterval ) )
+            for node in range(1, clusterCount+1):         
+                main.ONOSbench.handle.sendline("""onos $OC1 topology-events-metrics|grep "Topology Link Events"|cut -d ' ' -f7 """)
+                main.ONOSbench.handle.expect(":~") 
+                raw = (main.ONOSbench.handle.before).splitlines() 
+                myresult = "--"
+                for word in raw: 
+                    if "m1" in word: 
+                        myresult = word 
+                        myresult = myresult.replace("m1=","")
+                        break 
+                if myresult == "--": 
+                    main.log.error("Parse error or no data error") 
+                msg = ( "Node " + str(node)  +  " Link Event TP: " + str(myresult) )
+                main.log.info( msg )
+                linkResults[node] = round(float(myresult),2)
+                myLinkRate = round(float(myresult),2)
+
+                main.ONOSbench.handle.sendline("""onos $OC1 topology-events-metrics|grep "Topology Graph Events"|cut -d ' ' -f7 """)
+                main.ONOSbench.handle.expect(":~")
+                raw = (main.ONOSbench.handle.before).splitlines()
+                myresult = "--"
+                for word in raw:
+                    if "m1" in word:
+                        myresult = word
+                        myresult = myresult.replace("m1=","")
+                        break
+                if myresult == "--":
+                    main.log.error("Parse error or no data error")
+                msg = ( "Node " + str(node) + " Graph Event TP: " + str(myresult) )
+                main.log.info( msg )
+                graphResults[node] = round(float(myresult),2)
+                myGraphRate = round(float(myresult),2)
+                
+                difLinkGraph = float(myLinkRate - myGraphRate)
+                difLinkGraph = numpy.absolute(difLinkGraph)
+                main.log.info("Node " + str(node) + " abs(Link event - Graph event) = " + str(difLinkGraph)) 
+                tempx = numpy.divide(difLinkGraph,float(myLinkRate)) 
+                if tempx > sustainability:
+                    main.log.error("Difference in link event rate and graph event rate above " + str(sustainability) + " tolerance") 
+                print("")
+
+        print("")
+        print("")
+
+        main.log.report("Final Link Event TP Results on " + str(clusterCount) + " node cluster")
+        main.log.report("_______________________________________________")
+        for node in range(1, clusterCount+1):
+            main.log.report("Node " + str(node) + ": " + str(linkResults[node])) 
+
+        print("")
+        print("")
+
+        main.log.report("Final Graph Event TP Results on " + str(clusterCount) + " node cluster")
+        main.log.report("_______________________________________________")
+        for node in range(1, clusterCount+1):
+            main.log.report("Node " + str(node) + ": " + str(graphResults[node]))           
+          
+        ################################################################################# 
+				# 	Data Logging
+
+        logFileName = main.params[ 'TEST' ][ 'logFile' ]
+        logFile = open(logFileName, 'a')
+        main.log.info("Log file opened")
+        flickerRate = main.params[ 'TEST' ][ 'flickerRate']
+
+        for node in range (1, clusterCount + 1):
+            # replare ->  logFile.write( str(clusterCount) + "," + flickerNodes + "," )
+            logFile.write("'" + "baremetal" + str(node)  + "'," )
+            logFile.write( testDuration + "," )
+            logFile.write( flickerRate + "," )
+            logFile.write( str(linkResults[node]) + "," )
+            logFile.write( str(graphResults[node]) + "\n" )
+
+        logFile.close()
+        main.log.info("Log file closed")        
+        
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TestON/tests/LinkEventTP/LinkEventTP.topo b/TestON/tests/LinkEventTP/LinkEventTP.topo
index dda5114..cf5fc94 100644
--- a/TestON/tests/LinkEventTP/LinkEventTP.topo
+++ b/TestON/tests/LinkEventTP/LinkEventTP.topo
@@ -8,7 +8,10 @@
             <password>onos_test</password>
             <type>OnosDriver</type>
             <connect_order>1</connect_order>
-            <COMPONENTS> </COMPONENTS>
+            <COMPONENTS>
+		<home>~/onos</home>
+	    </COMPONENTS>
+
         </ONOSbench>
 
         <ONOS1cli>
@@ -19,7 +22,7 @@
             <connect_order>2</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS1cli>
-        
+
         <ONOS2cli>
             <host>10.128.5.55</host>
             <user>admin</user>
@@ -38,12 +41,48 @@
             <COMPONENTS> </COMPONENTS>
         </ONOS3cli>
 
+        <ONOS4cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4cli>
+
+        <ONOS5cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5cli>
+
+	<ONOS6cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6cli>
+
+        <ONOS7cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS7cli>
+
         <ONOS1>
             <host>10.128.5.51</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
-            <connect_order>5</connect_order>
+            <connect_order>9</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS1>
 
@@ -52,7 +91,7 @@
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
-            <connect_order>6</connect_order>
+            <connect_order>10</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS2>
 
@@ -61,10 +100,47 @@
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
-            <connect_order>7</connect_order>
+            <connect_order>11</connect_order>
             <COMPONENTS> </COMPONENTS>
         </ONOS3>
+
+        <ONOS4>
+            <host>10.128.5.54</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>12</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4>
+
+	
+        <ONOS5>
+            <host>10.128.5.65</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>13</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5>
+
+        <ONOS6>
+            <host>10.128.5.66</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>14</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6>
+
+        <ONOS7>
+            <host>10.128.5.67</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>15</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS7>
+
     </COMPONENT>
 
 </TOPOLOGY>
-