Regression 1024: add tests cases for PTA_SYSTEM_GET_TPM_EVENT_LOG service.

Adds test cases to exercise the PTA_SYSTEM_GET_TPM_EVENT_LOG service.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
diff --git a/host/xtest/Makefile b/host/xtest/Makefile
index ff77b18..9f0998c 100644
--- a/host/xtest/Makefile
+++ b/host/xtest/Makefile
@@ -132,6 +132,7 @@
 CFLAGS += -I../../ta/aes_perf/include
 CFLAGS += -I../../ta/socket/include
 CFLAGS += -I../../ta/sdp_basic/include
+CFLAGS += -I../../ta/tpm_log_test/include
 
 ifdef CFG_GP_PACKAGE_PATH
 CFLAGS += -I../../ta/GP_TTA_Arithmetical
diff --git a/host/xtest/regression_1000.c b/host/xtest/regression_1000.c
index 12cca59..a841183 100644
--- a/host/xtest/regression_1000.c
+++ b/host/xtest/regression_1000.c
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2020, ARM Limited. All rights reserved.
  * Copyright (c) 2014, STMicroelectronics International N.V.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -34,6 +35,7 @@
 #include <ta_miss_test.h>
 #include <ta_sims_keepalive_test.h>
 #include <ta_concurrent.h>
+#include <ta_tpm_log_test.h>
 #include <sdp_basic.h>
 #include <pta_secstor_ta_mgmt.h>
 
@@ -1879,3 +1881,31 @@
 }
 ADBG_CASE_DEFINE(regression, 1023, xtest_tee_test_1023,
 		"Test ELF initialization (.init_array)");
+
+#ifdef CFG_CORE_TPM_EVENT_LOG
+static void xtest_tee_test_1024(ADBG_Case_t *c)
+{
+	TEEC_Session session = {};
+	uint32_t ret_orig = 0;
+
+	xtest_teec_open_session(&session, &tpm_log_test_ta_uuid,
+				NULL, &ret_orig);
+
+	Do_ADBG_BeginSubCase(c, "TPM test service invocation");
+	ADBG_EXPECT_TEEC_SUCCESS(c, TEEC_InvokeCommand(&session,
+				  TA_TPM_TEST_GET_LOG,
+				  NULL, &ret_orig));
+	Do_ADBG_EndSubCase(c, "TPM test service invocation");
+
+	Do_ADBG_BeginSubCase(c, "TPM test passing short buffer");
+	ADBG_EXPECT_TEEC_SUCCESS(c, TEEC_InvokeCommand(&session,
+				  TA_TPM_TEST_SHORT_BUF,
+				  NULL, &ret_orig));
+	Do_ADBG_EndSubCase(c, "TPM test passing short buffer");
+
+	TEEC_CloseSession(&session);
+}
+
+ADBG_CASE_DEFINE(regression, 1024, xtest_tee_test_1024,
+		 "Test PTA_SYSTEM_GET_TPM_EVENT_LOG Service");
+#endif /* CFG_CORE_TPM_EVENT_LOG */
diff --git a/host/xtest/xtest_test.c b/host/xtest/xtest_test.c
index 97fc55d..c7778d5 100644
--- a/host/xtest/xtest_test.c
+++ b/host/xtest/xtest_test.c
@@ -27,6 +27,7 @@
 #include <enc_fs_key_manager_test.h>
 #include <ta_storage_benchmark.h>
 #include <ta_socket.h>
+#include <ta_tpm_log_test.h>
 #include <tee_api_defines.h>
 #include <__tee_isocket_defines.h>
 #include <__tee_tcpsocket_defines.h>
@@ -206,6 +207,7 @@
 const TEEC_UUID storage_benchmark_ta_uuid = TA_STORAGE_BENCHMARK_UUID;
 const TEEC_UUID socket_ta_uuid = TA_SOCKET_UUID;
 const TEEC_UUID sdp_basic_ta_uuid = TA_SDP_BASIC_UUID;
+const TEEC_UUID tpm_log_test_ta_uuid = TA_TPM_LOG_TEST_UUID;
 #ifdef WITH_GP_TESTS
 const TEEC_UUID gp_tta_ds_uuid = TA_TTA_DS_UUID;
 #endif
diff --git a/host/xtest/xtest_test.h b/host/xtest/xtest_test.h
index df9aea0..3382585 100644
--- a/host/xtest/xtest_test.h
+++ b/host/xtest/xtest_test.h
@@ -140,6 +140,7 @@
 extern const TEEC_UUID storage_benchmark_ta_uuid;
 extern const TEEC_UUID socket_ta_uuid;
 extern const TEEC_UUID sdp_basic_ta_uuid;
+extern const TEEC_UUID tpm_log_test_ta_uuid;
 extern char *_device;
 
 #endif /*XTEST_TEST_H*/