Repository: cloudstack Updated Branches: refs/heads/master 291b3ceea -> 42a861e59
CLOUDSTACK-7205: Adding expunge=True while deleting VM for test case execution speed improvement Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/42a861e5 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/42a861e5 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/42a861e5 Branch: refs/heads/master Commit: 42a861e5908b110bbb41145b09394bd86ef318e1 Parents: 291b3ce Author: Gaurav Aradhye <[email protected]> Authored: Wed Jul 30 03:36:27 2014 -0700 Committer: Girish Shilamkar <[email protected]> Committed: Wed Jul 30 21:37:26 2014 +0530 ---------------------------------------------------------------------- test/integration/component/test_brocade_vcs.py | 6 ++-- test/integration/component/test_eip_elb.py | 30 +------------------- .../component/test_escalations_networks.py | 2 +- .../component/test_multiple_ips_per_nic.py | 5 +--- test/integration/component/test_nuage_vsp.py | 4 +-- .../component/test_persistent_networks.py | 12 ++++---- .../component/test_project_resources.py | 5 +--- .../integration/component/test_project_usage.py | 2 +- .../component/test_reset_ssh_keypair.py | 24 ++++++++-------- .../component/test_security_groups.py | 17 +---------- test/integration/component/test_usage.py | 2 +- .../component/test_vm_passwdenabled.py | 2 +- 12 files changed, 30 insertions(+), 81 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_brocade_vcs.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_brocade_vcs.py b/test/integration/component/test_brocade_vcs.py index 556de28..a5eff53 100644 --- a/test/integration/component/test_brocade_vcs.py +++ b/test/integration/component/test_brocade_vcs.py @@ -317,13 +317,11 @@ class TestBrocadeVcs(cloudstackTestCase): ) # Deleting a single VM - VirtualMachine.delete(virtual_machine_1, self.apiclient) - VirtualMachine.expung(virtual_machine_1, self.apiclient) + VirtualMachine.delete(virtual_machine_1, self.apiclient, expunge=True) # Deleting a single VM - VirtualMachine.delete(virtual_machine_2, self.apiclient) - VirtualMachine.expung(virtual_machine_2, self.apiclient) + VirtualMachine.delete(virtual_machine_2, self.apiclient, expunge=True) # Delete Network http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_eip_elb.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_eip_elb.py b/test/integration/component/test_eip_elb.py index 0613c4d..c35ea9b 100644 --- a/test/integration/component/test_eip_elb.py +++ b/test/integration/component/test_eip_elb.py @@ -797,37 +797,9 @@ class TestEIP(cloudstackTestCase): )) self.debug("Destroying an instance: %s" % self.virtual_machine.name) - self.virtual_machine.delete(self.apiclient) + self.virtual_machine.delete(self.apiclient, expunge=True) self.debug("Destroy instance complete!") - config = list_configurations( - self.apiclient, - name='expunge.delay' - ) - self.assertEqual( - isinstance(config, list), - True, - "Check list configurations response" - ) - exp_delay = config[0] - self.debug("expunge.delay: %s" % exp_delay.value) - - config = list_configurations( - self.apiclient, - name='expunge.interval' - ) - self.assertEqual( - isinstance(config, list), - True, - "Check list configurations response" - ) - exp_interval = config[0] - self.debug("expunge.interval: %s" % exp_interval.value) - - # wait for exp_delay+exp_interval - cleans up VM - total_wait = int(exp_interval.value) + int(exp_delay.value) - time.sleep(total_wait) - vms = VirtualMachine.list( self.apiclient, id=self.virtual_machine.id http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_escalations_networks.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_escalations_networks.py b/test/integration/component/test_escalations_networks.py index 6e12eef..66985e9 100644 --- a/test/integration/component/test_escalations_networks.py +++ b/test/integration/component/test_escalations_networks.py @@ -1013,7 +1013,7 @@ class TestNetworks_1(cloudstackTestCase): ) instance_page2 = list_instances_page2[0] # Deleting a single VM - VirtualMachine.delete(vm_created, self.userapiclient) + VirtualMachine.delete(vm_created, self.userapiclient, expunge=True) # Listing the VM's in page 2 list_instance_response = VirtualMachine.list( self.userapiclient, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_multiple_ips_per_nic.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_multiple_ips_per_nic.py b/test/integration/component/test_multiple_ips_per_nic.py index 570ddd2..24b85df 100644 --- a/test/integration/component/test_multiple_ips_per_nic.py +++ b/test/integration/component/test_multiple_ips_per_nic.py @@ -965,10 +965,7 @@ class TestVmNetworkOperations(cloudstackTestCase): network.id, vmguestip=ipaddress_2.ipaddress) # Delete VM - virtual_machine.delete(self.apiclient) - - # Wait for VMs to expunge - wait_for_cleanup(self.api_client, ["expunge.delay", "expunge.interval"]) + virtual_machine.delete(self.apiclient, expunge=True) # Make sure the VM is expunged retriesCount = 20 http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_nuage_vsp.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_nuage_vsp.py b/test/integration/component/test_nuage_vsp.py index 143fe39..096b9d1 100644 --- a/test/integration/component/test_nuage_vsp.py +++ b/test/integration/component/test_nuage_vsp.py @@ -301,10 +301,10 @@ class TestNuageVsp(cloudstackTestCase): "VM state should be running after deployment" ) - VirtualMachine.delete(virtual_machine_1, self.apiclient) + VirtualMachine.delete(virtual_machine_1, self.apiclient, expunge=True) # Deleting a single VM - VirtualMachine.delete(virtual_machine_2, self.apiclient) + VirtualMachine.delete(virtual_machine_2, self.apiclient, expunge=True) # Delete Network Network.delete(self.network, self.apiclient) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_persistent_networks.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py index 016a391..210063e 100644 --- a/test/integration/component/test_persistent_networks.py +++ b/test/integration/component/test_persistent_networks.py @@ -164,7 +164,7 @@ class TestPersistentNetworks(cloudstackTestCase): """verify if vm is expunged""" isVmExpunged = False try: - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) except Exception as e: self.fail("Failed to delete VM: %s with error %s" % (virtual_machine.id, e)) @@ -232,7 +232,7 @@ class TestPersistentNetworks(cloudstackTestCase): virtual_machine = VirtualMachine.create(self.apiclient,self.services["virtual_machine"], networkids=[network.id],serviceofferingid=self.service_offering.id, accountid=self.account.name,domainid=self.domain.id) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) except Exception as e: self.fail("vm creation failed: %s" % e) @@ -378,7 +378,7 @@ class TestPersistentNetworks(cloudstackTestCase): self.fail("Exception while SSHing to VM %s with IP %s" % (virtual_machine.id, ipaddress.ipaddress.ipaddress)) # Delete VM - virtual_machine.delete(self.api_client) + virtual_machine.delete(self.api_client, expunge=True) # Verify VM is expunged self.verifyVmExpungement(virtual_machine) @@ -457,7 +457,7 @@ class TestPersistentNetworks(cloudstackTestCase): except Exception as e: self.fail("Exception while SSHing to VM %s with IP %s" % (virtual_machine.id, ipaddress.ipaddress.ipaddress)) - virtual_machine.delete(self.api_client) + virtual_machine.delete(self.api_client, expunge=True) # Verify VM is expunged self.verifyVmExpungement(virtual_machine) @@ -540,7 +540,7 @@ class TestPersistentNetworks(cloudstackTestCase): except Exception as e: self.fail("Exception while SSHing to VM %s with IP %s" % (virtual_machine.id, ipaddress.ipaddress.ipaddress)) - virtual_machine.delete(self.api_client) + virtual_machine.delete(self.api_client, expunge=True) # Verify VM is expunged self.verifyVmExpungement(virtual_machine) @@ -919,7 +919,7 @@ class TestPersistentNetworks(cloudstackTestCase): self.fail("Exception while SSHing to VM %s with IP %s" % (virtual_machine.id, ipaddress.ipaddress.ipaddress)) # Delete VM - virtual_machine.delete(self.api_client) + virtual_machine.delete(self.api_client, expunge=True) # Verify VM is expunged self.verifyVmExpungement(virtual_machine) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_project_resources.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index 4f61cb0..e533ca3 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -534,10 +534,7 @@ class TestNetwork(cloudstackTestCase): ) # Delete VM before network gets deleted in cleanup - virtual_machine.delete(self.apiclient) - - # Wait for expunge interval to cleanup VM - wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"]) + virtual_machine.delete(self.apiclient, expunge=True) return http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_project_usage.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index e8ed1b1..512156d 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -227,7 +227,7 @@ class TestVmUsage(cloudstackTestCase): try: # Destroy the VM self.debug("Destroying the VM: %s" % self.virtual_machine.id) - self.virtual_machine.delete(self.apiclient) + self.virtual_machine.delete(self.apiclient, expunge=True) except Exception as e: self.fail("Failed to delete VM: %s" % e) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_reset_ssh_keypair.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_reset_ssh_keypair.py b/test/integration/component/test_reset_ssh_keypair.py index d0ddb18..204690e 100644 --- a/test/integration/component/test_reset_ssh_keypair.py +++ b/test/integration/component/test_reset_ssh_keypair.py @@ -218,7 +218,7 @@ class TestResetSSHKeypair(cloudstackTestCase): ) cls._cleanup.append(cls.pw_ssh_enabled_template) # Delete the VM - No longer needed - cls.virtual_machine.delete(cls.api_client) + cls.virtual_machine.delete(cls.api_client, expunge=True) except Exception as e: cls.tearDownClass() raise unittest.SkipTest("Exception in setUpClass: %s" % e) @@ -359,7 +359,7 @@ class TestResetSSHKeypair(cloudstackTestCase): except Exception as e: self.fail("Failed to SSH into VM with new keypair: %s, %s" % (virtual_machine.name, e)) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return @attr(tags=["simulator", "basic", "advanced"]) @@ -477,7 +477,7 @@ class TestResetSSHKeypair(cloudstackTestCase): except Exception as e: self.fail("Failed to SSH into VM with password: %s, %s" % (virtual_machine.name, e)) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return @attr(tags=["simulator", "basic", "advanced"]) @@ -580,7 +580,7 @@ class TestResetSSHKeypair(cloudstackTestCase): except Exception as e: self.fail("Failed to SSH into VM with new keypair: %s, %s" % (virtual_machine.name, e)) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return @attr(tags=["simulator", "basic", "advanced"]) @@ -691,7 +691,7 @@ class TestResetSSHKeypair(cloudstackTestCase): except Exception as e: self.fail("Failed to SSH into VM with new keypair: %s, %s" % (virtual_machine.name, e)) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return @attr(tags=["simulator", "basic", "advanced"]) @@ -766,7 +766,7 @@ class TestResetSSHKeypair(cloudstackTestCase): domainid=self.account.domainid ) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return @attr(tags=["simulator", "basic", "advanced"]) @@ -844,7 +844,7 @@ class TestResetSSHKeypair(cloudstackTestCase): domainid=self.account.domainid ) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return @attr(tags=["simulator", "basic", "advanced"]) @@ -920,7 +920,7 @@ class TestResetSSHKeypair(cloudstackTestCase): ) self.debug("Reset SSH key pair failed due to invalid parameters") - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return class TestResetSSHKeyUserRights(cloudstackTestCase): @@ -1030,7 +1030,7 @@ class TestResetSSHKeyUserRights(cloudstackTestCase): cls.volume.id ) # Delete the VM - No longer needed - cls.virtual_machine.delete(cls.api_client) + cls.virtual_machine.delete(cls.api_client, expunge=True) cls._cleanup = [ cls.service_offering, @@ -1184,7 +1184,7 @@ class TestResetSSHKeyUserRights(cloudstackTestCase): self.fail("Failed to SSH into VM with new keypair: %s, %s" % (virtual_machine.name, e)) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return @attr(tags=["simulator", "basic", "advanced"]) @@ -1323,7 +1323,7 @@ class TestResetSSHKeyUserRights(cloudstackTestCase): self.fail("Failed to SSH into VM with new keypair: %s, %s" % (virtual_machine.name, e)) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return @attr(tags=["simulator", "basic", "advanced"]) @@ -1462,5 +1462,5 @@ class TestResetSSHKeyUserRights(cloudstackTestCase): except Exception as e: self.fail("Failed to SSH into VM with new keypair: %s, %s" % (virtual_machine.name, e)) - virtual_machine.delete(self.apiclient) + virtual_machine.delete(self.apiclient, expunge=True) return http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_security_groups.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index 6343613..ba27693 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -1207,23 +1207,8 @@ class TestDeleteSecurityGroup(cloudstackTestCase): self.debug("Deploying VM in account: %s" % self.account.name) # Destroy the VM - self.virtual_machine.delete(self.apiclient) + self.virtual_machine.delete(self.apiclient, expunge=True) - config = Configurations.list( - self.apiclient, - name='expunge.delay' - ) - self.assertEqual( - isinstance(config, list), - True, - "Check list configurations response" - ) - response = config[0] - self.debug("expunge.delay: %s" % response.value) - # Wait for some time more than expunge.delay - time.sleep(int(response.value) * 2) - - # Deleting Security group should raise exception try: self.debug("Deleting Security Group: %s" % security_group.id) security_group.delete(self.apiclient) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_usage.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index fe80da7..4cc5183 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -214,7 +214,7 @@ class TestVmUsage(cloudstackTestCase): try: # Destroy the VM self.debug("Destroying the VM: %s" % self.virtual_machine.id) - self.virtual_machine.delete(self.apiclient) + self.virtual_machine.delete(self.apiclient, expunge=True) except Exception as e: self.fail("Failed to destroy VM: %s" % e) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42a861e5/test/integration/component/test_vm_passwdenabled.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_vm_passwdenabled.py b/test/integration/component/test_vm_passwdenabled.py index 2f68257..0a1082a 100644 --- a/test/integration/component/test_vm_passwdenabled.py +++ b/test/integration/component/test_vm_passwdenabled.py @@ -208,7 +208,7 @@ class TestVMPasswordEnabled(cloudstackTestCase): domainid=cls.account.domainid ) # Delete the VM - No longer needed - cls.virtual_machine.delete(cls.api_client) + cls.virtual_machine.delete(cls.api_client, expunge=True) cls.services["small"]["template"] = cls.pw_enabled_template.id cls.vm = VirtualMachine.create(
