CHO test fixes: Check host IPs and make sure dhcp servers are always connected in HAGG topo
Change-Id: I26d8ecadce38c37f50c4bfef05ff555018b088b4
(cherry picked from commit 469d4ac4b19655db1215ce03946e24f3e563c3f6)
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 27e1bf6..64e267a 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1931,7 +1931,7 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()
- def getSwitchRandom( self, timeout=60, nonCut=True, switchClasses=None, excludeNodes=[] ):
+ def getSwitchRandom( self, timeout=60, nonCut=True, switchClasses=None, excludeNodes=[], excludeSwitches=[] ):
"""
Randomly get a switch from Mininet topology.
If nonCut is True, it gets a list of non-cut switches (the deletion
@@ -1940,6 +1940,7 @@
it just randomly returns one switch from all current switches in
Mininet.
excludeNodes will be pased to getGraphDict method
+ Switches specified in excludeSwitches will be excluded
Returns the name of the chosen switch.
"""
import random
@@ -1958,6 +1959,7 @@
return None
self.graph.update( graphDict )
candidateSwitches = self.graph.getNonCutVertices()
+ candidateSwitches = [ switch for switch in candidateSwitches if switch not in excludeSwitches ]
if candidateSwitches is None:
return None
elif len( candidateSwitches ) == 0: