Commit Graph

14 Commits

Author SHA1 Message Date
Bjorn Andersson
5ed816e004 helpers: device_present: Report driverless devices as blocked
Typical use of assert_device_present is to first assert_driver_present
and then check for the individual devices. Let the driver check fail and
report any of the device tests as blocked if the driver is not present.

This makes it clearer in the output that a device test failed due to the
lack of the driver, rather than some other aspect.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-10-11 21:25:12 -07:00
Fabien Lahoudere
d3ac0bc9be helpers: Add script to perform generic tests
Some tests does not depend on a board. We can consider these tests
as generic and bootrr-generic-tests is added to contain them.
This scripts is started at the begining of bootrr-auto before boards
specific tests.

Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
2019-05-08 09:00:50 -07:00
Enric Balletbo i Serra
4523c42196 helpers: Add an script to check if a file is empty
We might be interested on check if a file is empty or not. One use case
is check if the /sys/kernel/debug/devices_deferred file is not empty, in
such case mean that a driver is deferred for some reason so probe didn't
succeed.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
2019-05-08 09:00:50 -07:00
Enric Balletbo i Serra
bdec57ba38 helpers: Add a helper script to run the tests for device-tree based devices
Based on the compatible string you can identify which device model is running,
so add a helper script that allows you to detect which test suite should
be run.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
2019-05-08 09:00:50 -07:00
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
Amit Kucheria
a2cc1741bb helpers: Add value_in_range helper
This helper is useful to check if a value is within a given range e.g.
temperature is between 30 and 40 degrees.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2018-07-26 06:06:57 -07:00
Amit Kucheria
4ea31c5af8 helpers: Add state_check helper
This helper is useful to check the state of a sysfs variable, e.g. enabled,
disabled, running, offline, etc.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2018-07-26 06:06:57 -07:00
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
Nicolas Dechesne
8db9a55c02 bootrr: emulate lava-test-case command
In case lava-test-command is not available, emulate what it is
supposed to do. This is a convenient hack to make it easier to run
bootrr locally for debug/testing purpose.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2018-06-18 12:33:27 -07:00
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
Bjorn Andersson
f6e0bdda08 helpers: Allow timeout in assert_driver as well
Drivers for hardware on dynamically probed busses might take a while to
autoload, so add support for specifying a timeout for these.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-05-25 14:52:26 -07:00
Bjorn Andersson
8390be2bcb ensure_lib_firmware: Use bootrr helper and add timeout
Use bootrr helpers to support waiting for some time for the partition to
appear before giving up. This removes the need for putting an explicit
sleep in the test script.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-07 18:32:24 -08:00
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
Bjorn Andersson
ede63f2b8a make: Move files into subdirectories
Instead of mixing helpers and board files move them to separate folders.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-06 14:20:41 -08:00