diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-03 16:56:50 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-10 10:53:48 +0200 |
commit | 5e3651343318d721b1e3346cb98154ad34e73fb0 (patch) | |
tree | 1862e52afe29753f07b1fce286d476e38d5ff2d7 | |
parent | c3aae9cf738846563a0d6b5abb4a3aed55110fcc (diff) |
Avoid to kill anything when no config file found
Display an error and exit if no JSON test configuration
file found. Else it would kill your user session.
Change-Id: Idbd92c47fafc5c1b75397ec729b29abb49c607b1
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | afm-test.native.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/afm-test.native.sh b/afm-test.native.sh index e117ada..15be083 100644 --- a/afm-test.native.sh +++ b/afm-test.native.sh @@ -68,6 +68,9 @@ fi TESTCFGFILE=$(find "${TESTPACKAGEDIR}" -name "aft-*.json" -print | head -n1) TESTPROCNAME=$(grep '\"api\"' "${TESTCFGFILE}" | cut -d'"' -f4) +[ -z "${TESTPROCNAME}" ] && \ +echo "Can't find 'api' key from your test configuration file: ${TESTCFGFILE}.\n Either configuration file doesn't exist either it is incorrect." && \ +cleanNexit 4 API=$(grep "provided-api" "${SERVICEPACKAGEDIR}/config.xml" -A1 2> /dev/null | sed -r -e '1d' -e 's:.*"(.*)" v.*:\1:' 2> /dev/null) if [ -z "$API" ] && [ "$MODE" = "SERVICE" ] |