diff options
author | Bernard Ogden <bernie.ogden@linaro.org> | 2014-12-12 09:56:42 +0000 |
---|---|---|
committer | Bernard Ogden <bernie.ogden@linaro.org> | 2014-12-15 11:47:23 +0000 |
commit | ac57b83f7bf9e98ffd419523707bb91f86774caf (patch) | |
tree | 8fa3578dbebdf9d533b06d303e0a8a3820bbba2f | |
parent | ed9500eb125a2bc7a7f9162c781cda637d98b72d (diff) |
Ensure we see the output from lava.sh handlers
-rwxr-xr-x | scripts/runbenchmark.sh | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/scripts/runbenchmark.sh b/scripts/runbenchmark.sh index 4fa20a6..88c2cd5 100755 --- a/scripts/runbenchmark.sh +++ b/scripts/runbenchmark.sh @@ -10,6 +10,7 @@ benchmark= device= keep= cautious='' +lava_target= while getopts b:d:kc flag; do case "${flag}" in k) keep='-k';; @@ -102,15 +103,6 @@ clean_benchmark() kill "${listener_pid}" wait "${listener_pid}" fi - if test -d "${temps}"; then - exec 3>&- - exec 4>&- - rm -rf "${temps}" - if test $? -ne 0; then - echo "Failed to delete ${temps}" 1>&2 - error=1 - fi - fi if test x"${lava_pid}" != x; then if test ${clean} -ne 0; then @@ -120,7 +112,22 @@ clean_benchmark() kill "${lava_pid}" wait "${lava_pid}" fi + + #Make sure we see any messages from the lava.sh handlers + dd iflag=nonblock <&4 2>/dev/null | awk "{print \"${lava_target}: \" \$0}" + fi + + #Delete these last so that we can still get messages through the lava fifo + if test -d "${temps}"; then + exec 3>&- + exec 4>&- + rm -rf "${temps}" + if test $? -ne 0; then + echo "Failed to delete ${temps}" 1>&2 + error=1 + fi fi + exit "${error}" } @@ -167,6 +174,9 @@ if test $? -eq 0; then break fi done + #After this point, lava.sh should produce no output until we reach the exit handlers. + #Our exit handler checks the pipe from lava.sh before closing down. + if test x"${ip}" = x; then echo "+++ Failed to acquire LAVA target ${lava_target}" 1>&2 exit 1 |