27 Commits

Author SHA1 Message Date
Bjorn Andersson
84fd5d56e8 Merge pull request #63 from quic-bjorande/for-linux-msm/silence-lava-testcase-test
helpers/bootrr: Silence the lava-test-case test
2024-04-23 16:15:15 -05:00
Bjorn Andersson
18baa908d7 Merge pull request #60 from nfraprado/usb-probe-test-upstream
Introduce USB device probe helper
2024-04-23 16:14:42 -05:00
Bjorn Andersson
76a2fde625 helpers/bootrr: Silence the lava-test-case test
`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>
2024-04-21 20:39:55 -07:00
Caleb Connolly
15802fb245 bin: generate: use POSIX sh and support spaces
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>
2023-09-25 15:18:27 +01:00
Nícolas F. R. A. Prado
bc331ca133 helpers: Introduce assert_usb_probed
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>
2023-09-07 16:23:15 -04:00
Mark Brown
6ac3e34d34 helpers: Fix bashism in cpufreq and cpuidle tests
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>
2023-01-17 22:53:16 -06:00
Dmitry Baryshkov
5f9f7904ab bootrr-auto: switch to using sh
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>
2021-11-01 11:48:12 -05:00
Dmitry Baryshkov
17d6cf968b helpers/rproc-start,-stop: use common test_report_exit helper
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>
2021-11-01 11:48:12 -05:00
Dmitry Baryshkov
dad8a13e9e helpers/bootrr: move timeout to separate helper
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>
2021-11-01 11:48:12 -05:00
Thara Gopinath
eda0e4bf25 boards/thundercomm,db845c: Add support for checking if cpufreq and cpuidle is enabled
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>
2021-02-25 08:18:09 -08:00
Aníbal Limón
37018e5143 boards/qcom,apq8016-sbc: Add soundcard testing
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>
2021-01-21 08:56:20 -08:00
Aníbal Limón
efe5691ee5 helpers: assert_{mmc,partition} use test_report_exit
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
2021-01-21 08:56:20 -08:00
Nicolas Dechesne
866d779bca thermal: combine all thermal zones into a single test
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>
2021-01-18 20:30:56 -08:00
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