|
|
@ -17,14 +17,14 @@ from lib.util import (
|
|
|
|
load_plugins,
|
|
|
|
load_plugins,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
from lib.test import (
|
|
|
|
|
|
|
|
TestConfig,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from lib.target import (
|
|
|
|
from lib.target import (
|
|
|
|
TestTarget,
|
|
|
|
TestTarget,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from lib.config import (
|
|
|
|
|
|
|
|
IntegrationConfig,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
PROVIDERS = {}
|
|
|
|
PROVIDERS = {}
|
|
|
|
ENVIRONMENTS = {}
|
|
|
|
ENVIRONMENTS = {}
|
|
|
|
|
|
|
|
|
|
|
@ -39,10 +39,13 @@ def initialize_cloud_plugins():
|
|
|
|
|
|
|
|
|
|
|
|
def get_cloud_platforms(args, targets=None):
|
|
|
|
def get_cloud_platforms(args, targets=None):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:type args: TestConfig
|
|
|
|
:type args: IntegrationConfig
|
|
|
|
:type targets: tuple[IntegrationTarget] | None
|
|
|
|
:type targets: tuple[IntegrationTarget] | None
|
|
|
|
:rtype: list[str]
|
|
|
|
:rtype: list[str]
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
if args.list_targets:
|
|
|
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
|
|
if targets is None:
|
|
|
|
if targets is None:
|
|
|
|
cloud_platforms = set(args.metadata.cloud_config or [])
|
|
|
|
cloud_platforms = set(args.metadata.cloud_config or [])
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -76,7 +79,7 @@ def get_cloud_platform(target):
|
|
|
|
|
|
|
|
|
|
|
|
def get_cloud_providers(args, targets=None):
|
|
|
|
def get_cloud_providers(args, targets=None):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:type args: TestConfig
|
|
|
|
:type args: IntegrationConfig
|
|
|
|
:type targets: tuple[IntegrationTarget] | None
|
|
|
|
:type targets: tuple[IntegrationTarget] | None
|
|
|
|
:rtype: list[CloudProvider]
|
|
|
|
:rtype: list[CloudProvider]
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -85,7 +88,7 @@ def get_cloud_providers(args, targets=None):
|
|
|
|
|
|
|
|
|
|
|
|
def get_cloud_environment(args, target):
|
|
|
|
def get_cloud_environment(args, target):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:type args: TestConfig
|
|
|
|
:type args: IntegrationConfig
|
|
|
|
:type target: IntegrationTarget
|
|
|
|
:type target: IntegrationTarget
|
|
|
|
:rtype: CloudEnvironment
|
|
|
|
:rtype: CloudEnvironment
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -99,7 +102,7 @@ def get_cloud_environment(args, target):
|
|
|
|
|
|
|
|
|
|
|
|
def cloud_filter(args, targets):
|
|
|
|
def cloud_filter(args, targets):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:type args: TestConfig
|
|
|
|
:type args: IntegrationConfig
|
|
|
|
:type targets: tuple[IntegrationTarget]
|
|
|
|
:type targets: tuple[IntegrationTarget]
|
|
|
|
:return: list[str]
|
|
|
|
:return: list[str]
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -116,7 +119,7 @@ def cloud_filter(args, targets):
|
|
|
|
|
|
|
|
|
|
|
|
def cloud_init(args, targets):
|
|
|
|
def cloud_init(args, targets):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:type args: TestConfig
|
|
|
|
:type args: IntegrationConfig
|
|
|
|
:type targets: tuple[IntegrationTarget]
|
|
|
|
:type targets: tuple[IntegrationTarget]
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if args.metadata.cloud_config is not None:
|
|
|
|
if args.metadata.cloud_config is not None:
|
|
|
@ -139,7 +142,7 @@ class CloudBase(object):
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, args):
|
|
|
|
def __init__(self, args):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:type args: TestConfig
|
|
|
|
:type args: IntegrationConfig
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
self.args = args
|
|
|
|
self.args = args
|
|
|
|
self.platform = self.__module__.split('.')[2]
|
|
|
|
self.platform = self.__module__.split('.')[2]
|
|
|
@ -209,7 +212,7 @@ class CloudProvider(CloudBase):
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, args, config_extension='.yml'):
|
|
|
|
def __init__(self, args, config_extension='.yml'):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:type args: TestConfig
|
|
|
|
:type args: IntegrationConfig
|
|
|
|
:type config_extension: str
|
|
|
|
:type config_extension: str
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
super(CloudProvider, self).__init__(args)
|
|
|
|
super(CloudProvider, self).__init__(args)
|
|
|
|