Make host discovery function more generic

Change-Id: I9501100b7e689d823d0ba4fca27b94e7fd943a17
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 44055d3..b8ad87f 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -650,7 +650,7 @@
                                  onfail="Failed to kill switch?" )
 
     @staticmethod
-    def recoverSwitch( main, switch, switches, links, rediscoverHosts=False ):
+    def recoverSwitch( main, switch, switches, links, rediscoverHosts=False, hostsToDiscover=[] ):
         """
         Params: switches, links: number of expected switches and links after SwitchUp, ex.: '4', '6'
         Recover a switch and verify ONOS can see the proper change
@@ -665,8 +665,7 @@
             main.switchSleep ) )
         time.sleep( main.switchSleep )
         if rediscoverHosts:
-            main.Network.discoverIpv4Hosts( main.internalIpv4Hosts )
-            main.Network.discoverIpv6Hosts( main.internalIpv6Hosts )
+            main.Network.discoverHosts( hostList=hostsToDiscover )
             main.log.info( "Waiting %s seconds for hosts to get re-discovered" % (
                            main.switchSleep ) )
             time.sleep( main.switchSleep )