mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-5638: Fixed code to check router state
This commit is contained in:
parent
8455a0677a
commit
ec8610f756
@ -350,16 +350,31 @@ class TestRouterServices(cloudstackTestCase):
|
|||||||
"Check list router response"
|
"Check list router response"
|
||||||
)
|
)
|
||||||
# Router associated with account should be in running state
|
# Router associated with account should be in running state
|
||||||
for router in routers:
|
timeout = 180
|
||||||
self.debug("Router ID: %s & Router state: %s" % (
|
router = routers[0]
|
||||||
|
self.debug("Router ID: %s & Router state: %s" % (
|
||||||
router.id,
|
router.id,
|
||||||
router.state
|
router.state
|
||||||
))
|
))
|
||||||
self.assertEqual(
|
self.debug("Wait for %s secs max for router to reach Running state" % timeout)
|
||||||
|
while timeout:
|
||||||
|
time.sleep(60)
|
||||||
|
routers = list_routers(
|
||||||
|
self.apiclient,
|
||||||
|
account=self.account.name,
|
||||||
|
domainid=self.account.domainid,
|
||||||
|
id=router.id)
|
||||||
|
router = routers[0]
|
||||||
|
if router.state == 'Running':
|
||||||
|
break
|
||||||
|
|
||||||
|
timeout = timeout - 60
|
||||||
|
if timeout == 0:
|
||||||
|
self.assertEqual(
|
||||||
router.state,
|
router.state,
|
||||||
'Running',
|
'Running',
|
||||||
"Check list router response for router state"
|
"Router not in Running state")
|
||||||
)
|
|
||||||
|
|
||||||
# Network state associated with account should be 'Implemented'
|
# Network state associated with account should be 'Implemented'
|
||||||
networks = list_networks(
|
networks = list_networks(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user