Validate zuul_stream func test output

If we have to visually inspect the output of this test on every
run, we will fail, because we will certainly not visually inspect
the output of this test on every run. Let's at least try to
automate some of the validation.

Change-Id: Ib3b060c60d6037f664636b8854aa488573826a06
This commit is contained in:
David Shrewsbury 2017-08-31 13:03:12 -04:00
parent 90dca7b5ca
commit 13d6e58a99
3 changed files with 49 additions and 5 deletions

View File

@ -7,9 +7,9 @@
- name: Run a shell task with an ansible python exception
command: echo foo
args:
chdir: /somewhere/that/does/not/exist
chdir: /failure-shelltask/somewhere/that/does/not/exist
- always:
always:
- name: Loop with items on an ansible python exception
command: "echo {{ item }}"
@ -18,4 +18,4 @@
- item2
- item3
args:
chdir: /somewhere/that/does/not/exist
chdir: /failure-itemloop/somewhere/that/does/not/exist

View File

@ -30,7 +30,7 @@
- name: Run a shell task with an ansible python exception
command: echo foo
args:
chdir: /somewhere/that/does/not/exist
chdir: /shelltask/somewhere/that/does/not/exist
failed_when: false
- name: Loop with items on an ansible python exception
@ -40,5 +40,5 @@
- item2
- item3
args:
chdir: /somewhere/that/does/not/exist
chdir: /itemloop/somewhere/that/does/not/exist
failed_when: false

View File

@ -15,6 +15,50 @@
ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
- 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 \| link/loopback" job-output.txt
egrep "^.*\| node2 \| link/loopback" 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: Generate ARA html
command: ara generate html ara-output