summaryrefslogtreecommitdiff
path: root/test/py
AgeCommit message (Collapse)AuthorFilesLines
2020-07-08test_sleep.py: make sleep time and margin configurableHeiko Schocher1-3/+11
make the sleep time and the margin configurable. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2020-07-07cmd: blkls: Add blkls commandNiel Fourie1-0/+13
Add a command to print a list of available block device drivers, and for each, the list of known block devices. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-07cmd: dm: Fixed/Added DM driver listing subcommandsNiel Fourie1-2/+20
Renamed dm "drivers" subcommand to "compat" (as it listed compatibility strings) and prevent it from segfaulting when drivers have no of_match populated. Added a new "drivers" subcommand to dump a list of all known DM drivers and for each, their uclass id, uclass driver and names of attached devices. Added a new "static" subcommand to dump a list of DM drivers with statically defined platform data. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-07cmd: fs: Add command to list supported fs typesNiel Fourie1-0/+13
Added command "fstypes" to list supported/included filesystems. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Limit to sandbox] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-07cmd: part: Add subcommand to list supported partition tablesNiel Fourie1-0/+14
Add a subcommand "types" to the part command, which lists the supported partition table types. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-03test: correct time stamps for UEFI authenticationHeinrich Schuchardt1-8/+8
A time authenticated variable cannot be overwritten with another value with the same time stamp. So we must ensure the correct sequence of time stamps when generating out test data. Using parameter -t for sign-efi-sig-list gives reproducible results and avoids sleep statements. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-03test/py: efi_secboot: fix test case 1g of test_authvarAKASHI Takahiro1-6/+6
In the test case (1g) of test_authvar, "db" is mistakenly used, and it ends up being the exact same as (1f). So correct it as "dbx" test case. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-03test/py: efi_secboot: remove all "re.search"AKASHI Takahiro3-74/+65
Currently, we don't use any regular expression in matching outputs from U-Boot. Since its use is just redundant, we can remove all. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-03Revert "test: stabilize test_efi_secboot"AKASHI Takahiro3-9/+9
This reverts commit 5827c2545849441dd60467565aac11964259972f. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-06-30test/py: test_efi_fit: Update #size-cells to 1Bin Meng1-2/+2
test_efi_fit tests fail on RISC-V currently. This is due to the RISC-V arch_fixup_fdt() checks the #size-cells of the root node in order to correctly fix up the reserved memory node. Per the DT binding, the /reserved-memory node requires both <#address-cells> and <#size-cells> and they should use the same values as the root node. For the root node, it's not very useful if <#size-cells> is zero. Update #size-cells to 1 so tests can pass. Signed-off-by: Bin Meng <bin.meng@windriver.com>
2020-06-02test/py: use actual core count for parallel buildsHeinrich Schuchardt1-1/+1
When building U-Boot we should not blindly use make -j8 but consider the actual core count given by os.cpu_count(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>
2020-05-09test: describe naming conventions for macro UNIT_TESTHeinrich Schuchardt1-1/+16
Strict naming conventions have to be followed for Python function generate_ut_subtest() to collect C unit tests to be executed via command 'ut'. Describe the requirements both on the C as well on the Python side. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-04test: stabilize test_efi_secbootHeinrich Schuchardt3-9/+9
When setting up the console via function efi_console_register() we call query_console_serial(). This functions sends an escape sequence to the terminal to query the display size. The response is another escape sequence. console.run_command_list() is looking for a regular expression '^==>'. If the escape sequence for the screen size precedes the prompt without a line break, no match is found. When efi_disk_register() is called before efi_console_register() this leads to a test failuere of the UEFI secure boot tests. We can avoid the problem if the first UEFI command passed to u_boot_console.run_command_list() produces output. This patch achieves this by appending '; echo' to the first UEFI related command of the problematic tests. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-01test/py: vboot: add a test to check fit signature on fit with paddingPhilippe Reynes1-19/+33
The pytest vboot does all his tests on fit without padding. We add the same tests on fit with padding. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-04-30test/py: fix test_efi_secboot/conftest.pyHeinrich Schuchardt1-24/+6
If udisksctl is present test/py/tests/test_efi_secboot/conftest.py fails because the disk image is never mounted. Normal users can only mount fuse file systems. Unfortunately fusefat is still in an experimental state and seems not to work here correctly. So as we have to be root or use the sudo command anyway delete all coding referring to udisksctl. -- We should not use mount point /mnt as this directory or one of its sub-directories might already be in use as active mount points. Instead create a new directory in the build root as mount point. -- Remove debug print statements that have been commented out. print without parentheses is anyway invalid in Python 3. And pytest anyway filters out the output if there is no exception reported. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-04-27test: test_fs error messageHeinrich Schuchardt1-2/+3
For non-root users mkfs.vfat is not in the search path at least on Debian. Hence when running 'make tests' a message indicates that file system tests have been skipped: SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for filesystem: fat16 This message is not really helpful as the executed program is not indicated. Provide a more complete message like SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for filesystem: fat16. Command 'mkfs.vfat -F 16 build-sandbox/persistent-data/3GB.fat16.img' returned non-zero exit status 127. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-04-17test: pinmux: add pincontrol-gpio for pin configurationPatrick Delaunay1-0/+10
Add a simple pincontrol associated to the sandbox gpio driver, that allows to check pin configuration with the command pinmux. The pinmux test is also updated to test behavior with 2 pincontrols. Example to check LED pin configuration: => pinmux list | Device | Driver | Parent | pinctrl-gpio | sandbox_pinctrl_gpio | root_driver | pinctrl | sandbox_pinctrl | root_driver => pinmux dev pinctrl-gpio => pinmux status a0 : gpio input . a1 : gpio input . a2 : gpio input . a3 : gpio input . a4 : gpio input . a5 : gpio output . a6 : gpio output . ... Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-04-17test: dm: update test for pins configuration in pinctrl nodePatrick Delaunay1-10/+18
Add test for "pins" configuration in gpio uclass with set_state() ops and test for generic parsing of pinconf_param array). set_state() is called by: - pinctrl_generic_set_state |- pinctrl_generic_set_state_subnode Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-04-16efi_loader, pytest: add UEFI secure boot tests (image)AKASHI Takahiro2-0/+238
Provide test cases for * image authentication for signed images (test_efi_secboot/test_signed.py) * image authentication for unsigned images (test_efi_secboot/test_unsigned.py) Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-04-16efi_loader, pytest: add UEFI secure boot tests (authenticated variables)AKASHI Takahiro1-0/+282
Provide a couple of test cases for variable authentication. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-04-16efi_loader, pytest: set up secure boot environmentAKASHI Takahiro3-0/+180
A fixture for UEFI secure boot tests (image authentication and variable authentication) is defined. A small file system with test data in a single partition formatted in fat is created. This test requires efitools v1.5.2 or later. If the system's efitools is older, you have to build it on your own and define EFITOOLS_PATH. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-04-13Merge branch 'next'Tom Rini3-13/+37
Pull in changes that have been pending in our 'next' branch. This includes: - A large number of CI improvements including moving to gcc-9.2 for all platforms. - amlogic, xilinx, stm32, TI SoC updates - USB and i2c subsystem updtaes - Re-sync Kbuild/etc logic with v4.19 of the Linux kernel. - RSA key handling improvements
2020-04-11test/py: Allow using buildman to build U-BootSimon Glass2-10/+33
It is a pain to have to set the CROSS_COMPILE environment variable when using test.py's --build option. It is possible to get this using the -A option from buildman. But it seems better to just use buildman to do the build when it is available. However using buildman adds a new dependency to the test system which we want to avoid. So leave the default as is and add a flag to make it use buildman. Note that most of these changes relate to test.py and the parts of the travis/gitlab/azure scripts which relate to running test and building a suitable U-Boot to run the tests on. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-04-10test/py: Update u_boot_utils.find_ram_base to bypass the low 2MiB memoryBin Meng1-3/+4
On some RISC-V targets the low memory is protected that prevents S-mode U-Boot from access. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-04-09cmd: Add test and fix bugs for dm driversSean Anderson1-0/+17
Add a test for the dm drivers command. Also fix a null pointer dereference revealed by said test. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-04-01test: vboot: Reduce fake kernel size to 500 bytesSimon Glass1-1/+1
We don't need 5KB to test things out. A smaller size makes it easier to look at the FIT with fdtdump. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01test: vboot: Move key creation into a functionSimon Glass1-21/+18
This code is repeated so move it into a function with a parameter. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01test: vboot: Fix pylint errorsSimon Glass1-34/+19
Fix various minor things noticed by pylint. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01test: vboot: Tidy up the code a littleSimon Glass1-13/+21
Fix some long lines and comments. Use a distinct name for the 'required key' test. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01test: vboot: Parameterise the testSimon Glass1-6/+14
This test is actually made up of five separate tests. Split them out so that they appear as separate tests. Unfortunately this restarts U-Boot multiple times which adds about a second to the already-long vboot test, about 8 seconds total on my machine. We could add a special 'teardown' test afterwards but if the tests are executed out of order that would not work. Changing test_vboot into a class causes it not to be discovered and makes it different from all other tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01test: vboot: Add a test for a forged configurationSimon Glass2-1/+440
Add a check to make sure that it is not possible to add a new configuration and use the hashed nodes and hash of another configuration. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01test: vboot: Drop unnecessary parameter for fit_check_signSimon Glass1-2/+1
This tool only uses the last -k parameter provided. Drop the earlier one since it has no effect. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-03-30test/py: test_efi_grub_net() requires OF_CONTROLHeinrich Schuchardt1-0/+1
With CONFIG_OF_CONTROL environment variable $fdtcontroladdr is not defined and test_efi_grub_net() fails. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-28test/py: UEFI helloworld requires OF_CONTROLHeinrich Schuchardt1-2/+3
With CONFIG_OF_CONTROL environment variable $fdtcontroladdr is not defined and test_efi_helloworld_net() fails. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-27test/py: mmc: Fix 'mmc info' testcaseHarald Seiler1-2/+2
Commit 41e30dcf8796 ("cmd: mmc: Make Mode: printout consistent") fixed the layout of `mmc info` output. Reflect this change in the respective testcase. Also fix a typo in the documentation. Fixes: 41e30dcf8796 ("cmd: mmc: Make Mode: printout consistent") Signed-off-by: Harald Seiler <hws@denx.de> Acked-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-13cmd: gpio: Make `gpio input` return pin value againAlex Kiernan1-0/+37
4dbc107f4683 ("cmd: gpio: Correct do_gpio() return value") correctly changed the behaviour of the gpio command to return CMD_RET_SUCCESS or CMD_RET_FAILURE, but any existing script which expects the return value to be the pin value is broken by this change. Reinstate the legacy behaviour for `gpio input` only. Fixes: 4dbc107f4683 ("cmd: gpio: Correct do_gpio() return value") Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Alex Kiernan <alex.kiernan@hivehome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-02-05test: efi_selftest: fix pylint warningsHeinrich Schuchardt1-174/+187
Fix pylint warnings: * add missing module and function documentation * correct indentation Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-02-05test: test_efi_fit: fix pylint warningsHeinrich Schuchardt1-38/+39
Fix warnings issued by pylint: * naming of variables * usage of commas and semicolons * indentation * placement of module description Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-02-04test/py: android: Add test for abootimgSam Protsenko1-0/+159
Unit test for 'abootimg' command. Right now it covers dtb/dtbo functionality in Android Boot Image v2, which was added recently. Running test: $ ./test/py/test.py --bd sandbox --build -k test_abootimg shows that 1/1 tests passes successfully. Signed-off-by: Sam Protsenko <joe.skb7@gmail.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2020-02-04doc: android: Convert to Sphinx formatSam Protsenko1-1/+1
Convert Android documentation from regular txt format to Sphinx (RST). Also add Android index.rst file and reference it in root index.rst, so that Android documentation is visible. Test: $ make htmldocs $ xdg-open doc/output/index.html Signed-off-by: Sam Protsenko <joe.skb7@gmail.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2020-01-16Merge tag 'xilinx-for-v2020.04' of ↵Tom Rini1-0/+31
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze Xilinx/FPGA changes for v2020.04 ARM64: - Add INIT_SPL_RELATIVE dependency SPL: - FIT image fix - Enable customization of bl2_plat_get_bl31_params() Pytest: - Add test for octal/hex conversions Microblaze: - Fix manual relocation for one SPI instance Nand: - Convert zynq/zynqmp drivers to DM Xilinx: - Enable boot script location via Kconfig - Support OF_SEPARATE in board FDT selection - Remove low level uart setup it is done later by code - Add support for DEVICE_TREE variable passing for SPL Zynq: - Enable jtag boot mode via distro boot - Removing unused baseaddresses from hardware.h - DT fixups ZynqMP: - Fix emmc boot sequence - Simplify spl logic around bss and board_init_r() - Support psu_post_config_data() calling - Tune mini-nand DTS - Fix psu wiring for a2197 boards - Add runtime MMC device boot order filling in spl - Clear ATF handoff handling with custom bl2_plat_get_bl31_params() - Add support u-boot.its generation - Use single image configuration for all platforms - Enable PANIC_HANG via Kconfig - DT fixups - Firmware fixes - Add support for zcu208 and zcu1285 Versal: - Fix emmc boot sequence - Enable board_late_init() by default
2020-01-16test/py: use valid device tree in test_fit.pyHeinrich Schuchardt1-3/+6
The device tree compiler expects that a node with a unit-address has a reg property. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-01-14test/py: hush_if_test: Add tests to cover octal/hex valuesMichal Simek1-0/+31
Extend test suite to cover also automatic octal/hex converstions which haven't been implemented in past. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2020-01-07test/py: Create a test for launching UEFI binaries from FIT imagesCristian Ciocaltea1-0/+458
This test verifies the implementation of the 'bootm' extension that handles UEFI binaries inside FIT images (enabled via CONFIG_BOOTM_EFI). Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-07test/py: describe env__efi_loader_helloworld_fileHeinrich Schuchardt1-3/+4
Describe the components of environment variable env__efi_loader_helloworld_file. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-07test/py: Fix broken 'notbuildconfigspec' markerCristian Ciocaltea1-1/+1
Consider the following test sample: @pytest.mark.buildconfigspec('fit') @pytest.mark.notbuildconfigspec('generate_acpi_table') def test_sample(u_boot_console): Whatever the argument of the 'notbuildconfigspec' is, the test ends up being skipped with the message: ('/uboot/test/py/conftest.py', 463, 'Skipped: .config feature "fit" enabled') Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-07Merge branch 'next'Tom Rini1-12/+27
Bring in the following merges: commit 8fbbec12f7d2c18f8883f3371cfca74a98b5dd87 Merge: 87f69f467a83 63618e71e89b Author: Tom Rini <trini@konsulko.com> Date: Fri Jan 3 09:48:47 2020 -0500 Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next - updates and fixes on ls1028a, lx2, ls1046a, MC-DPSPARSER support commit 87f69f467a8335b171c71bf217d2625d515acd7c Merge: c0912f9bbfb2 4466b9970319 Author: Tom Rini <trini@konsulko.com> Date: Tue Dec 24 08:18:19 2019 -0500 Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx into next - Enable DM driver on ppc/km boards - Enable DM_USB for some of NXP powerpc platforms: P5040, T4240, T208x, T104x, P4080, P2041, P2020, P1020, P3041 - Some updates in mpc85xx-ddr driver, km boards commit c0912f9bbfb26dd03d189953678691b799d35b6e Merge: 533c9f5714bd a1d6dc3f8407 Author: Tom Rini <trini@konsulko.com> Date: Wed Dec 18 07:20:19 2019 -0500 Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-x86 into next - Various x86 common codes updated for TPL/SPL - I2C designware driver updated for PCI - ICH SPI driver updated to support Apollo Lake - Add Intel FSP2 base support - Intel Apollo Lake platform specific drivers support - Add a new board Google Chromebook Coral commit 533c9f5714bdba79dc6f2629284d4c1a08a611d1 Merge: 553cb0688782 033e18b47bd0 Author: Tom Rini <trini@konsulko.com> Date: Tue Dec 17 07:53:08 2019 -0500 Merge tag '20191217-for-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c into next i2c: for next - misc: i2c_eeprom: Add partition support and add ability to query size of eeprom device and partitions - i2c common: add support for offset overflow in to address and add sandbox tests for it. commit 553cb06887825314e74a9bdac337467c77d1db88 Merge: f39abbbc531e b4f98b3b16ec Author: Tom Rini <trini@konsulko.com> Date: Thu Dec 12 08:18:59 2019 -0500 Merge tag 'dm-next-13dec19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm into next buildman improvements including toolchain environment feature sandbox unicode support in serial
2020-01-02test: Fix the boardspec for the SPL handoff testSimon Glass1-1/+1
This test currently does not run because it specifies the sandbox board instead of sandbox_spl. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-02test_env: don't strip() printenv resultsStephen Warren1-1/+1
get_env() was originally written to strip() the output of printenv to isolate the test from any whitespace changes in printenv's output. However, this throws away any whitespace in the variable value, which can cause issues when test code expects to see that whitespace. In fact, printenv never adds any whitespace at all, so there's no need to strip. The strip causes a practical problem for test_env_echo_exists() if state_test_env.get_existent_var() happens to choose a U-Boot variable that contains trailing whitespace. This is true for variable boot_targets. With Python 2, get_existent_var() never returned boot_targets so this issue never caused a practical problem. With Python 3, get_existent_var does sometimes return boot_targets, no doubt due to Python 3's different dict hash key order implementation, about 0.5-2% of the time, so this test appears intermittent. With the strip removed, this intermittency is solved, since the test passes for all possible U-Boot variables. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2019-12-10test.py: Make search for autoconf.mk more permissiveSimon Glass1-12/+27
Buildman doesn't store this file in the same directory as a normal build. Update the conftest code to handle both cases. Change-Id: I1fd0e56054d7dc77394a7589336aa0991bd0133d Signed-off-by: Simon Glass <sjg@chromium.org>