Merge "Adding k8s-ha-contrail template"
diff --git a/tcp_tests/fixtures/ceph_fixtures.py b/tcp_tests/fixtures/ceph_fixtures.py
new file mode 100644
index 0000000..c294542
--- /dev/null
+++ b/tcp_tests/fixtures/ceph_fixtures.py
@@ -0,0 +1,84 @@
+# Copyright 2017 Mirantis, Inc.
+#
+# 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.
+
+import pytest
+
+from tcp_tests import logger
+from tcp_tests.helpers import ext
+from tcp_tests.managers import ceph_manager
+
+LOG = logger.logger
+
+
+@pytest.fixture(scope='function')
+def ceph_actions(config, hardware, underlay, salt_deployed):
+ """Fixture that provides various actions for OpenStack
+
+ :param config: fixture provides oslo.config
+ :param config: fixture provides oslo.config
+ :param underlay: fixture provides underlay manager
+ :param salt_deployed: fixture provides salt manager
+ :rtype: CephManager
+
+ For use in tests or fixtures to deploy a custom OpenStack
+ """
+ return ceph_manager.CephManager(config, underlay, hardware, salt_deployed)
+
+
+@pytest.mark.revert_snapshot(ext.SNAPSHOT.ceph_deployed)
+@pytest.fixture(scope='function')
+def ceph_deployed(revert_snapshot, request, config,
+ hardware, underlay, common_services_deployed,
+ ceph_actions):
+ """Fixture to get or install Ceph services on environment
+
+ :param revert_snapshot: fixture that reverts snapshot that is specified
+ in test with @pytest.mark.revert_snapshot(<name>)
+ :param request: fixture provides pytest data
+ :param config: fixture provides oslo.config
+ :param hardware: fixture provides enviromnet manager
+ :param underlay: fixture provides underlay manager
+ :param common_services_deployed: fixture provides CommonServicesManager
+ :param ceph_actions: fixture provides CephManager instance
+ :rtype: CephManager
+
+ If config.ceph.ceph_installed is not set, this fixture assumes
+ that the ceph services were not installed, and do the following:
+ - install ceph services
+ - make snapshot with name 'ceph_deployed'
+ - return CephManager instance
+
+ If config.ceph.ceph_installed was set, this fixture assumes that
+ the ceph services were already installed, and do the following:
+ - return CephManager instance
+
+ If you want to revert 'ceph_deployed' snapshot, please use mark:
+ @pytest.mark.revert_snapshot("ceph_deployed")
+ """
+ # Deploy Ceph cluster
+ if not config.ceph.ceph_installed:
+ steps_path = config.ceph_deploy.ceph_steps_path
+ commands = underlay.read_template(steps_path)
+ ceph_actions.install(commands)
+ hardware.create_snapshot(ext.SNAPSHOT.ceph_deployed)
+
+ else:
+ # 1. hardware environment created and powered on
+ # 2. config.underlay.ssh contains SSH access to provisioned nodes
+ # (can be passed from external config with TESTS_CONFIGS variable)
+ # 3. config.tcp.* options contain access credentials to the already
+ # installed TCP API endpoint
+ pass
+
+ return ceph_actions
diff --git a/tcp_tests/helpers/env_config.py b/tcp_tests/helpers/env_config.py
index 81e6764..5dbc87d 100644
--- a/tcp_tests/helpers/env_config.py
+++ b/tcp_tests/helpers/env_config.py
@@ -322,7 +322,7 @@
"from template aborted.")
-def yaml_template_load(config_file, options=None):
+def yaml_template_load(config_file, options=None, log_env_vars=True):
"""Temporary moved from fuel_devops to use jinja2"""
dirname = os.path.dirname(config_file)
@@ -376,5 +376,5 @@
TemplateLoader.add_constructor(
yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, construct_mapping)
- f = utils.render_template(config_file, options)
+ f = utils.render_template(config_file, options, log_env_vars=log_env_vars)
return yaml.load(f, TemplateLoader)
diff --git a/tcp_tests/helpers/ext.py b/tcp_tests/helpers/ext.py
index 99baaff..804d110 100644
--- a/tcp_tests/helpers/ext.py
+++ b/tcp_tests/helpers/ext.py
@@ -51,6 +51,7 @@
'virtlet_ceph_deployed',
'k8s_deployed',
'decapod_deployed',
+ 'ceph_deployed',
)
diff --git a/tcp_tests/helpers/utils.py b/tcp_tests/helpers/utils.py
index e24c18b..8cfa67a 100644
--- a/tcp_tests/helpers/utils.py
+++ b/tcp_tests/helpers/utils.py
@@ -332,7 +332,7 @@
self.write_content()
-def render_template(file_path, options=None):
+def render_template(file_path, options=None, log_env_vars=True):
required_env_vars = set()
optional_env_vars = dict()
@@ -362,11 +362,11 @@
followlinks=True))
template = environment.get_template(filename).render(options)
- if required_env_vars:
+ if required_env_vars and log_env_vars:
LOG.info("Required environment variables:")
for var in required_env_vars:
LOG.info(" {0}".format(var))
- if optional_env_vars:
+ if optional_env_vars and log_env_vars:
LOG.info("Optional environment variables:")
for var, default in sorted(optional_env_vars.iteritems()):
LOG.info(" {0} , value = {1}".format(var, default))
diff --git a/tcp_tests/managers/ceph_manager.py b/tcp_tests/managers/ceph_manager.py
new file mode 100644
index 0000000..bd68496
--- /dev/null
+++ b/tcp_tests/managers/ceph_manager.py
@@ -0,0 +1,39 @@
+# Copyright 2017 Mirantis, Inc.
+#
+# 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 tcp_tests.managers.execute_commands import ExecuteCommandsMixin
+from tcp_tests import logger
+
+LOG = logger.logger
+
+
+class CephManager(ExecuteCommandsMixin):
+ """docstring for CephManager"""
+
+ __config = None
+ __underlay = None
+ __hardware = None
+
+ def __init__(self, config, underlay, hardware, salt):
+ self.__config = config
+ self.__underlay = underlay
+ self.__hardware = hardware
+ self._salt = salt
+ super(CephManager, self).__init__(
+ config=config, underlay=underlay)
+
+ def install(self, commands):
+ self.execute_commands(commands,
+ label='Install Ceph')
+ self.__config.ceph.ceph_installed = True
diff --git a/tcp_tests/managers/openstack_manager.py b/tcp_tests/managers/openstack_manager.py
index 24971b8..89559b1 100644
--- a/tcp_tests/managers/openstack_manager.py
+++ b/tcp_tests/managers/openstack_manager.py
@@ -46,9 +46,8 @@
conf_name='lvm_mcp.conf',
registry=None):
if not registry:
- registry = ('{}/mirantis'
- '/oscore/rally-tempest'
- ':latest'.format(settings.DOCKER_REGISTRY))
+ registry = ('{0}/{1}'.format(settings.DOCKER_REGISTRY,
+ settings.DOCKER_NAME))
target_name = [node_name for node_name
in self.__underlay.node_names() if target in node_name]
diff --git a/tcp_tests/requirements.txt b/tcp_tests/requirements.txt
index a4149a8..8c30994 100644
--- a/tcp_tests/requirements.txt
+++ b/tcp_tests/requirements.txt
@@ -18,3 +18,4 @@
salt-pepper
setuptools<=36.2.0
netaddr
+mock>=1.2
diff --git a/tcp_tests/settings.py b/tcp_tests/settings.py
index 70b66d9..a1b296a 100644
--- a/tcp_tests/settings.py
+++ b/tcp_tests/settings.py
@@ -53,6 +53,8 @@
DOCKER_REGISTRY = os.environ.get('DOCKER_REGISTRY',
'docker-prod-virtual.docker.mirantis.net')
+DOCKER_NAME = os.environ.get('DOCKER_NAME',
+ 'mirantis/oscore/rally-tempest:latest')
PATTERN = os.environ.get('PATTERN', None)
RUN_TEMPEST = get_var_as_bool('RUN_TEMPEST', False)
diff --git a/tcp_tests/settings_oslo.py b/tcp_tests/settings_oslo.py
index 39e5e6b..293e1cc 100644
--- a/tcp_tests/settings_oslo.py
+++ b/tcp_tests/settings_oslo.py
@@ -235,41 +235,12 @@
ceph_deploy_opts = [
ct.Cfg('ceph_steps_path', ct.String(),
help="Path to YAML with steps to deploy sl",
- default=_default_sl_prepare_tests_steps_path),
- ct.Cfg('docker_image_alertmanager', ct.String(),
- default='{}/openstack-docker/alertmanager:latest'.format(
- settings.DOCKER_REGISTRY)),
- ct.Cfg('docker_image_pushgateway', ct.String(),
- default='{}/openstack-docker/pushgateway:latest'.format(
- settings.DOCKER_REGISTRY)),
- ct.Cfg('docker_image_prometheus', ct.String(),
- default='{}/openstack-docker/prometheus:latest'.format(
- settings.DOCKER_REGISTRY)),
- ct.Cfg('docker_image_remote_agent', ct.String(),
- default='{}/openstack-docker/telegraf:latest'.format(
- settings.DOCKER_REGISTRY)),
- ct.Cfg('docker_image_remote_storage_adapter', ct.String(),
- default='{}/openstack-docker/remote_storage_adapter:latest'.format(
- settings.DOCKER_REGISTRY)),
- # SalesForce connection options for pushkin
- ct.Cfg('sfdc_sandbox_enabled', ct.String(), default='False'),
- ct.Cfg('sfdc_auth_url', ct.String(), default=''),
- ct.Cfg('sfdc_username', ct.String(), default=''),
- ct.Cfg('sfdc_password', ct.String(), default=''),
- ct.Cfg('sfdc_consumer_key', ct.String(), default=''),
- ct.Cfg('sfdc_consumer_secret', ct.String(), default=''),
- ct.Cfg('sfdc_organization_id', ct.String(), default=''),
+ default=_default_ceph_prepare_tests_steps_path),
]
ceph_opts = [
- ct.Cfg('sl_installed', ct.Boolean(),
+ ct.Cfg('ceph_installed', ct.Boolean(),
help="", default=False),
- ct.Cfg('sl_vip_host', ct.IPAddress(),
- help="Vip address for SL services", default='0.0.0.0'),
- ct.Cfg('sl_prometheus_port', ct.String(),
- help="Prometheus port", default='15010'),
- ct.Cfg('sl_prometheus_proto', ct.String(),
- help="Proemtheus protocol", default='http'),
]
k8s_deploy_opts = [
@@ -348,6 +319,8 @@
('opencontrail', opencontrail_opts),
('stack_light', sl_opts),
('sl_deploy', sl_deploy_opts),
+ ('ceph', ceph_opts),
+ ('ceph_deploy', ceph_deploy_opts),
('k8s_deploy', k8s_deploy_opts),
('k8s', k8s_opts),
]
@@ -429,6 +402,16 @@
config.register_group(cfg.OptGroup(name='k8s',
title="K8s config and credentials"))
config.register_opts(group='k8s', opts=k8s_opts)
+ config.register_group(cfg.OptGroup(name='ceph',
+ title="ceph config", help=""))
+ config.register_opts(group='ceph', opts=ceph_opts)
+
+ config.register_group(
+ cfg.OptGroup(name='ceph_deploy',
+ title="Ceph deploy config ",
+ help=""))
+ config.register_opts(group='ceph_deploy', opts=ceph_deploy_opts)
+
return config
diff --git a/tcp_tests/templates/cookied-mcp-ocata-dop-sl2/sl.yaml b/tcp_tests/templates/cookied-mcp-ocata-dop-sl2/sl.yaml
index 4c5b470..1a6a7e3 100644
--- a/tcp_tests/templates/cookied-mcp-ocata-dop-sl2/sl.yaml
+++ b/tcp_tests/templates/cookied-mcp-ocata-dop-sl2/sl.yaml
@@ -1,4 +1,5 @@
{% from 'cookied-mcp-ocata-dop-sl2/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'cookied-mcp-ocata-dop-sl2/salt.yaml' import ENVIRONMENT_MODEL_INVENTORY_NAME with context %}
# Install docker swarm
- description: Install keepalived on mon nodes
@@ -145,12 +146,13 @@
# Change environment configuration before deploy
- description: Set SL docker images deploy parameters
cmd: |
- touch /srv/salt/reclass/classes/cluster/overrides.yml;
- {% for sl_opt, value in config.sl_deploy.items() %}
- {% if value|string() %}
- salt-call reclass.cluster_meta_set {{ sl_opt }} {{ value }};
- {% endif %}
- {% endfor %}
+ {#- For cookiecutter-generated model, use overrides.yml from environment model instead of cluster model #}
+ {%- set OVERRIDES_FILENAME='/srv/salt/reclass/classes/environment/' + ENVIRONMENT_MODEL_INVENTORY_NAME + '/overrides.yml' %}
+ {%- for sl_opt, value in config.sl_deploy.items() %}
+ {%- if value|string() %}
+ salt-call reclass.cluster_meta_set name={{ sl_opt }} value={{ value }} file_name={{ OVERRIDES_FILENAME }};
+ {%- endif %}
+ {%- endfor %}
salt '*' saltutil.refresh_pillar;
sleep 10
node_name: {{ HOSTNAME_CFG01 }}
diff --git a/tcp_tests/templates/mcp-ocata-local-repo-dvr/openstack.yaml b/tcp_tests/templates/mcp-ocata-local-repo-dvr/openstack.yaml
index 88588b5..72fda30 100644
--- a/tcp_tests/templates/mcp-ocata-local-repo-dvr/openstack.yaml
+++ b/tcp_tests/templates/mcp-ocata-local-repo-dvr/openstack.yaml
@@ -77,7 +77,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -165,7 +165,7 @@
- description: Check heat service
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 5, delay: 10}
skip_fail: false
diff --git a/tcp_tests/templates/mk24_lab_ovs_dvr_vlan_bm/openstack.yaml b/tcp_tests/templates/mk24_lab_ovs_dvr_vlan_bm/openstack.yaml
index e791352..4d0ce7b 100644
--- a/tcp_tests/templates/mk24_lab_ovs_dvr_vlan_bm/openstack.yaml
+++ b/tcp_tests/templates/mk24_lab_ovs_dvr_vlan_bm/openstack.yaml
@@ -51,7 +51,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
diff --git a/tcp_tests/templates/physical_mcp11_dvr/openstack.yaml b/tcp_tests/templates/physical_mcp11_dvr/openstack.yaml
index 5e18b49..ef6273e 100644
--- a/tcp_tests/templates/physical_mcp11_dvr/openstack.yaml
+++ b/tcp_tests/templates/physical_mcp11_dvr/openstack.yaml
@@ -51,7 +51,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
diff --git a/tcp_tests/templates/physical_mcp11_ovs_dpdk/openstack.yaml b/tcp_tests/templates/physical_mcp11_ovs_dpdk/openstack.yaml
index 913361b..745df96 100644
--- a/tcp_tests/templates/physical_mcp11_ovs_dpdk/openstack.yaml
+++ b/tcp_tests/templates/physical_mcp11_ovs_dpdk/openstack.yaml
@@ -51,7 +51,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp-ocata-cicd/openstack.yaml b/tcp_tests/templates/virtual-mcp-ocata-cicd/openstack.yaml
index 4e7e234..48ee922 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-cicd/openstack.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-cicd/openstack.yaml
@@ -56,7 +56,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -145,7 +145,7 @@
- description: Check heat service
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 5, delay: 10}
skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp-ocata-dvr/openstack.yaml b/tcp_tests/templates/virtual-mcp-ocata-dvr/openstack.yaml
index 21d5afe..dfe1c1c 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-dvr/openstack.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-dvr/openstack.yaml
@@ -79,7 +79,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -167,7 +167,7 @@
- description: Check heat service
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 5, delay: 10}
skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp-ocata-dvr/underlay.yaml b/tcp_tests/templates/virtual-mcp-ocata-dvr/underlay.yaml
index 4e6b814..6a10480 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-dvr/underlay.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-dvr/underlay.yaml
@@ -24,6 +24,8 @@
{% set HOSTNAME_MON02 = os_env('HOSTNAME_MON02', 'mon02.' + DOMAIN_NAME) %}
{% set HOSTNAME_MON03 = os_env('HOSTNAME_MON03', 'mon03.' + DOMAIN_NAME) %}
{% set HOSTNAME_GTW01 = os_env('HOSTNAME_GTW01', 'gtw01.' + DOMAIN_NAME) %}
+{% set HOSTNAME_DNS01 = os_env('HOSTNAME_DNS01', 'dns01.' + DOMAIN_NAME) %}
+{% set HOSTNAME_DNS02 = os_env('HOSTNAME_DNS02', 'dns02.' + DOMAIN_NAME) %}
{% set HOSTNAME_PRX01 = os_env('HOSTNAME_PRX01', 'prx01.' + DOMAIN_NAME) %}
template:
@@ -47,6 +49,8 @@
default_{{ HOSTNAME_MON02 }}: +108
default_{{ HOSTNAME_MON03 }}: +109
default_{{ HOSTNAME_GTW01 }}: +110
+ default_{{ HOSTNAME_DNS01 }}: +111
+ default_{{ HOSTNAME_DNS02 }}: +112
default_{{ HOSTNAME_PRX01 }}: +121
ip_ranges:
dhcp: [+90, -10]
@@ -67,6 +71,8 @@
default_{{ HOSTNAME_MON02 }}: +108
default_{{ HOSTNAME_MON03 }}: +109
default_{{ HOSTNAME_GTW01 }}: +110
+ default_{{ HOSTNAME_DNS01 }}: +111
+ default_{{ HOSTNAME_DNS02 }}: +112
default_{{ HOSTNAME_PRX01 }}: +121
ip_ranges:
dhcp: [+90, -10]
@@ -87,6 +93,8 @@
default_{{ HOSTNAME_MON02 }}: +108
default_{{ HOSTNAME_MON03 }}: +109
default_{{ HOSTNAME_GTW01 }}: +110
+ default_{{ HOSTNAME_DNS01 }}: +111
+ default_{{ HOSTNAME_DNS02 }}: +112
default_{{ HOSTNAME_PRX01 }}: +121
ip_ranges:
dhcp: [+10, -10]
@@ -107,6 +115,8 @@
default_{{ HOSTNAME_MON02 }}: +108
default_{{ HOSTNAME_MON03 }}: +109
default_{{ HOSTNAME_GTW01 }}: +110
+ default_{{ HOSTNAME_DNS01 }}: +111
+ default_{{ HOSTNAME_DNS02 }}: +112
default_{{ HOSTNAME_PRX01 }}: +121
ip_ranges:
dhcp: [+10, -10]
@@ -507,3 +517,55 @@
interfaces: *all_interfaces
network_config: *all_network_config
+
+ - name: {{ HOSTNAME_DNS01 }}
+ role: salt_minion
+ params:
+ vcpu: !os_env SLAVE_NODE_CPU, 1
+ memory: !os_env SLAVE_NODE_MEMORY, 2048
+ boot:
+ - hd
+ cloud_init_volume_name: iso
+ cloud_init_iface_up: ens3
+ volumes:
+ - name: system
+ capacity: !os_env NODE_VOLUME_SIZE, 150
+ backing_store: cloudimage1604
+ format: qcow2
+ - name: iso # Volume with name 'iso' will be used
+ # for store image with cloud-init metadata.
+ capacity: 1
+ format: raw
+ device: cdrom
+ bus: ide
+ cloudinit_meta_data: *cloudinit_meta_data
+ cloudinit_user_data: *cloudinit_user_data_1604
+
+ interfaces: *all_interfaces
+ network_config: *all_network_config
+
+ - name: {{ HOSTNAME_DNS02 }}
+ role: salt_minion
+ params:
+ vcpu: !os_env SLAVE_NODE_CPU, 1
+ memory: !os_env SLAVE_NODE_MEMORY, 2048
+ boot:
+ - hd
+ cloud_init_volume_name: iso
+ cloud_init_iface_up: ens3
+ volumes:
+ - name: system
+ capacity: !os_env NODE_VOLUME_SIZE, 150
+ backing_store: cloudimage1604
+ format: qcow2
+ - name: iso # Volume with name 'iso' will be used
+ # for store image with cloud-init metadata.
+ capacity: 1
+ format: raw
+ device: cdrom
+ bus: ide
+ cloudinit_meta_data: *cloudinit_meta_data
+ cloudinit_user_data: *cloudinit_user_data_1604
+
+ interfaces: *all_interfaces
+ network_config: *all_network_config
diff --git a/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/ceph.yaml b/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/ceph.yaml
index 723515d..eb0a042 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/ceph.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/ceph.yaml
@@ -17,14 +17,14 @@
- description: Sync grains on ceph mon nodes
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@ceph:mon' state.sls saltutil.sync_grains
+ -C 'I@ceph:mon' saltutil.sync_grains
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 10}
skip_fail: false
- description: Update mine on ceph mons
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' state.sls mine.update
+ -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' mine.update
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 10}
skip_fail: false
@@ -36,9 +36,9 @@
retry: {count: 1, delay: 5}
skip_fail: false
-- description: Install ceph mgr if defined
+- description: Install ceph mgr if defined(needed only for Luminious)
cmd: |
- if salt -C 'I@ceph:mgr' match.pillar 'ceph:mgt' ; then
+ if salt -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then
salt -C 'I@ceph:mgr' state.sls ceph.mgr
fi
node_name: {{ HOSTNAME_CFG01 }}
@@ -54,7 +54,7 @@
- description: Sync grains
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@ceph:osd' state.sls saltutil.sync_grains
+ -C 'I@ceph:osd' saltutil.sync_grains
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -64,18 +64,18 @@
-C 'I@ceph:osd' state.sls ceph.osd.custom
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
- skip_fail: false
+ skip_fail: true
- description: Sync grains
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@ceph:osd' state.sls saltutil.sync_grains
+ -C 'I@ceph:osd' saltutil.sync_grains
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
- description: Update mine on ceph osd
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@ceph:osd' state.sls mine.update
+ -C 'I@ceph:osd' mine.update
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 10}
skip_fail: false
@@ -97,7 +97,7 @@
- description: Install radosgw if exists
cmd: |
if salt -C 'I@ceph:radosgw' match.pillar 'ceph:radosgw' ; then
- salt -C 'I@ceph:radosgw' state.sls saltutil.sync_grains;
+ salt -C 'I@ceph:radosgw' saltutil.sync_grains;
salt -C 'I@ceph:radosgw' state.sls ceph.radosgw;
salt -C 'I@keystone:client' state.sls keystone.client;
fi
@@ -112,32 +112,22 @@
retry: {count: 1, delay: 10}
skip_fail: false
-- description: Connect ceph to glance if glance is using it
+- description: Connect ceph to glance
cmd: |
- if salt -C 'I@ceph:common and I@glance:server' match.pillar 'ceph:common and glance:server' ; then
- salt -C 'I@ceph:common and I@glance:server' state.sls ceph.common,ceph.setup.keyring,glance;
- salt -C 'I@ceph:common and I@glance:server' service.restart glance-api,glance-glare,glance-registry
- fi
+ salt -C 'I@ceph:common and I@glance:server' state.sls ceph.common,ceph.setup.keyring,glance;
+ salt -C 'I@ceph:common and I@glance:server' service.restart glance-api;
+ salt -C 'I@ceph:common and I@glance:server' service.restart glance-glare;
+ salt -C 'I@ceph:common and I@glance:server' service.restart glance-registry;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 2, delay: 5}
skip_fail: false
-- description: Connect ceph to cinder if cinder is using it
+- description: Connect ceph to cinder and nova
cmd: |
- if salt -C 'I@ceph:common and I@cinder:controller' match.pillar 'ceph:common and cinder:controller' ; then
- salt -C 'I@ceph:common and I@cinder:controller' state.sls ceph.common,ceph.setup.keyring,cinder
- fi
- node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 2, delay: 5}
- skip_fail: false
-
-- description: Connect ceph to nova
- cmd: |
- if salt -C 'I@ceph:common and I@nova:compute' match.pillar 'ceph:common and nova:compute' ; then
- salt -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
- salt -C 'I@ceph:common and I@nova:compute' state.sls saltutil.sync_grains;
- salt -C 'I@ceph:common and I@nova:compute' state.sls nova
- fi
+ salt -C 'I@ceph:common and I@cinder:controller' state.sls ceph.common,ceph.setup.keyring,cinder;
+ salt -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
+ salt -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains;
+ salt -C 'I@ceph:common and I@nova:compute' state.sls nova;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 2, delay: 5}
skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/openstack.yaml b/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/openstack.yaml
index 678103c..4dd76c5 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/openstack.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/openstack.yaml
@@ -57,14 +57,14 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
- description: Check glance image-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; glance image-list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -79,7 +79,7 @@
- description: Check nova service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; nova --debug service-list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 3, delay: 5}
skip_fail: false
@@ -89,12 +89,12 @@
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@cinder:controller' state.sls cinder -b 1
node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 5}
+ retry: {count: 2, delay: 5}
skip_fail: false
- description: Check cinder list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; cinder list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -116,7 +116,7 @@
- description: Check neutron agent-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -131,7 +131,7 @@
- description: Check heat service
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 5, delay: 10}
skip_fail: false
@@ -260,79 +260,6 @@
retry: {count: 1, delay: 30}
skip_fail: false
-# Configure cinder-volume salt-call
-- description: Set disks 01
- cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
- node_name: {{ HOSTNAME_CTL01 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Set disks 02
- cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
- node_name: {{ HOSTNAME_CTL02 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Set disks 03
- cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
- node_name: {{ HOSTNAME_CTL03 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Create partitions 01
- cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
- node_name: {{ HOSTNAME_CTL01 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Create partitions 02
- cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
- node_name: {{ HOSTNAME_CTL02 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Create partitions 03
- cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
- node_name: {{ HOSTNAME_CTL03 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: create volume_group
- cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
- node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Install cinder-volume
- cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
- node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Install crudini
- cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
- node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Temporary WR set enabled backends value 01
- cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
- node_name: {{ HOSTNAME_CTL01 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Temporary WR set enabled backends value 02
- cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
- node_name: {{ HOSTNAME_CTL02 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
-- description: Temporary WR set enabled backends value 03
- cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
- node_name: {{ HOSTNAME_CTL03 }}
- retry: {count: 1, delay: 30}
- skip_fail: false
-
- description: Install docker.io on gtw
cmd: salt-call cmd.run 'apt-get install docker.io -y'
node_name: {{ HOSTNAME_GTW01 }}
diff --git a/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/underlay.yaml b/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/underlay.yaml
index 5dee9e4..480beef 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/underlay.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-ovs-ceph/underlay.yaml
@@ -399,6 +399,9 @@
capacity: !os_env NODE_VOLUME_SIZE, 150
backing_store: cloudimage1604
format: qcow2
+ - name: cinder
+ capacity: 50
+ format: qcow2
- name: iso # Volume with name 'iso' will be used
# for store image with cloud-init metadata.
capacity: 1
@@ -425,6 +428,9 @@
capacity: !os_env NODE_VOLUME_SIZE, 150
backing_store: cloudimage1604
format: qcow2
+ - name: cinder
+ capacity: 50
+ format: qcow2
- name: iso # Volume with name 'iso' will be used
# for store image with cloud-init metadata.
capacity: 1
@@ -451,9 +457,6 @@
capacity: !os_env NODE_VOLUME_SIZE, 150
backing_store: cloudimage1604
format: qcow2
- - name: cinder
- capacity: 50
- format: qcow2
- name: iso # Volume with name 'iso' will be used
# for store image with cloud-init metadata.
capacity: 1
diff --git a/tcp_tests/templates/virtual-mcp-ocata-ovs/openstack.yaml b/tcp_tests/templates/virtual-mcp-ocata-ovs/openstack.yaml
index 569ae2d..3a23234 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-ovs/openstack.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-ovs/openstack.yaml
@@ -57,7 +57,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -146,7 +146,7 @@
- description: Check heat service
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 5, delay: 10}
skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp11-dvr/openstack.yaml b/tcp_tests/templates/virtual-mcp11-dvr/openstack.yaml
index 41ab7aa..0e8af92 100644
--- a/tcp_tests/templates/virtual-mcp11-dvr/openstack.yaml
+++ b/tcp_tests/templates/virtual-mcp11-dvr/openstack.yaml
@@ -57,7 +57,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -132,7 +132,7 @@
- description: Check heat service
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 5, delay: 10}
skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp11-ovs-dpdk/openstack.yaml b/tcp_tests/templates/virtual-mcp11-ovs-dpdk/openstack.yaml
index 658ddd5..ad5660e 100644
--- a/tcp_tests/templates/virtual-mcp11-ovs-dpdk/openstack.yaml
+++ b/tcp_tests/templates/virtual-mcp11-ovs-dpdk/openstack.yaml
@@ -56,7 +56,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -131,7 +131,7 @@
- description: Check heat service
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 5, delay: 10}
skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp11-ovs/openstack.yaml b/tcp_tests/templates/virtual-mcp11-ovs/openstack.yaml
index 821e44e..56d25fa 100644
--- a/tcp_tests/templates/virtual-mcp11-ovs/openstack.yaml
+++ b/tcp_tests/templates/virtual-mcp11-ovs/openstack.yaml
@@ -57,7 +57,7 @@
- description: Check keystone service-list
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
@@ -132,7 +132,7 @@
- description: Check heat service
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
- -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
+ -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 5, delay: 10}
skip_fail: false
diff --git a/tcp_tests/tests/system/conftest.py b/tcp_tests/tests/system/conftest.py
index 9aa021e..e767663 100644
--- a/tcp_tests/tests/system/conftest.py
+++ b/tcp_tests/tests/system/conftest.py
@@ -13,6 +13,7 @@
# under the License.
from tcp_tests.fixtures.common_fixtures import * # noqa
+from tcp_tests.fixtures.ceph_fixtures import * # noqa
from tcp_tests.fixtures.config_fixtures import * # noqa
from tcp_tests.fixtures.underlay_fixtures import * # noqa
from tcp_tests.fixtures.rally_fixtures import * # noqa
@@ -58,6 +59,8 @@
# stacklight_fixtures
'sl_actions',
'sl_deployed',
+ 'ceph_deployed',
+ 'ceph_action',
# k8s fixtures
'k8s_actions',
'k8s_deployed'
diff --git a/tcp_tests/tests/system/test_ovs_ocata_ceph.py b/tcp_tests/tests/system/test_ovs_ocata_ceph.py
new file mode 100644
index 0000000..5f5df02
--- /dev/null
+++ b/tcp_tests/tests/system/test_ovs_ocata_ceph.py
@@ -0,0 +1,48 @@
+# Copyright 2017 Mirantis, Inc.
+#
+# 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.
+
+import pytest
+
+from tcp_tests import logger
+from tcp_tests import settings
+
+LOG = logger.logger
+
+
+@pytest.mark.deploy
+class TestInstallOvsOcataCeph(object):
+ """Test class for test openstack with ceph and ovs deploy"""
+
+ @pytest.mark.grab_versions
+ @pytest.mark.fail_snapshot
+ def test_ocata_ceph_all_ovs_install(self, underlay, openstack_deployed,
+ ceph_deployed,
+ openstack_actions):
+ """Test for deploying ocata ovs with ceph and check it
+ Scenario:
+ 1. Prepare salt on hosts
+ 2. Setup controller nodes
+ 3. Setup compute nodes
+ 4. Setup ceph
+ 5. Run tempest
+
+ """
+ openstack_actions._salt.local(
+ tgt='*', fun='cmd.run',
+ args='service ntp stop; ntpd -gq; service ntp start')
+
+ if settings.RUN_TEMPEST:
+ openstack_actions.run_tempest(pattern=settings.PATTERN)
+ openstack_actions.download_tempest_report()
+ LOG.info("*************** DONE **************")
diff --git a/tcp_tests/tests/unit/test_yaml_templates.py b/tcp_tests/tests/unit/test_yaml_templates.py
new file mode 100644
index 0000000..54eb5b3
--- /dev/null
+++ b/tcp_tests/tests/unit/test_yaml_templates.py
@@ -0,0 +1,62 @@
+import pytest
+import mock
+import os
+
+from tcp_tests.helpers import env_config
+from tcp_tests import settings_oslo
+
+config = settings_oslo.load_config(config_files=[])
+config.underlay.ssh = [
+ {"node_name": "cfg01.cookied-dop-sl2.local", "host": "10.70.0.15"},
+ {"node_name": "cid01.cookied-dop-sl2.local", "host": "10.70.0.91"},
+ {"node_name": "cid02.cookied-dop-sl2.local", "host": "10.70.0.92"},
+ {"node_name": "cid03.cookied-dop-sl2.local", "host": "10.70.0.93"},
+ {"node_name": "ctl01.cookied-dop-sl2.local", "host": "10.70.0.11"},
+ {"node_name": "ctl02.cookied-dop-sl2.local", "host": "10.70.0.12"},
+ {"node_name": "ctl03.cookied-dop-sl2.local", "host": "10.70.0.13"},
+ {"node_name": "mon01.cookied-dop-sl2.local", "host": "10.70.0.71"},
+ {"node_name": "mon02.cookied-dop-sl2.local", "host": "10.70.0.72"},
+ {"node_name": "mon03.cookied-dop-sl2.local", "host": "10.70.0.73"},
+ {"node_name": "prx01.cookied-dop-sl2.local", "host": "10.70.0.81"},
+ {"node_name": "cmp001.cookied-dop-sl2.local", "host": "10.70.0.101"},
+ {"node_name": "cmp002.cookied-dop-sl2.local", "host": "10.70.0.102"},
+ {"node_name": "gtw01.cookied-dop-sl2.local", "host": "10.70.0.224"}
+]
+
+config.underlay.address_pools = {
+ "admin-pool01": "10.70.0.0/24",
+ "private-pool01": "10.60.0.0/24",
+ "tenant-pool01": "10.80.0.0/24",
+ "external-pool01": "10.90.0.0/24"
+}
+config.underlay.ssh_keys = [
+ {"public": "AAAARRRGGHHHhh", "private": "--- BLABLA-KEY ---"}
+]
+
+
+def find_yaml_paths():
+ exts = ['.yml', '.yaml']
+ for root, subFolder, files in os.walk('./tcp_tests/templates/'):
+ for filename in files:
+ if any([filename.endswith(ext) for ext in exts]):
+ yield str(os.path.join(root, filename))
+
+
+@pytest.mark.parametrize("yaml_path", find_yaml_paths())
+@pytest.mark.unit_tests
+@mock.patch('os.environ', autospec=True)
+def test_jinja_render_yaml_file(mock_os_environ, yaml_path):
+ def os_environ_getitem(name):
+ return "=< Mock value >="
+
+ def os_environ_get(name, default_value):
+ return default_value or "=< Mock value >="
+
+ mock_os_environ.__getitem__ = mock.Mock(side_effect=os_environ_getitem)
+ mock_os_environ.get = mock.Mock(side_effect=os_environ_get)
+
+ options = {
+ 'config': config,
+ }
+ env_config.yaml_template_load(yaml_path, options=options,
+ log_env_vars=False)