openstack-zuul-jobs/tests/fetch-zuul-cloner.yaml
David Moreau-Simard 56eb8fc485
Add integration tests for fetch-zuul-cloner
This role is included by default in base jobs. We don't want to
merge a regression that would break every job. Let's test it.

Change-Id: Icb37cb43c40358719157ef7278b5e4df67574edb
2017-10-13 16:01:41 -04:00

27 lines
719 B
YAML

- name: Test the fetch-zuul-cloner role
hosts: all
vars:
destination: "/usr/zuul-env/bin/zuul-cloner"
repo_src_dir: "/home/zuul/src/git.openstack.org"
roles:
- role: fetch-zuul-cloner
post_tasks:
- name: Check that the directory exists
file:
path: "{{ destination | dirname }}"
state: directory
register: directory
- name: Check that the zuul-cloner shim exists
stat:
path: "{{ destination }}"
register: cloner
- name: Validate that the shim was installed successfully
assert:
that:
- not directory | changed
- directory | succeeded
- cloner.stat.exists
- cloner.stat.mode == "0755"