Handling Basic zone failures in startVM with false condition

This closes #569
This commit is contained in:
pavan018 2015-07-09 12:53:27 +05:30 committed by sanjeev
parent 874445dae3
commit 97ed8c3af5
2 changed files with 40 additions and 30 deletions

View File

@ -1448,7 +1448,7 @@ class TestMaxAccountNetworks(cloudstackTestCase):
return return
@attr(tags=["advanced", "advancedns", "simulator", @attr(tags=["advanced", "advancedns", "simulator",
"api", "eip"]) "api"])
def test_maxAccountNetworks(self): def test_maxAccountNetworks(self):
"""Test Limit number of guest account specific networks """Test Limit number of guest account specific networks
""" """

View File

@ -1067,18 +1067,20 @@ class TestRouterStateAfterDeploy(cloudstackTestCase):
self.apiclient, self.apiclient,
VirtualMachine.STOPPED) VirtualMachine.STOPPED)
self.assertEqual(response[0], PASS, response[1]) self.assertEqual(response[0], PASS, response[1])
self.debug("Checking the router state after VM deployment")
routers = Router.list( if(self.zone.networktype == "Advanced"):
self.apiclient, self.debug("Checking the router state after VM deployment")
account=self.account.name, routers = Router.list(
domainid=self.account.domainid, self.apiclient,
listall=True account=self.account.name,
) domainid=self.account.domainid,
self.assertEqual( listall=True
routers, )
None, self.assertEqual(
"List routers should return empty response" routers,
) None,
"List routers should return empty response"
)
self.debug( self.debug(
"Deploying another instance (startvm=true) in the account: %s" % "Deploying another instance (startvm=true) in the account: %s" %
self.account.name) self.account.name)
@ -1097,12 +1099,19 @@ class TestRouterStateAfterDeploy(cloudstackTestCase):
VirtualMachine.RUNNING) VirtualMachine.RUNNING)
self.assertEqual(response[0], PASS, response[1]) self.assertEqual(response[0], PASS, response[1])
self.debug("Checking the router state after VM deployment") self.debug("Checking the router state after VM deployment")
routers = Router.list( if (self.zone.networktype == "Basic"):
self.apiclient, routers = Router.list(
account=self.account.name, self.apiclient,
domainid=self.account.domainid, zoneid=self.zone.id,
listall=True listall=True
) )
else:
routers = Router.list(
self.apiclient,
account=self.account.name,
domainid=self.account.domainid,
listall=True
)
self.assertEqual( self.assertEqual(
isinstance(routers, list), isinstance(routers, list),
True, True,
@ -1118,17 +1127,18 @@ class TestRouterStateAfterDeploy(cloudstackTestCase):
self.debug("Destroying the running VM:%s" % self.debug("Destroying the running VM:%s" %
self.virtual_machine_2.name) self.virtual_machine_2.name)
self.virtual_machine_2.delete(self.apiclient, expunge=True) self.virtual_machine_2.delete(self.apiclient, expunge=True)
routers = Router.list( if(self.zone.networktype == "Advanced"):
self.apiclient, routers = Router.list(
account=self.account.name, self.apiclient,
domainid=self.account.domainid, account=self.account.name,
listall=True domainid=self.account.domainid,
) listall=True
self.assertNotEqual( )
routers, self.assertNotEqual(
None, routers,
"Router should get deleted after expunge delay+wait" None,
) "Router should get deleted after expunge delay+wait"
)
return return