Add clients to tempest plugins
Change-Id: I847efff138dc4c3dbae686310221e1dfd0423587
This commit is contained in:
parent
a00cd2f638
commit
89cba9b96c
|
@ -21,12 +21,22 @@ from magnum_tempest_plugin.common import config
|
||||||
class MagnumClient(rest_client.RestClient, metaclass=abc.ABCMeta):
|
class MagnumClient(rest_client.RestClient, metaclass=abc.ABCMeta):
|
||||||
"""Abstract class responsible for setting up auth provider"""
|
"""Abstract class responsible for setting up auth provider"""
|
||||||
|
|
||||||
def __init__(self, auth_provider):
|
def __init__(self, auth_provider, **kwargs):
|
||||||
|
service = kwargs.pop(
|
||||||
|
"service"
|
||||||
|
) if "service" in kwargs else 'container-infra'
|
||||||
|
region = kwargs.pop(
|
||||||
|
"region"
|
||||||
|
) if "region" in kwargs else config.Config.region
|
||||||
|
disable_validation = kwargs.pop(
|
||||||
|
"disable_ssl_certificate_validation"
|
||||||
|
) if "disable_ssl_certificate_validation" in kwargs else True
|
||||||
super(MagnumClient, self).__init__(
|
super(MagnumClient, self).__init__(
|
||||||
auth_provider=auth_provider,
|
auth_provider=auth_provider,
|
||||||
service='container-infra',
|
service=service,
|
||||||
region=config.Config.region,
|
region=region,
|
||||||
disable_ssl_certificate_validation=True
|
disable_ssl_certificate_validation=disable_validation,
|
||||||
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -14,18 +14,30 @@ from oslo_config import cfg
|
||||||
from tempest import config # noqa
|
from tempest import config # noqa
|
||||||
|
|
||||||
|
|
||||||
service_available_group = cfg.OptGroup(name="service_available",
|
magnum_scope_enforcement = cfg.BoolOpt('magnum',
|
||||||
title="Available OpenStack Services")
|
default=False,
|
||||||
|
help="Does the Magnum service API "
|
||||||
|
"policies enforce scope? "
|
||||||
|
"This configuration value should "
|
||||||
|
"be same as magnum.conf: "
|
||||||
|
"[oslo_policy].enforce_scope "
|
||||||
|
"option.")
|
||||||
|
|
||||||
ServiceAvailableGroup = [
|
service_option = cfg.BoolOpt(
|
||||||
cfg.BoolOpt("magnum",
|
"magnum", default=True,
|
||||||
default=True,
|
help="Whether or not magnum is expected to be available")
|
||||||
help="Whether or not magnum is expected to be available"),
|
|
||||||
]
|
|
||||||
|
|
||||||
magnum_group = cfg.OptGroup(name="magnum", title="Magnum Options")
|
magnum_group = cfg.OptGroup(name="magnum", title="Magnum Options")
|
||||||
|
|
||||||
MagnumGroup = [
|
MagnumGroup = [
|
||||||
|
cfg.StrOpt("catalog_type",
|
||||||
|
default="container-infra",
|
||||||
|
help="Catalog type of the coe service."),
|
||||||
|
cfg.StrOpt('endpoint_type',
|
||||||
|
default='publicURL',
|
||||||
|
choices=['public', 'admin', 'internal',
|
||||||
|
'publicURL', 'adminURL', 'internalURL'],
|
||||||
|
help="The endpoint type to use for the coe service."),
|
||||||
cfg.StrOpt("docker_storage_driver",
|
cfg.StrOpt("docker_storage_driver",
|
||||||
help="Docker storage driver. Supported: devicemapper, overlay"),
|
help="Docker storage driver. Supported: devicemapper, overlay"),
|
||||||
cfg.StrOpt("image_id",
|
cfg.StrOpt("image_id",
|
||||||
|
|
|
@ -28,14 +28,30 @@ class MagnumTempestPlugin(plugins.TempestPlugin):
|
||||||
return full_test_dir, base_path
|
return full_test_dir, base_path
|
||||||
|
|
||||||
def register_opts(self, conf):
|
def register_opts(self, conf):
|
||||||
config.register_opt_group(
|
conf.register_opt(magnum_config.service_option,
|
||||||
conf, magnum_config.service_available_group,
|
group='service_available')
|
||||||
magnum_config.ServiceAvailableGroup)
|
conf.register_opt(magnum_config.magnum_scope_enforcement,
|
||||||
config.register_opt_group(conf, magnum_config.magnum_group,
|
group='enforce_scope')
|
||||||
magnum_config.MagnumGroup)
|
conf.register_group(magnum_config.magnum_group)
|
||||||
|
conf.register_opts(magnum_config.MagnumGroup, group='magnum')
|
||||||
|
|
||||||
def get_opt_lists(self):
|
def get_opt_lists(self):
|
||||||
return [
|
return [
|
||||||
(magnum_config.magnum_group.name, magnum_config.MagnumGroup),
|
(magnum_config.magnum_group.name, magnum_config.MagnumGroup),
|
||||||
('service_available', magnum_config.ServiceAvailableGroup)
|
('service_available', [magnum_config.service_option]),
|
||||||
|
('enforce_scope', [magnum_config.magnum_scope_enforcement])
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def get_service_clients(self):
|
||||||
|
magnum_config = config.service_client_config('magnum')
|
||||||
|
v1_params = {
|
||||||
|
'name': 'magnum_v1',
|
||||||
|
'service_version': 'magnum.v1',
|
||||||
|
'module_path': 'magnum_tempest_plugin.tests.api.v1.clients',
|
||||||
|
'client_names': [
|
||||||
|
'CertClient', 'ClusterTemplateClient',
|
||||||
|
'ClusterClient', 'MagnumServiceClient'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
v1_params.update(magnum_config)
|
||||||
|
return [v1_params]
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
from magnum_tempest_plugin.tests.api.v1.clients.cert_client \
|
||||||
|
import CertClient
|
||||||
|
from magnum_tempest_plugin.tests.api.v1.clients.cluster_client \
|
||||||
|
import ClusterClient
|
||||||
|
from magnum_tempest_plugin.tests.api.v1.clients.cluster_template_client \
|
||||||
|
import ClusterTemplateClient
|
||||||
|
from magnum_tempest_plugin.tests.api.v1.clients.magnum_service_client \
|
||||||
|
import MagnumServiceClient
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
'CertClient',
|
||||||
|
'ClusterClient',
|
||||||
|
'ClusterTemplateClient',
|
||||||
|
'MagnumServiceClient'
|
||||||
|
]
|
Loading…
Reference in New Issue