]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: avoid function name 'setup'
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 15 Jul 2023 08:48:39 +0000 (10:48 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 20 Jul 2023 07:12:50 +0000 (09:12 +0200)
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>
test/py/tests/test_efi_capsule/capsule_common.py
test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py
test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py
test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py

index 9eef6767a6e48ab51dfa3d15c080de08603a3ebd..fc0d851c619a098659279d4b04339e97f9afc477 100644 (file)
@@ -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:
index a3094c33f4ddf20ef721ef5e2cc27c09cbe13b87..11bcdc2bb293cd3de00bb255182e3b7cbe2d5a00 100644 (file)
@@ -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)
 
index 80d791e3de2c8949dfe840b26a210b4888586901..a5b5c8a3853ae166c02fb08f6ed6b2f2a8b8c89f 100644 (file)
@@ -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)
 
index 94d6c3eef06f2f850d5e34c22855ba9abaafb904..44a58baa3106477a6a86e05288d06171a213f9d5 100644 (file)
@@ -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)
 
index ad2b1c63242c2b3fb2ee45a3ca90639fabdb7fb8..83a10e160b8caa2bf5a8c35946418d56a7e2c521 100644 (file)
@@ -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)