mirror of
https://github.com/linux-msm/bootrr.git
synced 2026-02-25 13:12:03 -08:00
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>
This commit is contained in:
committed by
Bjorn Andersson
parent
29a357b718
commit
cc048442a7
16
helpers/assert_sysfs_attr_present
Executable file
16
helpers/assert_sysfs_attr_present
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user