Enable python-tempestconf support

This is an initial support for tempestconf tool.
Initially, tempestconf tool is being executed to generate the
tempestconf as it is, furthermore will be added the option to override
values, generate resources, hardcoded options, etc.
This is will be done in an incremental way in order to not have big
patches full of functionalities that might not be able to be fully
tested in one single patch.

Change-Id: I08cfa29361804de3bdb9077a7d8d2b8b417e50d8
This commit is contained in:
Arx Cruz 2018-10-24 11:47:08 +02:00 committed by Arx Cruz
parent 2dbd375b44
commit 55a8b2b34d
4 changed files with 74 additions and 0 deletions

View File

@ -267,6 +267,15 @@ tempest_role_project_group: utility_all
## Tunable overrides
tempest_tempest_conf_overrides: {}
# python-tempestconf variables
# The tempest_use_tempestconf by default is set to false, set to true if you
# want to generate the tempest.conf file with this tool, instead of
# tempest.conf from the template
tempest_use_tempestconf: false
tempest_tempestconf_venv_bin: "/openstack/venvs/tempestconf/bin"
tempest_tempestconf_pip_packages:
- python-tempestconf
# Stackviz tarball url
stackviz_tarball: "https://tarballs.openstack.org/package-stackviz-element/stackviz-latest.tar.gz"
stackviz_venv_bin: "/openstack/venvs/stackviz/bin"

View File

@ -0,0 +1,9 @@
---
features:
- |
Python-tempestconf is a tool that generates a tempest.conf file, based
only on the credentials from an openstack installation. It uses the
discoverable api from openstack to check for services, features, etc.
Add the possibility to use python-tempestconf tool to generate tempest.conf
file, rather than use the role template.

View File

@ -36,6 +36,7 @@
mode: "0644"
config_overrides: "{{ tempest_tempest_conf_overrides }}"
config_type: "ini"
when: not tempest_use_tempestconf | bool
- name: Initialise tempest workspace
shell: |
@ -58,6 +59,12 @@
# don't trigger ANSIBLE0013
- skip_ansible_lint
- include_tasks: tempestconf.yml
when: tempest_use_tempestconf | bool
tags:
- tempest-config
- tempestconf
- name: List installed tempest plugins
shell: |
set -e

49
tasks/tempestconf.yml Normal file
View File

@ -0,0 +1,49 @@
---
# Copyright 2018, Red Hat 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.
- name: Install python-tempestconf on venv
include_role:
name: "python_venv_build"
vars:
venv_install_destination_path: "{{ tempest_tempestconf_venv_bin | dirname }}"
venv_pip_install_args: "--isolated"
venv_pip_packages: "{{ tempest_tempestconf_pip_packages }}"
- name: Executing python-tempestconf
shell: |
. {{ tempest_tempestconf_venv_bin }}/activate
export OS_AUTH_URL="{{ keystone_service_internaluri }}"
export OS_IDENTITY_API_VERSION="3"
export OS_USERNAME="{{ keystone_admin_user_name }}"
export OS_PROJECT_NAME="{{ keystone_admin_tenant_name }}"
discover-tempest-config --out etc/tempest.conf \
--network-id "{{ tempest_neutron_public_network_id }}" \
--debug \
--create \
auth.use_dynamic_credentials true
environment:
OS_PASSWORD: "{{ keystone_auth_admin_password }}"
args:
chdir: "{{ tempest_workspace }}"
executable: /bin/bash
tags:
# don't trigger ANSIBLE0013
- skip_ansible_lint
- name: Copy tempest.conf to /etc/tempest
copy:
src: "{{ tempest_workspace }}/etc/tempest.conf"
dest: "/etc/tempest/tempest.conf"
remote_src: yes