test: use subshells a bit more

to tweak shell flags in specific functions without affecting the rest of
the script.
This commit is contained in:
Frantisek Sumsal
2021-09-18 20:44:34 +02:00
parent b216501a8e
commit de11005c1a
2 changed files with 32 additions and 34 deletions
+3 -5
View File
@@ -6,10 +6,8 @@ set -o pipefail
# Check if all symlinks under /dev/disk/ are valid
# shellcheck disable=SC2120
helper_check_device_symlinks() {
# Disable verbose logging only for this function (and reset the signal handler
# when leaving the function)
set +x; trap "trap - RETURN; set -x" RETURN
helper_check_device_symlinks() {(
set +x
local dev link path paths target
@@ -40,7 +38,7 @@ helper_check_device_symlinks() {
return 1
fi
done < <(find "${paths[@]}" -type l)
}
)}
testcase_megasas2_basic() {
lsblk -S