From 6ce64bb2ebecea56c6b1847319a610e01b3aac66 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 11 Jun 2018 08:19:54 +0200 Subject: [PATCH] Add zuul jobs Add functional and linting tests for the new project. Change-Id: Iae103901131aef872ba7daae078813ae81b1d0d2 --- tasks/zun_compute.yml | 14 +++++++++++++- tests/test-zun-check.yml | 10 ++++++++++ zuul.d/project.yaml | 27 +++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 zuul.d/project.yaml diff --git a/tasks/zun_compute.yml b/tasks/zun_compute.yml index 8c4fd58..2afaddf 100644 --- a/tasks/zun_compute.yml +++ b/tasks/zun_compute.yml @@ -44,9 +44,21 @@ repo: deb [arch=amd64] {{ item.uri }} {{ ansible_distribution_release | lower }} stable state: present filename: "{{ item.name }}" + update_cache: no with_items: "{{ zun_docker_repo }}" + register: add_nv_repos + + - name: Update Apt cache + apt: + update_cache: yes + when: add_nv_repos is changed + register: update_apt_cache + until: update_apt_cache is success + retries: 5 + delay: 2 + when: - - ansible_pkg_mgr == 'apt' + - "ansible_pkg_mgr == 'apt'" - name: Add yum repository get_url: diff --git a/tests/test-zun-check.yml b/tests/test-zun-check.yml index 4a5b605..28a8188 100644 --- a/tests/test-zun-check.yml +++ b/tests/test-zun-check.yml @@ -19,11 +19,17 @@ tasks: - name: Pull cirros image command: docker pull cirros + # TODO(cloudnull): Set up failed_when and changed_when conditions + tags: + - skip_ansible_lint - 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 + # TODO(cloudnull): Set up failed_when and changed_when conditions + tags: + - skip_ansible_lint - name: Run zun service check hosts: zun_api[0] @@ -33,8 +39,12 @@ shell: | . /root/openrc /openstack/venvs/zun-untagged/bin/openstack 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 + # TODO(cloudnull): Set up failed_when and changed_when conditions + tags: + - skip_ansible_lint diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml new file mode 100644 index 0000000..e5a6a43 --- /dev/null +++ b/zuul.d/project.yaml @@ -0,0 +1,27 @@ +--- +# Copyright 2018, SUSE LINUX GmbH. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- project: + check: + jobs: + - openstack-ansible-linters + - openstack-ansible-functional-ubuntu-xenial: + voting: false + experimental: + jobs: + - openstack-ansible-integrated-deploy-aio + gate: + jobs: + - openstack-ansible-linters