rhtyd commented on a change in pull request #2793: Destroyvm also removes
volumes
URL: https://github.com/apache/cloudstack/pull/2793#discussion_r211893785
##########
File path: test/integration/smoke/test_vm_life_cycle.py
##########
@@ -786,6 +788,46 @@ def test_10_attachAndDetach_iso(self):
)
return
+ @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic",
"sg"], required_hardware="false")
+ def test_11_destroy_vm_and_volumes(self):
+ """Test destroy Virtual Machine and it's volumes
+ """
+
+ # Validate the following
+ # 1. Deploys a VM and attaches disks to it
+ # 2. Destroys the VM with DataDisks option
+
+ small_disk_offering = DiskOffering.list(self.apiclient,
name='Small')[0]
+
+ small_virtual_machine = VirtualMachine.create(
+ self.apiclient,
+ self.services["small"],
+ accountid=self.account.name,
+ domainid=self.account.domainid,
+ serviceofferingid=self.small_offering.id,
+ mode=self.services["mode"]
+ )
+ vol1 = Volume.create(
+ self.apiclient,
+ self.services,
+ account=self.account.name,
+ diskofferingid=small_disk_offering.id,
+ domainid=self.account.domainid,
+ zoneid=self.zone.id
+ )
+
+ small_virtual_machine.attach_volume(self.apiclient, vol1)
+
+ self.debug("Destroy VM - ID: %s" % small_virtual_machine.id)
+ small_virtual_machine.delete(self.apiclient, volumeIds=vol1.id)
+
+ self.assertEqual(VirtualMachine.list(self.apiclient,
id=small_virtual_machine.id), None, "List response contains records when it
should not")
+
+ self.assertEqual(Volume.list(self.apiclient, id=vol1.id), None, "List
response contains records when it should not")
+
+ return
Review comment:
Remove `return` and extra newline where it does not make sense.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services