Continuous tracking of installed intents

Change-Id: I44a0e3fbda861ef53adab2d6b3a7d2c3ab8ef7ad
diff --git a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
index e18d746..762f6fd 100644
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
@@ -343,8 +343,12 @@
         offset = 0
         # the number of intents we expect to be in the installed state
         expectedIntents = 0
+        # keeps track of how many intents have been installed
+        maxIntents = 0
         # the number of flows we expect to be in the added state
         expectedFlows = main.defaultFlows
+        # keeps track of how many flows have been installed
+        maxFlows = main.defaultFlows
         # limit for the number of intents that can be installed
         limit = main.maxIntents / main.batchSize
 
@@ -371,6 +375,9 @@
             expectedIntents = offset
             expectedFlows += main.batchSize*2
 
+            maxIntents = main.intentFunctions.getIntents( main )
+            maxFlows = main.intentFunctions.getFlows( main )
+
             if offset >= main.minIntents and offset % main.checkInterval == 0 or expectedIntents == main.maxIntents:
                 # Verifying intents
                 main.log.step("Verifying intents")
@@ -403,9 +410,6 @@
                 if stepResult == main.FALSE:
                     break
 
-        maxIntents = main.intentFunctions.getIntents( main )
-        maxFlows = main.intentFunctions.getFlows( main )
-
         main.log.report("Done pushing intents")
         main.log.info("Summary: Intents=" + str(expectedIntents) + " Flows=" + str(expectedFlows))
         main.log.info("Installed intents: " + str(maxIntents) +
@@ -437,8 +441,12 @@
         offset = 0
         # the number of intents we expect to be in the installed state
         expectedIntents = 0
+        # keeps track of how many intents have been installed
+        maxIntents = 0
         # the number of flows we expect to be in the added state
         expectedFlows = main.defaultFlows
+        # keeps track of how many flows have been installed
+        maxFlows = main.defaultFlows
         # limit for the number of intents that can be installed
         limit = main.maxIntents / main.batchSize
 
@@ -461,6 +469,9 @@
             if stepResult == main.FALSE:
                 break
 
+            maxIntents = main.intentFunctions.getIntents( main )
+            maxFlows = main.intentFunctions.getFlows( main )
+
             offset += main.batchSize
             expectedIntents = offset
             expectedFlows += main.batchSize*2
@@ -537,9 +548,6 @@
                 main.CLIs[0].handle.expect('onos>')
             time.sleep(main.rerouteSleep)
 
-        maxIntents = main.intentFunctions.getIntents( main )
-        maxFlows = main.intentFunctions.getFlows( main )
-
         main.log.report("Done pushing intents")
         main.log.info("Summary: Intents=" + str(expectedIntents) + " Flows=" + str(expectedFlows))
         main.log.info("Installed intents: " + str(maxIntents) +