From c580e7c73719e6cdfd0a28b577d8e1108fd67cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Fri, 2 Aug 2024 14:00:14 +0200 Subject: [PATCH] testing/test_runner: Only set errexit during setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/testing/test_runner.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/testing/test_runner.sh b/lib/testing/test_runner.sh index 696af794..8c8ac85d 100755 --- a/lib/testing/test_runner.sh +++ b/lib/testing/test_runner.sh @@ -8,7 +8,6 @@ # Date: 26 May 2020 # Copyright (c) 2020 Red Hat -set -o errexit set -o nounset umask 077 @@ -336,6 +335,8 @@ setup() { local nsname + set -o errexit + check_prereq for i in $(seq $NUM_NS); do @@ -344,6 +345,8 @@ setup() NS_NAMES+=($nsname) done + set +o errexit + NS=$nsname }