SPM: TFTF skip test if FFA endpoint absent
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I0f653ae7764ede3dda3e51bd4eb94b7025606203
diff --git a/include/common/test_helpers.h b/include/common/test_helpers.h
index bf14a80..f9d41dd 100644
--- a/include/common/test_helpers.h
+++ b/include/common/test_helpers.h
@@ -202,6 +202,21 @@
} \
} while (0)
+#define SKIP_TEST_IF_FFA_ENDPOINT_NOT_DEPLOYED(mb, uuid) \
+ do { \
+ const uint32_t ffa_uuid[4] = uuid; \
+ smc_ret_values smc_ret = ffa_partition_info_get(ffa_uuid); \
+ ffa_rx_release(); \
+ if (smc_ret.ret0 == FFA_ERROR && \
+ smc_ret.ret2 == FFA_ERROR_INVALID_PARAMETER) { \
+ tftf_testcase_printf("FFA endpoint not deployed!\n"); \
+ return TEST_RESULT_SKIPPED; \
+ } else if (smc_ret.ret0 != FFA_SUCCESS_SMC32) { \
+ ERROR("ffa_partition_info_get failed!\n"); \
+ return TEST_RESULT_FAIL; \
+ } \
+ } while (0)
+
/* Helper macro to verify if system suspend API is supported */
#define is_psci_sys_susp_supported() \
(tftf_get_psci_feature_info(SMC_PSCI_SYSTEM_SUSPEND) \