TT#72700 bench.sh: fix fail detection of commands on pipe

http://www.gnu.org/software/bash/manual/bashref.html

The exit status of a pipeline is the exit status of the last command in
the pipeline, unless the pipefail option is enabled (see The Set Builtin).
If pipefail is enabled, the pipeline's return status is the value of the
last (rightmost) command to exit with a non-zero status, or zero if all
commands exit successfully.

Change-Id: I708c3a48084e97ab2fc6186dfdd666e7f5ab5ee6
changes/82/36982/1
Victor Seva 6 years ago
parent 2b9e6a8528
commit fea1a3cdc9

@ -45,6 +45,7 @@ if ! "${SKIP_CONFIG}" ; then
fi
echo "$(date) - Starting $NUM tests"
set -o pipefail
for i in $(seq "$NUM"); do
./run_tests.sh "${RUN_OPS[@]}" | tee /tmp/run_tests.log
status=$?
@ -63,6 +64,7 @@ for i in $(seq "$NUM"); do
mv log "log_$i"
mv result "result_$i"
done
set +o pipefail
if ! "${SKIP_CONFIG}" ; then
echo "remove configuration for tests"

Loading…
Cancel
Save