Random fixes for CHOTestMonkey
Change-Id: Ia44742153de86c4594633df8f91098208ac72e89
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index 314bde9..24e4a23 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -246,7 +246,7 @@
startStatus = main.Mininet1.startNet( topoFile = topoPath )
main.mininetSwitches = main.Mininet1.getSwitches()
main.mininetHosts = main.Mininet1.getHosts()
- main.mininetLinks = main.Mininet1.getLinks()
+ main.mininetLinks = main.Mininet1.getLinks( timeout=60 )
utilities.assert_equals( expect=main.TRUE,
actual=startStatus,
onpass="Start Mininet topology test PASS",
diff --git a/TestON/tests/CHOTestMonkey/dependencies/EventGenerator.py b/TestON/tests/CHOTestMonkey/dependencies/EventGenerator.py
index de32193..efb71d1 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/EventGenerator.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/EventGenerator.py
@@ -445,9 +445,7 @@
main.eventScheduler.scheduleEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
sleepTime = int( main.params[ 'EVENT' ][ 'installAllHostIntents' ][ 'sleepBeforeCheck' ] )
main.eventScheduler.scheduleEvent( EventType().TEST_SLEEP, EventScheduleMethod().RUN_BLOCK, [ sleepTime ] )
- main.eventScheduler.scheduleEvent( EventType().CHECK_INTENT, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventScheduler.scheduleEvent( EventType().CHECK_FLOW, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventScheduler.scheduleEvent( EventType().CHECK_TRAFFIC, EventScheduleMethod().RUN_NON_BLOCK )
+ self.insertAllChecks( EventScheduleMethod().RUN_NON_BLOCK )
if scheduleMethod == EventScheduleMethod().RUN_BLOCK:
main.eventScheduler.scheduleEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
@@ -482,9 +480,7 @@
main.eventScheduler.scheduleEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
sleepTime = int( main.params[ 'EVENT' ][ 'removeAllHostIntents' ][ 'sleepBeforeCheck' ] )
main.eventScheduler.scheduleEvent( EventType().TEST_SLEEP, EventScheduleMethod().RUN_BLOCK, [ sleepTime ] )
- main.eventScheduler.scheduleEvent( EventType().CHECK_INTENT, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventScheduler.scheduleEvent( EventType().CHECK_FLOW, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventScheduler.scheduleEvent( EventType().CHECK_TRAFFIC, EventScheduleMethod().RUN_NON_BLOCK )
+ self.insertAllChecks( EventScheduleMethod().RUN_NON_BLOCK )
if scheduleMethod == EventScheduleMethod().RUN_BLOCK:
main.eventScheduler.scheduleEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
@@ -519,9 +515,7 @@
main.eventScheduler.scheduleEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
sleepTime = int( main.params[ 'EVENT' ][ 'installAllPointIntents' ][ 'sleepBeforeCheck' ] )
main.eventScheduler.scheduleEvent( EventType().TEST_SLEEP, EventScheduleMethod().RUN_BLOCK, [ sleepTime ] )
- main.eventScheduler.scheduleEvent( EventType().CHECK_INTENT, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventScheduler.scheduleEvent( EventType().CHECK_FLOW, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventScheduler.scheduleEvent( EventType().CHECK_TRAFFIC, EventScheduleMethod().RUN_NON_BLOCK )
+ self.insertAllChecks( EventScheduleMethod().RUN_NON_BLOCK )
if scheduleMethod == EventScheduleMethod().RUN_BLOCK:
main.eventScheduler.scheduleEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
@@ -556,8 +550,6 @@
main.eventScheduler.scheduleEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
sleepTime = int( main.params[ 'EVENT' ][ 'removeAllPointIntents' ][ 'sleepBeforeCheck' ] )
main.eventScheduler.scheduleEvent( EventType().TEST_SLEEP, EventScheduleMethod().RUN_BLOCK, [ sleepTime ] )
- main.eventScheduler.scheduleEvent( EventType().CHECK_INTENT, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventScheduler.scheduleEvent( EventType().CHECK_FLOW, EventScheduleMethod().RUN_NON_BLOCK )
- main.eventScheduler.scheduleEvent( EventType().CHECK_TRAFFIC, EventScheduleMethod().RUN_NON_BLOCK )
+ self.insertAllChecks( EventScheduleMethod().RUN_NON_BLOCK )
if scheduleMethod == EventScheduleMethod().RUN_BLOCK:
main.eventScheduler.scheduleEvent( EventType().NULL, EventScheduleMethod().RUN_BLOCK )
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