From 73ee68376d5f86f9252ed1cca22f790a432a62ea Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Jul 28 2017 10:02:08 +0000 Subject: roles: More rigorous parsing of PASS/FAIL in beakerlib tests The parsing of PASS or FAIL status from a beakerlib test output needs to be more rigorous, or tests with lines like FAILED in their output will be triggered. --- diff --git a/roles/standard-test-beakerlib/tasks/main.yml b/roles/standard-test-beakerlib/tasks/main.yml index bacd0e7..f2918e2 100644 --- a/roles/standard-test-beakerlib/tasks/main.yml +++ b/roles/standard-test-beakerlib/tasks/main.yml @@ -121,7 +121,11 @@ - name: Make the master test summary log artifact shell: | logfile={{ remote_artifacts }}/test.$(echo {{ item }} | sed -e 's/\//-/g').log - if grep -q FAIL "$logfile"; then + if grep -q '\[ *FAIL *\]' "$logfile"; then + echo "FAIL {{ item }}" >> {{ remote_artifacts }}/test.log + elif grep -q '\[ *PASS *\]' "$logfile"; then + echo "PASS {{ item }}" >> {{ remote_artifacts }}/test.log + elif grep -q FAIL "$logfile"; then echo "FAIL {{ item }}" >> {{ remote_artifacts }}/test.log elif grep -q PASS "$logfile"; then echo "PASS {{ item }}" >> {{ remote_artifacts }}/test.log