Skip to content

Commit ec8610f

Browse files
author
Girish Shilamkar
committed
CLOUDSTACK-5638: Fixed code to check router state
1 parent 8455a06 commit ec8610f

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

test/integration/component/test_routers.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,31 @@ def test_02_NetworkGarbageCollection(self):
350350
"Check list router response"
351351
)
352352
# Router associated with account should be in running state
353-
for router in routers:
354-
self.debug("Router ID: %s & Router state: %s" % (
353+
timeout = 180
354+
router = routers[0]
355+
self.debug("Router ID: %s & Router state: %s" % (
355356
router.id,
356357
router.state
357358
))
358-
self.assertEqual(
359+
self.debug("Wait for %s secs max for router to reach Running state" % timeout)
360+
while timeout:
361+
time.sleep(60)
362+
routers = list_routers(
363+
self.apiclient,
364+
account=self.account.name,
365+
domainid=self.account.domainid,
366+
id=router.id)
367+
router = routers[0]
368+
if router.state == 'Running':
369+
break
370+
371+
timeout = timeout - 60
372+
if timeout == 0:
373+
self.assertEqual(
359374
router.state,
360375
'Running',
361-
"Check list router response for router state"
362-
)
376+
"Router not in Running state")
377+
363378

364379
# Network state associated with account should be 'Implemented'
365380
networks = list_networks(

0 commit comments

Comments
 (0)