Add a new 'fdt reserved' subcommand that displays all reserved memory
regions defined in the device tree's /reserved-memory node. This command
provides a formatted table showing the ID, name, start address, and size
of each reserved memory region.
Avoid a conflict with the existing 'fdt resize' command. Update the docs
and add a test.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Move fdt_print() function from cmd/fdt.c to a new lib/fdt_print.c file
to make it available as a library function for other code to use.
Move and rename is_printable_string(), making it available as well.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Add tests for checking:
- environment variable override with hex values
- invalid environment variable handling
- Kconfig-default behavior with device detection
- precedence rules (environment overrides device detection)
- serial terminal detection by manipulating sandbox state
Also expose calc_check_console_lines() in console.h for testing
and update pager functionality to use bypass mode when serial
is not connected to a terminal.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Show the actual value being used by the pager, if enabled.
Series-changes: 2
- Add new patch to show the pager page_len value
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide a test that the prompt is displayed and another that paging
happens but does not appear in the recorded console-output.
Signed-off-by: Simon Glass <sjg@chromium.org>
A single character may result in a stall waiting for user input, which
means that it may request that a string be output. So when the pager is
active we never actually use the devices' putc() methods. Add a special
case so they don't go to wrack and ruin.
As before, the pager is only supported with CONFIG_CONSOLE_MUX enabled.
Series-changes: 2
- Drop unnecessary '!= NULL'
Signed-off-by: Simon Glass <sjg@chromium.org>
We generally don't want the pager to be active when running tests,
since U-Boot appears to hang forever. Perhaps we could detect when the
tests are being run interactively and use the pager in that case. But
for now, just bypass it.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
The pager gets in the way of most tests, since it kicks in (by default)
when a command results in more than 25 lines of output. Use the -P flag
to bypass it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Sometimes output should be sent ignoring the pager, such as when it is
a message related to paging. Add a parameter to support this.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Cover the various cases in the base code. Put the tests in the 'common'
suite to match where the pager implementation is.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Change the default behavior of 'printenv -e' to show only EFI variable
names. The previous verbose output is now available with the -v flag.
This makes the command more user-friendly for quick variable listing.
Update documentation to reflect the new behavior and provide examples
of all three output modes: default (names only), -n (details without
hex dump), and -v (full verbose output).
It might be nicer to use -d to enable the dump, rather than have it on
by default.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Now that the EFI app supports booting Ubuntu via the EFI bootmeth, add
a test for this, for ARM. This uses the sjg lab.
Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: app: Support booting an OS
This series completes the work to get the EFI app booting an EFI
application (e.g. Ubuntu):
- efidebug dh now works, and is slightly enhanced
- device paths which refer to the underlying EFI layer can now be
requested by the app
- a test is provided, for EFI on ARM booting into Ubuntu using the sjg
lab
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:12
If only a single test runs, it does not set the max_count variable, so
it remains as zero. Handle this situation as a special case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Binman needs access to tools like mkimage and cbfstool to run all the
tests. Set up the TOOLS_DIR earlier and allow use of a TOOLS_DIR
environment variable to specify where the tools are. This can be used
from CI, for example.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pytest shows about 10 lines of output of limited merit at the top. Use
the -q flag to request that it doesn't so that the actionable things are
more visible.
Signed-off-by: Simon Glass <sjg@chromium.org>
The original purpose of 'make tcheck' was to run the tools and skip any
pytests. This has been lost by the addition of sandbox_noinst and
sandbox_vpl
Restore the intended behaviour by skipping all tests with sandbox_spl
(since it still needs to be built) and skipping the other builds
entirely.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current directory may be changed by a tool run from this script,
so use an absolute path when setting the DTC variable.
Signed-off-by: Simon Glass <sjg@chromium.org>
This test uses the same directory as the vboot tests, which means that
they conflict when tests are run in parallel.
Add a 'pk-' prefix to avoid this.
Signed-off-by: Simon Glass <sjg@chromium.org>
On platforms where most of the memory is above 4GB, the EFI app may find
itself using addresses with 9 or even 10 digits. Expand the width of the
columns to cope with this.
Add some double bars across digits 9 and 8 so that it is easier to make
the value.
Signed-off-by: Simon Glass <sjg@chromium.org>
Move setup_localboot_image() to a new module
Series-to: concept
Cover-letter:
test: Split up the image-creation code
This series moves the image-creation code into separate files so it is
easier to find and maintain.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
Move setup_cros_image() to its own module. This function creates disk
images with a ChromiumOS partition layout.
Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
Move setup_bootmenu_image() to its own module. This function creates an
image styled on Armbian 22.08 Jammy with a boot menu.
Co-authored-by: Claude <noreply@anthropic.com>
Move mkdir_cond(), copy_partition(), and setup_extlinux_image() to a
common module which can be used by the rest of the image-creation code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
Rather than having this code mixed with the tests, it seems better to
put it up one level. Move the directory and tidy up references.
Signed-off-by: Simon Glass <sjg@chromium.org>
Update the sizes to the expected size of the device's mapping in each
case, to avoid a warning in map_physmem() about a partial map.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Series-to: concept
Cover-letter:
test: Move towards using a fixture for test images
There are quite a few test images created by the test system. Most are
needed for bootstd tests.
At present these are created by a test, called test_ut_dm_init_bootstd()
which runs before the test_ut() tests.
This means that it is possible to create the images once, then iterate
on a test without the images being recreated each time.
While this is not a terrible approach, it does have some drawbacks:
- If an image is missing or corrupted for some reason, the test fails
- The relationship between the images and the tests is not obvious
- Images are often created even if the tests to be run do not need them
Overall, it seems worthwhile to explore moving to using a fixture for
the images.
Another problem is that 'make qcheck' and 'make pcheck' are not tested
in CI, so can break over time. The latter is a good way of seeing
whether each test is independent, e.g. not reliant on files created by
another test.
Overall this area of U-Boot could use some attention. This series makes
a very small start on this:
- Update test_fdt_add_pubkey() to work without test_vboot_base()
- Fix 'make qcheck' so that it passes
- Minor fixes to a few tests
- Pass separate fixtures to the image-setup functions instead of the
overall ubman fixture
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
The normal function requires a ubman but only uses it to find the log
fixture. This is a pain since the ubman is a function-level fixture.
Provide a version that takes a log directory, so that it can be called
from a session fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
This test should create its own files rather than relying on those
created by test_vboot_base(). Copy the code in the test.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present test_fdt_add_pubkey() relies on the vboot test having already
run, since its makes use of the files that test produces.
This means that the tests cannot run in parallel (make pcheck).
As a first step to resolving this, move the required common code out to
a standalone function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Now that this base-class function is called, it can produce an error on
test failure, since it passes an empty list for the arguments.
Rename the reset() function to prepare_for_spawn() and use that instead.
See also: ca30385c61 ("Correct implementation of Spawn() in ConsoleBase")
Signed-off-by: Simon Glass <sjg@chromium.org>