zuul-jobs/test-playbooks/base-roles/fetch-output.yaml
James E. Blair a4e1f29468 Add base role integration jobs
These are jobs for the roles in this repo which are currently
tested by the "base-integration" job in openstack-zuul-jobs.
Move it into this repo and rename it "base-roles".

Change-Id: Ibd07964a08120e033bc5a2deca18649bd0e74a48
2019-07-04 14:16:15 +02:00

47 lines
1.4 KiB
YAML

- name: Run the fetch-output role
hosts: all
pre_tasks:
# ensure-output-dirs is run before this
- name: Write test log file
copy:
dest: '{{ zuul_output_dir }}/{{ item }}/{{ inventory_hostname }}'
content: '{{ item }}'
loop:
- logs
- docs
- artifacts
roles:
- role: fetch-output
post_tasks:
- name: Check that logs have been pulled
delegate_to: localhost
file:
# log_path fact is set in fetch-output
path: "{{ log_path }}/{{ inventory_hostname }}"
state: file
register: local_log_content
- name: Check that artifacts have been pulled
delegate_to: localhost
file:
path: "{{ zuul.executor.work_root }}/artifacts/{{ inventory_hostname }}"
state: file
register: local_artifact_content
- name: Check that docs have been pulled
delegate_to: localhost
file:
path: "{{ zuul.executor.work_root }}/docs/{{ inventory_hostname }}"
state: file
register: local_doc_content
- name: Validate that files were pulled correctly
assert:
that:
- local_log_content is not changed
- local_log_content is succeeded
- local_artifact_content is not changed
- local_artifact_content is succeeded
- local_doc_content is not changed
- local_doc_content is succeeded