[ONOS-7937] Automatically check SCPF test results
Change-Id: Ifec2e7965fbc43ab9bb65338810ca62d7b120739
(cherry picked from commit aa7bc72e78ba2ba5656939232751b1501cc56ceb)
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.params b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.params
index 5ab7277..541d128 100644
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.params
+++ b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.params
@@ -1,14 +1,14 @@
<PARAMS>
- <testcases>0,1,2,1,2,1,2,1,2</testcases>
+ <testcases>0,1,2,1,2,1,2</testcases>
<GRAPH>
<nodeCluster>BM</nodeCluster>
<builds>20</builds>
</GRAPH>
- <SCALE>1,3,5,7</SCALE>
- <max>7</max>
+ <SCALE>1,3,5</SCALE>
+ <max>5</max>
<ENV>
<cellName>IntentInstallWithdrawCell</cellName>
@@ -30,14 +30,17 @@
<pull>False</pull>
<branch>master</branch>
</GIT>
+
<DEPENDENCY>
<FILE1>intentInstallLatFuncs</FILE1>
<PATH>/tests/SCPF/SCPFintentInstallWithdrawLat/dependencies/</PATH>
</DEPENDENCY>
+
<DATABASE>
<dbName>/tmp/IntentInstallWithdrawLatDB</dbName>
<dbFlowObj>/tmp/IntentInstallWithdrawLatDBWFO</dbFlowObj>
</DATABASE>
+
<ATTEMPTS>
<verify>6</verify>
<maxInvalidRun>5</maxInvalidRun>
@@ -52,11 +55,13 @@
# timeout for pexpect
<timeout>300</timeout>
</SLEEP>
+
<CFG>
<intentManager>org.onosproject.net.intent.impl.IntentManager</intentManager>
<intentConfigRegi>org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator</intentConfigRegi>
<nullProvider>org.onosproject.provider.nil.NullProviders</nullProvider>
</CFG>
+
<CTRL>
<USER>sdn</USER>
@@ -91,7 +96,11 @@
<ip1>localhost</ip1>
</BENCH>
- <JSON>
- </JSON>
+ <ALARM>
+ <maxInstallLat>20,22,50,45,50,120,41,50,100</maxInstallLat>
+ <maxWithdrawLat>16,18,40,40,45,90,40,45,80</maxWithdrawLat>
+ <maxInstallLatFlowObj>30,700,7000,60,500,3100,60,200,1800</maxInstallLatFlowObj>
+ <maxWithdrawLatFlowObj>30,900,5500,60,300,3000,55,200,1700</maxWithdrawLatFlowObj>
+ </ALARM>
</PARAMS>
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
index 8b798bd..30df5a4 100644
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
+++ b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
@@ -276,6 +276,26 @@
main.log.report( "Intent batch: " + str( batchSize ) )
main.log.report( "Install average: {} std: {}".format( installave, installstd ) )
main.log.report( "Withdraw average: {} std: {}".format( withdrawave, withdrawstd ) )
+
+ # Check test results
+ index = len( main.intentsList ) * ( main.cycle - 1 ) + main.intentsList.index( batchSize )
+ # Check installation results
+ if main.flowObj:
+ threshold = float( main.params[ 'ALARM' ][ 'maxInstallLatFlowObj' ].split( ',' )[ index ])
+ else:
+ threshold = float( main.params[ 'ALARM' ][ 'maxInstallLat' ].split( ',' )[ index ])
+ if installave > threshold:
+ main.log.alarm( "{}-node install avg: {} ms > {} ms".format( main.Cluster.numCtrls,
+ installave, threshold ) )
+ # Check withdrawal results
+ if main.flowObj:
+ threshold = float( main.params[ 'ALARM' ][ 'maxWithdrawLatFlowObj' ].split( ',' )[ index ])
+ else:
+ threshold = float( main.params[ 'ALARM' ][ 'maxWithdrawLat' ].split( ',' )[ index ])
+ if withdrawave > threshold:
+ main.log.alarm( "{}-node withdraw avg: {} ms > {} ms".format( main.Cluster.numCtrls,
+ withdrawave, threshold ) )
+
# write result to database file
if not ( numpy.isnan( installave ) or numpy.isnan( installstd ) or
numpy.isnan( withdrawstd ) or numpy.isnan( withdrawave ) ):