aboutsummaryrefslogtreecommitdiff
path: root/roles/kolla-ansible-tempest/tasks/main.yml
blob: 315c332137a1bd1622f28476fde4f29bb56d35b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
- name: Install required packages
  ansible.builtin.pip:
    name: "{{ kolla_ansible_tempest_packages + kolla_ansible_tempest_packages_extra }}"
    extra_args: "{{ ('-c' + kolla_ansible_tempest_upper_constraints) if kolla_ansible_tempest_upper_constraints | length > 0 }}"
    virtualenv: "{{ kolla_ansible_venv_path }}"
    virtualenv_command: "python3 -m venv"

- name: Init tempest workspace
  ansible.builtin.shell:
    cmd: >
      {{ kolla_ansible_venv_path }}/bin/tempest init tempest
      >/tmp/logs/ansible/test-init-tempest 2>&1
    creates: "/home/zuul/tempest"

- name: Discover tempest config
  environment:
    OS_CLIENT_CONFIG_FILE: "/etc/kolla/clouds.yaml"
  vars:
    ver: "{{ kolla_ansible_tempest_cirros_ver }}"
    image: "https://download.cirros-cloud.net/{{ ver }}/cirros-{{ ver }}-x86_64-disk.img"
  ansible.builtin.shell:
    chdir: "/home/zuul/tempest"
    cmd: >
      {{ kolla_ansible_venv_path }}/bin/discover-tempest-config
      --debug
      --image {{ image }}
      --os-cloud kolla-admin
      compute.build_timeout {{ kolla_ansible_tempest_build_timeout }}
      >/tmp/logs/ansible/test-init-tempest-discover 2>&1
  changed_when: false

- name: Run tempest tests
  environment:
    OS_LOG_CAPTURE: "1"
    OS_STDOUT_CAPTURE: "1"
    OS_STDERR_CAPTURE: "1"
    OS_TEST_TIMEOUT: "3600"
  vars:
    tempest_log_file: "test-tempest-run{{ '-post-upgrade' if post_upgrade | bool else '' }}"
  ansible.builtin.shell:
    chdir: "/home/zuul/tempest"
    cmd: >
      {{ kolla_ansible_venv_path }}/bin/tempest run
      --config-file etc/tempest.conf
      {% if kolla_ansible_tempest_regex | length > 0 %}
      --regex '{{ kolla_ansible_tempest_regex | join("|") }}'
      {% endif %}
      {% if kolla_ansible_tempest_exclude_regex | length > 0 %}
      --exclude-regex '{{ kolla_ansible_tempest_exclude_regex | join("|") }}'
      {% endif %}
      >/tmp/logs/ansible/{{ tempest_log_file }} 2>&1
  changed_when: true