Skip to content

Commit

Permalink
testing/test_runner: Only set errexit during setup
Browse files Browse the repository at this point in the history
We rely on `set -o errexit` to abort tests if any of the setup commands fail.
However, we don't want this turned on during test execution, since we rely on
explicit checks using check_run() to check the output of certain commands in the
tests. So move the errexit to cover only the setup function.

Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
  • Loading branch information
tohojo committed Aug 5, 2024
1 parent 5c7239b commit c580e7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/testing/test_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# Date: 26 May 2020
# Copyright (c) 2020 Red Hat

set -o errexit
set -o nounset
umask 077

Expand Down Expand Up @@ -336,6 +335,8 @@ setup()
{
local nsname

set -o errexit

check_prereq

for i in $(seq $NUM_NS); do
Expand All @@ -344,6 +345,8 @@ setup()
NS_NAMES+=($nsname)
done

set +o errexit

NS=$nsname
}

Expand Down

0 comments on commit c580e7c

Please sign in to comment.