diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-20 02:12:18 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-23 17:31:26 +0000 |
commit | 7ba30135732fc49bfadd5866c08be7080c9f3937 (patch) | |
tree | 83c50d815b0a007f4594f9f4bef8dfbbe2dac903 /test-wgt | |
parent | 92c55f032bc8f49186e68ea85783a027c7ad6b38 (diff) |
Select the test set to runhalibut_7.90.0halibut/7.90.0guppy_6.99.4guppy_6.99.3guppy_6.99.2guppy_6.99.1guppy/6.99.4guppy/6.99.3guppy/6.99.2guppy/6.99.17.90.06.99.46.99.36.99.26.99.1
The widget launcher script has been modified to use the environment
variable VERBSELECTED and VERBARGS. Then you are able to select a test set
defined by the testVerb configuration section in your JSON configuration file.
You can also use the special argument {'lavaOutput': true} to enable specials
Lava markers on the output.
Change-Id: If677cbbc8cb6cf6eb1bdf9f76b83f5e7976dd5a5
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'test-wgt')
-rw-r--r-- | test-wgt/launcher.sh.in | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/test-wgt/launcher.sh.in b/test-wgt/launcher.sh.in index 7414a7b..1dac914 100644 --- a/test-wgt/launcher.sh.in +++ b/test-wgt/launcher.sh.in @@ -21,6 +21,8 @@ PORT=$1 TOKEN=$2 +[ ! "${VERBSELECTED}" ] && VERBSELECTED="*" + # Research the Api name used CFGFILE=$(find ${AFM_APP_INSTALL_DIR} -name "*json" -print | head -n1) API=$(grep '\"api\"' ${CFGFILE} | cut -d'"' -f4) @@ -32,19 +34,36 @@ mkfifo $AFBCLIENTOUT declare -a testVerb -if [[ $(jq '.testVerb|type' $CFGFILE) == "array" ]] +if [[ $(jq -r '.testVerb|type' $CFGFILE) == "array" ]] then - testVerbLength=$(jq '.testVerb | length') - for (( idx=0; idx<testVerbLength; idx++ )) do - testVerb[$idx]=$(jq -r ".testVerb[$idx].uid" ${CFGFILE}) - done + testVerbLength=$(jq '.testVerb|length' $CFGFILE) + if [ "$VERBSELECTED" = "*" ] + then + # Get all the verbs of the test api + for (( idx=0; idx<testVerbLength; idx++ )) do + testVerb[$idx]=$(jq -r ".testVerb[$idx].uid" ${CFGFILE}) + done + else + # You search for a exact matching verb so there should be only one match + for (( idx=0; idx<testVerbLength; idx++ )) do + [ "$(jq -r ".testVerb[$idx].uid" ${CFGFILE})" = "$VERBSELECTED" ] && \ + testVerb[0]=$(jq -r ".testVerb[$idx].uid" ${CFGFILE}) + done + fi else - testVerb[0]=$(jq -r ".testVerb.uid" ${CFGFILE}) + if [ "$VERBSELECTED" = "*" ] + then + testVerb[0]=$(jq -r ".testVerb.uid" ${CFGFILE}) + else + [ "$(jq -r ".testVerb[0].uid" ${CFGFILE})" = "$VERBSELECTED" ] && \ + testVerb[0]=$(jq -r ".testVerb[$idx].uid" ${CFGFILE}) + fi fi testVerbLength=${#testVerb[@]} for (( idx=0; idx<testVerbLength; idx++ )) do - afb-client-demo -s ws://localhost:${PORT}/api?token=${TOKEN} "$API" "${testVerb[$idx]}" + echo "Launching ${testVerb[$idx]}" + afb-client-demo -s ws://localhost:${PORT}/api?token=${TOKEN} "$API" "${testVerb[$idx]}" "${VERBARGS}" done afb-client-demo ws://localhost:${PORT}/api?token=${TOKEN} "$API" "exit" |