Imporve SCPFportLat test
    - Improve calculate latency method
    - Add a dependence file to grep latency
    - Improve database method

Change-Id: I1bc4b51cdb93f03f855d9bdc8b0bcf5bf436ffa8
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
index 0a81dc6..4fc830f 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    <testcases>1,2,1,2,1,2,1,2</testcases>
+    <testcases>0,1,2,1,2,1,2,1,2</testcases>
 
     <SCALE>1,3,5,7</SCALE>
     <max>7</max>
@@ -9,76 +9,56 @@
         <cellApps>drivers,metrics,openflow</cellApps>
     </ENV>
 
-    <DEPENDENCY>
-        <path>/tests/SCPF/SCPFportLat/dependencies/</path>
-        <topology>topo-perf-2sw.py</topology>
-    </DEPENDENCY>
-
-    <GIT>
-        <autopull>off</autopull>
-        <checkout>master</checkout>
-    </GIT>
-
-    <CTRL>
-        <user>sdn</user>
-        <ip1>OC1</ip1>
-        <ip2>OC2</ip2>
-        <ip3>OC3</ip3>
-        <ip4>OC4</ip4>
-        <ip5>OC5</ip5>
-        <ip6>OC6</ip6>
-        <ip7>OC7</ip7>
-    </CTRL>
-
     <MN>
         <ip1>OCN</ip1>
     </MN>
 
-    <BENCH>
-        <ip>localhost</ip>
-    </BENCH>
+    <DEPENDENCY>
+        <path>/tests/SCPF/SCPFportLat/dependencies/</path>
+        <topology>topo-perf-2sw.py</topology>
+        <function>portFunc</function>
+    </DEPENDENCY>
+
+    <GIT>
+        <gitPull>off</gitPull>
+        <gitBranch>master</gitBranch>
+    </GIT>
 
     <TSHARK>
+        <tsharkReusltPath>/tmp/tshark_portStatus</tsharkReusltPath>
         <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 6653</tcpSynAck>
-        <finAckSequence>FIN</finAckSequence>
     </TSHARK>
+    <SLEEP>
+        <startup>5</startup>
+        <measure>5</measure>
+        <mininet>5</mininet>
+    </SLEEP>
+
+    <TIMEOUT>
+        <timeout>60</timeout>
+    </TIMEOUT>
 
     <TEST>
         #'on' or 'off' debug mode.
         #If on, logging will be more verbose and
         #tshark pcap will be enabled
         #pcap file located at /tmp/'capture_name'
-        <debugMode>on</debugMode>
-        <onosLogFile>/opt/onos/log/karaf*</onosLogFile>
-        <mci>off</mci>
-
-        <topoConfigFile>
-            single_topo_event_accumulator.cfg
-        </topoConfigFile>
-        <topoConfigName>
-            org.onlab.onos.net.topology.impl.DefaultTopologyProvider.cfg
-        </topoConfigName>
+        <debug>True</debug>
+        #Number of iterations to ignore initially
+        <warmUp>5</warmUp>
 
         #Number of times to iterate each case
-        <numIter>25</numIter>
-        <numSwitch>2</numSwitch>
-        #Number of iterations to ignore initially
-        <iterIgnore>5</iterIgnore>
+        <sampleSize>20</sampleSize>
 
-        <portUpThreshold>0,5000</portUpThreshold>
-        <portDownThreshold>0,1000</portDownThreshold>
+        <maxProcessTime>5000</maxProcessTime>
 
-        <tabletFile>tablets_3node.json</tabletFile>
+        <interface>s1-eth1</interface>
+        <device>s1</device>
    </TEST>
 
-    <DB>
-        <postToDB>no</postToDB>
-        <portEventResultPath>/tmp/portEventResultDb</portEventResultPath>
-    </DB>
+    <DATABASE>
+        <dbName>/tmp/portEventResultDb</dbName>
+    </DATABASE>
 
     <JSON>
         <deviceTimestamp>topologyDeviceEventTimestamp</deviceTimestamp>