summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini2018-12-031-4/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch queue for efi - 2018-12-03 This release is fully packed with lots of glorious improvements in UEFI land again! - Make PE images more standards compliant - Improve sandbox support - Improve correctness - Fix RISC-V execution on virt model - Honor board defined top of ram (fixes a few boards) - Imply DM USB access when distro boot is available - Code cleanups
| * efi_selftest: check fdt is marked as runtime dataHeinrich Schuchardt2018-12-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Check that the memory area containing the device tree is marked as runtime data. Update the Python test to pass ${fdtcontroladdr} to bootefi. Update the description of the Python test. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* | test: vboot: clean its filePhilippe Reynes2018-12-039-69/+69
| | | | | | | | | | | | | | | | | | This update the its file used in vboot test to respect the new node style name defined in doc/uImage.FIT (for example: replace kernel@1 by kernel and fdt@1 by fdt-1) Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | test: vboot: add padding pss for rsa signaturePhilippe Reynes2018-12-035-5/+187
|/ | | | | | | | The padding pss is now supported for rsa signature. This add test with padding pss on vboot test. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: i2c: Use new emulator parent uclassSimon Glass2018-11-292-5/+6
| | | | | | | Update the device tree, sandbox i2c driver and tests to use the new emulation parent to hold emulators. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Add a few more specific child-finding functionsSimon Glass2018-11-291-0/+27
| | | | | | | | Add two functions which can find a child device by uclass or by name. The first is useful with Multi-Function-Devices (MFDs) to find one of a particular type. The second is useful when only the name is known. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Export uclass_find_device_by_phandle()Simon Glass2018-11-291-0/+20
| | | | | | | This function may be useful to code outside of the code driver-model implementation. Export it and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: Add a 'make qcheck' target for quicker testingSimon Glass2018-11-296-3/+17
| | | | | | | | | | | At present tests are quite slow to run, over a minute on my machine. This presents a considerable barrier to bisecting for failures. The slowest tests are the filesystem ones and the buildman --fetch-arch test. Add a new 'qcheck' target that skips these tests. This reduces test time down to about 40 second, still too long, but bearable. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2018-11-261-2/+2
|\
| * dm: video: correctly set the cursor positionHeinrich Schuchardt2018-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | The terminal escape sequence ESC [ <x> ; <y> H is used to set the cursor position. According to the ECMA 48 standard the upper left corner in the escape sequences is [1, 1]. The video uclass uses [0, 0] as upper left corner. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* | spl: Add support for passing handoff info to U-Boot properSimon Glass2018-11-262-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | There is some basic informaton that SPL normally wants to pass through to U-Boot, such as the SDRAM size and bank information. Mkae use of the new bloblist structure for this. Add a new 'handoff' blob which is set up in SPL and passed to U-Boot proper. Also adda test for sandbox_spl that checks that this works correctly and a new 'sb' command to show the information passed from SPL. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | sandbox: Drop the deprecated 'sb' commandSimon Glass2018-11-263-8/+8
| | | | | | | | | | | | | | | | The old 'sb' command was deprecated in 2015 and replaced with 'host'. Remove the remaining users and the command, so that the name is available for other purposes. Signed-off-by: Simon Glass <sjg@chromium.org>
* | sandbox: Add an option to display of-platdata in SPLSimon Glass2018-11-261-1/+30
| | | | | | | | | | | | | | At present we don't have a test that of-platdata can be accessed in SPL. Add this in as a command-line option to SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test/py: Add a way to pass flags to sandboxSimon Glass2018-11-261-0/+18
| | | | | | | | | | | | | | | | | | It is sometimes useful to restart sandbox with some particular flags to test certain functionality. Add a new method to ConsoleSandbox to handle this, without changing the existing APIs. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>
* | spl: Add a define for SPL_TPL_PROMPTSimon Glass2018-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We should use a macro rather than hard-coding the SPL prompt to 'spl' since the code can be used by TPL too. Add a macro that works for both and use it in various places. This allows TPL to use the same code without printing confusing messages. Note that the string is lower case ('spl', 'tpl') which is a change from previously. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: Add a simple test for bloblistSimon Glass2018-11-263-0/+191
| | | | | | | | | | | | | | Add a unit test for the bloblist functionality and enable bloblist for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* | fs-test.sh: Update to use 'host' not 'sb'Tom Rini2018-11-261-7/+7
| | | | | | | | | | | | | | For a long time now, 'sb' has been deprecated as a command in favor of using 'host' for the sandbox hostfs interface, switch. Signed-off-by: Tom Rini <trini@konsulko.com>
* | sf: Add a method to obtain the block-protect settingSimon Glass2018-11-201-0/+9
| | | | | | | | | | | | | | | | | | It is useful to obtain the block-protect setting of the SPI flash, so we know whether it is fully open or (perhaps partially) write-protected. Add a method for this. Update the sandbox driver to process this operation and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: sf: Add a simple SPI flash testSimon Glass2018-11-201-2/+44
| | | | | | | | | | | | | | | | | | | | | | The current test is a functional test, covering all the way from the command line to the sandbox SPI driver. This is useful, but it is easier to diagnose failures with a smaller test. Add a simple test which reads and writes data and checks that it is stored and retrieved correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
* | misc: Update read() and write() methods to return bytes xferedSimon Glass2018-11-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | At present these functions return 0 on success. For some devices we want to know how many bytes were transferred. It seems useful to adjust the API to be more like the POSIX read() and write() functions. Update these two methods, a test and all users. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
* | dm: core: Widen the dump tree to show more of the driver's name.Liviu Dudau2018-11-201-14/+14
| | | | | | | | | | | | | | | | | | | | | | With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree. Also update the tests to take into account the wider output format. Signed-off-by: Liviu Dudau <liviu.dudau@foss.arm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | dm: adc: add uclass's mask and conversion helpersFabrice Gasnier2018-11-201-0/+35
| | | | | | | | | | | | | | | | | | Add two functions to ADC uclass's: - adc_raw_to_uV() to ease ADC raw value conversion to microvolts - adc_channel_mask() to get channels on consumer side Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | test/py: test pinmux commandPatrice Chotard2018-11-161-0/+66
|/ | | | | | | | | | | | | | Add pinmux test which test the following commands: - pinmux list - pinmux dev - pinmux status Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Mark some tests as sandbox-centric] Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* test: dm: virtio: Add test cases for virtio uclassBin Meng2018-11-142-0/+123
| | | | | | | | Now that we have a sandbox virtio transport driver, add some test cases to test virtio uclass driver. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: dm: pci: Add cases for finding next PCI capability APIsBin Meng2018-11-141-0/+20
| | | | | | | | Add test cases to cover the two newly added PCI APIs: dm_pci_find_next_capability() & dm_pci_find_next_ext_capability(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: dm: blk: Correct blk_base test caseBin Meng2018-11-141-16/+11
| | | | | | | | | | | | | | The blk_base test case creates a USB mass storage block device with the Sandbox host block device as its parent. This does not make any sense and causes potential issue, for example if the test case tries to read/write anything on the USB mass storage block device it will definitely fail as its parent is not on USB bus at all. Correct the test case by creating another Sandbox host block device instead of the USB mass storage one and adjust the case accordingly. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: dm: core: Add test case for uclass driver's child_post_probe()Bin Meng2018-11-142-2/+50
| | | | | | | Add test case to cover uclass driver's child_post_probe() method. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: regmap: Add test for regmap_{set, get}Mario Six2018-11-141-0/+28
| | | | | | | | Add test for regmap_{set,get} functions. Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
* test: regmap: Increase size of syscon0 memoryMario Six2018-11-141-1/+1
| | | | | | | | | | | | The upcoming changes to the regmap interface will contain a proper check for plausibility when reading/writing from/to a register map. To still have the current tests pass, increase the size of the memory region for the syscon0 device, since one of the tests reads and writes beyond this range. Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
* test: dm: core: Add a test case for driver marked with DM_FLAG_PRE_RELOC flagBin Meng2018-11-142-4/+27
| | | | | | | | Now that we fixed the pre-relocation driver binding for driver marked with DM_FLAG_PRE_RELOC flag, add a test case to cover that scenario. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: tee: fix resource leak in dm_test_tee()Jens Wiklander2018-11-011-9/+26
| | | | | | | Fixes possible resource leak in dm_test_tee() reported by Coverity. Reported-by: Coverity (CID: 184175) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
* test: overlay: add missing includeHeinrich Schuchardt2018-10-221-0/+1
| | | | | | | | | | | | | Compiling the overlay unit test fails with odroid-c2_defconfig showing errors like: test/overlay/cmd_ut_overlay.c:29:8: error: unknown type name ‘fdt32_t’ Add the missing include. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: Add test for PCI device without compat string and with DT nodeMarek Vasut2018-10-201-0/+5
| | | | | | | | | | | | | | Add test which checks if a PCI device described in DT with an entry and reg = <...> property, but without compatible string results in a valid U-Boot PCI udevice with the udevice.node populated with reference to this DT node. Also check if the other PCI device without a DT node does not contain any bogus udevice.node. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini2018-10-111-0/+170
|\
| * net: Don't overwrite waiting packets with asynchronous repliesJoe Hershberger2018-10-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Peter originally sent a fix, but it breaks a number of other things. This addresses the original reported issue in a different way. That report was: > U-Boot has 1 common buffer to send Ethernet frames, pointed to by > net_tx_packet. When sending to an IP address without knowing the MAC > address, U-Boot makes an ARP request (using the arp_tx_packet buffer) > to find out the MAC address of the IP addressr. When a matching ARP > reply is received, U-Boot continues sending the frame stored in the > net_tx_packet buffer. > > However, in the mean time, if U-Boot needs to send out any network > packets (e.g. replying ping packets or ARP requests for its own IP > address etc.), it will use the net_tx_packet buffer to prepare the > new packet. Thus this buffer is no longer the original packet meant > to be transmitted after the ARP reply. The original packet will be > lost. This instead uses the ARP tx buffer to send async replies in the case where we are actively waiting for an ARP reply. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Tran Tien Dat <peter.trantiendat@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
| * test: eth: Add a test for the target being pingedJoe Hershberger2018-10-101-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The target will respond to pings while doing other network handling. Make sure that the response happens and is correct. This currently corrupts the ongoing operation of the device if it happens to be awaiting an ARP reply of its own to whatever serverip it is attempting to communicate with. In the test, add an expectation that the user operation (ping, in this case) will fail. A later patch will address this problem. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * test: eth: Add a test for ARP requestsJoe Hershberger2018-10-101-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tests that ARP requests made to this target's IP address are responded-to by the target when it is doing other networking operations. This currently corrupts the ongoing operation of the device if it happens to be awaiting an ARP reply of its own to whatever serverip it is attempting to communicate with. In the test, add an expectation that the user operation (ping, in this case) will fail. A later patch will address this problem. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | sysreset: Add a way to find the last resetSimon Glass2018-10-091-0/+20
| | | | | | | | | | | | | | | | We have a method to return the last reset as a string for humans, but not a method that allows it to be used programmatically. Add a new method that returns the last reset as an enum. Signed-off-by: Simon Glass <sjg@chromium.org>
* | sysreset: Tidy up a few comments and loggingSimon Glass2018-10-091-1/+0
| | | | | | | | | | | | | | Some comments are incorrect or missing pieces. Fix these and use logging to print the error. Signed-off-by: Simon Glass <sjg@chromium.org>
* | panel: Expand the backlight supportSimon Glass2018-10-091-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | At present the panel can be turned on but not off, and the brightness cannot be controlled at run-time. Add a new API function to both the panel and backlight uclasses to handle this. Enhance the PWM backlight driver to deal with custom levels properly and allow the backlight to be turned on and off. Update the test to cover thes new features. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: panel: Add a test for the panel uclassSimon Glass2018-10-092-0/+51
| | | | | | | | | | | | | | At present this uclass has no tests. Add a simple one which checks the PWM configuration, regulator and GPIO. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: core: Update ofnode to read binman-style flash entrySimon Glass2018-10-091-0/+16
| | | | | | | | | | | | | | | | | | | | At present ofnode_read_fmap_entry() reads a flash map entry in a format which is not supported by binman. To allow use to use binman-format descriptions, update this function. Also add a simple test. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: core: Add a function to find the first inactive childSimon Glass2018-10-091-0/+31
| | | | | | | | | | | | | | Some devices have children and want to press an existing inactive child into service when needed. Add a function to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
* | sandbox: video: Speed up video outputSimon Glass2018-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At present there are many situations where sandbox syncs the display to the SDL frame buffer. This is a very expensive operation but is only needed every now and then. Update video_sync() so that we can specify whether this operation is really needed. At present this flag is not used on other architectures. It could also be used for reducing writeback-cache flushes but the benefit of that would need to be investigated. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* | log: Add helpers for common log levelsSimon Glass2018-10-092-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present to output a log message you need something like: log(UCLASS_SPI, LOCL_INFO, "message1"); log(UCLASS_SPI, LOCL_INFO, "message2"); but many files use the same category throughout. Also it is helpful to shorten the length of log names, providing helpers for common logging levels. Add some macros so that it is possible to do: (top of file, before #includes) #define LOG_CATEGORY UCLASS_SPI (later in the file) log_info("message1"); log_debug("message2"); log_err("message3"); Signed-off-by: Simon Glass <sjg@chromium.org>
* | binman: Run tests concurrentlySimon Glass2018-10-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the tests run one after the other using a single CPU. This is not very efficient. Bring in the concurrencytest module and run the tests concurrently, using one process for each CPU by default. A -P option allows this to be overridden, which is necessary for code-coverage to function correctly. This requires fixing a few tests which are currently not fully independent. At some point we might consider doing this across all pytests in U-Boot. There is a pytest version that supports specifying the number of processes to use, but it did not work for me. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: Reduce the number of tests run with sandbox_flattreeSimon Glass2018-10-081-1/+2
| | | | | | | | | | | | | | | | We only need to run driver-model tests with this config, since this is the only thing that is different when CONFIG_OF_LIVE is not defined. Filter out the other tests to same time. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: Tidy up comments and variable nameSimon Glass2018-10-081-4/+8
| | | | | | | | | | | | | | | | The 'result' variable counts the number of failures in running the tests. Rename it to 'failures' to make this more obvious. Also tidy up a few comments. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: Print the name of each test before running itSimon Glass2018-10-081-11/+19
| | | | | | | | | | | | | | | | | | At present the tests are run without any indication of what is running. For the tests which start with a build this is pretty obvious, but for tools it is not. Add a name for each test we run, and print it before starting the test. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: Simplify the PATH setupSimon Glass2018-10-081-9/+9
| | | | | | | | | | | | Use 'export' to avoid repeating the path setup for each command. Signed-off-by: Simon Glass <sjg@chromium.org>