summaryrefslogtreecommitdiff
path: root/tasks/run_tests.yml
blob: 7b75c73fff9ff06ed44e007c9cae67d828e82db1 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
- name: Copy overcloudrc
  become: true
  copy:
    src: /tmp/overcloudrc
    dest: /etc/redhat-certification-openstack/overcloudrc

- name: Copy tempest.conf
  become: true
  copy:
    src: /tmp/tempest.conf
    dest: /etc/redhat-certification-openstack/tempest.conf

- name: Combine all certification tags, tests and programs
  set_fact:
    all_certification_types: '{{ openstack_certification_tags }} + {{ openstack_certification_tests }} + {{ openstack_certification_programs }}'

- block:
    - name: Register keystone_auth_url
      shell: "source /etc/redhat-certification-openstack/overcloudrc && echo \"$OS_AUTH_URL\""
      register: keystone_auth_url

    - name: Register admin_username
      shell: "source /etc/redhat-certification-openstack/overcloudrc && echo \"$OS_USERNAME\""
      register: admin_username

    - name: Register admin_password
      shell: "source /etc/redhat-certification-openstack/overcloudrc && echo \"$OS_PASSWORD\""
      register: admin_password

    - name: Register admin_tenant_name
      shell: "source /etc/redhat-certification-openstack/overcloudrc && echo \"$OS_TENANT_NAME\""
      register: admin_tenant_name

    - name: Register admin_project_name
      shell: "source /etc/redhat-certification-openstack/overcloudrc && echo \"$OS_PROJECT_NAME\""
      register: admin_project_name

    - name: Create the test_config.json file
      become: true
      template:
        src: test_config.json.j2
        dest: /etc/redhat-certification-openstack/test_config.json
  when: "'baremetal' not in all_certification_types"

- name: Create the baremetal.json file
  become: true
  template:
    src: baremetal.json
    dest: /etc/redhat-certification-openstack/baremetal.json
  when: "'undercloud' in group_names and 'baremetal' in all_certification_types"

- name: Run certification test suite with tag argument
  become: true
  shell: >
    set -x
    rhcert-ci clean all && rhcert-ci run --tag {{ item }} && rhcert-ci save
  with_items: "{{ openstack_certification_tags }}"
  ignore_errors: true
  when: openstack_certification_test_type == "tag"

- name: Run certification test suite with program argument
  become: true
  shell: >
    set -x
    rhcert-ci clean all && rhcert-ci run --program {{ item }} && rhcert-ci save
  with_items: "{{ openstack_certification_programs }}"
  ignore_errors: true
  when: openstack_certification_test_type == "program"

- name: Run certification test suite with test argument
  become: true
  shell: >
    set -x
    rhcert-ci clean all && rhcert-ci run --test {{" --test ".join(openstack_certification_tests)}} && rhcert-ci save
  ignore_errors: true
  when: openstack_certification_test_type != "tag" and openstack_certification_test_type != "program"