Merge "[ONOS-7904] Run CHO test with Segment Routing and H-AGG topology"
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index f8e54fe..80e0246 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/SRDhcprelay/SRDhcprelay.py b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.py
index 13ea4dd..2501e12 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.py
@@ -211,7 +211,7 @@
         SRDhcprelayTest.runTest( main,
                                  testIndex=22,
                                  onosNodes=3,
-                                 description="DHCP v4 tests with 4 clients attached to switch directly and 1 server attached to switch indirectly (via gateway)",
+                                 description="DHCP v4 tests with tagged hosts: 4 clients attached to switch directly and 1 server attached to switch indirectly (via gateway)",
                                  remoteServer=True,
                                  vlan=[ 20, 20, 30, 30 ] )
 
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 ),