aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-08-07 23:11:35 +0200
committerTom Rini <trini@konsulko.com>2020-08-08 08:31:39 -0400
commit38ee01e4ddf7cca53fcf6585dd00373246b4df40 (patch)
tree39c95a609d9464b42005f48312707a7671fa06b4 /test
parent626b2df302fce4bf91a240f186ba447046db4741 (diff)
downloadu-boot-38ee01e4ddf7cca53fcf6585dd00373246b4df40.zip
u-boot-38ee01e4ddf7cca53fcf6585dd00373246b4df40.tar.gz
u-boot-38ee01e4ddf7cca53fcf6585dd00373246b4df40.tar.bz2
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 <xypron.glpk@gmx.de>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_efi_selftest.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py
index 9b520c2..63218ef 100644
--- a/test/py/tests/test_efi_selftest.py
+++ b/test/py/tests/test_efi_selftest.py
@@ -23,6 +23,7 @@ def test_efi_selftest(u_boot_console):
u_boot_console.restart_uboot()
@pytest.mark.buildconfigspec('cmd_bootefi_selftest')
+@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()