summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-01-23bootstd: Include the device tree in the bootflowSimon Glass
Some bootmeths provide a way to load a device tree as well as the base OS image. Add a way to store this in the bootflow. Update the 'bootflow info' command to show this information. Note that the device tree is not allocated, but instead is stored at an address provided by an environment variable. This may need to be adjusted at some point, but for now it works well and fits in with the existing distro-boot scripts. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add a virtio bootdevSimon Glass
Add a bootdev for virtio so that these devices can be used with standard boot. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23virtio: Avoid strange behaviour on removalSimon Glass
This device does a check on removal which is better handled in the actual test. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add an NVMe bootdevSimon Glass
Add a bootdev for NVMe so that these devices can be used with standard boot. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add an IDE bootdevSimon Glass
Add a bootdev for IDE so that these devices can be used with standard boot. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add a SCSI bootdevSimon Glass
Add a bootdev for SCSI so that these devices can be used with standard boot. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Only scan bootable partitionsSimon Glass
At present all partitions are scanned, whether marked bootable or not. Use only bootable partitions, defaulting to partition 1 if none is found. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23part: Add a function to find the first bootable partitionSimon Glass
If a disk has a bootable partition we are expected to use it to locate the boot files. Add a function to find it. To test this, update mmc1 to have two paritions, fixing up other tests accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add a hunter for ethernetSimon Glass
Sometimes ethernet devices are attached to PCI. Since it is quick to scan, add this into the ethernet hunter. Run dhcp to establish the network connection. Drop this from the bootdev since that is not needed now. Update a log message for clarity. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add an MMC hunterSimon Glass
Add a hunter for MMC. This doesn't do anything at present, since MMC is currently set up when U-Boot starts. If MMC moves to lazy init then we can add a hunter function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add a USB hunterSimon Glass
Add a hunter for USB which enumerates the bus to find new bootdevs. Update the tests and speed up bootdev_test_prio() while we are here, by dropping the USB delays. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Support running bootdev huntersSimon Glass
Add a way to run a bootdev hunter to find bootdevs of a certain type. Add this to the 'bootdev hunt' command. Test for this are added in a later patch, since a useful test needs some hunters to work with. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add the concept of a bootdev hunterSimon Glass
Some bootdevs must be enumerated before they appear. For example, USB bootdevs are not visible until USB is enumerated. With standard boot this needs to happen automatically, since we only want to enumerate a bus if it is needed. Add a way to define bootdev 'hunters' which can be used to hunt for bootdevs of a given type. Track which ones have been used and add a command to list them. Include a clang work-around which seems to be needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23sandbox: Allow ethernet bootdevs to be disabled for testsSimon Glass
Most tests don't want these and can create a lot of noise. Add a way to disable them. Use that in tests, with a flag provided to enable them for tests that need this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23dm: test: Correct ordering of DM setupSimon Glass
We must call dm_scan_other() after devices from the device tree have been created, since that function behaves differently if there is no bootstd device. Adjust the logic to achieve this. Also fix the bootflow_system() test which was relying on this broken behaviour. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23dm: part: Update test to use mmc2Simon Glass
At present this test sets up a partition table on mmc1. But this is used by the bootstd tests, so it is not possible to run those after this test has run, without restarting the Python test harness. This is inconvenient when running tests repeatedly with 'ut dm'. Move the test to use mmc2, which is not used by anything. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23test: Drop duplicate restore of DM stateSimon Glass
This code is present twice. Fix it so that it is only executed once. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23test: Fix the help for the ut commandSimon Glass
The font help has an incorrect newline. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: cdd964e3801 ("test: Tidy up help for ut command")
2023-01-23lib: Add a function to split a string into substringsSimon Glass
Some environment variables provide a space-separated list of strings. It is easier to process these when they are broken out into an array of strings. Add a utility function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23dm: test: Correct assertion in dm_test_part()Simon Glass
This obscures the line number. Update the test to avoid make sure that the line which failed is displayed, so it is possible to diagnose the failure. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23dm: core: Support sorting devices with dm treeSimon Glass
Add a -s flag to sort the top-level devices in order of uclass ID. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18test: compression: add zstd uncompression testBrandon Maier
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
2023-01-18test/py: gpt: add test for the gpt partition type GUID identifierEnric Balletbo i Serra
Add sandbox test for the gpt partition type command, the test uses the persistent data test_gpt_disk_image.bin to check that the first partition type GUID that identifies the type of the partition has the "Linux filesystem data" type ( 0FC63DAF-8483-4772-8E79-3D69D8477DE4 ). Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
2023-01-18test: compression: use sizeof() instead of magic numbersBrandon Maier
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
2023-01-16bootstd: Support setting a theme for the menuSimon Glass
Allow a theme to be set. For now this is very simple, just a default font size to use for all elements. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16bootstd: Add a test for the bootstd menuSimon Glass
Add a test which checks that two operating systems can be displayed in a menu, allowing one to be selected. Enable a few things on snow so that the unit tests build. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16expo: Add basic testsSimon Glass
Add some tests for the expo, including setting up and rendering an expo. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16bootstd: Allow reading a logo for the OSSimon Glass
Some operating systems provide a logo in bmp format. Read this in if present so it can be displayed in the menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16bootstd: Read the Operating System name for distro/scriptsSimon Glass
Add the concept of an OS name to the bootflow. This typically includes the OS name, version and kernel version. Implement this for the distro and script bootmeths so that it works with Armbian and older version of Fedora. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16video: Add font functions to the vidconsole APISimon Glass
Support for fonts currently depends on the type of vidconsole in use. Add two new methods to enumerate fonts and to set the font. Fix a few other method comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16sandbox: Enable mmc command and legacy imagesSimon Glass
The mmc command is useful for testing mmc disk images in sandbox, so enable it. We also need to enable legacy images so that we can run tests which use them. Disable it for a few avb tests since MMC is not implemented there yet. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-11Use `grep -E` or plain `grep` instead of `egrep`Ville Skyttä
`egrep` has been deprecated in GNU grep since 2007, and since 3.8 it emits obsolescence warnings: https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1 Acked-by: Dhruva Gole <d-gole@ti.com>
2023-01-11test: compression: use ut_assert for errorsBrandon Maier
Use the ut_assert macros for more useful error messages. Signed-off-by: Brandon Maier <brandon.maier@collins.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-11test: compression: check with trailing garbage in inputBrandon Maier
The Linux kernel appends 4 bytes to the end of compressed kernel Images containing the uncompressed image size. They are used to make self-decompressing Images easier. However for archs that don't support self-decompression, like ARM64, U-Boot must be able to decompress the image with the garbage data. The existing decompressors already support this. This unit test was added while working on zstd support as upstream zstd will error if there is garbage data in the input buffer, and special care was needed to support this. Signed-off-by: Brandon Maier <brandon.maier@collins.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-11test: cmd: exit: Add unit test for exit and partly run commandsMarek Vasut
Add a test which validates that exit from environment script works as expected, including return value propagation and clipping to positive integers. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de>
2023-01-11test: env: add test for u-boot-initial-env creationMax Krummenacher
Checks that `make u-boot-initial-env` creates the text file u-boot-initial-env and checks that it at least contains `board=<something>`. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-09Merge branch 'next'Tom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-05test:dm:fix typoYuepeng Xing
Fix typos in the 'test/dm' directory. Signed-off-by: Yuepeng Xing <xingyuepeng@eswincomputing.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-04test: unit test for u16_strcasecmp()Heinrich Schuchardt
Provide a unit test for u16_strcasecmp(). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-12-31cmd: source: Support specifying config nameSean Anderson
As discussed previously [1,2], the source command is not safe to use with verified boot unless there is a key with required = "images" (which has its own problems). This is because if such a key is absent, signatures are verified but not required. It is assumed that configuration nodes will provide the signature. Because the source command does not use configurations to determine the image to source, effectively no verification takes place. To address this, allow specifying configuration nodes. We use the same syntax as the bootm command (helpfully provided for us by fit_parse_conf). By default, we first try the default config and then the default image. To force using a config, # must be present in the command (e.g. `source $loadaddr#my-conf`). For convenience, the config may be omitted, just like the address may be (e.g. `source \#`). This also works for images (`source :` behaves exactly like `source` currently does). [1] https://lore.kernel.org/u-boot/7d711133-d513-5bcb-52f2-a9dbaa9eeded@prevas.dk/ [2] https://lore.kernel.org/u-boot/042dcb34-f85f-351e-1b0e-513f89005fdd@gmail.com/ Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-31test: Add test for source commandSean Anderson
This adds a basic test for FIT image handling by the source command. It's a python test becase we need to run mkimage. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-23log: Remove some places where we redefine LOGLEVELTom Rini
We cannot redefine a CONFIG value per file in this manner. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-21Merge tag 'v2023.01-rc4' into nextTom Rini
Prepare v2023.01-rc4 Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-20test: add unit test for u16_strnlen()Heinrich Schuchardt
Add the missing unit test. It can be executed with: ut unicode u16_strnlen Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-06event: Re-add file paths to the testsTom Rini
Now that we are enforcing dwarf-4 to be used we will have the full file paths present. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-06Merge tag 'sound-2023-01-rc4' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for sound-2023-01-rc4 * Avoid endless loop and amend unit test * Add man-page for the sound command * Fix sandbox sound driver
2022-12-05post: Migrate to KconfigTom Rini
We move the existing CONFIG_POST_* functionality over to CFG_POST and then introduce CONFIG_POST to Kconfig. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-05global: Move remaining CONFIG_SYS_SDRAM_* to CFG_SYS_SDRAM_*Tom Rini
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_SDRAM namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-05test: dm: eth: Add ip6_make_lladdr testViacheslav Mitrofanov
Add a test that checks generated Link Local Address. Use in sandbox Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-05test: dm: eth: Add ip6_make_snma testViacheslav Mitrofanov
Add a test that checks generated Solicited Node Multicast Address from our ipv6 address. Use in sandbox Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>