blob: 927503772eebf7118f4660e4fd0187c773ed2edd [file] [log] [blame]
Monty Taylor0d254d52017-08-26 13:26:29 -05001- hosts: controller
2 tasks:
3
Monty Taylorb81f2d02017-08-31 13:26:58 -05004 - 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 Taylor0d254d52017-08-26 13:26:29 -05006 environment:
7 ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
8 ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
9
Monty Tayloreb093982017-08-30 19:16:21 -050010 - name: Run ansible playbook that should fail
Monty Taylorb81f2d02017-08-31 13:26:58 -050011 command: ansible-playbook src/git.openstack.org/openstack-infra/zuul/playbooks/zuul-stream/fixtures/test-stream-failure.yaml
Monty Tayloreb093982017-08-30 19:16:21 -050012 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 Shrewsbury13d6e582017-08-31 13:03:12 -040018 - 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: |
25 egrep "^.*\| node1 \| link/loopback" job-output.txt
26 egrep "^.*\| node2 \| link/loopback" job-output.txt
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