Files
bootrr/helpers/assert_device_present
Nicolas Dechesne 45640e5b26 helpers/*: do not assume /usr/bin/
The helpers assume that bootrr script is located in /usr/bin, which is
not always the case, especially when one needs to run the test locally
from the git tree.

'source' command will search for files using $PATH. When bootrr
scripts are installed globally using 'make install' they will be
found. When running them from a local folder, setting PATH to include
<bootrr>/helpers will ensure that all scripts will be found.

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

18 lines
345 B
Bash
Executable File

#!/bin/sh
source 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