Files
bootrr/helpers/assert_device_present
Bjorn Andersson 94e92916fd bootrr: Move common functions to bootrr
Move the common functions to a helper and use this from
assert_device_present.

Make assert_device_present accept a fourth parameter for a timeout,
which will cause the assert to wait for the given amount of time for the
device to appear.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-07 18:07:09 -08:00

18 lines
354 B
Bash
Executable File

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