Enable core flow number check in CHO Test
Change-Id: I537912145d5cc797c51dd5be8ef6c45f934776f0
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
index 6c9ef4b..85b2e0e 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
@@ -94,6 +94,8 @@
<CLIParamNum>0</CLIParamNum>
<rerunInterval>5</rerunInterval>
<maxRerunNum>5</maxRerunNum>
+ <coreFlowNum>4</coreFlowNum>
+ <coreFlowNum6>6</coreFlowNum6>
</FlowCheck>
<TrafficCheck>
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
index aad520c..6b0080f 100755
--- a/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
@@ -46,9 +46,27 @@
def startCheckEvent( self, args=None ):
import json
checkResult = EventStates().PASS
+ if main.enableIPv6:
+ coreFlowNum = main.params[ 'EVENT' ][ 'FlowCheck' ][ 'coreFlowNum6' ]
+ else:
+ coreFlowNum = main.params[ 'EVENT' ][ 'FlowCheck' ][ 'coreFlowNum' ]
for controller in main.controllers:
if controller.isUp():
with controller.CLILock:
+ # Check core flow number
+ for device in main.devices:
+ if device.isRemoved():
+ continue
+ coreFlowNumOnos = controller.CLI.flowAddedCount( device.dpid, core=True )
+ if coreFlowNumOnos == None:
+ main.log.warn( "Flow Check - error when trying to get flow number of %s on ONOS%s" % ( device.dpid, controller.index ) )
+ checkResult = EventStates().FAIL
+ else:
+ coreFlowNumOnos = int( coreFlowNumOnos )
+ if coreFlowNumOnos != coreFlowNum:
+ main.log.warn( "Flow Check - core flow number of %s on ONOS%s is %s" % ( device.dpid, controller.index, coreFlowNumOnos ) )
+ checkResult = EventStates().FAIL
+ # Get flows for comparison
flows = controller.CLI.flows()
try:
flows = json.loads( flows )