Files
bootrr/helpers/state_check
Nicolas Dechesne 866d779bca thermal: combine all thermal zones into a single test
Instead of reporting each thermal zone independently, test them all in
batch mode, and report one test case. When looking at the lists of
test results we will now have the same tests name for any platform
instead of a different number of tests executed for each of them.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2021-01-18 20:30:56 -08:00

27 lines
471 B
Bash
Executable File

#!/bin/sh
. bootrr
TEST_CASE_ID="$1"
STATE="$2"
shift 2
# one or more files to check in batch mode
LOC="$*"
if [ -z "${TEST_CASE_ID}" -o -z "${LOC}" -o -z "${STATE}" ]; then
echo "Usage: $0 <test-case-id> <path> <desired state> [<timeout>]"
exit 1
fi
for f in ${LOC}; do
[ -r "${f}" ] || test_report_exit fail
val=$(cat "$f")
if [ "${val}" != "${STATE}" ]; then
test_report_exit fail
fi
done
# if we are here, everything is all right!
test_report_exit pass