mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7393: Expunging VM immediately and removing unncessary wait in test_vpc_vm_life_cycle.py
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
parent
d80f6a8d4a
commit
402fc914cf
@ -3509,61 +3509,12 @@ class TestVMLifeCycleDiffHosts(cloudstackTestCase):
|
|||||||
self.debug("Delete virtual machines in account: %s" %
|
self.debug("Delete virtual machines in account: %s" %
|
||||||
self.account.name)
|
self.account.name)
|
||||||
try:
|
try:
|
||||||
self.vm_1.delete(self.apiclient, expunge=False)
|
self.vm_1.delete(self.apiclient)
|
||||||
|
self.vm_2.delete(self.apiclient)
|
||||||
list_vm_response = list_virtual_machines(
|
self.vm_3.delete(self.apiclient)
|
||||||
self.apiclient,
|
|
||||||
id=self.vm_1.id
|
|
||||||
)
|
|
||||||
|
|
||||||
vm_response = list_vm_response[0]
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
vm_response.state,
|
|
||||||
'Destroyed',
|
|
||||||
"VM state should be destroyed"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.vm_2.delete(self.apiclient, expunge=False)
|
|
||||||
|
|
||||||
list_vm_response = list_virtual_machines(
|
|
||||||
self.apiclient,
|
|
||||||
id=self.vm_2.id
|
|
||||||
)
|
|
||||||
|
|
||||||
vm_response = list_vm_response[0]
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
vm_response.state,
|
|
||||||
'Destroyed',
|
|
||||||
"VM state should be destroyed"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.vm_3.delete(self.apiclient, expunge=False)
|
|
||||||
|
|
||||||
list_vm_response = list_virtual_machines(
|
|
||||||
self.apiclient,
|
|
||||||
id=self.vm_3.id
|
|
||||||
)
|
|
||||||
|
|
||||||
vm_response = list_vm_response[0]
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
vm_response.state,
|
|
||||||
'Destroyed',
|
|
||||||
"VM state should be destroyed"
|
|
||||||
)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("Failed to destroy the virtual instances, %s" % e)
|
self.fail("Failed to destroy the virtual instances, %s" % e)
|
||||||
|
|
||||||
self.debug(
|
|
||||||
"Waiting for expunge interval to cleanup the network and VMs")
|
|
||||||
|
|
||||||
wait_for_cleanup(
|
|
||||||
self.apiclient,
|
|
||||||
["expunge.interval", "expunge.delay"]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Check if the network rules still exists after Vm stop
|
# Check if the network rules still exists after Vm stop
|
||||||
self.debug("Checking if NAT rules existed")
|
self.debug("Checking if NAT rules existed")
|
||||||
with self.assertRaises(Exception):
|
with self.assertRaises(Exception):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user