diff --git a/playbooks/quickstart-extras-validate.yml b/playbooks/quickstart-extras-validate.yml index dafe4b26d..dc2b83e13 100644 --- a/playbooks/quickstart-extras-validate.yml +++ b/playbooks/quickstart-extras-validate.yml @@ -17,7 +17,7 @@ roles: - {role: validate-simple, when: test_ping|bool} -# Execute tempest against the overcloud deployment +# Execute tempest using validate-tempest against the overcloud deployment - name: Execute tempest against the overcloud hosts: undercloud tags: @@ -26,6 +26,21 @@ roles: - {role: validate-tempest, when: tempest_config|bool or run_tempest|bool} +# Execute tempest using os_tempest against the overcloud deployment +- name: Validate the deployment + hosts: undercloud + tasks: + - include_tasks: tempest.yml + vars: + tempest_install_method: distro + tempest_cloud_name: 'overcloud' + when: + - not run_tempest|bool + - use_os_tempest is defined + - use_os_tempest|bool + tags: + - overcloud-validate + # Ensure services and containers are OK - name: Execute simple service and container validations hosts: diff --git a/playbooks/tempest.yml b/playbooks/tempest.yml index 4920df922..496165b86 100644 --- a/playbooks/tempest.yml +++ b/playbooks/tempest.yml @@ -91,6 +91,30 @@ tempest_test_blacklist: "{{ known_failures | json_query('[?undercloud != `true`]') }}" when: tempest_cloud_name != 'undercloud' +- name: set python_cmd + set_fact: + python_cmd: "python{{ ansible_python.version.major }}" + cacheable: true + when: python_cmd is not defined + +- name: Check if virtualenv is in the system + command: "{{ python_cmd }} -m virtualenv --version" + register: virtualenv_exist + failed_when: false + changed_when: false + +- when: virtualenv_exist.rc != 0 + name: Install virtualenv + become: true + package: + state: present + name: > + {% if ansible_python.version.major == 3 %} + python3-virtualenv + {% else %} + python-virtualenv + {% endif %} + - name: Run os_tempest role vars: ansible_become: true