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

Change-Id: I1bc4b51cdb93f03f855d9bdc8b0bcf5bf436ffa8
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index ac3a9a2..2d61501 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -3794,6 +3794,43 @@
             main.cleanup()
             main.exit()
 
+    def changeInterfaceStatus( self, devicename, intf, status ):
+        '''
+
+        Args:
+            devicename: switch name
+            intf: port name on switch
+            status: up or down
+
+        Returns: boolean to show success change status
+
+        '''
+        if status == "down" or status == "up":
+            try:
+                cmd = devicename + " ifconfig " + intf + " " + status
+                self.handle.sendline( cmd )
+                self.handle.expect("mininet>")
+                return main.TRUE
+            except pexpect.TIMEOUT:
+                main.log.exception(self.name + ": Command timed out")
+                return main.FALSE
+            except pexpect.EOF:
+                main.log.exception(self.name + ": connection closed.")
+                main.cleanup()
+                main.exit()
+            except TypeError:
+                main.log.exception(self.name + ": TypeError")
+                main.cleanup()
+                main.exit()
+            except Exception:
+                main.log.exception(self.name + ": Uncaught exception!")
+                main.cleanup()
+                main.exit()
+        else:
+            main.log.warn("Interface status should be up or down!")
+            return main.FALSE
+
+
 
 if __name__ != "__main__":
     sys.modules[ __name__ ] = MininetCliDriver()