aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2018-06-19test_avb: Add pymark.buildconfigspec information for the AVB testsTom Rini1-0/+5
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-06-18test/py: avb2.0: add tests for avb commandsIgor Opaniuk1-0/+111
1. Run AVB 2.0 full verification chain, avb verify 2. Check if 'avb get_uuid' works, compare results with 'part list mmc 1' output 3. Test `avb read` commands, which reads N bytes from a partition identified by a name Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
2018-06-07test: Fix sandbox_spl test filterSimon Glass1-2/+1
This filter does not match the test it is intended to anymore. Update it so that it works again. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-01Merge branch 'master' of git://git.denx.de/u-boot-mipsTom Rini1-0/+42
2018-06-01dm: core: add functions to get memory-mapped I/O addressesÁlvaro Fernández Rojas1-0/+42
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-31tests: Make test_log.py tests depend on cmd_log not logTom Rini1-2/+2
While the tests in this testcase are for the log subsystem they are only able to be run if CONFIG_CMD_LOG is enabled as well as CONFIG_LOG, so update the buildconfigspec requirement. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-31test: dm: Fix wrong aliases property namesEugeniu Rosca1-1/+1
After importing v4.17-rc1 Linux commit 9130ba884640 ("scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987"), sandbox build reports below warnings: arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-' arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-' arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-' arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-' Silent them by applying the 's/_/-/' substitution in the names of the 'fdt_dummy0', 'fdt_dummy1', 'fdt_dummy2', 'fdt_dummy3' properties. Similar DTC warnings have been recently fixed in Linux kernel, e.g. via v4.17-rc1 commit d366c30d19f4 ("ARM: dts: STi: Fix aliases property name for STi boards"). If done alone, the DTS update generates a failure of the `ut dm fdt_translation` unit test in sandbox environment as seen below: $ ./u-boot -d arch/sandbox/dts/test.dtb ---<-snip->--- => ut dm fdt_translation Test: dm_test_fdt_translation: test-fdt.c test/dm/test-fdt.c:444, dm_test_fdt_translation(): 0 == uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, 1, &dev): Expected 0, got -19 Test: dm_test_fdt_translation: test-fdt.c (flat tree) test/dm/test-fdt.c:444, dm_test_fdt_translation(): 0 == uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, 1, &dev): Expected 0, got -19 Failures: 2 ---<-snip->--- Fix this issue in place, by updating the "name" string in the UCLASS_DRIVER(fdt_dummy) definition, so that it matches the newly updated aliases properties. After that, the test passes: $ ./u-boot -d arch/sandbox/dts/test.dtb ---<-snip->--- => ut dm fdt_translation Test: dm_test_fdt_translation: test-fdt.c Test: dm_test_fdt_translation: test-fdt.c (flat tree) Failures: 0 ---<-snip->--- Fixes: e8d5291824e2 ("core: ofnode: Fix translation for #size-cells == 0") Reported-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-25test/py: add TPMv2.x test suiteMiquel Raynal1-0/+233
Add tests for the TPMv2.x commands. These commands may run both on a physical TPM and with the sandbox driver. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-05-23test: fs: fs-test: Modified test 1 to do a ls to a nonexistent dirEugen Hristev1-0/+2
Added a simple ls to a nonexistent directory for test 1. In case the driver is broken for a nonexistent directory, U-boot might crash. Here is an example failed output: => # Test Case 1 - ls => ext4ls host 0:0 <DIR> 4096 . <DIR> 4096 .. <DIR> 16384 lost+found <DIR> 4096 SUBDIR 2621440000 2.5GB.file 1048576 1MB.file => # In addition, test with a nonexistent directory to see if we crash. => ext4ls host 0:0 invalid_d ** Can not find directory. ** ./test/fs/fs-test.sh: line 161: 25786 Segmentation fault (core dumped) $UBOOT <<EOF Subsequent tests will fail if U-boot crashes. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-05-18sandbox: tests: Add tests for mc34708 PMIC deviceLukasz Majewski1-0/+56
Following tests has been added for mc34708 device: - get_test for mc34708 PMIC - Check if proper number of registers is read - Check if default (emulated via i2c device) value is properly read - Check if value write/read operation is correct - Perform tests to check if pmic_clrsetbits() is working correctly Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-18sandbox: tests: Exclude common test code (pmic_get) in test/dm/pmic.cLukasz Majewski1-2/+10
The common code can be excluded to be reused by tests for other PMIC. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-10SPDX: Convert a few files that were missed beforeTom Rini1-3/+1
As part of the main conversion a few files were missed. These files had additional whitespace after the '*' and before the SPDX tag and my previous regex was too strict. This time I did a grep for all SPDX tags and then filtered out anything that matched the correct styles. Fixes: 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style") Reported-by: Heinrich Schuchardt <xypron.debian@gmx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-08test: regmap: add read/modify/write testNeil Armstrong1-0/+25
Add calls to regmap_read/modify_bits/write even if the proper memory read/write calls are not executed in sandbox. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-08dm: led: add testcase for "default-state" propertyPatrick Bruenn1-1/+19
Add two more gpio-leds to sandbox test device tree with default-state property set to "on"/"off". Add dm_test_led_default_state() to check that these new LED's are set to LEDST_ON and LEDST_OFF. dm: led: add testcase for "default-state" property Add two more gpio-leds to sandbox test device tree with default-state property set to "on"/"off". Add dm_test_led_default_state() to check that these new LED's are set to LEDST_ON and LEDST_OFF. Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>
2018-05-07test: ofnode: test ofnode_device_is_compatible()Masahiro Yamada2-0/+18
Test ofnode_device_is_compatible(), and also ofnode_path(). Requested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-07test: regmap: test Linux-compatible syscon_node_to_regmap()Masahiro Yamada1-0/+17
Like Linux, syscon_node_to_regmap() allows a node to work as a syscon provider without binding it to a syscon driver. Test this. Requested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-07regmap: clean up regmap allocationMasahiro Yamada1-8/+5
Putting zero length array at the end of struct is a common technique to embed arbitrary length of members. There is no good reason to let regmap_alloc_count() branch by "if (count <= 1)". As far as I understood the code, regmap->base is an alias of regmap->ranges[0].start, but it is not helpful but make the code just ugly. Rename regmap_alloc_count() to regmap_alloc() because the _count suffix seems pointless. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: fixup cpu_info-rcar.c] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini89-181/+90
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-28test: dm: regmap: fix license headerMasahiro Yamada1-1/+1
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini15-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>
2018-04-10clk: add sandbox test for bulk APINeil Armstrong1-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>
2018-04-10reset: add sandbox test for bulk APINeil Armstrong1-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>
2018-04-04efi_selftest: check installation of the device treeHeinrich Schuchardt1-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>
2018-04-01core: ofnode: Fix translation for #size-cells == 0Mario Six1-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>
2018-03-22test/py: add spi_flash testsLiam Beguin1-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>
2018-03-22test/py: add generic CRC32 functionLiam Beguin1-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>
2018-03-22test/py: do not import pytest multiple timesLiam Beguin1-1/+0
Signed-off-by: Liam Beguin <liambeguin@gmail.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2018-03-22test/py: README: add HOSTNAME to PYTHONPATHLiam Beguin1-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>
2018-03-22test/py: README: fix typoLiam Beguin1-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>
2018-03-13test/py: highlight warnings in the log summaryStephen Warren3-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>
2018-03-13test/py: add MMC/SD block read testStephen Warren1-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>
2018-03-06dm: video: support increased intensity (bold)Heinrich Schuchardt1-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>
2018-03-06dm: video: show correct colors in graphical consoleHeinrich Schuchardt1-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>
2018-02-03log: Add tests for the new log featuresSimon Glass1-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>
2018-02-03log: Update log_console to honour the log formatSimon Glass1-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>
2018-02-03dm: core: Add a function to look up a uclass by nameSimon Glass1-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>
2018-01-28vsprintf.c: correct printing of a NULL device pathHeinrich Schuchardt1-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>
2018-01-28host-tools: use python2 explicitly for shebangMasahiro Yamada1-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>
2018-01-22vsprintf.c: add EFI device path printingHeinrich Schuchardt1-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>
2018-01-15test: Set the DTC environment variableSimon Glass1-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>
2018-01-15binman: Run code coverage testsSimon Glass1-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>
2018-01-15test: Run dtoc testsSimon Glass1-0/+1
Update the test script to run the dtoc tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-01-15test: Run buildman testsSimon Glass1-0/+1
Update the test script to run the buildman tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-01-15test: Run patman testsSimon Glass1-0/+1
Update the test script to run the patman tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-01-15test: Run binman testsSimon Glass1-0/+3
Update the test script to run the binman tests also. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-01-15dm: core: parse chosen nodeRob Clark2-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>
2017-12-18Merge tag 'xilinx-for-v2018.01-rc2-v2' of ↵Tom Rini1-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
2017-12-18test/py: Setup variables based on HUSH selectionStephen Warren1-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>
2017-12-14Merge git://git.denx.de/u-boot-dmTom Rini1-0/+2
2017-12-12power: extend prefix match to regulator-name propertyFelix Brack1-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>