Exclude invalid latency numbers from intent reroute test results

Change-Id: I247f7d6e0179d978f7e4706745f07b213c7afade
(cherry picked from commit fea75169bd97475de441ec6b624df347f4f02d03)
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
index 7501bf5..d4d1971 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.params
@@ -27,6 +27,7 @@
 
     <TEST>
         <warmUp>5</warmUp>
+        <maxLatency>1000</maxLatency>
         <sampleSize>20</sampleSize>
         <intents>1,100,1000</intents>                       #list format, will be split on ','
         <FObjintents>1,100</FObjintents>
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index 7a8a294..40790fb 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -282,8 +282,10 @@
 
                     firstLocalLatnecy, lastLocalLatnecy, firstGlobalLatency, lastGlobalLatnecy \
                         = main.intentRerouteLatFuncs.calculateLatency( main, topologyTimestamps, intentTimestamps )
-                    if firstLocalLatnecy < 0:
-                        main.log.info( "Got negative latency, skipping this iteration..." )
+                    maxLatency = float( main.params[ 'TEST' ][ 'maxLatency' ] )
+                    if firstLocalLatnecy < 0 or lastLocalLatnecy < 0 or \
+                       firstLocalLatnecy > maxLatency or lastLocalLatnecy > maxLatency:
+                        main.log.info( "Got invalid latency, skipping this iteration..." )
                         main.intentRerouteLatFuncs.bringBackTopology( main )
                         if main.validRun >= main.warmUp:
                             main.invalidRun += 1