Add options to randomly toggle FlowObjective in CHO test

Change-Id: Ie18e3c586dfad5258d6ae3c65a2e7687a100581f
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
index 85b2e0e..8695c6f 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.params
@@ -36,7 +36,7 @@
         <ipv4Prefix>10.1.</ipv4Prefix>
         <karafCliTimeout>7200000</karafCliTimeout>
         <testDuration>86400</testDuration>
-        <package>off</package>
+        <package>on</package>
         <autoPull>off</autoPull>
         <branch>master</branch>
     </TEST>
@@ -392,6 +392,7 @@
         <addPointIntentWeight>3</addPointIntentWeight>
         <linkDownWeight>3</linkDownWeight>
         <deviceDownWeight>2</deviceDownWeight>
+        <toggleFlowObj>0</toggleFlowObj>
     </CASE70>
 
     <CASE80>
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index e6606d4..0dc7a33 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -781,9 +781,12 @@
         pointIntentNum = 0
         downDeviceNum = 0
         downLinkNum = 0
+        flowObj = False
         upControllers = [ 1, 2, 3 ]
         while True:
             events = []
+            for i in range( int( main.params[ 'CASE70' ][ 'toggleFlowObj' ] ) ):
+                events.append( 'toggle-flowobj' )
             for i in range( int( main.params[ 'CASE70' ][ 'addHostIntentWeight' ] ) ):
                 events.append( 'add-host-intent' )
             for i in range( int( main.params[ 'CASE70' ][ 'addPointIntentWeight' ] ) ):
@@ -838,6 +841,12 @@
             elif event == 'device-up':
                 main.eventGenerator.triggerEvent( EventType().NETWORK_DEVICE_UP, EventScheduleMethod().RUN_BLOCK, 'random' )
                 downDeviceNum -= 1
+            elif event == 'toggle-flowobj':
+                if flowObj == False:
+                    main.eventGenerator.triggerEvent( EventType().ONOS_SET_FLOWOBJ, EventScheduleMethod().RUN_BLOCK, 'true' )
+                else:
+                    main.eventGenerator.triggerEvent( EventType().ONOS_SET_FLOWOBJ, EventScheduleMethod().RUN_BLOCK, 'false' )
+                flowObj = not flowObj
             else:
                 pass
             main.eventGenerator.triggerEvent( EventType().CHECK_TOPO, EventScheduleMethod().RUN_NON_BLOCK )