From b33c87caa0702ec5b727b42528b47d6317fd15e9 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 28 Jan 2025 10:27:19 +0000 Subject: [PATCH] tests: boot: test_mcuboot: Add swap using offset test Adds a variation of the test which tests swap using offset mode, based on the swap using move test Signed-off-by: Jamie McCrae --- tests/boot/test_mcuboot/swapped_app/Kconfig | 4 ++++ tests/boot/test_mcuboot/testcase.yaml | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/boot/test_mcuboot/swapped_app/Kconfig b/tests/boot/test_mcuboot/swapped_app/Kconfig index 9f603e6ce32..fd33c400fb0 100644 --- a/tests/boot/test_mcuboot/swapped_app/Kconfig +++ b/tests/boot/test_mcuboot/swapped_app/Kconfig @@ -1,9 +1,13 @@ # Copyright 2022 NXP +# Copyright 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 source "Kconfig.zephyr" # Workaround for not being able to have commas in macro arguments DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition config BUILD_OUTPUT_ADJUST_LMA + default "$(dt_node_reg_addr_hex,$(dt_nodelabel_path,slot1_partition))-\ + $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))+\ + $(dt_node_int_prop_hex,$(dt_node_parent,$(dt_node_parent,$(dt_nodelabel_path,slot1_partition))),erase-block-size)" if MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET default "$(dt_node_reg_addr_hex,$(dt_nodelabel_path,slot1_partition))-\ $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))" diff --git a/tests/boot/test_mcuboot/testcase.yaml b/tests/boot/test_mcuboot/testcase.yaml index 27e71f310b3..ffa090f882b 100644 --- a/tests/boot/test_mcuboot/testcase.yaml +++ b/tests/boot/test_mcuboot/testcase.yaml @@ -1,5 +1,6 @@ common: sysbuild: true + tags: mcuboot harness: console harness_config: type: multi_line @@ -11,7 +12,6 @@ common: - "Swapped application booted on (.*)" tests: bootloader.mcuboot: - tags: mcuboot platform_allow: - frdm_k22f - frdm_k64f @@ -48,8 +48,17 @@ tests: - frdm_k64f - nrf52840dk/nrf52840 bootloader.mcuboot.assert: - tags: mcuboot platform_allow: - b_u585i_iot02a extra_configs: - CONFIG_ASSERT=y + bootloader.mcuboot.swap_using_offset: + platform_allow: + - frdm_k64f + - nrf5340dk/nrf5340/cpuapp + integration_platforms: + - frdm_k64f + - nrf5340dk/nrf5340/cpuapp + extra_args: + - SB_CONFIG_MCUBOOT_MODE_SWAP_USING_OFFSET=y + - swapped_app_CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET=y