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 <daan.hoogland@gmail.com>

* revert most cleanup code

* Revert "cleanup in resource housekeeping"

This reverts commit 1d140bd215b29c7a5ec4cbfb9eabf0465a8864d9.

* add extra config to VirtualMachine.create(..)

---------

Co-authored-by: Wei Zhou <weizhou@apache.org>
This commit is contained in:
dahn 2023-02-13 23:20:11 -08:00 committed by GitHub
parent 933970d9da
commit 597a8030b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 14 deletions

View File

@ -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):

View File

@ -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()):