TFTF: SP-to-SP direct messaging deadlock test

TFTF sends CACTUS_REQ_DEADLOCK_CMD to cactus SP.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I1dc243fc5d22a6fe23b453648d69b7405091e05e
diff --git a/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c b/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
index 7484cc7..aeeb19b 100644
--- a/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
+++ b/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
@@ -145,3 +145,29 @@
 
 	return result;
 }
+
+test_result_t test_ffa_sp_to_sp_deadlock(void)
+{
+	smc_ret_values ret;
+
+	/**********************************************************************
+	 * Check SPMC has ffa_version and expected FFA endpoints are deployed.
+	 **********************************************************************/
+	CHECK_HAFNIUM_SPMC_TESTING_SETUP(1, 0, expected_sp_uuids);
+
+	ret = CACTUS_REQ_DEADLOCK_SEND_CMD(HYP_ID, SP_ID(1), SP_ID(2),
+					   SP_ID(3));
+
+	if (ret.ret0 != FFA_MSG_SEND_DIRECT_RESP_SMC32) {
+		ERROR("Failed to send message. error: %lx\n",
+		      ret.ret2);
+		return TEST_RESULT_FAIL;
+	}
+
+	if (CACTUS_GET_RESPONSE(ret) == CACTUS_ERROR) {
+		ERROR("cactus SP response is CACTUS_ERROR!\n");
+		return TEST_RESULT_FAIL;
+	}
+
+	return TEST_RESULT_SUCCESS;
+}
diff --git a/tftf/tests/tests-spm.xml b/tftf/tests/tests-spm.xml
index d665b5a..14be8ca 100644
--- a/tftf/tests/tests-spm.xml
+++ b/tftf/tests/tests-spm.xml
@@ -39,6 +39,9 @@
      <testcase name="FF-A Request SP-to-SP direct messaging"
                function="test_ffa_sp_to_sp_direct_messaging" />
 
+     <testcase name="FF-A Request SP-to-SP direct messaging deadlock"
+           function="test_ffa_sp_to_sp_deadlock" />
+
   </testsuite>
 
   <testsuite name="FF-A Memory Sharing"