[ONOS-7937] Automatically check SCPF test results
Change-Id: Ifec2e7965fbc43ab9bb65338810ca62d7b120739
(cherry picked from commit aa7bc72e78ba2ba5656939232751b1501cc56ceb)
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
index 5ac38e6..99a246d 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
@@ -81,6 +81,7 @@
main.MNLinksTime = int( main.params[ 'TIMEOUT' ][ 'links' ] )
main.getTopoTime = int( main.params[ 'TIMEOUT' ][ 'getTopo' ] )
main.currScale = None
+ main.maxScale = 1
main.threadID = 0
if main.hostDiscover == 'True':
main.hostDiscover = True
@@ -464,6 +465,7 @@
main.log.error( "The results of two capture are different!" )
main.log.debug( "The data is " + str( main.allinfo ) )
if main.writeData != -1:
+ main.maxScale = main.currScale
main.log.info( "Write the date into database" )
# write the date into data base
with open( main.dbFilePath, "a" ) as dbFile:
@@ -490,3 +492,12 @@
"ERROR",
"Except" ],
"s" )
+
+ def CASE1001( self, main ):
+ """
+ Write abnormal test results to alarm log
+ """
+ threshold = int( main.params[ 'ALARM' ][ 'minMaxScale' ] )
+ if int( main.maxScale ) < threshold:
+ main.log.alarm( "Max scale: {}x{} < {}x{}".format( main.maxScale, main.maxScale,
+ threshold, threshold ) )