[ONOS-7937] Automatically check portLat results

Change-Id: Idfcd0c84d80505271c3984093f6ed9a24af4c08c
(cherry picked from commit a8e75026bab69f7380728047cd41e812c978fa7f)
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
index 3a6f503..9ca7d2c 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
@@ -230,6 +230,20 @@
                 main.log.report(
                     "Link to Grapg Std: {}".format( str( resultDict[ d ][ 'node' + str( i ) ][ 'Std' ][ 'LtoG' ] ) ) )
 
+        # Check if any result is abnormal
+        result = resultDict[ 'up' ][ 'node' + str( maxDict[ 'up' ][ 'node' ] ) ][ 'Ave' ][ 'EtoE' ]
+        if result > float( main.params[ 'ALARM' ][ 'maxPortUpAve' ].split( ',' )[ main.cycle - 1 ] ):
+            main.log.alarm( "Average of port up latency is {} with cluster size {}".format( result, main.Cluster.numCtrls ) )
+        result = resultDict[ 'up' ][ 'node' + str( maxDict[ 'up' ][ 'node' ] ) ][ 'Std' ][ 'EtoE' ]
+        if result > float( main.params[ 'ALARM' ][ 'maxPortUpStd' ].split( ',' )[ main.cycle - 1 ] ):
+            main.log.alarm( "Std of port up latency is {} with cluster size {}".format( result, main.Cluster.numCtrls ) )
+        result = resultDict[ 'down' ][ 'node' + str( maxDict[ 'down' ][ 'node' ] ) ][ 'Ave' ][ 'EtoE' ]
+        if result > float( main.params[ 'ALARM' ][ 'maxPortDownAve' ].split( ',' )[ main.cycle - 1 ] ):
+            main.log.alarm( "Average of port down latency is {} with cluster size {}".format( result, main.Cluster.numCtrls ) )
+        result = resultDict[ 'down' ][ 'node' + str( maxDict[ 'down' ][ 'node' ] ) ][ 'Std' ][ 'EtoE' ]
+        if result > float( main.params[ 'ALARM' ][ 'maxPortDownStd' ].split( ',' )[ main.cycle - 1 ] ):
+            main.log.alarm( "Std of port down latency is {} with cluster size {}".format( result, main.Cluster.numCtrls ) )
+
         with open( main.dbFileName, "a" ) as dbFile:
             # Scale number
             temp = str( main.Cluster.numCtrls )