From b4cd32293fccb6dc5f6489e0f695267112fadd7a Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 9 Jan 2019 14:10:22 +0000 Subject: [PATCH] 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 --- defaults/main.yml | 5 ++++- vars/main.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index f6693253..fe54ac82 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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) }}" diff --git a/vars/main.yml b/vars/main.yml index 909dacc6..7c635b7b 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -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 }}"