test: fix pylint warnings in test_efi_bootmgr

* Use f'' strings instead of .format().
* Correct sequence of imports.
* Remove a superfluous import.
* Add missing documentation.
* Replace yield by return.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Heinrich Schuchardt
2022-03-27 10:03:33 +02:00
parent edd8f66a0c
commit 86fa918df6
2 changed files with 18 additions and 9 deletions

View File

@@ -1,4 +1,6 @@
# SPDX-License-Identifier: GPL-2.0+
""" Unit test for UEFI bootmanager
"""
import pytest
@@ -6,7 +8,16 @@ import pytest
@pytest.mark.buildconfigspec('cmd_efidebug')
@pytest.mark.buildconfigspec('cmd_bootefi_bootmgr')
def test_efi_bootmgr(u_boot_console, efi_bootmgr_data):
u_boot_console.run_command(cmd = 'host bind 0 {}'.format(efi_bootmgr_data))
""" Unit test for UEFI bootmanager
The efidebug command is used to set up UEFI load options.
The bootefi bootmgr loads initrddump.efi as a payload.
The crc32 of the loaded initrd.img is checked
Args:
u_boot_console -- U-Boot console
efi_bootmgr_data -- Path to the disk image used for testing.
"""
u_boot_console.run_command(cmd = f'host bind 0 {efi_bootmgr_data}')
u_boot_console.run_command(cmd = 'efidebug boot add ' \
'-b 0001 label-1 host 0:1 initrddump.efi ' \