Fix tee statement for catching tempest output

The use of exec and tee doesn't seem to be quite right, and was
unreliable in terms of catching the exit status of the tempest
test as well as not catching the output when things went wrong.

This changes the way we do the redirect and the tee to something
that should be more robust and seems to work reliably in testing.

Change-Id: Ieb9d725839fb8e3f9e2e63a2b7b2e9c7c86713a2
This commit is contained in:
John Griffith 2014-02-13 22:56:29 +00:00
parent 305bad7887
commit d6997d3176

View File

@ -89,9 +89,8 @@ start_cinder
sleep 5 sleep 5
# run tempest api/volume/test_* # run tempest api/volume/test_*
log_message "Run the actual tempest volume tests (./tools/pretty_tox.sh api.volume_*)...", True log_message "Run the actual tempest volume tests (./tools/pretty_tox.sh api.volume)...", True
exec 2> >(tee -a $TEMPFILE) ./tools/pretty_tox.sh api.volume 2>&1 | tee -a $TEMPFILE
`./tools/pretty_tox.sh api.volume`
if [[ $? = 0 ]]; then if [[ $? = 0 ]]; then
log_message "CONGRATULATIONS!!! Device driver PASSED!", True log_message "CONGRATULATIONS!!! Device driver PASSED!", True
log_message "Submit output: ($TEMPFILE)" log_message "Submit output: ($TEMPFILE)"