Fix and add tests for tempest plugin system

This commit does the following:

- fixes a bug in tempest_install.yml where we install plugins into the
  wrong venv location (previously tempest_git_dest, which is no longer
  set)
- updates the plugin clone directory name to use the plugin name with
  dashes changed to underscores (this follows the typical pattern
  imposed by openstack-ansible)
- adds tempest_plugins to test-vars.yml and then ensures that the
  associated tempest plugin is installed

Change-Id: I41644d7f0b8f03edc43629f90aa4910b3eb3dcea
This commit is contained in:
Matt Thompson 2016-05-12 10:11:18 +01:00 committed by Jesse Pretorius (odyssey4me)
parent d32e7f83fd
commit 046e69c423
4 changed files with 13 additions and 6 deletions

View File

@ -43,8 +43,8 @@ tempest_venv_enabled: true
# By default, no tempest plugins are installed. Override ``tempest_plugins``
# as follows:
# tempest_plugins:
# - name: designate_tempest_plugin
# repo: https://github.com/openstack/designate-tempest-plugin
# - name: designate-tempest-plugin
# repo: https://git.openstack.org/openstack/designate-tempest-plugin
# branch: master
tempest_plugins: []

View File

@ -228,7 +228,7 @@
- name: Get tempest plugins from git
git:
repo: "{{ item.repo }}"
dest: "/opt/{{ item.name }}_{{ item.branch|replace('/', '_') }}"
dest: "/opt/{{ item.name|replace('-', '_') }}_{{ item.branch|replace('/', '_') }}"
version: "{{ item.branch }}"
force: yes
with_items: "{{ tempest_plugins }}"
@ -242,9 +242,9 @@
- name: Install tempest plugins (venv)
pip:
name: "/opt/{{ item.name }}_{{ item.branch|replace('/', '_') }}"
name: "/opt/{{ item.name|replace('-', '_') }}_{{ item.branch|replace('/', '_') }}"
state: latest
virtualenv: "{{ tempest_git_dest }}"
virtualenv: "{{ tempest_venv_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options_fact }}"
with_items: "{{ tempest_plugins }}"
@ -260,7 +260,7 @@
- name: Install tempest plugins (no venv)
pip:
name: "/opt/{{ item.name }}_{{ item.branch|replace('/', '_') }}"
name: "/opt/{{ item.name|replace('-', '_') }}_{{ item.branch|replace('/', '_') }}"
state: present
extra_args: "{{ pip_install_options_fact }}"
with_items: "{{ tempest_plugins }}"

View File

@ -18,6 +18,9 @@
user: root
gather_facts: false
tasks:
- name: Ensure tempest plugins have been installed
command: "{{ tempest_venv_bin }}/pip show {{ item.name }}"
with_items: "{{ tempest_plugins }}"
- name: Run tempest
shell: |
. {{ tempest_venv_bin }}/activate

View File

@ -54,3 +54,7 @@ tempest_service_available_horizon: False
tempest_service_available_neutron: False
tempest_service_available_nova: False
tempest_service_available_swift: False
tempest_plugins:
- name: designate-tempest-plugin
repo: https://git.openstack.org/openstack/designate-tempest-plugin
branch: master