Skip to content

Commit

Permalink
tests: Update SUIT Kconfig usage
Browse files Browse the repository at this point in the history
Updates to use new Kconfig symbol names, and enables usage of the
test Kconfig only in tests to prevent accidental selection by
users where it should not be able to be selected

Signed-off-by: Jamie McCrae <[email protected]>
  • Loading branch information
nordicjm committed Jan 24, 2025
1 parent b8fd15a commit af92dee
Show file tree
Hide file tree
Showing 22 changed files with 122 additions and 37 deletions.
1 change: 0 additions & 1 deletion tests/subsys/suit/cache_pool_digest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(integration_test_cache_pool_digest)
include(../cmake/test_template.cmake)


zephyr_library_link_libraries(suit_stream_sinks_interface)
zephyr_library_link_libraries(suit_utils)
zephyr_library_link_libraries(suit_platform_interface)
Expand Down
9 changes: 9 additions & 0 deletions tests/subsys/suit/check_content/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

rsource "../tests/Kconfig"

source "Kconfig.zephyr"
9 changes: 9 additions & 0 deletions tests/subsys/suit/check_image_match/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

rsource "../tests/Kconfig"

source "Kconfig.zephyr"
54 changes: 27 additions & 27 deletions tests/subsys/suit/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,35 @@ add_subdirectory(validator_test)
add_subdirectory_ifdef(CONFIG_SUIT_STREAM_FILTER_DECRYPT decrypt_utils)
zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/include)

if (CONFIG_MBEDTLS)
if (CONFIG_SUIT_PLATFORM)
# Link SUIT platform (incl. crypto) module with mbedTLS library, that provides PSA crypto APIs.
target_link_libraries(suit_platform_interface INTERFACE mbedTLS)
endif() # CONFIG_SUIT_PLATFORM

if (CONFIG_SUIT_STREAM_SINK_DIGEST)
target_link_libraries(suit_stream_sinks_interface INTERFACE mbedTLS)
if(CONFIG_MBEDTLS)
if(CONFIG_SUIT_PLATFORM)
# Link SUIT platform (incl. crypto) module with mbedTLS library, that provides PSA crypto APIs.
target_link_libraries(suit_platform_interface INTERFACE mbedTLS)
endif()

if(CONFIG_SUIT_STREAM_SINK_DIGEST)
target_link_libraries(suit_stream_sinks_interface INTERFACE mbedTLS)
endif()

if(CONFIG_SUIT_STREAM_FILTER_DECRYPT)
target_link_libraries(suit_stream_filters_interface INTERFACE mbedTLS)
target_link_libraries(suit_decrypt_test_utils PUBLIC mbedTLS)
endif()

if(CONFIG_SUIT_STORAGE_LAYOUT_SOC)
target_link_libraries(suit_storage_interface INTERFACE mbedTLS)
endif()

# Fix the mbedTLS build scripts:
# The "mbedtls/library/psa_crypto_cipher.c" file includes "<psa_crypto_cipher.h>",
# but this header is not a part of mbedTLS public API, thus it is not found and
# the compiler reports this as an error.
target_include_directories(mbedTLS INTERFACE ${ZEPHYR_MBEDTLS_MODULE_DIR}/library)
endif()

if (CONFIG_SUIT_STREAM_FILTER_DECRYPT)
target_link_libraries(suit_stream_filters_interface INTERFACE mbedTLS)
target_link_libraries(suit_decrypt_test_utils PUBLIC mbedTLS)
endif()

if (CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20)
target_link_libraries(suit_storage_interface INTERFACE mbedTLS)
endif()

# Fix the mbedTLS build scripts:
# The "mbedtls/library/psa_crypto_cipher.c" file includes "<psa_crypto_cipher.h>",
# but this header is not a part of mbedTLS public API, thus it is not found and
# the compiler reports this as an error.
target_include_directories(mbedTLS INTERFACE ${ZEPHYR_MBEDTLS_MODULE_DIR}/library)
endif()

if (CONFIG_SUIT_DEFAULT_MBEDTLS_CONFIG)
# Add include path for the default, customized mbedTLS configuration header.
zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/tls_config)
if(CONFIG_SUIT_DEFAULT_MBEDTLS_CONFIG)
# Add include path for the default, customized mbedTLS configuration header.
zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/tls_config)
endif()

zephyr_interface_library_named(suit_update_magic_values)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ project(integration_suit_component_compatibility_check)
include(../cmake/test_template.cmake)

target_include_directories(app PRIVATE
${SUIT_SUBSYS_DIR}/mci//include
${SUIT_SUBSYS_DIR}/mci/include
${SUIT_SUBSYS_DIR}/storage/include
)

