From 87e7c57d08c9ff87aa6c2db621efc620c7318a30 Mon Sep 17 00:00:00 2001 From: Vishesh Date: Tue, 7 May 2024 03:32:36 +0530 Subject: [PATCH] Fixup e2e test_restore_vm (#9025) * Fixup e2e test_restore_vm * Fix template's size attribute * Resolve comments --- test/integration/smoke/test_restore_vm.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/integration/smoke/test_restore_vm.py b/test/integration/smoke/test_restore_vm.py index ec0383d17a8..dd33346ed9e 100644 --- a/test/integration/smoke/test_restore_vm.py +++ b/test/integration/smoke/test_restore_vm.py @@ -32,6 +32,7 @@ class TestRestoreVM(cloudstackTestCase): testClient = super(TestRestoreVM, cls).getClsTestClient() cls.apiclient = testClient.getApiClient() cls.services = testClient.getParsedTestDataConfig() + cls._cleanup = [] # Get Zone, Domain and templates cls.domain = get_domain(cls.apiclient) @@ -42,16 +43,21 @@ class TestRestoreVM(cloudstackTestCase): cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls.service_offering = ServiceOffering.create(cls.apiclient, cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) - cls.template_t1 = Template.register(cls.apiclient, cls.services["test_templates"][ + template_t1 = Template.register(cls.apiclient, cls.services["test_templates"][ cls.hypervisor.lower() if cls.hypervisor.lower() != 'simulator' else 'xenserver'], zoneid=cls.zone.id, hypervisor=cls.hypervisor.lower()) + cls._cleanup.append(template_t1) + template_t1.download(cls.apiclient) + cls.template_t1 = Template.list(cls.apiclient, templatefilter='all', id=template_t1.id)[0] - cls.template_t2 = Template.register(cls.apiclient, cls.services["test_templates"][ + template_t2 = Template.register(cls.apiclient, cls.services["test_templates"][ cls.hypervisor.lower() if cls.hypervisor.lower() != 'simulator' else 'xenserver'], zoneid=cls.zone.id, hypervisor=cls.hypervisor.lower()) - - cls._cleanup = [cls.service_offering, cls.template_t1, cls.template_t2] + cls._cleanup.append(template_t2) + template_t2.download(cls.apiclient) + cls.template_t2 = Template.list(cls.apiclient, templatefilter='all', id=template_t2.id)[0] @classmethod def tearDownClass(cls):