Files
bootrr/helpers/assert_sysfs_attr_present
Enric Balletbo i Serra cc048442a7 helpers: Add assert_sysfs_attr_present helper
This helper is useful to check if a sysfs attribute is present.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
2019-02-04 14:51:21 -08:00

17 lines
308 B
Bash
Executable File

#!/bin/sh
. bootrr
TEST_CASE_ID="$1"
SYSFS_ATTRIBUTE="$2"
TIMEOUT="${3:-1}"
if [ -z "${TEST_CASE_ID}" -o -z "${SYSFS_ATTRIBUTE}" ]; then
echo "Usage: $0 <test-case-id> <sysfs attribute> [<timeout>]"
exit 1
fi
timeout ${TIMEOUT} [ -f ${SYSFS_ATTRIBUTE} ] || test_report_exit fail
test_report_exit pass