diff options
author | RĂ©mi Duraffort <remi.duraffort@linaro.org> | 2018-07-13 09:58:01 +0200 |
---|---|---|
committer | Neil Williams <neil.williams@linaro.org> | 2018-07-13 13:07:08 +0000 |
commit | 01faa5d415a44b2237f2cdbd8b3a5ff03a9fad39 (patch) | |
tree | 76d29d29cc1e7d3c16c4793f7861ebfe45f55574 | |
parent | 0216c20cc3baa97a5a980b221a0a941096a2f6fc (diff) |
Port 41747ab2 to android lava-test-runner
Change-Id: Idd4d55a81df7a0fd332fdc0d06e23922362370bc
-rwxr-xr-x | lava_dispatcher/lava_test_shell/distro/android/lava-test-runner | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/lava_dispatcher/lava_test_shell/distro/android/lava-test-runner b/lava_dispatcher/lava_test_shell/distro/android/lava-test-runner index 26c19c36c..7d277c9ed 100755 --- a/lava_dispatcher/lava_test_shell/distro/android/lava-test-runner +++ b/lava_dispatcher/lava_test_shell/distro/android/lava-test-runner @@ -1,3 +1,4 @@ +set +x LCK=${LCK-"/lava-test-runner.lck"} @@ -15,27 +16,24 @@ else LAVA_PATH=$1 fi -echo $LAVA_PATH -PREFIX="<LAVA_TEST_RUNNER>:" WORKFILE="$LAVA_PATH/lava-test-runner.conf" RESULTSDIR="$LAVA_PATH/results" BINDIR="$LAVA_PATH/../bin" +. $BINDIR/lava-common-functions + cleanup() { - # just adds a little handy debugging - ls ${RESULTSDIR} - echo "${PREFIX} exiting lava-test-runner" + signal "<LAVA_TEST_RUNNER EXIT>" } { trap cleanup INT TERM EXIT export PATH=${BINDIR}:${PATH} - echo "${PREFIX} started" mkdir -p ${RESULTSDIR} - echo "${PREFIX} disabling suspend and waiting for home screen ..." + signal "<LAVA_TEST_RUNNER disabling suspend and waiting for home screen ...>" disablesuspend.sh # move the workfile to something timestamped and run that. This @@ -44,30 +42,24 @@ cleanup() mv ${WORKFILE} ${WORKFILE}-${TS} WORKFILE=${WORKFILE}-${TS} - echo "${PREFIX} looking for work in ${WORKFILE}" - for line in $(cat ${WORKFILE}); do + for line in $(cat ${WORKFILE} | grep -v LAVA_SIGNAL); do # we don't have "basename" on android, but this does the # equivalent under mksh - testdir=${line%/} # trim off trailing slash iff it exists + testdir=${line%/} # trim off trailing slash if it exists test=${testdir/*\//} - echo "${PREFIX} running ${test} under lava-test-shell..." odir=${RESULTSDIR}/${test}-`date +%s` mkdir ${odir} - cp ${line}/testdef.yaml ${odir}/ - cp ${line}/testdef_metadata ${odir}/ if [ -f ${line}/install.sh ]; then - echo "${PREFIX} running ${test} installer ..." /system/bin/sh ${line}/install.sh R=$? echo ${R} > ${odir}/install_return_code if [ ${R} -ne 0 ] ; then - echo "${PREFIX} ${test} installer failed, skippig" + signal "<LAVA_TEST_RUNNER INSTALL_FAIL>" continue fi fi lava-test-shell --output_dir ${odir} /system/bin/sh -e "${line}/run.sh" - echo "${PREFIX} ${test} exited with: `cat ${odir}/return_code`" done } |