summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2018-09-23efi_selftest: test key notification functionsHeinrich Schuchardt1-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>
2018-09-23test/py: test EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOLHeinrich Schuchardt1-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>
2018-09-23test/py: rework test_efi_selftest_text_input()Heinrich Schuchardt1-6/+11
Use more precise regular expressions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-09-23test/py: Unicode w/ EFI_SIMPLE_TEXT_INPUT_PROTOCOLHeinrich Schuchardt1-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>
2018-09-23efi_loader: support Unicode text inputHeinrich Schuchardt1-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>
2018-09-23test/py: fs: add fstest/unlink testAkashi, Takahiro2-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>
2018-09-23test/py: fs: add fstest/mkdir testAKASHI Takahiro2-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>
2018-09-23test/py: fs: add extended write operation testAKASHI Takahiro3-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>
2018-09-23test/py: convert fs-test.sh to pytestAKASHI Takahiro3-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>
2018-09-23fs-test: update the test result as of v2018.09AKASHI Takahiro1-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>
2018-09-23fs-test: fix false positive error at Test Case 12AKASHI Takahiro1-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>
2018-09-23test/py: typo occuredHeinrich Schuchardt1-1/+1
%s/occured/occurred/ Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-09-23test/py: test EFI_SIMPLE_TEXT_INPUT_PROTOCOLHeinrich Schuchardt1-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>
2018-09-23test: tests for utf_to_lower() utf_to_upper().Heinrich Schuchardt1-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>
2018-09-23test: test printing UnicodeHeinrich Schuchardt1-0/+43
Test printing of Unicode strings Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-09-23test: unit tests for Unicode functionsHeinrich Schuchardt4-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>
2018-09-23test: print_ut.c use #if CONFIG_IS_ENABLED(EFI_LOADER)Heinrich Schuchardt1-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>
2018-09-18dm: fix alignment of help message of "dm" commandMasahiro Yamada1-1/+1
Currently, "help dm" shows as follows: => help dm dm - Driver model low level access Usage: dm tree Dump driver model tree ('*' = activated) dm uclass Dump list of instances for each uclass dm devres Dump list of device resources for each device Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2018-09-18test: ofnode: test ofnode_by_prop_value()Jens Wiklander1-0/+27
Test ofnode_by_prop_value() Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-09-18test: Add tests for CPU uclassMario Six2-0/+46
Add a sandbox CPU driver, and some tests for the CPU uclass. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-09-18test: Add tests for sysreset_get_statusMario Six1-0/+20
Add some tests for sysreset_get_status. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-09-11Merge tag 'fpga-for-v2018.11' of git://git.denx.de/u-boot-microblazeTom Rini1-0/+552
FPGA changes for v2018.11 - add fpga tests to cover fpga commands - fpga Kconfig cleanup - fix cmd/fpga.c - add support for missing fpga loadmk commands - add fpga fragment to MAINTAINERS
2018-09-11test/py: Extend fpga command to test all fpga load typesMichal Simek1-0/+552
Add support for info, load, loadp, loadb, loadbp, loadmk_legacy, loadmk_legacy_gz, loadmk_fit, loadfs also with variable support. There are probably missing failed tests. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-09-10Remove <inttypes.h> includes and PRI* usages in printf() entirelyMasahiro Yamada1-4/+3
In int-ll64.h, we always use the following typedefs: typedef unsigned int u32; typedef unsigned long uintptr_t; typedef unsigned long long u64; This does not need to match to the compiler's <inttypes.h>. Do not include it. The use of PRI* makes the code super-ugly. You can simply use "l" for printing uintptr_t, "ll" for u64, and no modifier for u32. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-09-10Remove CONFIG_USE_STDINTMasahiro Yamada1-2/+0
You do not need to use the typedefs provided by compiler. Our compilers are either IPL32 or LP64. Hence, U-Boot can/should always use int-ll64.h typedefs like Linux kernel, whatever the typedefs the compiler internally uses. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-09-10sandbox: Add serial testPatrice Chotard2-0/+55
Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-24Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini1-0/+178
2018-08-24dm: test: Fix typo in test-main commentMichal Simek1-1/+1
Trivial fix. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-21cmd: Add bind/unbind commands to bind a device to a driver from the command lineJean-Jacques Hiblot1-0/+178
In some cases it can be useful to be able to bind a device to a driver from the command line. The obvious example is for versatile devices such as USB gadget. Another use case is when the devices are not yet ready at startup and require some setup before the drivers are bound (ex: FPGA which bitsream is fetched from a mass storage or ethernet) usage example: bind usb_dev_generic 0 usb_ether unbind usb_dev_generic 0 usb_ether or unbind eth 1 bind /ocp/omap_dwc3@48380000/usb@48390000 usb_ether unbind /ocp/omap_dwc3@48380000/usb@48390000 Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-08-11Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-stagingTom Rini2-0/+84
2018-08-11Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2-0/+78
2018-08-11test: Add tests for misc uclassMario Six2-0/+84
Add a set of tests for the misc uclass. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-11test: Add AXI testMario Six2-0/+78
Add tests for the AXI uclass. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-08-10sandbox: led: use new function to configure default statePatrick Delaunay1-0/+3
Initialize the led with the default state defined in device tree in board_init and solve issue with test for led default state. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-08-08test: dm: pci: Add cases for finding PCI capability APIsBin Meng1-0/+32
Add several PCI capability and extended capability ID registers in the swap_case driver, so that we can add test case for dm_pci_find_capability() and dm_pci_find_ext_capability(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Add tests for mixed static and dynamic devices on the same busBin Meng1-0/+63
In the Sandbox test configuration, PCI bus#0 only has static devices while bus#1 only has dynamic devices. Create a bus#2 that has both types of devices and test such. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Test driver binding with driver data providedBin Meng1-0/+17
With struct pci_device_id, it's possible to pass a driver data for bound driver to use. This adds a test case for this functionality. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Add tests for configuration space accessBin Meng1-9/+15
So far we missed the testing for PCI configuration space access. This adds tests for it, as well as removing some redundant asserts. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Test more than one PCI host controllerBin Meng1-0/+11
So far there is only one PCI host controller in the sandbox test configuration. This is normally the case for x86, but it can be common on other architectures like ARM/PPC to have more than one PCI host controller in the system. This updates the case to cover such scenario. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Test more than one device on the same busBin Meng1-4/+33
It's quite common to have more than one device on the same PCI bus. This updates the test case to test such scenario. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Remove unnecessary steps in dm_test_pci_swapcase()Bin Meng1-3/+1
The check on uclass_get_device() and device_active() is unnecessary as the follow-up test operations will implicitly probe the driver. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-06dm: power-domain: query power domain after get devicePeng Fan1-0/+2
This is to test power_domain_on in device_probe. If the device has a power-domain property, enable it when probe the device. So add the test to check whether it is powered on or not. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-03clk: add clk_valid()Fabrice Gasnier1-0/+1
Add clk_valid() to check for optional clocks are valid. Call clk_valid() in test/dm/clk.c and add relevant test routine to sandbox clk tests. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-07-30fs-test.sh: Update expected result outputTom Rini1-5/+5
Given 0dc1bfb7302d ("fs: fat: cannot write to subdirectories") we have changed how the FAT code works from creating the illegal file "./file" and instead rejecting the path. The correct behavior would be to write "file" to "." but not writing an illegal file is a step in the right direction. For now, update the expected output to account for the failure. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-07-28test/py: tpm2: switch from 'tpm' to 'tpm2' commandMiquel Raynal1-20/+20
While using the 'tpm' command should work on most cases, this test suite only works with TPMv2 and since the work to make both versions build at the same time, we might end up having both 'tpm' (TPMv1) and 'tpm2' (TPMv2) commands available at the same time. Ensure this test suite always use the right one. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-07-20test/py: add test for whitelist of variables while importing environmentQuentin Schulz1-0/+97
This tests that the importing of an environment with a specified whitelist works as intended. If there are variables passed as parameter to the env import command, those only should be imported in the current environment. For each variable passed as parameter, if - foo is bar in current env and bar2 in exported env, after importing exported env, foo shall be bar2, - foo does not exist in current env and foo is bar2 in exported env, after importing exported env, foo shall be bar2, - foo is bar in current env and does not exist in exported env (but is passed as parameter), after importing exported env, foo shall be empty ONLY if the -d option is passed to env import, otherwise foo shall be bar, Any variable not passed as parameter should be left untouched. Two other tests are made to test that size cannot be '-' if the checksum protection is enabled. Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2018-07-20test/py: remove hacks for non-zero RAM base address in testsQuentin Schulz3-5/+5
Some functions have different behaviour when the given address is 0 (assumed to be NULL by the function). find_ram_base() does not return 0 anymore so it's safe to remove those offsets. Suggested-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2018-07-20test/py: return a RAM address different from 0 as it can be interpreted as NULLQuentin Schulz1-0/+6
Some functions test that the given address is not NULL (0) and fail or have a different behaviour if that's the case (e.g. hexport_r). Let's make the RAM base address to be not zero by setting it to 2MiB if that's the case. 2MiB is chosen because it represents the size of an ARM LPAE/v8 section. Suggested-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2018-07-19test: smem: add basic smem testRamon Fried2-0/+28
Add basic smem sandbox testing. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-07-11Merge git://git.denx.de/u-boot-dmTom Rini8-22/+30