diff mbox series

[v2] test: test for ignore OsIndications

Message ID 20240704144316.251029-1-ilias.apalodimas@linaro.org
State Accepted
Commit e6003091dbd692ff43a7afd8d904dc28b45d0b9f
Headers show
Series [v2] test: test for ignore OsIndications | expand

Commit Message

Ilias Apalodimas July 4, 2024, 2:43 p.m. UTC
The tests we currently have expect the firmware update to fail
when OsIndications is not set properly. However, we have a Kconfig flag
that explicitly ignores that variable. Adjust the tests accordingly

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
Changes since v1:
- v1 was rebased incorrectly and only sent half of the patch
 .../test_capsule_firmware_raw.py              | 21 ++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

--
2.43.0
diff mbox series

Patch

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 a5b5c8a3853a..f3a2dff5c2c8 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
@@ -76,7 +76,7 @@  class TestEfiCapsuleFirmwareRaw:
             self, u_boot_config, u_boot_console, efi_capsule_data):
         """ Test Case 2
         Update U-Boot and U-Boot environment on SPI Flash but with OsIndications unset
-        No update should happen
+        No update should happen unless CONFIG_EFI_IGNORE_OSINDICATIONS is set
         0x100000-0x150000: U-Boot binary (but dummy)
         0x150000-0x200000: U-Boot environment (but dummy)
         """
@@ -91,16 +91,27 @@  class TestEfiCapsuleFirmwareRaw:
         # reboot
         u_boot_console.restart_uboot()

+        ignore_os_indications = u_boot_config.buildconfig.get(
+            'config_efi_ignore_osindications')
+        need_reboot = True if ignore_os_indications else False
+
+        capsule_auth = u_boot_config.buildconfig.get(
+            'config_efi_capsule_authenticate')
+
         capsule_early = u_boot_config.buildconfig.get(
             'config_efi_capsule_on_disk_early')
         with u_boot_console.log.section('Test Case 2-b, after reboot'):
             if not capsule_early:
-                exec_manual_update(u_boot_console, disk_img, capsule_files, False)
+                exec_manual_update(u_boot_console, disk_img, capsule_files, need_reboot)

-            check_file_exist(u_boot_console, disk_img, capsule_files)
+            if not ignore_os_indications:
+                check_file_exist(u_boot_console, disk_img, capsule_files)

-            verify_content(u_boot_console, '100000', 'u-boot:Old')
-            verify_content(u_boot_console, '150000', 'u-boot-env:Old')
+            expected = 'u-boot:New' if (ignore_os_indications and not capsule_auth) else 'u-boot:Old'
+            verify_content(u_boot_console, '100000', expected)
+
+            expected = 'u-boot-env:New' if (ignore_os_indications and not capsule_auth) else 'u-boot-env:Old'
+            verify_content(u_boot_console, '150000', expected)

     def test_efi_capsule_fw3(
             self, u_boot_config, u_boot_console, efi_capsule_data):