Add options for coe and network_driver
Change-Id: Idb47a7a6509a97101f77451f9e19049a0d007fcc
This commit is contained in:
parent
ae982f96a5
commit
b80886a9f0
|
@ -137,6 +137,14 @@ class Config(object):
|
|||
cls.copy_logs = True
|
||||
cls.copy_logs = str(CONF.magnum.copy_logs).lower() == 'true'
|
||||
|
||||
@classmethod
|
||||
def set_coe(cls, config):
|
||||
cls.coe = CONF.magnum.coe
|
||||
|
||||
@classmethod
|
||||
def set_network_driver(cls, config):
|
||||
cls.network_driver = CONF.magnum.network_driver
|
||||
|
||||
@classmethod
|
||||
def setUp(cls):
|
||||
cls.set_admin_creds(config)
|
||||
|
@ -155,3 +163,5 @@ class Config(object):
|
|||
cls.set_csr_location(config)
|
||||
cls.set_dns_nameserver(config)
|
||||
cls.set_copy_logs(config)
|
||||
cls.set_coe(config)
|
||||
cls.set_network_driver(config)
|
||||
|
|
|
@ -487,24 +487,25 @@ def cluster_template_valid_data_with_specific_coe(coe):
|
|||
image_id=config.Config.image_id, coe=coe)
|
||||
|
||||
|
||||
def valid_swarm_mode_cluster_template(is_public=False):
|
||||
def valid_cluster_template(is_public=False):
|
||||
"""Generates a valid swarm-mode cluster_template with valid data
|
||||
|
||||
:returns: ClusterTemplateEntity with generated data
|
||||
"""
|
||||
master_flavor_id = config.Config.master_flavor_id
|
||||
return cluster_template_data(image_id=config.Config.image_id,
|
||||
flavor_id=config.Config.flavor_id,
|
||||
public=is_public,
|
||||
dns_nameserver=config.Config.dns_nameserver,
|
||||
master_flavor_id=master_flavor_id,
|
||||
coe="swarm-mode",
|
||||
cluster_distro=None,
|
||||
external_network_id=config.Config.nic_id,
|
||||
http_proxy=None, https_proxy=None,
|
||||
no_proxy=None, network_driver=None,
|
||||
volume_driver=None, labels={},
|
||||
tls_disabled=False)
|
||||
return cluster_template_data(
|
||||
image_id=config.Config.image_id,
|
||||
flavor_id=config.Config.flavor_id,
|
||||
public=is_public,
|
||||
dns_nameserver=config.Config.dns_nameserver,
|
||||
master_flavor_id=master_flavor_id,
|
||||
coe=config.Config.coe,
|
||||
cluster_distro=None,
|
||||
external_network_id=config.Config.nic_id,
|
||||
http_proxy=None, https_proxy=None,
|
||||
no_proxy=None, network_driver=config.Config.network_driver,
|
||||
volume_driver=None, labels={},
|
||||
tls_disabled=False)
|
||||
|
||||
|
||||
def cluster_data(name=data_utils.rand_name('cluster'),
|
||||
|
|
|
@ -64,4 +64,11 @@ MagnumGroup = [
|
|||
cfg.BoolOpt("copy_logs",
|
||||
default=True,
|
||||
help="Specify whether to copy nova server logs on failure."),
|
||||
|
||||
cfg.StrOpt("coe",
|
||||
default="swarm-mode",
|
||||
help="Container Orchestration Engine"),
|
||||
|
||||
cfg.StrOpt("network_driver",
|
||||
help="Network Driver"),
|
||||
]
|
||||
|
|
|
@ -63,7 +63,7 @@ class ClusterTest(base.BaseTempestTest):
|
|||
creds=self.creds,
|
||||
type_of_creds='default',
|
||||
request_type='cert')
|
||||
model = datagen.valid_swarm_mode_cluster_template()
|
||||
model = datagen.valid_cluster_template()
|
||||
_, self.cluster_template = self._create_cluster_template(model)
|
||||
|
||||
# NOTE (dimtruck) by default tempest sets timeout to 20 mins.
|
||||
|
|
|
@ -79,7 +79,7 @@ class ClusterTemplateTest(base.BaseTempestTest):
|
|||
|
||||
@testtools.testcase.attr('positive')
|
||||
def test_create_get_public_cluster_template(self):
|
||||
gen_model = datagen.valid_swarm_mode_cluster_template(is_public=True)
|
||||
gen_model = datagen.valid_cluster_template(is_public=True)
|
||||
self.assertRaises(
|
||||
exceptions.Forbidden,
|
||||
self.cluster_template_client.post_cluster_template, gen_model)
|
||||
|
|
|
@ -59,7 +59,7 @@ class ClusterTemplateAdminTest(base.BaseTempestTest):
|
|||
|
||||
@testtools.testcase.attr('positive')
|
||||
def test_create_get_public_cluster_template(self):
|
||||
gen_model = datagen.valid_swarm_mode_cluster_template(is_public=True)
|
||||
gen_model = datagen.valid_cluster_template(is_public=True)
|
||||
resp, model = self._create_cluster_template(gen_model)
|
||||
|
||||
resp, model = \
|
||||
|
|
Loading…
Reference in New Issue