summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Wienand <iwienand@redhat.com>2022-08-17 07:43:50 +1000
committerIan Wienand <iwienand@redhat.com>2022-08-18 09:44:53 +1000
commita145daa4dd0955b2bdff27a3a49b2ff8095415ad (patch)
treef0ee4c5cfb78fa599df643b99f5c77bd40196803
parent61a5b7f0934aec9380a80ddca70c24555f472caf (diff)
downloadzuul-a145daa4dd0955b2bdff27a3a49b2ff8095415ad.tar.gz
zuul-stream: validate on per node basis
This is a small refactor to check the output of each node separately. This should have no effect, but makes it easier to add more testing in a follow-on change. Change-Id: Ic5d490c54da968b23fed068253f5be0249ea953a
-rw-r--r--playbooks/zuul-stream/functional.yaml6
-rw-r--r--playbooks/zuul-stream/validate.yaml27
2 files changed, 13 insertions, 20 deletions
diff --git a/playbooks/zuul-stream/functional.yaml b/playbooks/zuul-stream/functional.yaml
index 7ae4704a9..b8a44a87c 100644
--- a/playbooks/zuul-stream/functional.yaml
+++ b/playbooks/zuul-stream/functional.yaml
@@ -77,8 +77,10 @@
- name: Validate outputs
include_tasks: validate.yaml
loop:
- - job-output-success-19887.txt
- - job-output-success-19885.txt
+ - { node: 'node1', filename: 'job-output-success-19887.txt' }
+ - { node: 'node2', filename: 'job-output-success-19887.txt' }
+ - { node: 'node1', filename: 'job-output-success-19885.txt' }
+ - { node: 'node2', filename: 'job-output-success-19885.txt' }
# failure case
diff --git a/playbooks/zuul-stream/validate.yaml b/playbooks/zuul-stream/validate.yaml
index 73ccd873a..81c613406 100644
--- a/playbooks/zuul-stream/validate.yaml
+++ b/playbooks/zuul-stream/validate.yaml
@@ -1,38 +1,29 @@
- name: Validate output - setupvar
shell: |
- egrep "^.*\| node1 \|\s+\"setupvar\": {" {{ item }}
- egrep "^.*\| node2 \|\s+\"setupvar\": {" {{ item }}
+ egrep "^.*\| {{ item.node }} \|\s+\"setupvar\": {" {{ item.filename }}
- name: Validate output - shell task
shell: |
- egrep "^.*\| node1 \| 1: lo:" {{ item }}
- egrep "^.*\| node2 \| 1: lo:" {{ item }}
+ egrep "^.*\| {{ item.node }} \| 1: lo:" {{ item.filename }}
- name: Validate output - loop with items
shell: |
- egrep "^.+\| node1 \| ok: Item: item1" {{ item }}
- egrep "^.+\| node1 \| ok: Item: item2" {{ item }}
- egrep "^.+\| node1 \| ok: Item: item3" {{ item }}
- egrep "^.+\| node2 \| ok: Item: item1" {{ item }}
- egrep "^.+\| node2 \| ok: Item: item2" {{ item }}
- egrep "^.+\| node2 \| ok: Item: item3" {{ item }}
+ egrep "^.+\| {{ item.node }} \| ok: Item: item1" {{ item.filename }}
+ egrep "^.+\| {{ item.node }} \| ok: Item: item2" {{ item.filename }}
+ egrep "^.+\| {{ item.node }} \| ok: Item: item3" {{ item.filename }}
- name: Validate output - loop with complex items
shell: |
- egrep "^.+\| node1 \| ok: Item: Runtime" {{ item }}
- egrep "^.+\| node2 \| ok: Item: Runtime" {{ item }}
+ egrep "^.+\| {{ item.node }} \| ok: Item: Runtime" {{ item.filename }}
- name: Validate output - failed shell task
shell: |
- egrep "^.+\| node1 \| Exception: Test module failure exception task" {{ item }}
- egrep "^.+\| node2 \| Exception: Test module failure exception task" {{ item }}
+ egrep "^.+\| {{ item.node }} \| Exception: Test module failure exception task" {{ item.filename }}
- name: Validate output - item loop with exception
shell: |
- egrep "^.+\| node1 \| Exception: Test module failure exception loop" {{ item }}
- egrep "^.+\| node2 \| Exception: Test module failure exception loop" {{ item }}
+ egrep "^.+\| {{ item.node }} \| Exception: Test module failure exception loop" {{ item.filename }}
- name: Validate output - binary data
shell: |
- egrep "^.*\| node1 \| \\\\x80abc" {{ item }}
- egrep "^.*\| node2 \| \\\\x80abc" {{ item }}
+ egrep "^.*\| {{ item.node }} \| \\\\x80abc" {{ item.filename }}