test: make helper_check_device_symlinks() less verbose

This commit is contained in:
Frantisek Sumsal 2021-09-14 14:36:04 +02:00
parent df72bd45f3
commit a0560b93ea

View file

@ -7,12 +7,17 @@ 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
local dev link paths target
[[ $# -gt 0 ]] && paths=("$@") || paths=("/dev/disk")
while read -r link; do
target="$(readlink -f "$link")"
echo "$link -> $target"
# Both checks should do virtually the same thing, but check both to be
# on the safe side
if [[ ! -e "$link" || ! -e "$target" ]]; then