Skip to content

Commit 4df0c4a

Browse files
author
Girish Shilamkar
committed
CLOUDSTACK-5187: Fix test_vpc_vm_life_cycle recover tests
The vms were recovered without deleting the vms first therefore the API failed.
1 parent 80dfd0f commit 4df0c4a

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

‎test/integration/component/test_vpc_vm_life_cycle.py‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -651,15 +651,13 @@ def test_06_recover_instance_in_network(self):
651651
""" Test recover an instance in VPC networks
652652
"""
653653

654-
# Validate the following
655-
# 1. Recover the virtual machines.
656-
# 2. Vm should be in stopped state. State both the instances
657-
# 3. Make sure that all the PF,LB and Static NAT rules on this VM
658-
# works as expected.
659-
# 3. Make sure that we are able to access google.com from this user Vm
654+
self.debug("Deleted instacnes ..")
655+
try:
656+
self.vm_1.delete(self.apiclient)
657+
self.vm_2.delete(self.apiclient)
658+
except Exception as e:
659+
self.fail("Failed to stop the virtual instances, %s" % e)
660660

661-
self.debug("Recovering the expunged virtual machines in account: %s" %
662-
self.account.name)
663661
try:
664662
self.vm_1.recover(self.apiclient)
665663
self.vm_2.recover(self.apiclient)
@@ -1421,15 +1419,11 @@ def test_06_recover_instance_in_network(self):
14211419
""" Test recover an instance in VPC networks
14221420
"""
14231421

1424-
# Validate the following
1425-
# 1. Recover the virtual machines.
1426-
# 2. Vm should be in stopped state. State both the instances
1427-
# 3. Make sure that all the PF,LB and Static NAT rules on this VM
1428-
# works as expected.
1429-
# 3. Make sure that we are able to access google.com from this user Vm
1422+
try:
1423+
self.vm_2.delete(self.apiclient)
1424+
except Exception as e:
1425+
self.fail("Failed to destroy the virtual instances, %s" % e)
14301426

1431-
self.debug("Recovering the expunged virtual machines in account: %s" %
1432-
self.account.name)
14331427
try:
14341428
self.vm_2.recover(self.apiclient)
14351429
except Exception as e:

0 commit comments

Comments
 (0)