target_sources(app PRIVATE
# Use nRF54H20-specific MCI implementation.
${SUIT_SUBSYS_DIR}/mci/src/suit_mci_nrf54h20.c
${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_component_compatibility.c
${SUIT_SUBSYS_DIR}/storage/src/suit_storage_nrf54h20.c
)

# Link with the CMake target, that includes SUIT platform internal APIs header
Expand Down
2 changes: 0 additions & 2 deletions tests/subsys/suit/component_compatibility_check/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ CONFIG_SUIT_MEMPTR_STORAGE=y
CONFIG_SUIT_PLATFORM=y
CONFIG_SUIT_PLATFORM_VARIANT_SDFW=y

# Force SUIT storage memory layout to match nRF54H20-specific implementation.
CONFIG_SUIT_STORAGE=y
CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20=y
CONFIG_SUIT_METADATA=y
# nRF54H20 storage uses SHA-256 to protect MPI and NVVs:
CONFIG_SUIT_CRYPTO=y
Expand Down
1 change: 1 addition & 0 deletions tests/subsys/suit/copy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

# Include and define MOCK_* Kconfigs
rsource "../mocks/Kconfig"
rsource "../tests/Kconfig"

source "Kconfig.zephyr"
3 changes: 1 addition & 2 deletions tests/subsys/suit/digest_sink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(integration_test_suit_digest_sink)
include(../cmake/test_template.cmake)


# link with the cmake target, that includes suit platform internal apis header
# Link with the CMake target, that includes suit platform internal apis header
zephyr_library_link_libraries(suit_stream_sinks_interface)
9 changes: 9 additions & 0 deletions tests/subsys/suit/envelope_decoder/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

rsource "../tests/Kconfig"

source "Kconfig.zephyr"
9 changes: 9 additions & 0 deletions tests/subsys/suit/fetch_integrated_payload_flash/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

rsource "../tests/Kconfig"

source "Kconfig.zephyr"
2 changes: 1 addition & 1 deletion tests/subsys/suit/flash_sink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(integration_test_flash_sink)
include(../cmake/test_template.cmake)

# link with the cmake target, that includes suit platform internal apis header
# Link with the CMake target, that includes suit platform internal apis header
zephyr_library_link_libraries(suit_utils)
zephyr_library_link_libraries(suit_stream_sinks_interface)
1 change: 1 addition & 0 deletions tests/subsys/suit/manifest_variables/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

# Include and define MOCK_* Kconfigs
rsource "../mocks/Kconfig"
rsource "../tests/Kconfig"

source "Kconfig.zephyr"
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ target_sources(app PRIVATE

# Link with the CMake target, that includes SUIT platform internal APIs header
zephyr_library_link_libraries(suit_utils)

if(CONFIG_TESTS_SUIT_ORCHESTRATOR_APP_FULL_PROCESSING)
zephyr_library_link_libraries(suit_cache_interface)
zephyr_library_link_libraries(suit_stream_sources_interface)
Expand Down
9 changes: 9 additions & 0 deletions tests/subsys/suit/orchestrator/orchestrator_sdfw/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

rsource "../../tests/Kconfig"

source "Kconfig.zephyr"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ include(../../cmake/test_template.cmake)
FILE(GLOB manifest_sources ../manifest/src/*.c)
target_sources(app PRIVATE
${manifest_sources}
# Use nRF54H20-specific implementation.
${SUIT_SUBSYS_DIR}/storage/src/suit_storage_nrf54h20.c
)

target_include_directories(app PRIVATE
${SUIT_SUBSYS_DIR}/storage/include
)

# Link with the CMake target, that includes SUIT platform internal APIs header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CONFIG_SUIT_CACHE=y
CONFIG_SUIT_CACHE_MAX_CACHES=5
CONFIG_SUIT_STORAGE=y
# Force SUIT storage memory layout to match nRF54H20-specific implementation.
CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20=y
CONFIG_SUIT_STORAGE_LAYOUT_SOC=y
# nRF54H20 storage uses SHA-256 to protect MPI and NVVs:
CONFIG_SUIT_CRYPTO=y
CONFIG_SUIT_MEMPTR_STORAGE=y
Expand Down
9 changes: 9 additions & 0 deletions tests/subsys/suit/storage/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

rsource "../tests/Kconfig"

source "Kconfig.zephyr"
9 changes: 9 additions & 0 deletions tests/subsys/suit/storage_nrf54h20/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(integration_test_suit_storage_nrf54h20)
include(../cmake/test_template.cmake)

target_include_directories(app PRIVATE
${SUIT_SUBSYS_DIR}/storage/include
)

target_sources(app PRIVATE
# Use nRF54H20-specific implementation.
${SUIT_SUBSYS_DIR}/storage/src/suit_storage_nrf54h20.c
)

# Link with the CMake target, that includes SUIT platform internal APIs header
zephyr_library_link_libraries(suit_utils)
zephyr_library_link_libraries(suit_storage_interface)
Expand Down
2 changes: 0 additions & 2 deletions tests/subsys/suit/storage_nrf54h20/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ CONFIG_ZTEST=y
CONFIG_SUIT=y
CONFIG_SUIT_UTILS=y
CONFIG_SUIT_STORAGE=y
# Force SUIT storage memory layout to match nRF54H20-specific implementation.
CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20=y
CONFIG_SUIT_METADATA=y
# nRF54H20 storage uses SHA-256 to protect MPI and NVVs:
CONFIG_SUIT_CRYPTO=y
Expand Down
7 changes: 7 additions & 0 deletions tests/subsys/suit/tests/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

rsource "sdfw/Kconfig"
9 changes: 9 additions & 0 deletions tests/subsys/suit/tests/sdfw/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config SUPPORT_SUIT_STORAGE_LAYOUT_TEST
default y
depends on SUIT_STORAGE
1 change: 1 addition & 0 deletions tests/subsys/suit/write/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

# Include and define MOCK_* Kconfigs
rsource "../mocks/Kconfig"
rsource "../tests/Kconfig"

source "Kconfig.zephyr"

0 comments on commit af92dee

Please sign in to comment.