Merge "[ONOS-6883] Invstigating and Fixing FUNCintent test"
diff --git a/TestON/tests/FUNC/FUNCintent/FUNCintent.py b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
index 3686ca5..9de5740 100644
--- a/TestON/tests/FUNC/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
@@ -339,7 +339,6 @@
         """
         if main.initialized == main.FALSE:
             main.log.error( "Test components did not start correctly, skipping further tests" )
-            main.stop()
             main.skipCase()
         main.case( "Balance mastership of switches" )
         main.step( "Balancing mastership of switches" )
diff --git a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
index 9a552cb..7418965 100644
--- a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
@@ -2382,6 +2382,7 @@
         else failed
 
     """
+    main.log.info( "Checking encapsulated intent for " + tag + ".")
     HostJson = []
     Jflows = main.Cluster.active( 0 ).CLI.flows( noCore=True )
     try:
@@ -2401,20 +2402,25 @@
 
     PopTag = tag + "_POP"
     PushTag = tag + "_PUSH"
-
+    main.log.info( "Host Json info :" )
     for EachHostJson in HostJson:
         for i in range( totalflows ):
-            if EachHostJson[ i ][ "treatment" ][ "instructions" ][ 0 ][ "subtype" ] == PopTag:
-                pop += 1
-            elif EachHostJson[ i ][ "treatment" ][ "instructions" ][ 0 ][ "subtype" ] == PushTag:
-                push += 1
+            main.log.info( str( EachHostJson[ i ] ) )
+            checkJson = EachHostJson[ i ][ "treatment" ][ "instructions" ][ 0 ]
+            main.Cluster.active( 0 ).REST.pprint( checkJson )
+            if 'subtype' in checkJson:
+                if checkJson[ "subtype" ] == PopTag:
+                    pop += 1
+                elif checkJson[ "subtype" ] == PushTag:
+                    push += 1
 
     if pop == totalflows and push == totalflows:
         return main.TRUE
     else:
+        main.log.error( "Total " + PushTag + str( push ) )
+        main.log.error( "Total " + PopTag + str( pop ) )
         return main.FALSE
 
-
 def ProtectedIntentCheck( main ):
     intent = main.Cluster.active( 0 ).CLI.intents( jsonFormat=False )
     if "Protection" in intent: