summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test: dm: regmap: fix license headerMasahiro Yamada2018-04-281-1/+1
| | | | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini2018-04-2715-30/+0
| | | | | | | | We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
* clk: add sandbox test for bulk APINeil Armstrong2018-04-101-0/+37
| | | | | | | | | | This patch adds the bulk clock API tests for the sandbox test suite. It's very similar to the main test but only uses the _bulk() API and checks if the clocks are correctly enabled/disabled. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* reset: add sandbox test for bulk APINeil Armstrong2018-04-101-0/+33
| | | | | | | | | | | | | | This patch adds the bulk reset API tests for the sandbox test suite. Unlike the main test, it also check the "other" reset signal using the bulk API and checks if the resets are correctly asserted/deasserted. To allow the bulk API to work, and avoid changing the DT, the number of resets of the sandbox reset controller has been bumped to 101 for the "other" reset line to be valid. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* efi_selftest: check installation of the device treeHeinrich Schuchardt2018-04-041-0/+14
| | | | | | | | | | | | | | | | The unit test checks if a device tree is installed. It requires that the 'compatible' property of the root node exists. If available it prints the 'serial-number' property. The serial-number property is derived from the environment variable 'serial#'. This can be used to check if the image_setup_libfdt() function is executed. A Python test is supplied. It sets a value for serial# and checks that the selftest shows this as serial-number. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* core: ofnode: Fix translation for #size-cells == 0Mario Six2018-04-011-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 286ede6 ("drivers: core: Add translation in live tree case") made dev_get_addr always use proper bus translations for addresses read from the device tree. But this leads to problems with certain busses, e.g. I2C busses, which run into an error during translation, and hence stop working. It turns out that of_translate_address() and fdt_translate_address() stop the address translation with an error when they're asked to translate addresses for busses where #size-cells == 0 (comment from drivers/core/of_addr.c): * Note: We consider that crossing any level with #size-cells == 0 to mean * that translation is impossible (that is we are not dealing with a value * that can be mapped to a cpu physical address). This is not really specified * that way, but this is traditionally the way IBM at least do things To fix this case, we check in both the live-tree and non-live tree-case, whether the bus of the device whose address is about to be translated has size-cell size zero. If this is the case, we just read the address as a plain integer and return it, and only apply bus translations if the size-cell size if greater than zero. Signed-off-by: Mario Six <mario.six@gdsys.cc> Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com> Reported-by: Martin Fuzzey <mfuzzey@parkeon.com> Fixes: 286ede6 ("drivers: core: Add translation in live tree case") Reviewed-by: Simon Glass <sjg@chromium.org>
* test/py: add spi_flash testsLiam Beguin2018-03-221-0/+218
| | | | | | | Add basic tests for the spi_flash subsystem. Signed-off-by: Liam Beguin <liambeguin@gmail.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* test/py: add generic CRC32 functionLiam Beguin2018-03-221-0/+23
| | | | | | | | Add a generic function which can be used to compute the CRC32 value of a region of RAM. Signed-off-by: Liam Beguin <liambeguin@gmail.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* test/py: do not import pytest multiple timesLiam Beguin2018-03-221-1/+0
| | | | | Signed-off-by: Liam Beguin <liambeguin@gmail.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* test/py: README: add HOSTNAME to PYTHONPATHLiam Beguin2018-03-221-2/+2
| | | | | | | | | As opposed to PATH, HOSTNAME is not appended to PYTHONPATH automatically. Lets add it to the examples to make it more obvious to new users. Signed-off-by: Liam Beguin <liambeguin@gmail.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* test/py: README: fix typoLiam Beguin2018-03-221-1/+1
| | | | | | | | Fix a minor typo causing vim (and possibly other) to get confused with coloring. Signed-off-by: Liam Beguin <liambeguin@gmail.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* test/py: highlight warnings in the log summaryStephen Warren2018-03-133-3/+50
| | | | | | | | | | Currently, if a test emits a warning message but otherwise passes, there's no indication of this in the log summary, which can lead to warnings being missed. Enhance the test logic to explicitly mention warnings in otherwise passing tests, and not to collapse the log sections for tests with warnings, so that they're more easily seen when scanning the log. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* test/py: add MMC/SD block read testStephen Warren2018-03-131-0/+129
| | | | | | | | Add a standalone MMC block read test. This allows direct testing of MMC access rather than relying on doing so as a side-effect of e.g. DFU or UMS testing, which may not be enabled on all platforms. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* dm: video: support increased intensity (bold)Heinrich Schuchardt2018-03-061-1/+1
| | | | | | | | Support special rendition code 0 - reset attributes. Support special rendition code 1 - increased intensity (bold). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: video: show correct colors in graphical consoleHeinrich Schuchardt2018-03-061-1/+1
| | | | | | | | | | | | | | | | | | Get RGB sequence in pixels right (swap blue and red). Do not set reserved bits. qemu-system-i386 -display sdl -vga virtio and qemu-system-i386 -display sdl -vga cirrus now display the similar colors (highlighting still missing) as qemu-system-i386 -nographic Testing is possible via setenv efi_selftest test output bootefi selftest Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* log: Add tests for the new log featuresSimon Glass2018-02-031-1/+27
| | | | | | | | Add a test of the 'log format' and 'log rec' commands. This also covers things like log_get_cat_by_name(), since they are used by these commands. Fix a style nit in the tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
* log: Update log_console to honour the log formatSimon Glass2018-02-031-2/+2
| | | | | | | At present this just outputs the message. Update it to output whatever the format requests. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Add a function to look up a uclass by nameSimon Glass2018-02-031-0/+9
| | | | | | | | | Each uclass has a driver name which we can use to look up the uclass. This is useful for logging, where the uclass ID is used as the category. Add a function to handle this, as well as a test. Signed-off-by: Simon Glass <sjg@chromium.org>
* vsprintf.c: correct printing of a NULL device pathHeinrich Schuchardt2018-01-281-0/+4
| | | | | | | | | | | | | | | | | | When printing '%pD' with a value of NULL we want to output '<NULL>'. But this requires copying to buf. Leave this to string16. A unit test is supplied which relies on EFI support in the sandbox. The development for EFI support in the sandbox is currently in branch u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText for media types"). Ater rebasing the aforementioned branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test is executed successfully. Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* host-tools: use python2 explicitly for shebangMasahiro Yamada2018-01-281-1/+1
| | | | | | | | | | | All of these host tools are apparently written for Python2, not Python3. Use 'python2' in the shebang line according to PEP 394 (https://www.python.org/dev/peps/pep-0394/). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* vsprintf.c: add EFI device path printingHeinrich Schuchardt2018-01-221-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For debugging efi_loader we need the capability to print EFI device paths. With this patch we can write: debug("device path: %pD", dp); A possible output would be device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82) This enhancement is not available when building without EFI support and neither in the SPL nor in the API example. A test is provided. It can be executed in the sandbox with command ut_print. The development for EFI support in the sandbox is currently in branch u-boot-dm/efi-working. The branch currently lacks commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText for media types"). Ater rebasing the aforementioned branch on U-Boot v2018.01 the test is executed successfully. Without EFI support in the sandbox the test is simply skipped. Suggested-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* test: Set the DTC environment variableSimon Glass2018-01-151-3/+5
| | | | | | | Set this to our own device-tree compiler since we know it is new enough to run the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Run code coverage testsSimon Glass2018-01-151-0/+7
| | | | | | | | | | | Binman has 100% test coverage for the code as it is at present. To encourage it to stay that way, run the code-coverage test as part of the normal U-Boot tests. This is RFC because it requires the Python code coverage tools to be available. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: Run dtoc testsSimon Glass2018-01-151-0/+1
| | | | | | Update the test script to run the dtoc tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: Run buildman testsSimon Glass2018-01-151-0/+1
| | | | | | Update the test script to run the buildman tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: Run patman testsSimon Glass2018-01-151-0/+1
| | | | | | Update the test script to run the patman tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: Run binman testsSimon Glass2018-01-151-0/+3
| | | | | | Update the test script to run the binman tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: parse chosen nodeRob Clark2018-01-152-2/+2
| | | | | | | This is the node that would contain, for example, the framebuffer setup by an earlier stage. Signed-off-by: Rob Clark <robdclark@gmail.com>
* Merge tag 'xilinx-for-v2018.01-rc2-v2' of ↵Tom Rini2017-12-181-1/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://www.denx.de/git/u-boot-microblaze Xilinx changes for v2018.01-rc2-v2 fpga: - Enable loading bitstream via fit image for !xilinx platforms zynq: - Fix SPL SD boot mode zynqmp: - Not not reset in panic - Do not use simple allocator because of fat changes - Various dt chagnes - modeboot variable setup - Fix fpga loading on automotive devices - Fix coverity issues test: - Fix env test for !hush case - Stephen's patch
| * test/py: Setup variables based on HUSH selectionStephen Warren2017-12-181-1/+10
| | | | | | | | | | | | | | | | After adding our small zynq uboot which has hush parser off same variable tests start to failed. Use quotes only when hush is enabled. Reported-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | Merge git://git.denx.de/u-boot-dmTom Rini2017-12-141-0/+2
|\ \ | |/ |/|
| * power: extend prefix match to regulator-name propertyFelix Brack2017-12-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends pmic_bind_children prefix matching. In addition to the node name the property regulator-name is used while trying to match prefixes. This allows assigning different drivers to regulator nodes named regulator@1 and regulator@10 for example. I have discarded the idea of using other properties then regulator-name as I do not see any benefit in using property compatible or even regulator-compatible. Of course I am open to change this if there are good reasons to do so. Signed-off-by: Felix Brack <fb@ltec.ch> Reviewed-by: Simon Glass <sjg@chromium.org>
* | test: py: Add an option to skip sleep testMichal Simek2017-12-121-0/+13
| | | | | | | | | | | | | | | | | | | | Some QEMUs have a problem with time setup that's why sleep test is failing. Introduce env__sleep_accurate boardenv variable to have an option to skip sleep test. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* | test/py: gpt: update size of gpt partitionPatrick Delaunay2017-12-121-15/+17
|/ | | | | | | | | - avoid disturbing 0MiB partition size (in fact < 1MiB) - test overlap limit between part1 and part2 - test gpt write with data with modifier 'M' for MiB Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* log: test: Add a pytest for loggingSimon Glass2017-12-071-0/+101
| | | | | | | Add a test which tries out various filters and options to make sure that logging works as expected. Signed-off-by: Simon Glass <sjg@chromium.org>
* log: Add a test commandSimon Glass2017-12-073-0/+213
| | | | | | Add a command which exercises the logging system. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini2017-12-052-2/+16
|\ | | | | | | | | | | | | | | | | | | Patch queue for efi - 2017-12-05 Highlights for this release: - Dynamic EFI object creation (lists instead of static arrays) - EFI selftest improvements - Minor fixes
| * test/py: check return code of helloworldHeinrich Schuchardt2017-12-011-0/+2
| | | | | | | | | | | | | | | | Check that helloworld.efi returns EFI_SUCCESS. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * test/py: fix typo in test_efi_loader.pyHeinrich Schuchardt2017-12-011-1/+1
| | | | | | | | | | | | | | Make a comment line easier to read. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * test/py: test reboot by EFI watchdogHeinrich Schuchardt2017-12-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Clear environment variable efi_selftest before executing the default tests. Provide a test verifying that the EFI watchdog reboots the system upon timeout. The test depends on CONFIG_CMD_EFI_SELFTEST=y. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* | test: compression: Convert to unit test frameworkSimon Glass2017-12-042-69/+123
| | | | | | | | | | | | | | | | | | | | | | Adjust this test to use the unit test framework. Drop the two existing commands for running the tests and replace them with a single 'ut compression' command, with sub-commands. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Continue to have ret = run_test_internal(...) in run_test so ret is always initialized] Signed-off-by: Tom Rini <trini@konsulko.com>
* | test/py: Allow any unit test suite to be foundSimon Glass2017-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The u-boot.sym file is scanned to find unit test suites for execution. At present it only finds those whose names start with 'dm' or 'env'. This code is buried in the bowels of the test code so when adding a new suite it is not easy to discover why it is ignored by the test framework. There seems to be no need to make this restriction. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>
* | test: compression: Put test variables in a structSimon Glass2017-12-021-54/+74
| | | | | | | | | | | | | | | | | | | | | | At present the test setup is somewhat mixed with the test itself. But if the test setup fails (which it should not) then the test is actually invalid. Put all the test buffers and sizes in a struct and separate out the core code into a function. This will make it easier to move the code to use the unit test framework. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: overlay: Use cmd_ut_category()Simon Glass2017-12-021-19/+2
| | | | | | | | | | | | Adjust the code to use the common test-execution function. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: Add a command function for test executionSimon Glass2017-12-022-18/+26
|/ | | | | | | | The logic to either iterate through a list of tests or pick a named test is common to at lest two test suits. Move this logic into a new function and call it from the environment tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: Correct operation when tests passSimon Glass2017-11-271-1/+2
| | | | | | | When tests pass an error message is printed because of a variable that is not initialised. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* test/run: Report and return failureSimon Glass2017-11-221-3/+17
| | | | | | | | | This script runs the tests but does not report failure. Also it always returns an exit code of 0 even on failure. Fix these problems by checking the result of each test. Signed-off-by: Simon Glass <sjg@chromium.org>
* test/py: add timestamps to logStephen Warren2017-11-173-0/+44
| | | | | | | | | | | It can be useful to record how long tests take; this can help debug slow running test systems or track changes in performance over time. Enhance the test system to record timestamps while running test: - Whenever a new log file section is started. - After U-Boot is started and communication has been established. - After each host or U-Boot command is executed. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* test/py: regenerate persistent GPT image if code changesStephen Warren2017-11-062-17/+92
| | | | | | | | | | | | test_gpt generates a persistent disk image which can be re-used across multiple test runs. Currently, if the Python code that generates the disk image change, the image is not regenerated, which could cause test failures e.g. if a test was updated to expect some new partition name or size, yet the persistent disk image contained the old name or size. This change introduces functionality to regenerate the disk image if the instructions to generate the image have changed. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* test/py: fix typos in README.mdMasahiro Yamada2017-10-231-3/+3
| | | | | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>