Files
bootrr/helpers/assert_device_present
Nicolas Dechesne 8ed17b019a helpers/*: use '.' not 'source'
The 'source' command is a bashism, and not in the POSIX standard. So
it fails when using POSIX compliant shell such as Dash which is the
default on Debian. Using the '.' command is equivalent to using
source, and is POSIX compliant.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2018-06-18 12:33:27 -07:00

18 lines
340 B
Bash
Executable File

#!/bin/sh
. bootrr
TEST_CASE_ID="$1"
DRIVER="$2"
DEVICE="$3"
TIMEOUT="${4:-1}"
if [ -z "${TEST_CASE_ID}" -o -z "${DRIVER}" -o -z "${DEVICE}" ]; then
echo "Usage: $0 <test-case-id> <driver> <device> [<timeout>]"
exit 1
fi
timeout ${TIMEOUT} [ -L /sys/bus/*/drivers/${DRIVER}/${DEVICE} ] || test_report_exit fail
test_report_exit pass