DaanHoogland commented on code in PR #8096:
URL: https://github.com/apache/cloudstack/pull/8096#discussion_r1360650087
##########
test/integration/smoke/test_templates.py:
##########
@@ -1337,8 +1330,19 @@ def test_03_deploy_vm_wrong_checksum(self):
serviceofferingid=self.service_offering.id
)
self.cleanup.append(virtual_machine)
- self.fail("Expected to fail deployment")
+ failed = True
except Exception as e:
self.debug("Expected exception")
+ list_virtual_machine_response = VirtualMachine.list(
+ self.apiclient,
+ templateid=tmpl.id,
+ listall=True
+ )
+ if type(list_virtual_machine_response) == list and
len(list_virtual_machine_response) > 0:
+ for virtual_machine_response in list_virtual_machine_response:
+ VirtualMachine.delete(virtual_machine_response,
self.apiclient, expunge=True)
Review Comment:
So if we succeed we added `virtual_machine` to `self.cleanup`.
If we fail we get here and are now deleting it by `template_id`.
it feels flacky but should work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]