Files
bootrr/helpers/value_in_range
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

29 lines
518 B
Bash
Executable File

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