[ONOS-7031] Implement raft log check to the CHO events

Change-Id: I466a3ad53c4a9cf56eead1125bafdd857c23835e
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
index 6bb3467..b1b9d0f 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
@@ -134,6 +134,14 @@
             <maxRerunNum>5</maxRerunNum>
         </ONOSCheck>
 
+        <RaftLogSizeCheck>
+            <status>on</status>
+            <typeIndex>15</typeIndex>
+            <typeString>CHECK_RAFT_LOG_SIZE</typeString>
+            <CLI>check-raft-size</CLI>
+            <CLIParamNum>0</CLIParamNum>
+        </RaftLogSizeCheck>
+
         <LinkDown>
             <status>on</status>
             <typeIndex>20</typeIndex>
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index 2a0dc55..3e21612 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -785,6 +785,7 @@
             main.eventGenerator.triggerEvent( EventType().CHECK_TRAFFIC, EventScheduleMethod().RUN_NON_BLOCK )
             main.eventGenerator.triggerEvent( EventType().CHECK_FLOW, EventScheduleMethod().RUN_NON_BLOCK )
             main.eventGenerator.triggerEvent( EventType().CHECK_INTENT, EventScheduleMethod().RUN_NON_BLOCK )
+            main.eventGenerator.triggerEvent( EventType().CHECK_RAFT_LOG_SIZE, EventScheduleMethod().RUN_NON_BLOCK )
             with main.eventScheduler.idleCondition:
                 while not main.eventScheduler.isIdle():
                     main.eventScheduler.idleCondition.wait()
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.topo b/TestON/tests/CHOTestMonkey/CHOTestMonkey.topo
index 9930443..5fdf91d 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.topo
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.topo
@@ -33,4 +33,4 @@
         </Mininet1>
 
     </COMPONENT>
-</TOPOLOGY>
\ No newline at end of file
+</TOPOLOGY>
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
index 786bfa8..fc03203 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
@@ -328,3 +328,19 @@
                 checkResult = EventStates().FAIL
                 main.log.warn( "Traffic Check - ping6 failed" )
         return checkResult
+
+class RaftLogSizeCheck( CheckEvent ):
+
+    def __init__( self ):
+        CheckEvent.__init__( self )
+        self.typeString = main.params[ 'EVENT' ][ self.__class__.__name__ ][ 'typeString' ]
+        self.typeIndex = int( main.params[ 'EVENT' ][ self.__class__.__name__ ][ 'typeIndex' ] )
+
+    def startCheckEvent( self, args=None ):
+        checkResult = EventStates().PASS
+        main.log.info( "Starting checking Raft Log size" )
+        if not main.Cluster.checkPartitionSize():
+            checkResult = EventStates().FAIL
+            main.log.warn( "Raft Log Size Check - Raft log grew too big" )
+
+        return checkResult