aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2020-08-24clk: set flags in the ccf registration routinesDario Binacchi1-0/+7
The top-level framework flags are passed as parameter to the common clock framework (ccf) registration routines without being used. Checks of the flags setting added by the patch have been added in the ccf test. Signed-off-by: Dario Binacchi <dariobin@libero.it>
2020-08-24dm: test: clk: add the test for the ccf gated clockDario Binacchi1-0/+8
Unlike the other clock types, in the case of the gated clock, a new driver has been developed which does not use the registering routine provided by the common clock framework. The addition of the ecspi0 clock to sandbox therefore allows testing the ccf gate clock. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-22test: dm: Add test case for devfdt_get_addr_ptrOvidiu Panait1-0/+18
Add flat tree test case to cover devfdt_get_addr_ptr function. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-22test/py: Update test_bindPatrice Chotard1-6/+9
As bind-test is now binded at sandbox startup and no more by test_bind.py, bind-test nodes are not located at the end of "dm tree" output, but can be located everywhere in the tree, so bind-test output could either be: simple_bus 0 [ ] generic_simple_bus |-- bind-test phy 0 [ ] phy_sandbox | |-- bind-test-child1 simple_bus 1 [ ] generic_simple_bus | `-- bind-test-child2 or: simple_bus 5 [ ] generic_simple_bus `-- bind-test phy 2 [ ] phy_sandbox |-- bind-test-child1 simple_bus 6 [ ] generic_simple_bus `-- bind-test-child2 in_tree() function need to be updated to take care of that change. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-22sandbox: dts: Add compatible string for bind-test nodePatrice Chotard2-4/+1
Usage of lists_bind_fdt() in bind command imposes to add a compatible string for bind-test node. Others impacts are: - bind-test node is binded at sandbox start, so no need to bind it in test_bind_unbind_with_node() test. - As explained just above, after sandbox start, now a phy exist. In test/dm/phy.c, it was verified that a third phy didn't exist, now we must verified that a fourth phy doesn't exist. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-20i2c: eeprom: Use reg property instead of offset and sizeMichal Simek1-0/+8
Remove adhoc dt binding for fixed-partition definition for i2c eeprom. fixed-partition are using reg property instead of offset/size pair. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-15Merge tag 'efi-2020-10-rc3-2' of ↵Tom Rini5-24/+326
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-10-rc3 (2) This series includes bug fixes for: * UEFI secure boot - images with multiple signatures * UEFI secure boot - support for intermediate certificates * corrections for UEFI unit tests * missing loadaddr on MAIX board
2020-08-14lib: sscanf: add sscanf implementationAndrii Anisov2-0/+175
Port sscanf implementation from mini-os and introduce new Kconfig option to enable it: CONFIG_SSCANF. Disable by default. Signed-off-by: Andrii Anisov <andrii_anisov@epam.com> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
2020-08-14test/py: efi_secboot: modify 'multiple signatures' test caseAKASHI Takahiro2-12/+19
The test case 5 in test_signed (multiple signatures) must be modified and aligned with the change introduced in the previous commit ("efi_loader: signature: correct a behavior against multiple signatures"). Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-08-13test/py: efi_secboot: add test for intermediate certificatesAKASHI Takahiro4-0/+305
In this test case, an image may have a signature with additional intermediate certificates. A chain of trust will be followed and all the certificates in the middle of chain must be verified before loading. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-08-13test/py: efi_secboot: small rework for adding a new testAKASHI Takahiro2-13/+3
It won't be very useful to customize HELLO_PATH and EFI_SECBOOT_IMAGE_NAME under the current code base. So just remove them. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-08-10test/py: fix SquashFS testsJoao Marcos Costa3-14/+16
Use "cons.config.build_dir" instead of writing to the source directory (read-only). This will fix the test failures in Azure. Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2020-08-08test/py: serial# cannot be overwritten on some devicesHeinrich Schuchardt1-2/+5
On some devices the environment variable serial# cannot be overwritten. Set the variable only if it is not set. For our unit test it is sufficient to test if any value for serial-number is set. Fixes: 8a5cdf601f8d ("test: efi_selftest: Do not force serial# setting") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-07test: py: test_shell_run() with CONFIG_HUSH_PARSER=nHeinrich Schuchardt1-3/+3
The hush parser not enabled for some boards, e.g. sipeed_maix_bitm_defconfig. With CONFIG_HUSH_PARSER=n a double quotation mark is not interpreted as the beginning of a string. Use a single quotation mark instead. Furthermore without the hush parser variables have to be referenced as ${varname}. Add the missing braces. Reported-by: Sean Anderson <seanga2@gmail.com> Fixes: 8b86c609b860 ("test/py: add test of basic shell functionality") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-07tests: support mkfs.ext4 without metadata_csumStephen Warren2-3/+8
Modify various test/py filesystem creation routines to support systems that don't implement the metadata_csum ext4 feature. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2020-08-07test/py: Add tests for the SquashFS commandsJoao Marcos Costa3-0/+101
Add Python scripts to test 'ls' and 'load' commands. The scripts generate a SquashFS image and clean the directory after the assertions, or if an exception is raised. Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2020-08-07cmd: Update the memory-search commandSimon Glass4-30/+103
Add various fixes and improvements to this command that were missed in the original version. Unfortunately I forgot to send v2. - Fix Kconfig name - Use a separate variable for the remaining search length - Correct a minor bug - Move into a separate test suite - Add -q flag to the 'quiet' test to test operation when console is enabled - Enable the feature for sandbox Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-07test: Add a flag for tests that need console recordingSimon Glass1-0/+10
Allow tests that need console recording to be marked, so they can be skipped if it is not available. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-07dm: Rename DM test flags to make them more genericSimon Glass74-290/+290
The test flags used by driver model are currently not available to other tests. Rather than creating two sets of flags, make these flags generic by changing the DM_ prefix to UT_ and moving them to the test.h header. This will allow adding other test flags without confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-07test: Add a way to check part of a console line or skip itSimon Glass1-0/+22
Some lines of the output are not worth testing, or not worth testing in their entirety. For example, when checking a hex dump we know that the hex-dump routine can display ASCII so we only need to check the hex bytes, not the ASCII dump. Add a new test macros which can check only part of a console line. Sometimes it is useful to skip a line altogether, so add a macro for that also. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-04test/py: Add test support for three stage bootYan Liu1-0/+10
Current pytest only support upto 2 stage boot; Some boards like TI K3 am6/J7 boards use 3 stage boot. This patch adds u_boot_spl2 to be able to handle the 3-stage boot case. User needs to set "env__spl2_skipped" in u_boot_boardenv config file to use this support. By default it is set to TRUE. Signed-off-by: Yan Liu <yan-liu@ti.com> Signed-off-by: Yan Liu <yan-liu@ti.com>
2020-08-03dm: core: Drop header files from dm/test.hSimon Glass61-17/+81
These header file should not be included in other header files. Remove them and add to each individual file. Add test/test.h to test/ui.h since that is a reasonable place. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-31test: sandbox: add test for erase commandPatrick Delaunay1-0/+16
Add test for the erase command tested on ENV in EXT4. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-07-31test: environment in ext4Patrick Delaunay1-1/+96
Add basic test to persistent environment in ext4: save and load in host ext4 file 'uboot.env'. On first execution an empty EXT4 file system is created in persistent data dir: env.ext4.img. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-07-31test: efi_selftest: Do not force serial# settingTom Rini1-1/+1
As part of the EFI self test we set and check the serial# variable. However, we should not be forcing this setting. In the case where we are allowed to change the variable it will change, and we will pass the test. In the case where we cannot change it, force may or may not be allowed, depending on further environment restrictions. Drop the -f flag here as we do not need it. Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-31test: do not rely on => being the promptHeinrich Schuchardt1-1/+1
In our tests we should use the customized prompt for testing. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Tom Rini <trini@konsulko.com>
2020-07-28test: dm: add a test for class buttonPhilippe Reynes2-0/+75
Add a test to confirm that we can read button state using the button-gpio driver. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-07-28test/py: add tests for the button commandsPhilippe Reynes1-0/+19
Adds tests for the button commands. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-07-28sandbox, test: change hog gpioPhilippe Reynes1-6/+6
Since commit 9ba84329dc45 ("sandbox, test: add test for GPIO_HOG function"), the gpio_a 0,1,2 and 3 are used by hog in test.dts. But 2 leds 'sandbox:red' and 'sandbox:green' are using gpio_a 0 and 1. As hog always request his gpios, the led command on both led is broken: => led sandbox:red LED 'sandbox:red' not found (err=-16) The gpio is already requested by hog, so it can't be enabled for led 'sandbox:red'. This commit change the gpio used by hog to 10, 11, 12 and 13, so the led command could be used again with 'sandbox:red' and 'sandbox:green'. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2020-07-27Merge tag 'dm-pull-20jul20-take2a' of ↵Tom Rini8-6/+140
https://gitlab.denx.de/u-boot/custodians/u-boot-dm binman support for FIT new UCLASS_SOC patman switch 'test' command minor fdt fixes patman usability improvements
2020-07-26test: env: add test for env info sub-commandPatrick Delaunay1-0/+63
Add a pytest for testing the env info sub-command: test_env_info: test command with several option that can be executed on real hardware device without assumption test_env_info_sandbox: test the result on sandbox with a known ENV configuration: ready & default & persistent The quiet option '-q' is used for support in shell test; for example: if env info -p -d -q; then env save; fi Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Stephen Warren <swarren@nvidia.com>
2020-07-25test/dm: check if devices existHeinrich Schuchardt5-5/+18
Running 'ut dm' on the sandbox without -D or -d results in segmentation faults due to NULL pointer dereferences. Check that device pointers are non-NULL before using them. Use ut_assertnonnull() for pointers instead of ut_assert(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-07-25test: Add tests for SOC uclassDave Gerlach2-0/+121
Add a sandbox SOC driver, and some tests for the SOC uclass. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-24patman: Add a 'test' subcommandSimon Glass1-1/+1
At present we use --test to indicate that tests should be run. It is better to use a subcommand for list, like binman. Change it and adjust the existing code to fit under a 'send' subcommand, the default. Give this subcommand the same default arguments as the others. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-24Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"Tom Rini8-140/+6
This reverts commit 5d3a21df6694ebd66d5c34c9d62a26edc7456fc7, reversing changes made to 56d37f1c564107e27d873181d838571b7d7860e7. Unfortunately this is causing CI failures: https://travis-ci.org/github/trini/u-boot/jobs/711313649 Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-23Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dmTom Rini8-6/+140
binman support for FIT new UCLASS_SOC patman switch 'test' command minor fdt fixes patman usability improvements
2020-07-22test/py: efi_secboot: fix additional pylint errorsAKASHI Takahiro1-7/+8
This is a fixup by autopep8 after the commit ("test/py: efi_secboot: apply autopep8"). Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-22test/py: efi_secboot: remove unused functionAKASHI Takahiro1-9/+0
'tool_is_in_path' function is no longer used anywhere after Heinrich has removed 'sudo' version of fixture setup. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-22efi_loader: use logging for bootefi commandHeinrich Schuchardt2-10/+8
Log messages of the bootefi command instead of simply printing them to the console. Do not show "## Application terminated" message when the UEFI binary completed successfully. Adjust the python tests testing for '## Application terminated'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-20test/dm: check if devices existHeinrich Schuchardt5-5/+18
Running 'ut dm' on the sandbox without -D or -d results in segmentation faults due to NULL pointer dereferences. Check that device pointers are non-NULL before using them. Use ut_assertnonnull() for pointers instead of ut_assert(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-07-20test: Add tests for SOC uclassDave Gerlach2-0/+121
Add a sandbox SOC driver, and some tests for the SOC uclass. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20patman: Add a 'test' subcommandSimon Glass1-1/+1
At present we use --test to indicate that tests should be run. It is better to use a subcommand for list, like binman. Change it and adjust the existing code to fit under a 'send' subcommand, the default. Give this subcommand the same default arguments as the others. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-17acpi: Support writing named valuesSimon Glass1-0/+77
Allow writing named integers and strings to the generated ACPI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> [bmeng: Fix the "new blank line at EOF" warning] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17acpi: Support generation of a deviceSimon Glass1-0/+27
Allow writing an ACPI device to the generated ACPI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> [bmeng: Fix build failures on Sandbox] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17acpi: Support generation of a generic registerSimon Glass1-0/+46
Allow writing out a generic register. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> [bmeng: Fix build failures on Sandbox] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17acpi: Support generation of a scopeSimon Glass3-2/+35
Add a function to write a scope to the generated ACPI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: Fix build failures on Sandbox] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17acpi: Export functions to write sized valuesSimon Glass1-1/+43
At present only acpigen_write_integer() is exported for use by other code. But in some cases it is useful to call the specific function depending on the size of the value. Export these functions and add a test. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: Fix the "new blank line at EOF" warning] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17acpi: Add an acpi command to list/dump generated ACPI itemsSimon Glass1-0/+39
Add a command that shows the individual blocks of data generated by each device, effectively splitting the full table into its component parts. This can be helpful for debugging. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17dm: acpi: Enhance acpi_get_name()Simon Glass1-1/+41
For many device types it is possible to figure out the name just by looking at its uclass or parent. Add a function to handle this, since it allows us to cover the vast majority of cases automatically. However it is sometimes impossible to figure out an ACPI name for a device just by looking at its uclass. For example a touch device may have a vendor-specific name. Add a new "acpi,name" property to allow a custom name to be created. With this new feature we can drop the get_name() methods in the sandbox I2C and SPI drivers. They were only added for testing purposes. Update the tests to use the new values. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17pci: Avoid a crash in device_is_on_pci_bus()Simon Glass1-0/+14
This function cannot currently be called on the root node. Add a check for this as well as a test. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>