mirror of
https://xff.cz/git/u-boot/
synced 2025-09-04 02:02:08 +02:00
test: address some pylint warnings
* remove unused variables * module description must precede import statements * fix inconsistent return values Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
@@ -6,9 +6,6 @@
|
|||||||
|
|
||||||
# Test efi loader implementation
|
# Test efi loader implementation
|
||||||
|
|
||||||
import pytest
|
|
||||||
import u_boot_utils
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Note: This test relies on boardenv_* containing configuration values to define
|
Note: This test relies on boardenv_* containing configuration values to define
|
||||||
which network environment is available for testing. Without this, the parts
|
which network environment is available for testing. Without this, the parts
|
||||||
@@ -50,6 +47,9 @@ env__efi_loader_helloworld_file = {
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
import u_boot_utils
|
||||||
|
|
||||||
net_set_up = False
|
net_set_up = False
|
||||||
|
|
||||||
def test_efi_pre_commands(u_boot_console):
|
def test_efi_pre_commands(u_boot_console):
|
||||||
@@ -80,7 +80,7 @@ def test_efi_setup_dhcp(u_boot_console):
|
|||||||
env_vars = u_boot_console.config.env.get('env__net_static_env_vars', None)
|
env_vars = u_boot_console.config.env.get('env__net_static_env_vars', None)
|
||||||
if not env_vars:
|
if not env_vars:
|
||||||
pytest.skip('No DHCP server available')
|
pytest.skip('No DHCP server available')
|
||||||
return None
|
return
|
||||||
|
|
||||||
u_boot_console.run_command('setenv autoload no')
|
u_boot_console.run_command('setenv autoload no')
|
||||||
output = u_boot_console.run_command('dhcp')
|
output = u_boot_console.run_command('dhcp')
|
||||||
@@ -193,7 +193,7 @@ def test_efi_grub_net(u_boot_console):
|
|||||||
check_smbios = u_boot_console.config.env.get('env__efi_loader_check_smbios', False)
|
check_smbios = u_boot_console.config.env.get('env__efi_loader_check_smbios', False)
|
||||||
if check_smbios:
|
if check_smbios:
|
||||||
u_boot_console.wait_for('grub>')
|
u_boot_console.wait_for('grub>')
|
||||||
output = u_boot_console.run_command('lsefisystab', wait_for_prompt=False, wait_for_echo=False)
|
u_boot_console.run_command('lsefisystab', wait_for_prompt=False, wait_for_echo=False)
|
||||||
u_boot_console.wait_for('SMBIOS')
|
u_boot_console.wait_for('SMBIOS')
|
||||||
|
|
||||||
# Then exit cleanly
|
# Then exit cleanly
|
||||||
|
@@ -73,8 +73,7 @@ def test_efi_selftest_text_input(u_boot_console):
|
|||||||
This function calls the text input EFI selftest.
|
This function calls the text input EFI selftest.
|
||||||
"""
|
"""
|
||||||
u_boot_console.run_command(cmd='setenv efi_selftest text input')
|
u_boot_console.run_command(cmd='setenv efi_selftest text input')
|
||||||
output = u_boot_console.run_command(cmd='bootefi selftest',
|
u_boot_console.run_command(cmd='bootefi selftest', wait_for_prompt=False)
|
||||||
wait_for_prompt=False)
|
|
||||||
m = u_boot_console.p.expect([r'To terminate type \'x\''])
|
m = u_boot_console.p.expect([r'To terminate type \'x\''])
|
||||||
if m != 0:
|
if m != 0:
|
||||||
raise Exception('No prompt for \'text input\' test')
|
raise Exception('No prompt for \'text input\' test')
|
||||||
@@ -143,8 +142,7 @@ def test_efi_selftest_text_input_ex(u_boot_console):
|
|||||||
This function calls the extended text input EFI selftest.
|
This function calls the extended text input EFI selftest.
|
||||||
"""
|
"""
|
||||||
u_boot_console.run_command(cmd='setenv efi_selftest extended text input')
|
u_boot_console.run_command(cmd='setenv efi_selftest extended text input')
|
||||||
output = u_boot_console.run_command(cmd='bootefi selftest',
|
u_boot_console.run_command(cmd='bootefi selftest', wait_for_prompt=False)
|
||||||
wait_for_prompt=False)
|
|
||||||
m = u_boot_console.p.expect([r'To terminate type \'CTRL\+x\''])
|
m = u_boot_console.p.expect([r'To terminate type \'CTRL\+x\''])
|
||||||
if m != 0:
|
if m != 0:
|
||||||
raise Exception('No prompt for \'text input\' test')
|
raise Exception('No prompt for \'text input\' test')
|
||||||
|
Reference in New Issue
Block a user