test/py: serial# cannot be overwritten on some devices
PATCH 1/1 test/py: serial# cannot be overwritten on some devices
On some devices the environment variable serial# cannot be overwritten. Set the variable only if it is not set.
For our unit test it is sufficient to test if any value for serial-number is set.
Fixes 8a5cdf601f8d ("test: efi_selftest: Do not force serial# setting")
Signed-off-by Heinrich Schuchardt <[email protected]>
--- test/py/tests/test_efi_selftest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
test/py/tests/test_efi_selftest.py +5 -2
@@ -23,6 +23,7 @@ def test_efi_selftest(u_boot_console): u_boot_console.restart_uboot() @pytest.mark.buildconfigspec('cmd_bootefi_selftest') + at pytest.mark.buildconfigspec('hush_parser') @pytest.mark.buildconfigspec('of_control') @pytest.mark.notbuildconfigspec('generate_acpi_table') def test_efi_selftest_device_tree(u_boot_console):
@@ -36,9 +37,11 @@ def test_efi_selftest_device_tree(u_boot_console): output = u_boot_console.run_command('bootefi selftest') assert '\'device tree\'' in output u_boot_console.run_command(cmd='setenv efi_selftest device tree') - u_boot_console.run_command(cmd='setenv serial# Testing DT') + # Set serial# if it is not already set. + u_boot_console.run_command(cmd='setenv efi_test "${serial#}x"') + u_boot_console.run_command(cmd='test "${efi_test}" = x && setenv serial# 0') u_boot_console.run_command(cmd='bootefi selftest ${fdtcontroladdr}', wait_for_prompt=False) - m = u_boot_console.p.expect(['serial-number: Testing DT', 'U-Boot']) + m = u_boot_console.p.expect(['serial-number:', 'U-Boot']) if m != 0: raise Exception('serial-number missing in device tree') u_boot_console.restart_uboot()
--
2.20.1
PATCH 1/1 test/py: serial# cannot be overwritten on some devices
Quoted 8 lines · Heinrich Schuchardt
On some devices the environment variable serial# cannot be overwritten. Set the variable only if it is not set.
For our unit test it is sufficient to test if any value for serial-number is set.
Fixes 8a5cdf601f8d ("test: efi_selftest: Do not force serial# setting")Signed-off-by Heinrich Schuchardt <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200808/e1b30859/attachment.sig>