Automatically select the correct tempest plugins

In this patch we change the way the plugin list is used
by default to ensure that only the plugins needed for the
environment are installed.

This removes the need to implement override plugin lists
when testing other services, allowing us to centralise
all configuration and source-based build testing in this
role.

We also add any missing plugins or additional boolean
enablement variables to ensure we have a complete matching
list between the defaults and vars.

Note that a change to the actual tests exercised will come
in a later patch.

Change-Id: I576386e158604bc21abe3672df407fcf08684d3d
This commit is contained in:
Jesse Pretorius 2019-01-09 14:10:22 +00:00
parent 765f3a29b7
commit b4cd32293f
2 changed files with 32 additions and 1 deletions

View File

@ -82,7 +82,7 @@ tempest_log_dir: "/var/log/tempest"
# install_test_requirements: True #for installing the plugin with its test_requirements (default: True)
# - name: ironic-tempest-plugin
# package: ironic #for installing the plugin from packages
tempest_plugins: "{{ _tempest_plugins['keystone'] + _tempest_plugins['cinder'] + _tempest_plugins['heat'] + _tempest_plugins['neutron'] }}"
tempest_plugins: "{{ _tempest_plugins.values() | sum(start=[]) | selectattr('install', 'equalto', true) | list }}"
# tempest_workspace where tempest can be runned
tempest_workspace: "{{ ansible_env.HOME }}/workspace"
@ -168,6 +168,7 @@ tempest_service_available_aodh: "{{ groups['aodh_all'] is defined and groups['ao
tempest_service_available_barbican: "{{ groups['barbican_all'] is defined and groups['barbican_all'] | length > 0 }}"
tempest_service_available_ceilometer: "{{ groups['ceilometer_all'] is defined and groups['ceilometer_all'] | length > 0 }}"
tempest_service_available_cinder: "{{ groups['cinder_all'] is defined and groups['cinder_all'] | length > 0 }}"
tempest_service_available_cloudkitty: "{{ groups['cloudkitty_all'] is defined and groups['cloudkitty_all'] | length > 0 }}"
tempest_service_available_congress: "{{ groups['congress_all'] is defined and groups['congress_all'] | length > 0 }}"
tempest_service_available_designate: "{{ groups['designate_all'] is defined and groups['designate_all'] | length > 0 }}"
tempest_service_available_glance: "{{ groups['glance_all'] is defined and groups['glance_all'] | length > 0 }}"
@ -177,9 +178,11 @@ tempest_service_available_ironic: "{{ groups['ironic_all'] is defined and groups
tempest_service_available_magnum: "{{ groups['magnum_all'] is defined and groups['magnum_all'] | length > 0 }}"
tempest_service_available_manila: "{{ groups['manila_all'] is defined and groups['manila_all'] | length > 0 }}"
tempest_service_available_neutron: "{{ groups['neutron_all'] is defined and groups['neutron_all'] | length > 0 }}"
tempest_service_available_neutron_bgpvpn: "{{ (groups['neutron_all'] is defined) and (groups['neutron_all'] | length > 0) and ('bgpvpn' in neutron_plugin_base | default([])) }}"
tempest_service_available_neutron_fwaas: "{{ (groups['neutron_all'] is defined) and (groups['neutron_all'] | length > 0) and (('firewall' in neutron_plugin_base | default([])) or ('firewall_v2' in neutron_plugin_base | default([]))) }}"
tempest_service_available_neutron_vpnaas: "{{ (groups['neutron_all'] is defined) and (groups['neutron_all'] | length > 0) and ('vpnaas' in neutron_plugin_base | default([])) }}"
tempest_service_available_nova: "{{ groups['nova_all'] is defined and groups['nova_all'] | length > 0 }}"
tempest_service_available_nova_lxd: "{{ groups['nova_all'] is defined and groups['nova_all'] | length > 0 and nova_virt_type | default('kvm') == 'lxd' }}"
tempest_service_available_octavia: "{{ groups['octavia_all'] is defined and groups['octavia_all'] | length > 0 }}"
tempest_service_available_sahara: "{{ groups['sahara_all'] is defined and groups['sahara_all'] | length > 0 }}"
tempest_service_available_swift: "{{ (groups['swift_all'] is defined and groups['swift_all'] | length > 0) or (groups['ceph-rgw'] is defined and groups['ceph-rgw'] | length > 0) or (ceph_rgws | length > 0) }}"

