mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-21 16:39:08 -07:00
Overhaul ansible-test cloud test plugins. (#53044)
This commit is contained in:
parent
9c644d9bcc
commit
eeaff731de
34 changed files with 338 additions and 211 deletions
|
@ -6,6 +6,7 @@ import os
|
|||
from lib.cloud import (
|
||||
CloudProvider,
|
||||
CloudEnvironment,
|
||||
CloudEnvironmentConfig,
|
||||
)
|
||||
|
||||
from lib.util import (
|
||||
|
@ -30,7 +31,7 @@ class VcenterProvider(CloudProvider):
|
|||
"""
|
||||
:type args: TestConfig
|
||||
"""
|
||||
super(VcenterProvider, self).__init__(args, config_extension='.ini')
|
||||
super(VcenterProvider, self).__init__(args)
|
||||
|
||||
# The simulator must be pinned to a specific version to guarantee CI passes with the version used.
|
||||
if os.environ.get('ANSIBLE_VCSIM_CONTAINER'):
|
||||
|
@ -144,13 +145,19 @@ class VcenterProvider(CloudProvider):
|
|||
|
||||
class VcenterEnvironment(CloudEnvironment):
|
||||
"""VMware vcenter/esx environment plugin. Updates integration test environment after delegation."""
|
||||
def configure_environment(self, env, cmd):
|
||||
def get_environment_config(self):
|
||||
"""
|
||||
:type env: dict[str, str]
|
||||
:type cmd: list[str]
|
||||
:rtype: CloudEnvironmentConfig
|
||||
"""
|
||||
cmd.append('-e')
|
||||
cmd.append('vcsim=%s' % self._get_cloud_config('vcenter_host'))
|
||||
env_vars = dict(
|
||||
VCENTER_HOST=self._get_cloud_config('vcenter_host'),
|
||||
)
|
||||
|
||||
# Send the container IP down to the integration test(s)
|
||||
env['VCENTER_HOST'] = self._get_cloud_config('vcenter_host')
|
||||
ansible_vars = dict(
|
||||
vcsim=self._get_cloud_config('vcenter_host'),
|
||||
)
|
||||
|
||||
return CloudEnvironmentConfig(
|
||||
env_vars=env_vars,
|
||||
ansible_vars=ansible_vars,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue