Monty Taylor | 0d254d5 | 2017-08-26 13:26:29 -0500 | [diff] [blame] | 1 | - hosts: controller |
| 2 | tasks: |
| 3 | |
Monty Taylor | b81f2d0 | 2017-08-31 13:26:58 -0500 | [diff] [blame] | 4 | - name: Run ansible that should succeed |
| 5 | command: ansible-playbook src/git.openstack.org/openstack-infra/zuul/playbooks/zuul-stream/fixtures/test-stream.yaml |
Monty Taylor | 0d254d5 | 2017-08-26 13:26:29 -0500 | [diff] [blame] | 6 | environment: |
| 7 | ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json" |
| 8 | ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json" |
| 9 | |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 10 | - name: Run ansible playbook that should fail |
Monty Taylor | b81f2d0 | 2017-08-31 13:26:58 -0500 | [diff] [blame] | 11 | command: ansible-playbook src/git.openstack.org/openstack-infra/zuul/playbooks/zuul-stream/fixtures/test-stream-failure.yaml |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 12 | register: failed_results |
| 13 | failed_when: "failed_results.rc != 2" |
| 14 | environment: |
| 15 | ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json" |
| 16 | ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json" |
| 17 | |
David Shrewsbury | 13d6e58 | 2017-08-31 13:03:12 -0400 | [diff] [blame] | 18 | - name: Validate output - setupvar |
| 19 | shell: | |
| 20 | egrep "^.*\| node1 \|\s+\"setupvar\": {" job-output.txt |
| 21 | egrep "^.*\| node2 \|\s+\"setupvar\": {" job-output.txt |
| 22 | |
| 23 | - name: Validate output - shell task |
| 24 | shell: | |
Clark Boylan | 3d4e466 | 2017-09-06 12:35:17 -0700 | [diff] [blame] | 25 | egrep "^.*\| node1 \| link/loopback" job-output.txt |
| 26 | egrep "^.*\| node2 \| link/loopback" job-output.txt |
David Shrewsbury | 13d6e58 | 2017-08-31 13:03:12 -0400 | [diff] [blame] | 27 | |
| 28 | - name: Validate output - loop with items |
| 29 | shell: | |
| 30 | egrep "^.+\| node1 \| ok: Item: item1" job-output.txt |
| 31 | egrep "^.+\| node1 \| ok: Item: item2" job-output.txt |
| 32 | egrep "^.+\| node1 \| ok: Item: item3" job-output.txt |
| 33 | egrep "^.+\| node2 \| ok: Item: item1" job-output.txt |
| 34 | egrep "^.+\| node2 \| ok: Item: item2" job-output.txt |
| 35 | egrep "^.+\| node2 \| ok: Item: item3" job-output.txt |
| 36 | |
| 37 | - name: Validate output - loop with complex items |
| 38 | shell: | |
| 39 | egrep "^.+\| node1 \| ok: Item: Runtime" job-output.txt |
| 40 | egrep "^.+\| node2 \| ok: Item: Runtime" job-output.txt |
| 41 | |
| 42 | - name: Validate output - shell task with exception |
| 43 | shell: | |
| 44 | egrep "^.+\| node1 \| OSError.+\/shelltask\/" job-output.txt |
| 45 | egrep "^.+\| node2 \| OSError.+\/shelltask\/" job-output.txt |
| 46 | |
| 47 | - name: Validate output - item loop with exception |
| 48 | shell: | |
| 49 | egrep "^.+\| node1 \| OSError.+\/itemloop\/" job-output.txt |
| 50 | egrep "^.+\| node2 \| OSError.+\/itemloop\/" job-output.txt |
| 51 | |
| 52 | - name: Validate output - failure shell task with exception |
| 53 | shell: | |
| 54 | egrep "^.+\| node1 \| OSError.+\/failure-shelltask\/" job-output.txt |
| 55 | egrep "^.+\| node2 \| OSError.+\/failure-shelltask\/" job-output.txt |
| 56 | |
| 57 | - name: Validate output - failure item loop with exception |
| 58 | shell: | |
| 59 | egrep "^.+\| node1 \| OSError.+\/failure-itemloop\/" job-output.txt |
| 60 | egrep "^.+\| node2 \| OSError.+\/failure-itemloop\/" job-output.txt |