summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Savineau <dsavinea@redhat.com>2018-07-09 17:08:01 -0400
committerDimitri Savineau <dsavinea@redhat.com>2018-07-10 13:00:03 -0400
commitecbb5bfd9b34eed6b0b6c5668b68c308ded4d413 (patch)
tree17af277ccd648e8c52f43afe553ef59bdb5b2689
parent023d31e0fbca55f8da4306280dd2f7982e31f3e3 (diff)
Openstack and Baremetal packages are exclusive
When installating both openstack and baremetal rpm packages on the same host, we will have supportable and sosreport tests ran twice because both package are exclusive (at run time). When baremetal is present in one of the certification types we don't need to executed the openstack tasks (test_config.json file). The opposite is also true. Change-Id: I81b8b4ed23ecf854c2b112892c2000208604a3ce
-rw-r--r--README.md4
-rw-r--r--defaults/main.yml15
-rw-r--r--tasks/main.yml71
3 files changed, 50 insertions, 40 deletions
diff --git a/README.md b/README.md
index 9a6e95c..cd82666 100644
--- a/README.md
+++ b/README.md
@@ -19,8 +19,8 @@ in details.
| openstack_certification_output_filename | False | cert.txt | String | Output filename for rhcert-ci print |
| openstack_certification_test_type | False | test | String | Type of suite of tests to run. (values: test, tag, program) |
| openstack_certification_tests | False | self_check,supportable,director | Array | List of tests to run. |
-| openstack_certification_tags | False | N/A | Array | List of tags to run. |
-| openstack_certification_programs | False | N/A | Array | List of programs to run. |
+| openstack_certification_tags | False | [] | Array | List of tags to run. |
+| openstack_certification_programs | False | [] | Array | List of programs to run. |
| openstack_certification_supported_apis_and_extensions | False | N/A | Array | List of supported APIs and extensions. |
| openstack_certification_enable_rhsm_repo | False | Yes | Bool | When No/False, RHSM registration will be omitted. |
| openstack_certification_repo_file | False | N/A | String | Path to a repo file, which will be copied to the host. |
diff --git a/defaults/main.yml b/defaults/main.yml
index a510d64..7a6acf5 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -82,7 +82,7 @@ openstack_certification_tests:
# If one wants to enable tags rather than test
# make sure to set openstack_certification_test_type: tag
#
-# openstack_certification_tags:
+openstack_certification_tags: []
# - osqa
# - portable
# - certification
@@ -100,7 +100,7 @@ openstack_certification_tests:
# If one wants to enable program rather than test
# make sure to set openstack_certification_test_type: program
#
-# openstack_certification_programs:
+openstack_certification_programs: []
# - baremetal
# - cloud
# - container
@@ -169,10 +169,13 @@ openstack_certification_supported_apis_and_extensions:
# openstack_certification_tempest_conf_path: /home/stack/tempest/etc/tempest.conf
openstack_certification_tempest_conf_path_is_remote: Yes
openstack_certification_enable_rhsm_repo: Yes
-openstack_certification_install_rpms:
- - redhat-certification
- - redhat-certification-baremetal
- - redhat-certification-openstack
+openstack_certification_install_rpms: >-
+ [ 'redhat-certification',
+ {% if 'baremetal' in openstack_certification_tags + openstack_certification_tests + openstack_certification_programs %}
+ 'redhat-certification-baremetal' ]
+ {% else %}
+ 'redhat-certification-openstack' ]
+ {% endif %}
# Address of the overcloud node (compute/controller)
# on which you want to run the director test
diff --git a/tasks/main.yml b/tasks/main.yml
index 8b2004a..ec8b6f9 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -14,45 +14,52 @@
state: latest
when: rhosp_status.results|length >= 1
-- name: Register keystone_auth_url
- shell: "source {{ openstack_certification_overcloudrc }} && echo \"$OS_AUTH_URL\""
- register: keystone_auth_url
+- name: Combine all certification tags, tests and programs
+ set_fact:
+ all_certification_types: '{{ openstack_certification_tags }} + {{ openstack_certification_tests }} + {{ openstack_certification_programs }}'
-- name: Register admin_username
- shell: "source {{ openstack_certification_overcloudrc }} && echo \"$OS_USERNAME\""
- register: admin_username
-
-- name: Register admin_password
- shell: "source {{ openstack_certification_overcloudrc }} && echo \"$OS_PASSWORD\""
- register: admin_password
-
-- name: Register admin_tenant_name
- shell: "source {{ openstack_certification_overcloudrc }} && echo \"$OS_TENANT_NAME\""
- register: admin_tenant_name
-
-- name: Register admin_project_name
- shell: "source {{ openstack_certification_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
+- block:
+ - name: Register keystone_auth_url
+ shell: "source {{ openstack_certification_overcloudrc }} && echo \"$OS_AUTH_URL\""
+ register: keystone_auth_url
+
+ - name: Register admin_username
+ shell: "source {{ openstack_certification_overcloudrc }} && echo \"$OS_USERNAME\""
+ register: admin_username
+
+ - name: Register admin_password
+ shell: "source {{ openstack_certification_overcloudrc }} && echo \"$OS_PASSWORD\""
+ register: admin_password
+
+ - name: Register admin_tenant_name
+ shell: "source {{ openstack_certification_overcloudrc }} && echo \"$OS_TENANT_NAME\""
+ register: admin_tenant_name
+
+ - name: Register admin_project_name
+ shell: "source {{ openstack_certification_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
+
+ - name: copy the tempest configuration file
+ become: True
+ copy:
+ src: '{{ openstack_certification_tempest_conf_path }}'
+ dest: /etc/redhat-certification-openstack
+ remote_src: '{{ openstack_certification_tempest_conf_path_is_remote|bool }}'
+ when: openstack_certification_tempest_conf_path is defined
+ 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
-
-- name: copy the tempest configuration file
- become: True
- copy:
- src: '{{ openstack_certification_tempest_conf_path }}'
- dest: /etc/redhat-certification-openstack
- remote_src: '{{ openstack_certification_tempest_conf_path_is_remote|bool }}'
- when: openstack_certification_tempest_conf_path is defined
+ when: 'baremetal' in all_certification_types
- name: Run certification test suite with tag argument
become: True