From adad0bc0b335d1114bc60df3acb07c315e80422c Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 26 Jul 2018 13:38:13 +0100 Subject: [PATCH] tests: Ensure clouds.yaml is present, and use it Instead of sourcing openrc (which is so 1995), we use clouds.yaml instead. Also, to make sure it is there we run the role that puts it there. Change-Id: I15769746ffbcfdc990e39dee4fb1545b564bb442 --- tests/test-zun-check.yml | 38 ++++++++++++++++++++++++-------------- zuul.d/project.yaml | 10 +++++----- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/tests/test-zun-check.yml b/tests/test-zun-check.yml index 5ddba10..813c003 100644 --- a/tests/test-zun-check.yml +++ b/tests/test-zun-check.yml @@ -16,35 +16,45 @@ - name: Create a zun image hosts: zun_compute remote_user: root + gather_facts: true + any_errors_fatal: true + vars_files: + - common/test-vars.yml tasks: - name: Pull cirros image command: docker pull cirros # TODO(cloudnull): Set up failed_when and changed_when conditions - tags: - - skip_ansible_lint + changed_when: false + + - name: Ensure the clouds.yaml file is present + include_role: + name: openstack_openrc - name: Upload image into glance shell: | - . /root/openrc - docker save cirros | /openstack/venvs/zun-untagged/bin/openstack image create zun-cirros --public --container-format docker --disk-format raw + docker save cirros | /openstack/venvs/zun-untagged/bin/openstack --os-cloud default image create zun-cirros --public --container-format docker --disk-format raw # TODO(cloudnull): Set up failed_when and changed_when conditions - tags: - - skip_ansible_lint + changed_when: false - name: Run zun service check hosts: zun_api[0] remote_user: root + gather_facts: true + any_errors_fatal: true + vars_files: + - common/test-vars.yml tasks: + - name: Ensure the clouds.yaml file is present + include_role: + name: openstack_openrc + - name: Check zun service is functional - shell: | - . /root/openrc - /openstack/venvs/zun-untagged/bin/openstack appcontainer service list + command: | + /openstack/venvs/zun-untagged/bin/openstack --os-cloud default appcontainer service list changed_when: false - name: Create zun container - shell: | - . /root/openrc - /openstack/venvs/zun-untagged/bin/openstack appcontainer run --name container-check --net network=private zun-cirros ping 127.0.0.1 + command: | + /openstack/venvs/zun-untagged/bin/openstack --os-cloud default appcontainer run --name container-check --net network=private zun-cirros ping 127.0.0.1 # TODO(cloudnull): Set up failed_when and changed_when conditions - tags: - - skip_ansible_lint + changed_when: false diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index e5a6a43..8ca8ff1 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -17,11 +17,11 @@ check: jobs: - openstack-ansible-linters - - openstack-ansible-functional-ubuntu-xenial: - voting: false - experimental: - jobs: - - openstack-ansible-integrated-deploy-aio + - openstack-ansible-functional-ubuntu-xenial gate: jobs: - openstack-ansible-linters + - openstack-ansible-functional-ubuntu-xenial + experimental: + jobs: + - openstack-ansible-integrated-deploy-aio