Random fixes for CHOTestMonkey
Change-Id: Ia44742153de86c4594633df8f91098208ac72e89
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
index 7f0ca7c..de5fd48 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
@@ -194,10 +194,14 @@
controller = main.controllers[ self.CLIIndex - 1 ]
with controller.CLILock:
# TODO: handle the case that multiple hosts attach to one device
+ srcMAC = ""
+ dstMAC = ""
+ if len( self.deviceA.hosts ) > 0:
+ srcMAC = self.deviceA.hosts[ 0 ].mac
+ if len( self.deviceB.hosts ) > 0:
+ dstMAC = self.deviceB.hosts[ 0 ].mac
id = controller.CLI.addPointIntent( self.deviceA.dpid, self.deviceB.dpid,
- 1, 1, '',
- self.deviceA.hosts[ 0 ].mac,
- self.deviceB.hosts[ 0 ].mac )
+ 1, 1, '', srcMAC, dstMAC )
if id == None:
main.log.warn( self.typeString + " - add point intent failed" )
return EventStates().FAIL