View File

@ -19,74 +19,102 @@
# branch: # when installing from a repo
# install_test_requirements: # when installing from a repo
# package: # when installing from a pip package
# install: # boolean to enable/disable the installation of this item
_tempest_plugins:
barbican:
- name: barbican-tempest-plugin
repo: https://git.openstack.org/openstack/barbican-tempest-plugin
branch: master
install: "{{ tempest_service_available_barbican | bool }}"
cinder:
- name: cinder-tempest-plugin
repo: https://git.openstack.org/openstack/cinder-tempest-plugin
branch: master
install: "{{ tempest_service_available_cinder | bool }}"
cloudkitty:
- name: cloudkitty-tempest-plugin
repo: https://git.openstack.org/openstack/cloudkitty-tempest-plugin
branch: master
install: "{{ tempest_service_available_cloudkitty | bool }}"
congress:
- name: congress-tempest-plugin
repo: https://git.openstack.org/openstack/congress-tempest-plugin
branch: master
install_test_requirements: false
install: "{{ tempest_service_available_congress | bool }}"
designate:
- name: designate-tempest-plugin
repo: https://git.openstack.org/openstack/designate-tempest-plugin
branch: master
install: "{{ tempest_service_available_designate | bool }}"
heat:
- name: heat-tempest-plugin
repo: https://git.openstack.org/openstack/heat-tempest-plugin
branch: master
install: "{{ tempest_service_available_heat | bool }}"
ironic:
- name: ironic-tempest-plugin
repo: https://git.openstack.org/openstack/ironic-tempest-plugin
branch: master
install: "{{ tempest_service_available_ironic | bool }}"
keystone:
- name: keystone-tempest-plugin
repo: https://git.openstack.org/openstack/keystone-tempest-plugin
branch: master
install: yes
magnum:
- name: magnum-tempest-plugin
repo: https://git.openstack.org/openstack/magnum-tempest-plugin
branch: master
install: "{{ tempest_service_available_magnum | bool }}"
manila:
- name: manila-tempest-plugin
repo: https://git.openstack.org/openstack/manila-tempest-plugin
branch: master
install: "{{ tempest_service_available_manila | bool }}"
networking-bgpvpn:
- name: networking-bgpvpn
repo: https://git.openstack.org/openstack/networking-bgpvpn
branch: master
install: "{{ tempest_service_available_neutron_bgpvpn | bool }}"
neutron-fwaas:
- name: neutron-fwaas
repo: https://git.openstack.org/openstack/neutron-fwaas
branch: master
install: "{{ tempest_service_available_neutron_fwaas | bool }}"
neutron-vpnaas:
- name: neutron-vpnaas
repo: https://git.openstack.org/openstack/neutron-vpnaas
branch: master
install: "{{ tempest_service_available_neutron_vpnaas | bool }}"
neutron:
- name: neutron-tempest-plugin
repo: https://git.openstack.org/openstack/neutron-tempest-plugin
branch: master
install: "{{ tempest_service_available_neutron | bool }}"
nova-lxd:
- name: nova-lxd
repo: https://git.openstack.org/openstack/nova-lxd
branch: master
install: "{{ tempest_service_available_nova_lxd | bool }}"
octavia:
- name: octavia-tempest-plugin
repo: https://git.openstack.org/openstack/octavia-tempest-plugin
branch: master
install: "{{ tempest_service_available_octavia | bool }}"
sahara:
- name: sahara-tests
repo: https://git.openstack.org/openstack/sahara-tests
branch: master
install: "{{ tempest_service_available_sahara | bool }}"
telemetry:
- name: telemetry-tempest-plugin
repo: https://git.openstack.org/openstack/telemetry-tempest-plugin
branch: master
install: "{{ (tempest_service_available_aodh | bool) or (tempest_service_available_ceilometer | bool) }}"
zaqar:
- name: zaqar-tempest-plugin
repo: https://git.openstack.org/openstack/zaqar-tempest-plugin
branch: master
install: "{{ tempest_service_available_zaqar | bool }}"