[PATCH 4/4] test/py: add ECPT tests

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Mar 9 13:37:02 CET 2026


On 3/5/26 17:13, Vincent Stehlé wrote:
> Add a couple of EFI Conformance Profiles Table (ECPT) tests, which exercise
> the "efidebug ecpt" command.
> 
> Signed-off-by: Vincent Stehlé <vincent.stehle at arm.com>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> ---
>   test/py/tests/test_efi_ecpt.py | 42 ++++++++++++++++++++++++++++++++++
>   1 file changed, 42 insertions(+)
>   create mode 100644 test/py/tests/test_efi_ecpt.py
> 
> diff --git a/test/py/tests/test_efi_ecpt.py b/test/py/tests/test_efi_ecpt.py
> new file mode 100644
> index 00000000000..5e7c79c4577
> --- /dev/null
> +++ b/test/py/tests/test_efi_ecpt.py
> @@ -0,0 +1,42 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +""" Unit test for the EFI Conformance Profiles Table (ECPT)
> +"""
> +
> +import pytest
> +
> +
> + at pytest.mark.buildconfigspec('cmd_efidebug')
> + at pytest.mark.buildconfigspec('efi_ecpt')
> +def test_efi_ecpt(ubman) -> None:
> +    """ Unit test for the ECPT
> +    This test assumes nothing about the ECPT contents, it just checks that the
> +    ECPT table is there and that the efidebug ecpt command does not fail.
> +
> +    Args:
> +        ubman -- U-Boot console
> +    """
> +    response = ubman.run_command('efidebug tables')
> +    assert ('36122546-f7e7-4c8f-bd9b-eb8525b50c0b  '
> +            'EFI Conformance Profiles Table') in response
> +
> +    response = ubman.run_command('efidebug ecpt')
> +    assert 'Unknown command' not in response
> +    assert 'Configure UEFI environment' not in response
> +    assert 'Usage:' not in response
> +    assert 'table not present' not in response
> +
> +
> + at pytest.mark.buildconfigspec('cmd_efidebug')
> + at pytest.mark.buildconfigspec('efi_ecpt')

EFI_EBBR_2_1_CONFORMANCE depends on EFI_ECPT.

Given the next line the line above is redundant.

> + at pytest.mark.buildconfigspec('efi_ebbr_2_1_conformance')

If CONFIG_EFI_ECPT=y and CONFIG_EFI_EBBR_2_1_CONFORMANCE=n, we still 
expect the `efidebug ecpt` command to succeed.

I would suggest to move the CONFIG_EFI_EBBR_2_1_CONFORMANCE check to 
inside the test. This also matches that the EBBR defines more 
conformance levels which we should add to the ECPT table.

> +def test_efi_ecpt_ebbr_2_1(ubman) -> None:
> +    """ Unit test for the ECPT, with EBBR 2.1 profile
> +    This test uses the efidebug ecpt command to dump the ECPT and check that
> +    the EBBR 2.1 conformance profile is there.
> +
> +    Args:
> +        ubman -- U-Boot console
> +    """
> +    response = ubman.run_command('efidebug ecpt')
> +    assert ('cce33c35-74ac-4087-bce7-8b29b02eeb27  '
> +            'EFI EBBR 2.1 Conformance Profile') in response

I don't think that printing out the GUID in hexadecimal is helpful for 
users. But that would be a change in 3/4.

Best regards

Heinrich


More information about the U-Boot mailing list