summaryrefslogtreecommitdiff
path: root/test/cmd
AgeCommit message (Collapse)Author
2025-02-11test: Drop suites.hSimon Glass
This file is empty now. Remove it and its uses. Signed-off-by: Simon Glass <[email protected]>
2025-02-07cmd/setexpr: support concatenation of direct stringsHeinrich Schuchardt
The setexpr.s command allows to concatenate two strings. According to the description in doc/usage/cmd/setexpr.rst the parameters value1 and value2 can be either direct values or pointers to a memory location holding the values. Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values is a direct value. $? is set to false. * Add support for direct values in setexpr.s. * Correct the unit test for "setexpr.s fred 0". * Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-02-07test: remove available memory check in setexpr_test_str_oper()Heinrich Schuchardt
env_set() frees the previous value after allocating the new value. As the free() may merge memory chunks the available memory is not expected to stay constant. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-02-07test: remove available memory check in setexpr_test_str()Heinrich Schuchardt
env_set() frees the previous value after allocating the new value. As the free() may merge memory chunks the available memory is not expected to stay constant. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-02-07test: clean up setexpr_test_str()Heinrich Schuchardt
Assign variable buf in the sub-test where it is used. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-01-27test/cmd/wget.c: Fix loadaddr rewriteMarek Vasut
The $loadaddr variable is a hexadecimal value, not a string, it must be assigned using env_set_hex(). This may break follow up tests, like the dm_test_cmd_hash_md5 in CI. To avoid any interference with other tests, set $wgetaddr variable which is specific to this test and use it in the test. Fixes: 20f641987f83 ("test/cmd/wget.c: move net_test_wget() to the cmd test suite") Signed-off-by: Marek Vasut <[email protected]> Acked-by: Jerome Forissier <[email protected]> Reviewed-by: Fabio Estevam <[email protected]>
2025-01-24test: Drop the function for running seama testsSimon Glass
Use the new suite-runner to run these tests instead. It is not clear that these actually work, since they are not enabled on sandbox for some reason. Signed-off-by: Simon Glass <[email protected]> Acked-by: Linus Walleij <[email protected]>
2025-01-24test: Drop the function for running pci_mps testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running loadm testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running addrmap testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running setexpr testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running mem testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running mbr testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running font testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running fdt testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running exit testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running cmd testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running bdinfo testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the _test suffix on linker listsSimon Glass
Most test suites have a _test suffix. This is not necessary as there is also a ut_ prefix. Drop the suffix so that (with future work) the suite name can be used as the linker-list name. Remove the suffix from the pytest regex as well, moving it to the top of the file, as it is a constant. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Rename test suites to match their linker-list nameSimon Glass
Some suites have a different name from that used in the linker list. That makes it hard to programmatically match the name printed when the suite runs to the linker-list name it has. Update the names so they are the same. Signed-off-by: Simon Glass <[email protected]>
2024-12-30lmb: Rename free_mem to available_memIlias Apalodimas
free_mem is a misnomer. We never update it with the free memory for LMB. Instead, it describes all available memory and is checked against used_mem to decide whether an area is free or not. So let's rename this field to better match its usage. Reviewed-by: Sam Protsenko <[email protected]> Tested-by: Sam Protsenko <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
2024-12-30lmb: Move enum lmb_flags to a u32Ilias Apalodimas
LMB flags is not an enum anymore. It's currently used as a bitmask in various places of our code. So make it a u32 which is more appropriate when dealing with masks. Reviewed-by: Sam Protsenko <[email protected]> Tested-by: Sam Protsenko <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
2024-12-28test/cmd/wget: replace bogus response with an actual response from the HTTP ↵Mikhail Kshevetskiy
server According to HTTP/1.0 standard the HTTP reply consist of * Status Line + CRLF * Zero or more Response Header Fields (each ended with CRLF) * CRLF on new line (Response Header Fields end marker) * Optional Entity Body. Thus in response headers we state: Content-Length = 30 but actual transferred file data is: "\r\n<html><body>Hi</body></html>\r\n". This is 32 bytes of data. So we get and check for correctness 32 bytes of data, but * The response we are used is incorrect, real server will set Content-Length to 32. * default_wget_info->hdr_cont_len will be set to wrong value 30 (used for efi http booting). Fix an issue by: * replace bogus response with an actual response from the HTTP server * format response to show HTTP response structure * recalculate md5sum as transferred file data has been changed. The server response was captured with the commands echo -ne "<html><body>Hi</body></html>\n" > ~/public_html/test.html echo -ne "GET /~${USER}/test.html HTTP/1.0\r\n\r\n" | netcat localhost 80 >reply.txt Signed-off-by: Mikhail Kshevetskiy <[email protected]>
2024-12-28test/cmd/wget: fix the testMikhail Kshevetskiy
Changes: * update to new tcp stack * fix zero values for ISS and IRS issue (see RFC 9293) Signed-off-by: Mikhail Kshevetskiy <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-11-29test/cmd/wget.c: move net_test_wget() to the cmd test suiteJerome Forissier
Since net_test_wget() is testing a command and is in test/cmd it should be in the 'cmd' test suite, not 'lib'. Saving and restoring the values of the environment variables that the test manipulates is necessary to avoid a regression when running the whole ut test suite. A minimal reproducer is: $ ./u-boot -T -c "ut cmd net_test_wget; ut dm dm_test_eth_act" | \ grep -E "(Test:|Failures:)" Reported-by: Simon Glass <[email protected]> Signed-off-by: Jerome Forissier <[email protected]>
2024-11-18test: cmd/hash: check return value of ut_check_console_lineHeinrich Schuchardt
ut_check_console_line() does include an assert. Pass the result to ut_assertok(). Addresses-Coverity-ID: 514958 Error handling issues Fixes: 7dfafcd65ef3 ("test: unit test for hash command") Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-11-14lmb.c: add missing comma in lmb_dump_region()Heinrich Schuchardt
In the message string " %s[%d]\t[0x%llx-0x%llx], 0x%08llx bytes flags: " a comma is missing before flags. To avoid increasing the code size replace '0x%' by '%#'. Printing the size with leading zeros but not the addresses does not really make sense. Remove the leading zeros from the size output. Signed-off-by: Heinrich Schuchardt <[email protected]> [trini: Fix test/cmd/bdinfo.c for these changes] Signed-off-by: Tom Rini <[email protected]>
2024-11-14test: use %zd for size_t in mbr_test_run()Heinrich Schuchardt
For printing size_t we must use %zd and not %ld to avoid a -Wformat error on 32-bit systems. Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-11-14test: cmd/mbr: pass correct buffer size to init_write_buffersHeinrich Schuchardt
We want to completely initialize the mbr and embr buffers. This requires passing the buffer size and not the size of a pointer to the buffer. Addresses-Coverity-ID: 510454 Wrong sizeof argument Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-11-14Merge patch series "cmd: hash: correct parameter count check"Tom Rini
Heinrich Schuchardt <[email protected]> says: Since commit 348ea878508d ("cmd: hash: fix param count check") the hash command cannot be used without the optional variable name parameter if CONFIG_HASH_VERIFY=y. 'hash sha1 $loadaddr $filesize' returns CMD_RET_USAGE. The minimum number of arguments is four no matter if verification is enabled or not. Fix the parameter check. Provide a unit test. Link: https://lore.kernel.org/r/[email protected]
2024-11-14test: unit test for hash commandHeinrich Schuchardt
Provide a unit test testing the hash command. Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-11-13Merge patch series "test: Tidy up the test/ directory"Tom Rini
Simon Glass <[email protected]> says: Some tests do not use the unit-test framework. Others are in a suite of their own, for no obvious reason. This series tidies this up. Link: https://lore.kernel.org/r/[email protected]
2024-11-13test: Update command test to use unit-test functionsSimon Glass
Rather than enabled DEBUG and using assert(), use the unit-test functions now provided. Drop a check that causes pytest to fail. Signed-off-by: Simon Glass <[email protected]> Tested-by: Tom Rini <[email protected]> # rpi_3, rpi_4, rpi_arm64, am64x_evm_a53, am64-sk
2024-11-13command: test: Move into the cmd suiteSimon Glass
The command test was the very first test written in U-Boot, some 12 years ago. It predates the unit-test subsystem and was never converted over. There is no particular need for the command test to have its own command. It is also confusing to have it separate from the normal test suites. At present this test is not run in CI. Move it into the cmd suite instead, updating it to become a unit test. One of the checks is dropped to avoid an error. Signed-off-by: Simon Glass <[email protected]> Tested-by: Tom Rini <[email protected]> # rpi_3, rpi_4, rpi_arm64, am64x_evm_a53, am64-sk
2024-11-13command_ut: test: Move test into libSimon Glass
This test doesn't belong at the top level. Move it into the lib/ directory, since that is where compression is implemented. Rename it to just 'command', since it is obviously a unit test and the _ut suffix does not add much except to make it different from the names of other test files. Signed-off-by: Simon Glass <[email protected]> Tested-by: Tom Rini <[email protected]> # rpi_3, rpi_4, rpi_arm64, am64x_evm_a53, am64-sk
2024-11-03x86: coreboot: Allow building an expo for editing CMOS configSimon Glass
Coreboot provides the CMOS layout in the tables it passes to U-Boot. Use that to build an editor for the CMOS settings. Signed-off-by: Simon Glass <[email protected]>
2024-11-03x86: coreboot: Add a command to check and update CMOS RAMSimon Glass
Coreboot tables provide information about the CMOS-RAM checksum. Add a command which can check and update this. With this it is possible to adjust CMOS-RAM settings and tidy up the checksum afterwards. Signed-off-by: Simon Glass <[email protected]>
2024-11-03x86: coreboot: Show the option tableSimon Glass
Update the cbsysinfo command to show the contents of the CMOS option table. While we are here, add some example output for this command, along with mention of what the unimplemented tags are. Signed-off-by: Simon Glass <[email protected]>
2024-11-03x86: coreboot: Add a test for cbsysinfo commandSimon Glass
Add a simple test for this command, checking that coreboot has the required features. Signed-off-by: Simon Glass <[email protected]>
2024-11-01test/cmd/mem_copy.c: Use CONFIG_SYS_LOAD_ADDR for baseTom Rini
When reading/writing to memory we cannot assume that a base address of 0x0 is correct and functional. So use CONFIG_SYS_LOAD_ADDR as the base from which we add a bit more padding and being our tests. Signed-off-by: Tom Rini <[email protected]>
2024-10-29test/cmd: Make some "ut dm" tests only available on sandboxTom Rini
Currently, the "dm" suite in unit tests (ut) is only available on sandbox. Make sure that all cmd tests that are part of this suite are only available on sandbox and not attempted to be run on hardware (where it will fail to be able to be started). Reviewed-by: Heinrich Schuchardt <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-10-25meminfo: Show the lmb recordsSimon Glass
Add the lmb records onto the end of the memory map. Signed-off-by: Simon Glass <[email protected]>
2024-10-25cmd: Update the meminfo command to show the memory mapSimon Glass
U-Boot has a fairly rigid memory map which is normally not visible unless debugging is enabled in board_f.c Update the 'meminfo' command to show it. This command does not cover arch-specific pieces but gives a good overview of where things are. Signed-off-by: Simon Glass <[email protected]>
2024-10-18x86: Add msr commandSimon Glass
It is useful to obtain the results of MSR queries as well as to update MSR registers, so add a command these tasks. Signed-off-by: Simon Glass <[email protected]>
2024-10-18x86: Add a cpuid commandSimon Glass
It is useful to obtain the results of cpuid queries, so add a command for this. Signed-off-by: Simon Glass <[email protected]>
2024-10-18coreboot: Switch to a monospaced fontSimon Glass
The default font is proportional, with different character widths. Select a monospace font for coreboot so that the 'dm tree' output lines up correctly. Update the coreboot tests to match. Signed-off-by: Simon Glass <[email protected]>
2024-10-18video: Allow querying the font sizeSimon Glass
All the font size to be queried using the 'font size' command. Signed-off-by: Simon Glass <[email protected]>
2024-10-16net: introduce alternative implementation as net/lwip/Jerome Forissier
Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net/lwip/ directory and the NET_LWIP symbol. Network support is either NO_NET, NET (legacy stack) or NET_LWIP. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP. SPL_NET cannot be enabled when NET_LWIP=y. SPL_NET pulls some symbols that are part of NET (such as arp_init(), arp_timeout_check(), arp_receive(), net_arp_wait_packet_ip()). lwIP support in SPL may be added later. Similarly, DFU_TFTP and FASTBOOT are not compatible with NET_LWIP because of dependencies on net_loop(), tftp_timeout_ms, tftp_timeout_count_max and other NET things. Let's add a dependency on !NET_LWIP for now. SANDBOX can select NET_LWIP but doing so will currently disable the eth dm tests as well as the wget tests which have strong dependencies on the NET code. Other adjustments to Kconfig files are made to fix "unmet direct dependencies detected" for USB_FUNCTION_SDP and CMD_FASTBOOT when the default networking stack is set to NET_LWIP ("default NET_LWIP" instead of "default NET" in Kconfig). The networking stack is now a choice between NO_NET, NET and NET_LWIP. Therefore '# CONFIG_NET is not set' should be 'CONFIG_NO_NET=y'. Adjust the defconfigs accordingly. Signed-off-by: Jerome Forissier <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2024-09-18Merge patch series "Fix various bugs"Tom Rini
Simon Glass <[email protected]> says: This series includes the patches needed to make make the EFI 'boot' test work. That test has now been split off into a separate series along with the EFI patches. This series fixes these problems: - sandbox memory-mapping conflict with PCI - the fix for that causes the mbr test to crash as it sets up pointers instead of addresses for its 'mmc' commands - the mmc and read commands which cast addresses to pointers - a tricky bug to do with USB keyboard and stdio - a few other minor things
2024-09-18test: mbr: Drop a duplicate testSimon Glass
The test currently runs twice as it is declared twice. Unwind this. Signed-off-by: Simon Glass <[email protected]>