From fe86ade858ec4d9cb6913b1b9c280ad5214ef28b Mon Sep 17 00:00:00 2001 From: Ronny Nilsson Date: Sun, 8 Nov 2020 01:10:53 +0100 Subject: [PATCH] iop: Refactor, extract to separate function. --- iop/scripts/taas.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/iop/scripts/taas.sh b/iop/scripts/taas.sh index c4cc4c4e9..e53168d0b 100644 --- a/iop/scripts/taas.sh +++ b/iop/scripts/taas.sh @@ -5,9 +5,8 @@ # https://dev.iopsys.eu/iopsys/iopsys-taas -function smoketest { - local image app - +#-------------------------------------------------------------- +function taas-init() { # Path to TaaS binarys. Try some likely ones. if ! which taas-smoketest >/dev/null; then PATH="${PATH}:${PWD}/../iopsys-taas/bin" @@ -34,6 +33,15 @@ function smoketest { exit 1 fi done +} + + + +#-------------------------------------------------------------- +function taas-smoketest { + local image app + + taas-init || return # Find the default latest image (.y3 or FIT). for image in bin/targets/iopsys-*/generic/last.y3 \ @@ -56,7 +64,7 @@ function smoketest { esac if [ -n "$product" ]; then - taas-smoketest "$image" "$product" || exit + command taas-smoketest "$image" "$product" || exit echo "Smoketest OK" else echo "Unsupported target; skipping smoketest." @@ -69,5 +77,5 @@ function smoketest { exit 1 } -register_command "smoketest" "Write image to a device in the lab and check if it boots up." +register_command "taas-smoketest" "Write image to a device in the lab and check if it boots up."