`command -v` is invoked to check if lava-test-case exists, to know if we
need to fake it using `echo`. But in the event that lava-test-case
actually exist it also prints the full path of the executable.
Pipe the output to /dev/null, as we only care about the exit code.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Handles drivers with spaces in their names, and simplify slightly by
using globbing to unwrap the bus for loop.
It's necessary to add the final '*' in the "for driver in" loop in
bootrr-generate-template on POSIX sh.
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Current bootrr helpers, assert_device_present and assert_driver_present,
use driver and device names, both of which are not part of the kernel's
stable ABI and end up requiring extra maintenance whenever those names
are changed, in order to check for the expected name on each kernel
version.
Introduce a new helper, assert_usb_probed, that verifies a USB device
has been probed, taking as parameters the device's hardware identifying
properties, which are documented kernel ABI: idVendor, idProduct,
bcdDevice, bDeviceClass, bDeviceSubClass, bDeviceProtocol,
bInterfaceClass, bInterfaceSubClass, bInterfaceProtocol,
bInterfaceNumber.
A 'count' parameter is also required, to inform the number of devices
matching these criteria that should have been probed. This allows the
test to verify the probe of multiple identical devices.
A '*' can be used as wildcard for any of the matching fields as
necessary.
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
The helpers for verifiying that cpufreq and cpuidle are enabled
use let which is a bash extension and not supported in standard
POSIX shell, including with busybox. Convert to use expr which
is standard.
Signed-off-by: Mark Brown <broonie@kernel.org>
There is nothing bash-specific in bootrr-auto, we can safely use /bin/sh
instead. Verified with dash and with busybox sh.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Use common test_report_exit implementation from the bootrr rather than
hand-coding lava-only version.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
There is no need to have timeout as a function in the bootrr file. Move
it to a separate helper file as we have for the rest of helpers.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Add helper files to check if cpufreq and cpuidle are enabled. Also
add the test support for db845c.
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
This test covers check for WCD and HDMI audio driver/devices and check
/proc/asound to ensure soundcard has devices attached.
Common assert_soundcard_present is implemented to check /proc/asound for
soundcards a devices associated with it. In this case 2 Playbacks and 1
Capture device.
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Instead of reporting each thermal zone independently, test them all in
batch mode, and report one test case. When looking at the lists of
test results we will now have the same tests name for any platform
instead of a different number of tests executed for each of them.
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>