summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-06-12tools/tbot: update READMEHeiko Schocher
refer in the README to tbots webpage, and delete the README in tools/tbot, as the latest documentation for tbot is on this webpage. Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-12test: bus: Add a check that dev is not NULLSimon Glass
We know that uclass_get_device() and device_find_child_by_of_offset() do not return NULL for dev when they succeeds but coverity does not. Add an extra check to hopefully keep it happy. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 163246) Fixes: 0753bc2 (dm: Simple Watchdog uclass)
2017-06-12test: wdt: Add a check that dev is not NULLSimon Glass
We know that uclass_get_device() does not return NULL for dev when it succeeds but coverity does not. Add an extra check to hopefully keep it happy. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 163247) Fixes: 0753bc2 (dm: Simple Watchdog uclass)
2017-06-12test: pwm: Add a check that dev is not NULLSimon Glass
We know that uclass_get_device() does not return NULL for dev when it succeeds but coverity does not. Add an extra check to hopefully keep it happy. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 161690) Fixes: 43b4156 (dm: sandbox: pwm: Add a basic pwm test)
2017-06-09dm: blk: Add a way to obtain a block device from its parentSimon Glass
Many devices support a child block device (e.g. MMC, USB). Add a convenient way to get this device given the parent device. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-06-05test: py: hush: Add echo dependencyMichal Simek
Some tests depends on echo command to be present. Reported-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2017-06-05test: py: Use global pytestmark for hush testsMichal Simek
All tests in test_hush_if_test depends on hush parser to be present. This patch simplify test dependencies by using global pytestmark. Reported-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Stephen Warren <swarren@nvidia.com>
2017-06-01dm: phy: Update tests to use ut_asserteq()Simon Glass
Use ut_asserteq() to test equality since this gives a better error message on failure. Also make a few of the tests more specific. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: test: Disable the fdt_offset test with livetreeSimon Glass
We cannot run this test with livetree since it uses device tree offsets. Mark it as flat tree only. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: test: Separate out the bus DT offset testSimon Glass
We cannot access the device tree via an offset when running in livetree mode. Separate out that part of the bus' children tests and mark it as for the flat tree only. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01test: Update 'make test' to run more testsSimon Glass
The standard sandbox board cannot run the of-platdata test since it needs SPL. Also, we should test the flat tree version of sandbox. Add these tests to the default test script. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: core: Run tests with both livetree and flat treeSimon Glass
Some tests require either livetree or flat tree. Add flags to allow the tests to specify this. Adjust the test runner to run with livetree (if supported) and then flat tree. Some video tests are quite slow and running on flat tree adds little extra test value, so run these on livetree only. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: test: Add support for running tests with livetreeSimon Glass
It is useful to run the driver model tests with both livetree and flat tree in case something is different between the two. Add this feature to the test runner. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: test: Show the test filename when runningSimon Glass
Show the filename of the test being run. Skip the path and show just the base name. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: test: Move test running code into a separate functionSimon Glass
We want to run the same test on flat and live trees. In preparation for this, create a new function which handles running a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01sandbox: Add a way to reset sandbox state for testsSimon Glass
Running a new test should reset the sandbox state to avoid tests interferring with each other. Move the existing state-reset code into a function so it can be used from tests. Also update the code to reset the SPI devices and adjust the test code to call it. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: core: Scan the live tree when setting up driver modelSimon Glass
When starting up driver model with a live tree we need to scan the tree for devices. Add code to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: blk: Improve block device claimingSimon Glass
The intention with block devices is that the device number (devnum field in its descriptor) matches the alias of its parent device. For example, with: aliases { mmc0 = "/sdhci@700b0600"; mmc1 = "/sdhci@700b0400"; } we expect that the block devices for mmc0 and mmc1 would have device numbers of 0 and 1 respectively. Unfortunately this does not currently always happen. If there is another MMC device earlier in the driver model data structures its block device will be created first. It will therefore get device number 0 and mmc0 will therefore miss out. In this case the MMC device will have sequence number 0 but its block device will not. To avoid this, allow a device to request a device number and bump any existing device number that is using it. This all happens during the binding phase so it is safe to change these numbers around. This allows device numbers to match the aliases in all circumstances. Add a test to verify the behaviour. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: blk: Allow finding block devices without probingSimon Glass
Sometimes it is useful to be able to find a block device without also probing it. Add a function for this as well as the associated test. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-22test: py: Add cmd_echo dependencyMichal Simek
There is missing dependency on echo command. Mark tests which requires echo. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2017-05-10dm: sandbox: pwm: add test for pwm_set_invert()Kever Yang
Add test case for new interface set_invert(). Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org> Fix typo in subject and build error in sandbox_pwm_set_invert(): Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-09dm: test: Add tests for the generic PHY uclassJean-Jacques Hiblot
Those tests check: - the ability for a phy-user to get a phy based on its name or its index - the ability of a phy device (provider) to manage multiple ports - the ability to perform operations on the phy (init,deinit,on,off) - the behavior of the uclass when optional operations are not implemented Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-05-08dm: Simple Watchdog uclassmaxims@google.com
This is a simple uclass for Watchdog Timers. It has four operations: start, restart, reset, stop. Drivers must implement start, restart and stop operations, while implementing reset is optional: It's default implementation expires watchdog timer in one clock tick. Signed-off-by: Maxim Sloyko <maxims@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-04-27dm: sandbox: pwm: Add a basic pwm testSimon Glass
Unfortunately a test for the PWM uclass was not included when it was submitted. This was noticed when trying to add more functionality: http://patchwork.ozlabs.org/patch/748172/ Add a simple test to get us started. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-15dm: led: Add support for blinking LEDsSimon Glass
Allow LEDs to be blinked if the driver supports it. Enable this for sandbox so that the tests run. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-15dm: led: Support toggling LEDsSimon Glass
Add support for toggling an LED into the uclass interface. This can be efficiently implemented by the driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-15dm: led: Add support for getting the state of an LEDSimon Glass
It is useful to be able to read the LED as well as write it. Add this to the uclass and update the GPIO driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-15dm: led: Adjust the LED uclassSimon Glass
At present this is very simple, supporting only on and off. We want to also support toggling and blinking. As a first step, change the name of the main method and use an enum to indicate the state. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ziping Chen <techping.chan@gmail.com>
2017-04-05dm: test: Add test for device removalStefan Roese
Add a test for the correct device removal. Currently two different ways for device removal are supported: - Normal device removal via the device_remove() API - Removal via selective device driver flags (DM_FLAG_ACTIVE_DMA) This new test "remove_active_dma" adds tests cases for those both ways of removal. This is done by adding a new test driver, which has this flag set. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org>
2017-04-05dm: core: Add flags parameter to device_remove()Stefan Roese
This patch adds the flags parameter to device_remove() and changes all calls to this function to provide the default value of DM_REMOVE_NORMAL for "normal" device removal. This is in preparation for the driver specific pre-OS (e.g. DMA cancelling) remove support. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2017-03-20test-fit.py: Minor grammar/spelling/clarification tweaksRobert P. J. Day
* Add note that execution needs Python development package installed * Standardize on upper case "FIT", "FDT" as necessary for clarity * Fix "tempoerary", "linex" typos Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2017-02-08dm: core: Replace of_offset with accessorSimon Glass
At present devices use a simple integer offset to record the device tree node associated with the device. In preparation for supporting a live device tree, which uses a node pointer instead, refactor existing code to access this field through an inline function. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-11-27travis: Add efi_loader grub2 testAlexander Graf
We have all the building blocks now to run arbitrary efi applications in travis. The most important one out there is grub2, so let's add a simple test to verify that grub2 still comes up. Signed-off-by: Alexander Graf <agraf@suse.de>
2016-11-27efi_loader: Allow to compile helloworld.efi w/o bundling itAlexander Graf
Today we can compile a self-contained hello world efi test binary that allows us to quickly verify whether the EFI loader framwork works. We can use that binary outside of the self-contained test case though, by providing it to a to-be-tested system via tftp. This patch separates compilation of the helloworld.efi file from including it in the u-boot binary for "bootefi hello". It also modifies the efi_loader test case to enable travis to pick up the compiled file. Because we're now no longer bloating the resulting u-boot binary, we can enable compilation always, giving us good travis test coverage. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-11-26tests: Add efi_loader hello world testAlexander Graf
Now that we have working network tests and a hello world efi application built inside our tree, we can automatically test that efi binary running inside of U-Boot. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-11-26tests: net: Offset downloads to 4MBAlexander Graf
The network test currently downloads files at 0MB offset of RAM start. This works for most ARM systems, but x86 has weird memory layout constraints on the first MB of RAM. To not get caught into any of these, let's add a 4MB pad from start of RAM to the default memory offset. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-11-21fs-test.sh: Update expected resultsStefan Brüns
After the latest changes, ext4 no longer has any fails. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2016-11-21test/py: expose config and log as session scoped fixtureStefan Brüns
If a test uses a fixture which is expensive to setup, the fixture can possibly created with session or module scope. As u_boot_console has function scope, it can not be used in this case. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2016-10-23test/py: ensure a log section exists for skipped testsStephen Warren
In pytest 3, runtestprotocol() may not call pytest_runtest_setup() if the test is skipped. That call is required to create a section for the test in the log file. If this is skipped, the call to log.end_section() at the tail of pytest_runtest_protocol() will throw an exception. This patch ensures that a log section always exists, both to avoid the exception and to ensure that a consistently structured log file is always created. Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reported-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Stephen Warren <swarren@nvidia.com> Tested-by: Tom Rini <trini@konsulko.com>
2016-10-14test/py/tests/test_sleep.py: Add check for CONFIG_CMD_MISCTom Rini
We can only run this command if the sleep command is enabled and that depends on CONFIG_CMD_MISC Signed-off-by: Tom Rini <trini@konsulko.com>
2016-10-14Merge git://git.denx.de/u-boot-fdtTom Rini
2016-10-13libfdt: Bring in upstream stringlist functionsSimon Glass
These have now landed upstream. The naming is different and in one case the function signature has changed. Update the code to match. This applies the following upstream commits by Thierry Reding <treding@nvidia.com> : 604e61e fdt: Add functions to retrieve strings 8702bd1 fdt: Add a function to get the index of a string 2218387 fdt: Add a function to count strings Signed-off-by: Simon Glass <sjg@chromium.org>
2016-10-13test: add NFS download testGuillaume GARDET
Add a NFS download test, based on TFTP test. Tested on i.MX6 SabreLite board. Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> Cc: Tom Rini <trini@konsulko.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Stephen Warren <swarren@nvidia.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2016-09-23fs-test.sh: Update expected resultsTom Rini
Thanks to Stefan Brüns we have more tests and a few more passes too, update the expected output now. Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2016-09-23test/fs: Check writes using "." (same dir) relative pathStefan Brüns
<path>/<fname> and <path>/./<fname> should reference the same file. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2016-09-23test/fs: Check ext4 behaviour if dirent is first entry in directory blockStefan Brüns
This is a regression test for a crash happening if the first dirent in the block matches. Code tried to access a predecessor entry which does not exist. The crash happened for any block, but "." is always the first entry in the first directory block and thus easy to check for. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2016-09-23test/fs: strip noise from filesystem code prior to checking resultsStefan Brüns
ext4 and fat code emit some diagnostic messages during command execution. These additional lines force a match window size which strictly is not necessary. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2016-09-23test/fs: remove use of undefined WRITE_FILE variableStefan Brüns
The write file is created from $SMALL_FILE by appending ".w" on all other occurences in the code. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2016-09-23test/fs: Restructure file path specification to allow some flexibilityStefan Brüns
Instead of providing the full path, specify directory and filename separately. This allows to specify intermediate directories, required for some additional tests. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2016-09-22test/py/tests/test_vboot.py: Add check that we boot the imageTom Rini
Make sure that when we're telling bootm to boot an image, and we expect the image to boot we get the output from sandbox that we attempted to run Linux and that U-Boot completed its job. Cc: Simon Glass <sjg@chromium.org> Cc: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>