test: fix some pylint problems in test_capsule_firmware_raw.py

* improve doc-string formatting
* remove unused imports

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Heinrich Schuchardt 2022-04-30 15:24:31 +02:00
parent 5c1037d578
commit 1979404263

View file

@ -1,17 +1,13 @@
# SPDX-License-Identifier: GPL-2.0+ # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2020, Linaro Limited # Copyright (c) 2020, Linaro Limited
# Author: AKASHI Takahiro <takahiro.akashi@linaro.org> # Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
#
# U-Boot UEFI: Firmware Update Test
""" """ U-Boot UEFI: Firmware Update Test
This test verifies capsule-on-disk firmware update for raw images This test verifies capsule-on-disk firmware update for raw images
""" """
from subprocess import check_call, check_output, CalledProcessError
import pytest import pytest
from capsule_defs import * from capsule_defs import CAPSULE_DATA_DIR, CAPSULE_INSTALL_DIR
@pytest.mark.boardspec('sandbox') @pytest.mark.boardspec('sandbox')
@pytest.mark.buildconfigspec('efi_capsule_firmware_raw') @pytest.mark.buildconfigspec('efi_capsule_firmware_raw')
@ -24,15 +20,18 @@ from capsule_defs import *
@pytest.mark.buildconfigspec('cmd_nvedit_efi') @pytest.mark.buildconfigspec('cmd_nvedit_efi')
@pytest.mark.buildconfigspec('cmd_sf') @pytest.mark.buildconfigspec('cmd_sf')
@pytest.mark.slow @pytest.mark.slow
class TestEfiCapsuleFirmwareRaw(object): class TestEfiCapsuleFirmwareRaw:
""" Tests verifying capsule-on-disk firmware update for raw images
"""
def test_efi_capsule_fw1( def test_efi_capsule_fw1(
self, u_boot_config, u_boot_console, efi_capsule_data): self, u_boot_config, u_boot_console, efi_capsule_data):
""" """ Test Case 1
Test Case 1 - Update U-Boot and U-Boot environment on SPI Flash Update U-Boot and U-Boot environment on SPI Flash
but with an incorrect GUID value in the capsule but with an incorrect GUID value in the capsule
No update should happen No update should happen
0x100000-0x150000: U-Boot binary (but dummy) 0x100000-0x150000: U-Boot binary (but dummy)
0x150000-0x200000: U-Boot environment (but dummy) 0x150000-0x200000: U-Boot environment (but dummy)
""" """
# other tests might have run and the # other tests might have run and the
@ -106,12 +105,11 @@ class TestEfiCapsuleFirmwareRaw(object):
def test_efi_capsule_fw2( def test_efi_capsule_fw2(
self, u_boot_config, u_boot_console, efi_capsule_data): self, u_boot_config, u_boot_console, efi_capsule_data):
""" """ Test Case 2
Test Case 2 - Update U-Boot and U-Boot environment on SPI Flash Update U-Boot and U-Boot environment on SPI Flash but with OsIndications unset
but with OsIndications unset No update should happen
No update should happen 0x100000-0x150000: U-Boot binary (but dummy)
0x100000-0x150000: U-Boot binary (but dummy) 0x150000-0x200000: U-Boot environment (but dummy)
0x150000-0x200000: U-Boot environment (but dummy)
""" """
disk_img = efi_capsule_data disk_img = efi_capsule_data
with u_boot_console.log.section('Test Case 2-a, before reboot'): with u_boot_console.log.section('Test Case 2-a, before reboot'):
@ -191,9 +189,9 @@ class TestEfiCapsuleFirmwareRaw(object):
def test_efi_capsule_fw3( def test_efi_capsule_fw3(
self, u_boot_config, u_boot_console, efi_capsule_data): self, u_boot_config, u_boot_console, efi_capsule_data):
""" """ Test Case 3
Test Case 3 - Update U-Boot on SPI Flash, raw image format Update U-Boot on SPI Flash, raw image format
0x100000-0x150000: U-Boot binary (but dummy) 0x100000-0x150000: U-Boot binary (but dummy)
""" """
disk_img = efi_capsule_data disk_img = efi_capsule_data
with u_boot_console.log.section('Test Case 3-a, before reboot'): with u_boot_console.log.section('Test Case 3-a, before reboot'):