Skip to content

Commit 26eb69d

Browse files
committed
testing/test_runner: Only set errexit during setup
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]>
1 parent 223c0fa commit 26eb69d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/testing/test_runner.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# Date: 26 May 2020
99
# Copyright (c) 2020 Red Hat
1010

11-
set -o errexit
1211
set -o nounset
1312
umask 077
1413

@@ -343,6 +342,8 @@ setup()
343342
{
344343
local nsname
345344

345+
set -o errexit
346+
346347
check_prereq
347348

348349
for i in $(seq $NUM_NS); do
@@ -351,6 +352,8 @@ setup()
351352
NS_NAMES+=($nsname)
352353
done
353354

355+
set +o errexit
356+
354357
NS=$nsname
355358
}
356359

0 commit comments

Comments
 (0)