This commit was bulk generated and pushed by the OpenDev sysadmins as a part of the Git hosting and code review systems migration detailed in these mailing list posts: http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html Attempts have been made to correct repository namespaces and hostnames based on simple pattern matching, but it's possible some were updated incorrectly or missed entirely. Please reach out to us via the contact information listed at https://opendev.org/ with any questions you may have.
78 lines
3.1 KiB
YAML
78 lines
3.1 KiB
YAML
- hosts: controller
|
|
tasks:
|
|
|
|
- name: Set python path fact
|
|
set_fact:
|
|
python_path: "/usr/local/lib/python3.5/dist-packages"
|
|
|
|
- name: Run ansible that should succeed
|
|
command: >
|
|
/usr/lib/zuul/ansible/{{ zuul_ansible_version }}/bin/ansible-playbook
|
|
src/opendev.org/zuul/zuul/playbooks/zuul-stream/fixtures/test-stream.yaml
|
|
environment:
|
|
ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
|
|
ZUUL_JOBDIR: "{{ ansible_user_dir}}"
|
|
ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
|
|
PYTHONPATH: "{{ python_path }}"
|
|
|
|
- name: Run ansible playbook that should fail
|
|
command: >
|
|
/usr/lib/zuul/ansible/{{ zuul_ansible_version }}/bin/ansible-playbook
|
|
src/opendev.org/zuul/zuul/playbooks/zuul-stream/fixtures/test-stream-failure.yaml
|
|
register: failed_results
|
|
failed_when: "failed_results.rc != 2"
|
|
environment:
|
|
ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
|
|
ZUUL_JOBDIR: "{{ ansible_user_dir}}"
|
|
ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
|
|
PYTHONPATH: "{{ python_path }}"
|
|
|
|
- name: Validate output - setupvar
|
|
shell: |
|
|
egrep "^.*\| node1 \|\s+\"setupvar\": {" job-output.txt
|
|
egrep "^.*\| node2 \|\s+\"setupvar\": {" job-output.txt
|
|
|
|
- name: Validate output - shell task
|
|
shell: |
|
|
egrep "^.*\| node1 \| 1: lo:" job-output.txt
|
|
egrep "^.*\| node2 \| 1: lo:" job-output.txt
|
|
|
|
- name: Validate output - loop with items
|
|
shell: |
|
|
egrep "^.+\| node1 \| ok: Item: item1" job-output.txt
|
|
egrep "^.+\| node1 \| ok: Item: item2" job-output.txt
|
|
egrep "^.+\| node1 \| ok: Item: item3" job-output.txt
|
|
egrep "^.+\| node2 \| ok: Item: item1" job-output.txt
|
|
egrep "^.+\| node2 \| ok: Item: item2" job-output.txt
|
|
egrep "^.+\| node2 \| ok: Item: item3" job-output.txt
|
|
|
|
- name: Validate output - loop with complex items
|
|
shell: |
|
|
egrep "^.+\| node1 \| ok: Item: Runtime" job-output.txt
|
|
egrep "^.+\| node2 \| ok: Item: Runtime" job-output.txt
|
|
|
|
- name: Validate output - shell task with exception
|
|
shell: |
|
|
egrep "^.+\| node1 \| OSError.+\/shelltask\/" job-output.txt
|
|
egrep "^.+\| node2 \| OSError.+\/shelltask\/" job-output.txt
|
|
|
|
- name: Validate output - item loop with exception
|
|
shell: |
|
|
egrep "^.+\| node1 \| OSError.+\/itemloop\/" job-output.txt
|
|
egrep "^.+\| node2 \| OSError.+\/itemloop\/" job-output.txt
|
|
|
|
- name: Validate output - failure shell task with exception
|
|
shell: |
|
|
egrep "^.+\| node1 \| OSError.+\/failure-shelltask\/" job-output.txt
|
|
egrep "^.+\| node2 \| OSError.+\/failure-shelltask\/" job-output.txt
|
|
|
|
- name: Validate output - failure item loop with exception
|
|
shell: |
|
|
egrep "^.+\| node1 \| OSError.+\/failure-itemloop\/" job-output.txt
|
|
egrep "^.+\| node2 \| OSError.+\/failure-itemloop\/" job-output.txt
|
|
|
|
- name: Validate output - binary data
|
|
shell: |
|
|
egrep "^.*\| node1 \| \\\\x80abc" job-output.txt
|
|
egrep "^.*\| node2 \| \\\\x80abc" job-output.txt
|