aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeinrich Schuchardt2023-07-15 10:48:39 +0200
committerHeinrich Schuchardt2023-07-20 09:12:50 +0200
commit4f399f277cd0116944642ea7246795678fcb495f (patch)
tree673221448d411ac927c92ae798250782e9f5f883 /test
parent06fc19ca4de943827f5aa026f7aa9c3a05411677 (diff)
test: avoid function name 'setup'
pytest 7.3.2 treats the function name 'setup' as a fixture [1]. This leads to errors like: TypeError: setup() missing 2 required positional arguments: 'disk_img' and 'osindications' Rename setup() to capsule_setup(). [1] How to run tests written for nose https://docs.pytest.org/en/7.3.x/how-to/nose.html Fixes: 482ef90aeb4c ("test: efi_capsule: refactor efi_capsule test") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_efi_capsule/capsule_common.py2
-rw-r--r--test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py10
-rw-r--r--test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py12
-rw-r--r--test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py12
-rw-r--r--test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py12
5 files changed, 24 insertions, 24 deletions
diff --git a/test/py/tests/test_efi_capsule/capsule_common.py b/test/py/tests/test_efi_capsule/capsule_common.py
index 9eef6767a6e..fc0d851c619 100644
--- a/test/py/tests/test_efi_capsule/capsule_common.py
+++ b/test/py/tests/test_efi_capsule/capsule_common.py
@@ -6,7 +6,7 @@
from capsule_defs import CAPSULE_DATA_DIR, CAPSULE_INSTALL_DIR
-def setup(u_boot_console, disk_img, osindications):
+def capsule_setup(u_boot_console, disk_img, osindications):
"""setup the test
Args:
diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py
index a3094c33f4d..11bcdc2bb29 100644
--- a/test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py
+++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py
@@ -8,7 +8,7 @@ This test verifies capsule-on-disk firmware update for FIT images
import pytest
from capsule_common import (
- setup,
+ capsule_setup,
init_content,
place_capsule_file,
exec_manual_update,
@@ -49,7 +49,7 @@ class TestEfiCapsuleFirmwareFit():
disk_img = efi_capsule_data
capsule_files = ['Test05']
with u_boot_console.log.section('Test Case 1-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -81,7 +81,7 @@ class TestEfiCapsuleFirmwareFit():
disk_img = efi_capsule_data
capsule_files = ['Test04']
with u_boot_console.log.section('Test Case 2-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -116,7 +116,7 @@ class TestEfiCapsuleFirmwareFit():
disk_img = efi_capsule_data
capsule_files = ['Test104']
with u_boot_console.log.section('Test Case 3-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -165,7 +165,7 @@ class TestEfiCapsuleFirmwareFit():
disk_img = efi_capsule_data
capsule_files = ['Test105']
with u_boot_console.log.section('Test Case 4-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py
index 80d791e3de2..a5b5c8a3853 100644
--- a/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py
+++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py
@@ -8,7 +8,7 @@ This test verifies capsule-on-disk firmware update for raw images
import pytest
from capsule_common import (
- setup,
+ capsule_setup,
init_content,
place_capsule_file,
exec_manual_update,
@@ -51,7 +51,7 @@ class TestEfiCapsuleFirmwareRaw:
disk_img = efi_capsule_data
capsule_files = ['Test03']
with u_boot_console.log.section('Test Case 1-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -83,7 +83,7 @@ class TestEfiCapsuleFirmwareRaw:
disk_img = efi_capsule_data
capsule_files = ['Test01', 'Test02']
with u_boot_console.log.section('Test Case 2-a, before reboot'):
- setup(u_boot_console, disk_img, None)
+ capsule_setup(u_boot_console, disk_img, None)
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -111,7 +111,7 @@ class TestEfiCapsuleFirmwareRaw:
disk_img = efi_capsule_data
capsule_files = ['Test01', 'Test02']
with u_boot_console.log.section('Test Case 3-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -157,7 +157,7 @@ class TestEfiCapsuleFirmwareRaw:
disk_img = efi_capsule_data
capsule_files = ['Test101', 'Test102']
with u_boot_console.log.section('Test Case 4-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -211,7 +211,7 @@ class TestEfiCapsuleFirmwareRaw:
disk_img = efi_capsule_data
capsule_files = ['Test103']
with u_boot_console.log.section('Test Case 5-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
index 94d6c3eef06..44a58baa310 100644
--- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
+++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
@@ -11,7 +11,7 @@ with signed capsule files containing FIT images
import pytest
from capsule_common import (
- setup,
+ capsule_setup,
init_content,
place_capsule_file,
exec_manual_update,
@@ -47,7 +47,7 @@ class TestEfiCapsuleFirmwareSignedFit():
disk_img = efi_capsule_data
capsule_files = ['Test13']
with u_boot_console.log.section('Test Case 1-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -76,7 +76,7 @@ class TestEfiCapsuleFirmwareSignedFit():
disk_img = efi_capsule_data
capsule_files = ['Test14']
with u_boot_console.log.section('Test Case 2-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -107,7 +107,7 @@ class TestEfiCapsuleFirmwareSignedFit():
disk_img = efi_capsule_data
capsule_files = ['Test02']
with u_boot_console.log.section('Test Case 3-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -137,7 +137,7 @@ class TestEfiCapsuleFirmwareSignedFit():
disk_img = efi_capsule_data
capsule_files = ['Test114']
with u_boot_console.log.section('Test Case 4-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -176,7 +176,7 @@ class TestEfiCapsuleFirmwareSignedFit():
disk_img = efi_capsule_data
capsule_files = ['Test115']
with u_boot_console.log.section('Test Case 5-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
index ad2b1c63242..83a10e160b8 100644
--- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
+++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
@@ -9,7 +9,7 @@ with signed capsule files containing raw images
import pytest
from capsule_common import (
- setup,
+ capsule_setup,
init_content,
place_capsule_file,
exec_manual_update,
@@ -44,7 +44,7 @@ class TestEfiCapsuleFirmwareSignedRaw():
disk_img = efi_capsule_data
capsule_files = ['Test11']
with u_boot_console.log.section('Test Case 1-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -72,7 +72,7 @@ class TestEfiCapsuleFirmwareSignedRaw():
disk_img = efi_capsule_data
capsule_files = ['Test12']
with u_boot_console.log.section('Test Case 2-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -101,7 +101,7 @@ class TestEfiCapsuleFirmwareSignedRaw():
disk_img = efi_capsule_data
capsule_files = ['Test02']
with u_boot_console.log.section('Test Case 3-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -131,7 +131,7 @@ class TestEfiCapsuleFirmwareSignedRaw():
disk_img = efi_capsule_data
capsule_files = ['Test111', 'Test112']
with u_boot_console.log.section('Test Case 4-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
@@ -175,7 +175,7 @@ class TestEfiCapsuleFirmwareSignedRaw():
disk_img = efi_capsule_data
capsule_files = ['Test113']
with u_boot_console.log.section('Test Case 5-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)