summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | test/py: Fix unicode handling for log filteringSimon Glass2018-10-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the unicode filtering seems to get confused at times with this error: UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 32: ordinal not in range(128) It seems to be due to self._nonprint being interpreted as UTF-8. Fix it by using ordinals instead of characters, changing the string to set. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Michal Simek <michal.simek@xilinx.com>
* | sandbox: Unprotect DATA regions in bus testsSimon Glass2018-10-081-0/+12
|/ | | | | | | | | | | | On my Ubuntu 18.04.1 machine two driver-model bus tests have started failing recently. The problem appears to be that the DATA region of the executable is protected. This does not seem correct, but perhaps there is a reason. To work around it, unprotect the regions in these tests before accessing them. Signed-off-by: Simon Glass <sjg@chromium.org>
* test_avb: Update pymark.buildconfigspec information for the AVB testsJens Wiklander2018-10-071-3/+5
| | | | | | | | | Update the pymark.buildconfigspec to depend on 'cmd_mmc' in addition to 'cmd_avb' for those tests that needs more a more complete MMC implementation or the "mmc" command. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
* test: tee: test TEE uclassJens Wiklander2018-10-072-0/+99
| | | | | | | | | Tests the TEE uclass with a sandbox tee driver. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> [trini: initialize session to 0 in dm_test_tee] Signed-off-by: Tom Rini <trini@konsulko.com>
* test/py: test_fs: add docstring comments to helper functionsAkashi Takahiro2018-10-061-0/+133
| | | | | | | | After Siomon's comment, add a descriptive comment (docstring) to each of helper functions in conftest.py. No functionality changed. Signed-off-by: Akashi Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* test/py: test_fs: remove fs_type argument from umount_fs()Akashi Takahiro2018-10-061-7/+7
| | | | | | | Since there is no use of fs_type in umount_fs(), just remove it. Signed-off-by: Akashi Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* test/py: ignore console read exceptions after test failureStephen Warren2018-10-061-1/+11
| | | | | | | | | | | | After a test has failed, test/py drains the U-Boot console log to ensure that any relevant output is captured. At this point, we don't care about detecting any additional errors, since the test is already known to have failed, and U-Boot will be restarted. To ensure that the test cleanup code is not interrupted, and can correctly terminate the log sections for the failed test, ignore any exception that occurs while reading the U-Boot console output during this limited period of time. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2018-09-304-0/+163
|\
| * dm: test: Add "/firmware" node scan testRajan Vaja2018-09-292-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | Add a test which verifies that all subnodes under "/firmware" nodes are scanned. Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Added 'imply FIRMWARE' to sandbox Kconfig to fix test failures, fixed ordering of lines in arch/sandbox/dts/test.dts and test/dm/Makefile, updated #if condition in drivers/firmware/firmware-uclass.c: Signed-off-by: Simon Glass <sjg@chromium.org>
| * test: Add tests for board uclassMario Six2018-09-292-0/+58
| | | | | | | | | | | | | | Add tests for the new board uclass. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
| * test: Add tests for dev_{enable, disable}_by_pathMario Six2018-09-291-0/+28
| | | | | | | | | | | | | | Add tests for the dev_{enable,disable}_by_path functions. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
| * test: Add tests for DT-manipulation functionsMario Six2018-09-291-0/+54
| | | | | | | | | | | | | | | | Add tests for the ofnode_set_enabled, ofnode_write_string, and ofnode_write_property functions. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
* | test: list: Add tests for hexdump.cMario Six2018-09-283-0/+101
| | | | | | | | | | | | | | | | Add tests for the hex2bin, bin2hex, and hex_to_bin functions, which were recently added to U-Boot. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
* | video_osd: Add osd sandbox driver and testsMario Six2018-09-282-0/+211
|/ | | | | | | Add sandbox driver and tests for the new OSD uclass. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
* efi_selftest: test key notification functionsHeinrich Schuchardt2018-09-231-2/+2
| | | | | | | | Use a key notification function to leave the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL test. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: test EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOLHeinrich Schuchardt2018-09-231-0/+79
| | | | | | | Add a unit test for the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: rework test_efi_selftest_text_input()Heinrich Schuchardt2018-09-231-6/+11
| | | | | | | Use more precise regular expressions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: Unicode w/ EFI_SIMPLE_TEXT_INPUT_PROTOCOLHeinrich Schuchardt2018-09-231-0/+7
| | | | | | | | Test that the Euro sign is correctly retrieved from the console via the EFI_SIMPLE_TEXT_INPUT_PROTOCOL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: support Unicode text inputHeinrich Schuchardt2018-09-231-4/+4
| | | | | | | | | | | Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters. With the patch it can consume UTF-8 from the console. Currently only the serial console and the console can deliver UTF-8. Local consoles are restricted to ASCII. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: fs: add fstest/unlink testAkashi, Takahiro2018-09-232-0/+171
| | | | | | | | In this commit, test cases for unlink interfaces are added as part of "test_fs" test suite. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: fs: add fstest/mkdir testAKASHI Takahiro2018-09-232-0/+141
| | | | | | | | In this commit, test cases for mkdir interfaces are added as part of "test_fs" test suite. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: fs: add extended write operation testAKASHI Takahiro2018-09-233-0/+310
| | | | | | | | | | | | In this commit and the following, test scripts for new filesystem functionalities introduced by my patch set, "fs: fat: extend FAT write operations," are provided. In particular, this patch adds test cases for sub-directory write and write with non-zero offset. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: convert fs-test.sh to pytestAKASHI Takahiro2018-09-233-0/+515
| | | | | | | | | | | | | | | | | In this commit, the same set of test cases as in test/fs/fs-test.sh is provided using pytest framework. Actually, fs-test.sh provides three variants:"sb" (sb command), "nonfs" (fatxx and etc.) and "fs" (hostfs), and this patch currently supports only "nonfs" variant; So it is not a replacement of fs-test.sh for now. Simple usage: $ py.test test/py/tests/test_fs [<other options>] You may also specify filesystem types to be tested: $ py.test test/py/tests/test_fs --fs-type fat32 [<other options>] Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* fs-test: update the test result as of v2018.09AKASHI Takahiro2018-09-231-10/+12
| | | | | | | | As far as this patch series has been applied, all the tests should pass. So update the test result summary. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* fs-test: fix false positive error at Test Case 12AKASHI Takahiro2018-09-231-1/+1
| | | | | | | The error message to be matched is wrong. Fix it. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: typo occuredHeinrich Schuchardt2018-09-231-1/+1
| | | | | | | %s/occured/occurred/ Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test/py: test EFI_SIMPLE_TEXT_INPUT_PROTOCOLHeinrich Schuchardt2018-09-231-0/+58
| | | | | | | Execute the EFI selftest for the EFI_SIMPLE_TEXT_INPUT_PROTOCOL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test: tests for utf_to_lower() utf_to_upper().Heinrich Schuchardt2018-09-231-0/+34
| | | | | | | Provide unit tests for utf_to_lower() utf_to_upper(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test: test printing UnicodeHeinrich Schuchardt2018-09-231-0/+43
| | | | | | | Test printing of Unicode strings Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test: unit tests for Unicode functionsHeinrich Schuchardt2018-09-234-3/+485
| | | | | | | Provide unit tests for Unicode functions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* test: print_ut.c use #if CONFIG_IS_ENABLED(EFI_LOADER)Heinrich Schuchardt2018-09-231-4/+2
| | | | | | | | Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements. Suggested-by: Alexander Graf <agraf@suse.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>