Skip to content

Commit

Permalink
rootfs/bookworm-gst-fluster: Rework error handling for missing test s…
Browse files Browse the repository at this point in the history
…uites

This patch changes missing test suite error handling to:
- fail (with message) if no test suite was passed to downloader function
- allow readlink to fail and then handle its error with debugging
  message

Signed-off-by: Paweł Wieczorek <[email protected]>
  • Loading branch information
pawiecz authored and nuclearcat committed Aug 19, 2024
1 parent 8752213 commit a7ce4ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions config/rootfs/debos/scripts/bookworm-gst-fluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,20 @@ extract_vector_from_archive() {
}

download_fluster_testsuite() {
json_file=$(readlink -e "${1}")
local fluster_testsuite="${1}"

[ -z "${json_file}" ] && {
[ -z "${fluster_testsuite}" ] && {
echo "No JSON test suite file provided"
exit 1
}

# disable set -e (immediate exit) to allow error handling after readlink failure
set +e
json_file=$(readlink -e "${fluster_testsuite}")
set -e

if [ ! -f "${json_file}" ]; then
echo "${json_file} file not found!"
echo "${fluster_testsuite} file not found!"
exit 1
fi

Expand Down

0 comments on commit a7ce4ea

Please sign in to comment.