Added a limit to the number of intents that can be installed

Change-Id: Ieeb90e0677e087dbe72dac519a9678b3b242e0df
diff --git a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
index 967722e..97e32c3 100755
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
@@ -43,6 +43,7 @@
     <TEST>
         <batch_size>1000</batch_size>
         <min_intents>500000</min_intents>
+        <max_intents>1000000</max_intents>
         <check_interval>1000</check_interval>
     </TEST>
 
diff --git a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
index 6285758..793d5ea 100644
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
@@ -39,6 +39,7 @@
         main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
         main.timeout = int(main.params['SLEEP']['timeout'])
         main.minIntents = int(main.params['TEST']['min_intents'])
+        main.maxIntents = int(main.params['TEST']['max_intents'])
         main.checkInterval = int(main.params['TEST']['check_interval'])
         wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
         wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
@@ -324,9 +325,10 @@
         expectedIntents = 0
         # the number of flows we expect to be in the added state
         expectedFlows = main.defaultFlows
-
+        # limit for the number of intents that can be installed
+        limit = main.maxIntents / main.batchSize
         try:
-            while True:
+            for i in range(limit):
                 # Push intents
                 main.log.step("Pushing intents")
                 stepResult = main.intentFunctions.pushIntents( main,
@@ -406,9 +408,10 @@
         expectedIntents = 0
         # the number of flows we expect to be in the added state
         expectedFlows = main.defaultFlows
-
+        # limit for the number of intents that can be installed
+        limit = main.maxIntents / main.batchSize
         try:
-            while True:
+            for i in range(limit):
                 # Push intents
                 main.log.step("Pushing intents")
                 stepResult = main.intentFunctions.pushIntents( main,