Add mixed setup for debian based OS

Since debian/ubuntu do not provide packages for tempest plugins, we are using
mixed setup. We install tempest as a distro package, while installing
tempest plugins from source, but without venv (for system python).
That guarantees that we have all required plugins and do tests.
To accomplish that variable tempest_plugin_install_source was
introduced.

Change-Id: I198190d601cf8a922c3afaa69a3c0e42ab075735
This commit is contained in:
Dmitriy Rabotyagov 2019-08-08 17:32:20 +03:00
parent 6f5e0518dd
commit e7e15eb164
4 changed files with 21 additions and 6 deletions

View File

@ -49,6 +49,9 @@
tags: tags:
- tempest-config - tempest-config
- name: Flush handlers
meta: flush_handlers
- import_tasks: tempest_run.yml - import_tasks: tempest_run.yml
when: tempest_run | bool when: tempest_run | bool
tags: tags:

View File

@ -27,11 +27,11 @@
# NOTE(noonedeadpunk): # NOTE(noonedeadpunk):
# Applying default filter for tempest_install_method is required despite the variable being defined # Applying default filter is required despite the variable being defined
# in defaults as in case of non-integrated tests meta handlers from other roles might fail. # in defaults as in case of non-integrated tests meta handlers from other roles might fail.
- name: Install Tempest packages from PIP - name: Install Tempest packages from PIP
import_tasks: tempest_install_source.yml import_tasks: tempest_install_source.yml
when: (tempest_install_method | default('source')) == 'source' when: (tempest_install_method | default('source')) == 'source' or (tempest_plugin_install_source | default(False))
- name: Install stackviz on venv - name: Install stackviz on venv
import_role: import_role:

View File

@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# Note(noonedeadpunk) When tempest_plugin_install_source is true, we do not
# want pip packages to be installed inside venv, since tempest itself is
# installed via system packages so that plugins will be visable for tempest.
- name: Install the python venv - name: Install the python venv
import_role: import_role:
name: "python_venv_build" name: "python_venv_build"
@ -25,6 +28,7 @@
- section: "tempest" - section: "tempest"
option: "venv_tag" option: "venv_tag"
value: "{{ tempest_venv_tag }}" value: "{{ tempest_venv_tag }}"
when: not tempest_plugin_install_source
- name: Get tempest plugins from git - name: Get tempest plugins from git
git: git:
@ -43,8 +47,8 @@
pip: pip:
name: "/opt/{{ item.name|replace('-', '_') }}_{{ item.branch|replace('/', '_') }}" name: "/opt/{{ item.name|replace('-', '_') }}_{{ item.branch|replace('/', '_') }}"
state: "{{ tempest_pip_package_state }}" state: "{{ tempest_pip_package_state }}"
virtualenv: "{{ tempest_venv_bin | dirname }}" virtualenv: "{{ tempest_plugin_install_source | ternary(omit, tempest_venv_bin | dirname) }}"
virtualenv_site_packages: "no" virtualenv_site_packages: "{{ tempest_plugin_install_source | ternary(omit, 'no') }}"
extra_args: >- extra_args: >-
{{ tempest_pip_install_args }} {{ tempest_pip_install_args }}
--isolated --isolated
@ -59,8 +63,8 @@
pip: pip:
name: "{{ item.package }}" name: "{{ item.package }}"
state: "{{ tempest_pip_package_state }}" state: "{{ tempest_pip_package_state }}"
virtualenv: "{{ tempest_venv_bin | dirname }}" virtualenv: "{{ tempest_mixed_setup | ternary(omit, tempest_venv_bin | dirname) }}"
virtualenv_site_packages: "no" virtualenv_site_packages: "{{ tempest_mixed_setup | ternary(omit, 'no') }}"
extra_args: >- extra_args: >-
{{ tempest_pip_install_args }} {{ tempest_pip_install_args }}
--isolated --isolated

View File

@ -151,3 +151,11 @@ _tempest_plugins:
repo: https://opendev.org/openstack/zaqar-tempest-plugin repo: https://opendev.org/openstack/zaqar-tempest-plugin
branch: master branch: master
install: "{{ tempest_service_available_zaqar | bool }}" install: "{{ tempest_service_available_zaqar | bool }}"
# Note(noonedeadpunk):
# Ubuntu does not publish tempest plugin packages. They do
# all their testing using the source-based installation of
# tempest.
# For mixed setup we are using source install tasks, except
# that we're deploying pip packages without venv.
tempest_plugin_install_source: "{{ ((tempest_install_method == 'distro') and (ansible_os_family | lower == 'debian')) | bool }}"