diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2021-11-15 20:26:50 +0300 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2021-11-30 11:23:48 +0300 |
commit | 3b7bf8a9e48f0951e4060f832bba409fd406273e (patch) | |
tree | ebb17a7e25cba2d8dcfc16f2899c49aafddf60ab /test/py | |
parent | 617270b97ba9d930cf830f41472053ac195a80d4 (diff) | |
download | u-boot-3b7bf8a9e48f0951e4060f832bba409fd406273e.tar.xz |
test: unit test for the EFI_TCG2_PROTOCOL
Encapsulate the UEFI EFI_TCG2_PROTOCOL unit test in an Python test.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'test/py')
-rw-r--r-- | test/py/tests/test_efi_selftest.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py index 0161a6ea24..a48cd3290c 100644 --- a/test/py/tests/test_efi_selftest.py +++ b/test/py/tests/test_efi_selftest.py @@ -210,3 +210,23 @@ def test_efi_selftest_text_input_ex(u_boot_console): if m != 0: raise Exception('Failures occurred during the EFI selftest') u_boot_console.restart_uboot() + +@pytest.mark.buildconfigspec('cmd_bootefi_selftest') +@pytest.mark.buildconfigspec('efi_tcg2_protocol') +def test_efi_selftest_tcg2(u_boot_console): + """Test the EFI_TCG2 PROTOCOL + + :param u_boot_console: U-Boot console + + This function executes the 'tcg2' unit test. + """ + u_boot_console.restart_uboot() + u_boot_console.run_command(cmd='setenv efi_selftest list') + output = u_boot_console.run_command('bootefi selftest') + assert '\'tcg2\'' in output + u_boot_console.run_command(cmd='setenv efi_selftest tcg2') + u_boot_console.run_command(cmd='bootefi selftest', wait_for_prompt=False) + m = u_boot_console.p.expect(['Summary: 0 failures', 'Press any key']) + if m != 0: + raise Exception('Failures occurred during the EFI selftest') + u_boot_console.restart_uboot() |