Test: Add configuration for FWU secure test suites
The secure test suites is only enabled when the FWU partition
and the TFM_FWU_TEST_SECURE is enabled.
Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
Change-Id: I8290d95d57cd93405865e6b1037ab328d23ac2e8
diff --git a/test/framework/secure_suites.c b/test/framework/secure_suites.c
index 8a1d821..9592cdc 100644
--- a/test/framework/secure_suites.c
+++ b/test/framework/secure_suites.c
@@ -22,7 +22,7 @@
#if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG)
#include "crypto_s_tests.h"
#endif
-#if defined(TFM_PARTITION_FIRMWARE_UPDATE)
+#if defined(TFM_FWU_TEST_SECURE_ENABLED)
#include "fwu_s_tests.h"
#endif
#if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG)
@@ -72,8 +72,8 @@
{®ister_testsuite_s_audit_interface, 0, 0, 0},
#endif
-#ifdef TFM_PARTITION_FIRMWARE_UPDATE
- /* Non-secure Firmware Update test cases */
+#ifdef TFM_FWU_TEST_SECURE_ENABLED
+ /* Secure Firmware Update test cases */
{®ister_testsuite_s_psa_fwu_interface, 0, 0, 0},
#endif
diff --git a/test/suites/fwu/mcuboot/CMakeLists.txt b/test/suites/fwu/mcuboot/CMakeLists.txt
index 5d8f132..3bc530d 100644
--- a/test/suites/fwu/mcuboot/CMakeLists.txt
+++ b/test/suites/fwu/mcuboot/CMakeLists.txt
@@ -43,7 +43,7 @@
####################### Secure #################################################
-if (TEST_S)
+if (TEST_S AND TFM_FWU_TEST_SECURE)
target_sources(tfm_test_suite_fwu_s
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/fwu_tests_common.c
@@ -69,6 +69,8 @@
$<$<BOOL:${TFM_FWU_TEST_REQUEST_REBOOT}>:TFM_FWU_TEST_REQUEST_REBOOT>
$<$<BOOL:${TFM_FWU_TEST_QUERY_WITH_NULL}>:TFM_FWU_TEST_QUERY_WITH_NULL>
$<$<BOOL:${MCUBOOT_IMAGE_NUMBER}>:MCUBOOT_IMAGE_NUMBER=${MCUBOOT_IMAGE_NUMBER}>
+ INTERFACE
+ TFM_FWU_TEST_SECURE_ENABLED
)
target_link_libraries(tfm_s_tests
diff --git a/test/test_services/CMakeLists.txt b/test/test_services/CMakeLists.txt
index 139d825..4d905ee 100644
--- a/test/test_services/CMakeLists.txt
+++ b/test/test_services/CMakeLists.txt
@@ -37,7 +37,7 @@
if(TFM_PSA_API)
add_library(tfm_test_suite_ipc_s STATIC EXCLUDE_FROM_ALL)
endif()
- if(TFM_PARTITION_FIRMWARE_UPDATE)
+ if(TFM_PARTITION_FIRMWARE_UPDATE AND TFM_FWU_TEST_SECURE)
add_library(tfm_test_suite_fwu_s STATIC EXCLUDE_FROM_ALL)
endif()
endif()