From fea1a3cdc92bebf7cd5a090a5150dff9932b6e14 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 21 Jan 2020 10:27:12 +0100 Subject: [PATCH] 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 --- bench.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bench.sh b/bench.sh index 4c42cb10..dbbf22eb 100755 --- a/bench.sh +++ b/bench.sh @@ -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"