Files
bootrr/helpers/rproc-stop
Dmitry Baryshkov 17d6cf968b helpers/rproc-start,-stop: use common test_report_exit helper
Use common test_report_exit implementation from the bootrr rather than
hand-coding lava-only version.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2021-11-01 11:48:12 -05:00

34 lines
647 B
Bash
Executable File

#!/bin/sh
. bootrr
TEST_CASE_ID="$1"
DEVICE="$2"
if [ -z "${TEST_CASE_ID}" -o -z "${DEVICE}" ]; then
echo "Usage: $0 <test-case-id> <rproc-device>"
exit 1
fi
if [ \! -d /sys/bus/*/devices/${DEVICE}/remoteproc ]; then
test_report_exit blocked
fi
RPROC_DIR=$(dirname /sys/bus/*/devices/${DEVICE}/remoteproc/remoteproc*/.)
if [ $(cat ${RPROC_DIR}/state) = "offline" ]; then
test_report_exit skip
fi
if [ $(cat ${RPROC_DIR}/state) != "running" ]; then
test_report_exit blocked
fi
echo stop > ${RPROC_DIR}/state || test_report_exit fail
if [ $(cat ${RPROC_DIR}/state) != "offline" ]; then
test_report_exit fail
fi
test_report_exit pass