From 597a8030b7c3235e59207041634206bead379c08 Mon Sep 17 00:00:00 2001 From: dahn Date: Mon, 13 Feb 2023 23:20:11 -0800 Subject: [PATCH] integration test fixes for 4.18 (#7190) * cleanup in resource housekeeping * cleanup in resource housekeeping * Update test/integration/smoke/test_deploy_vm_extra_config_data.py Co-authored-by: dahn * revert most cleanup code * Revert "cleanup in resource housekeeping" This reverts commit 1d140bd215b29c7a5ec4cbfb9eabf0465a8864d9. * add extra config to VirtualMachine.create(..) --------- Co-authored-by: Wei Zhou --- .../smoke/test_deploy_vm_extra_config_data.py | 18 +++++------------- tools/marvin/marvin/lib/base.py | 6 +++++- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/test/integration/smoke/test_deploy_vm_extra_config_data.py b/test/integration/smoke/test_deploy_vm_extra_config_data.py index 80b046102ca..318febb7a1e 100644 --- a/test/integration/smoke/test_deploy_vm_extra_config_data.py +++ b/test/integration/smoke/test_deploy_vm_extra_config_data.py @@ -63,34 +63,26 @@ class TestAddConfigtoDeployVM(cloudstackTestCase): cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls._cleanup = [] # Create an account, network, and IP addresses cls.account = Account.create( cls.apiclient, cls.services["account"], domainid=cls.domain.id ) + cls._cleanup.append(cls.account) cls.service_offering = ServiceOffering.create( cls.apiclient, cls.services["service_offerings"]["small"] ) - - cls.cleanup = [ - cls.account, - cls.service_offering - ] + cls._cleanup.append(cls.service_offering) cls.hosts_hugepages = cls.set_hosts_hugepages() @classmethod def tearDownClass(cls): - try: - cls.apiclient = super(TestAddConfigtoDeployVM, cls).getClsTestClient().getApiClient() - cls.reset_hosts_hugepages() - # Clean up, terminate the created templates - cleanup_resources(cls.apiclient, cls.cleanup) - - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) + cls.reset_hosts_hugepages() + super(TestAddConfigtoDeployVM, cls).tearDownClass() @classmethod def set_hosts_hugepages(cls): diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index a9f8e06cddd..9d28d5a3f2a 100755 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -522,7 +522,8 @@ class VirtualMachine: method='GET', hypervisor=None, customcpunumber=None, customcpuspeed=None, custommemory=None, rootdisksize=None, rootdiskcontroller=None, vpcid=None, macaddress=None, datadisktemplate_diskoffering_list={}, - properties=None, nicnetworklist=None, bootmode=None, boottype=None, dynamicscalingenabled=None, userdataid=None, userdatadetails=None): + properties=None, nicnetworklist=None, bootmode=None, boottype=None, dynamicscalingenabled=None, + userdataid=None, userdatadetails=None, extraconfig=None): """Create the instance""" cmd = deployVirtualMachine.deployVirtualMachineCmd() @@ -678,6 +679,9 @@ class VirtualMachine: if boottype: cmd.boottype = boottype + if extraconfig: + cmd.extraconfig = extraconfig + virtual_machine = apiclient.deployVirtualMachine(cmd, method=method) if 'password' in list(virtual_machine.__dict__.keys()):