summaryrefslogtreecommitdiffstats
path: root/afm-test.native.sh
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-19 17:37:50 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-22 19:18:15 +0200
commit4f0fc5c1b993b6590c98a4d2d82a9b343875dad5 (patch)
treea6aa3d1263b9eb2536f9bf9d58af9ce06a343855 /afm-test.native.sh
parentf4eb0fa9e68ecc9eaac0398fbec47e8e9ebc668b (diff)
Improve native launching method
This will launch every verbs defined in the test configuration file instead of only the hardcoded launch_all_tests verbs Change-Id: Ibc890660cd2209516195ad0f3cf2069e2612b0d4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'afm-test.native.sh')
-rw-r--r--afm-test.native.sh21
1 files changed, 19 insertions, 2 deletions
diff --git a/afm-test.native.sh b/afm-test.native.sh
index 04212e0..9f9d6ca 100644
--- a/afm-test.native.sh
+++ b/afm-test.native.sh
@@ -96,12 +96,29 @@ export AFT_${ENV_API}_PLUGIN_PATH
PROCNAME="afbd-$(grep -Eo 'id=".*" ' "${SERVICEPACKAGEDIR}/config.xml" | cut -d'=' -f2 | tr -d '" '| tr '[:upper:]' '[:lower:]')"
SOCKETSERVICE="/tmp/$API"
+declare -a testVerb
+
+if [[ $(jq -r '.testVerb|type' ${TESTCFGFILE}) == "array" ]]
+then
+ testVerbLength=$(jq '.testVerb|length' ${TESTCFGFILE})
+ for (( idx=0; idx<testVerbLength; idx++ )) do
+ testVerb[$idx]=$(jq -r ".testVerb[$idx].uid" ${TESTCFGFILE})
+ done
+else
+ testVerb[0]=$(jq -r ".testVerb.uid" ${TESTCFGFILE})
+fi
+
export AFT_CONFIG_PATH="${TESTPACKAGEDIR}"
export AFT_PLUGIN_PATH="${TESTPACKAGEDIR}"
LOGFILESERVICE="test-service.log"
LOGFILETEST="test.log"
+testVerbLength=${#testVerb[@]}
+for (( idx=0; idx<testVerbLength; idx++ )) do
+ testVerbCalls="--call=${TESTAPINAME}/${testVerb[$idx]}:'{}' ${testVerbCalls}"
+done
+
if [ ${MODE} = "SOLO" ]
then
pkill "${TESTPROCNAME}"
@@ -115,7 +132,7 @@ then
--workdir="${TESTPACKAGEDIR}" \
--ldpaths="${SERVICEPACKAGEDIR}" \
--binding="${AFBTEST}" \
- --call="${TESTAPINAME}/launch_all_tests:{}" \
+ $(echo -e "${testVerbCalls}") \
--call="${TESTAPINAME}/exit:{}" \
-vvv &> "${LOGFILETEST}"
elif [ ${MODE} = "SERVICE" ]
@@ -140,7 +157,7 @@ then
--workdir="${TESTPACKAGEDIR}" \
--binding="${AFBTEST}" \
--ws-client=unix:"${SOCKETSERVICE}" \
- --call="${TESTAPINAME}/launch_all_tests:{}" \
+ $(echo -e "${testVerbCalls}") \
--call="${TESTAPINAME}/exit:{}" \
-vvv &> "${LOGFILETEST}"
else