fix assertion of checking flows/groups

Change-Id: Icba149cf3343ab3df7f942edf9c20ef5cfeaa3c9
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 4bfd45a..1966a63 100755
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -2676,6 +2676,7 @@
     def checkFlowCount( self, min=0, timeout=60 ):
         count = self.getTotalFlowsNum( timeout=timeout )
         count = int( count ) if count else 0
+        main.log.debug( "found {} flows".format( count ) )
         return count if ( count > min ) else False
 
     def checkFlowsState( self, isPENDING=True, timeout=60, noExit=False ):
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index e5433f9..0d7dc4e 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -363,9 +363,11 @@
                                  kwargs={ 'min': minFlowCount },
                                  attempts=10,
                                  sleep=sleep )
+        if count == main.FALSE:
+            count = main.Cluster.active( 0 ).CLI.checkFlowCount()
         utilities.assertEquals(
                 expect=True,
-                actual=( count > 0 ),
+                actual=( count > minFlowCount ),
                 onpass="Flow count looks correct: " + str( count ),
                 onfail="Flow count looks wrong: " + str( count ) )
 
@@ -414,11 +416,13 @@
                                  args=( dpid, minFlowCount ),
                                  attempts=5,
                                  sleep=sleep )
+        if count == main.FALSE:
+            count = main.Cluster.active( 0 ).CLI.checkFlowAddedCount( dpid )
         utilities.assertEquals(
             expect=True,
             actual=( count > minFlowCount ),
             onpass="Flow count looks correct: " + str( count ),
-            onfail="Flow count looks wrong. " )
+            onfail="Flow count looks wrong: " + str( count ) )
 
     @staticmethod
     def checkFlowEqualityByDpid( main, dpid, flowCount, sleep=10 ):
@@ -429,10 +433,11 @@
                                  args=( dpid, flowCount, False, 1 ),
                                  attempts=5,
                                  sleep=sleep )
-
+        if count == main.FALSE:
+            count = main.Cluster.active( 0 ).CLI.checkFlowAddedCount( dpid )
         utilities.assertEquals(
                 expect=True,
-                actual=( int( count ) == flowCount ),
+                actual=( count == flowCount ),
                 onpass="Flow count looks correct: " + str( count ) ,
                 onfail="Flow count looks wrong. found {},  should be {}.".format( count, flowCount ) )
 
@@ -445,7 +450,8 @@
                                  args=( dpid, groupCount, False, 1),
                                  attempts=5,
                                  sleep=sleep )
-
+        if count == main.FALSE:
+            count = main.Cluseter.active( 0 ).CLI.checkGroupAddedCount( dpid )
         utilities.assertEquals(
                 expect=True,
                 actual=( count == groupCount ),