From 5e3651343318d721b1e3346cb98154ad34e73fb0 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 3 Oct 2018 16:56:50 +0200 Subject: 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 --- afm-test.native.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'afm-test.native.sh') 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" ] -- cgit 1.2.3-korg