aboutsummaryrefslogtreecommitdiff
path: root/tftf
diff options
context:
space:
mode:
authorDeepika Bhavnani <deepika.bhavnani@arm.com>2019-09-10 23:24:36 +0300
committerDeepika Bhavnani <deepika.bhavnani@arm.com>2019-10-01 18:18:55 +0300
commit807c61553fde97d41d29713b7e0159536f3ab680 (patch)
treeca02366b01ff30a9c6322a94645b7da43626b602 /tftf
parent0012dbc2a841abeff25be8be1113f19073ee4d2c (diff)
downloadtf-a-tests-807c61553fde97d41d29713b7e0159536f3ab680.tar.gz
Added SYSTEM_RESET test case
Signed-off-by: Deepika Bhavnani <deepika.bhavnani@arm.com> Change-Id: Ie946e83d4365679d6daa1d3b25142a9380cffe2f
Diffstat (limited to 'tftf')
-rw-r--r--tftf/tests/runtime_services/standard_service/psci/api_tests/system_reset/test_system_reset.c32
-rw-r--r--tftf/tests/tests-manual.mk5
-rw-r--r--tftf/tests/tests-manual.xml6
-rw-r--r--tftf/tests/tests-reboot.mk1
-rw-r--r--tftf/tests/tests-reboot.xml4
5 files changed, 45 insertions, 3 deletions
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/system_reset/test_system_reset.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/system_reset/test_system_reset.c
new file mode 100644
index 00000000..41eb7af1
--- /dev/null
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/system_reset/test_system_reset.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2019, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <psci.h>
+#include <smccc.h>
+#include <tftf_lib.h>
+
+/*
+ * @Test_Aim@ Validate the SYSTEM_RESET call.
+ * Test SUCCESS in case of system reset.
+ * Test FAIL in case of execution not terminated.
+ */
+test_result_t test_system_reset(void)
+{
+ smc_args args = { SMC_PSCI_SYSTEM_RESET };
+
+ if (tftf_is_rebooted() == 1) {
+ /* Successfully resumed from SYSTEM_RESET */
+ return TEST_RESULT_SUCCESS;
+ }
+
+ tftf_notify_reboot();
+ tftf_smc(&args);
+
+ /* The PSCI SYSTEM_RESET call is not supposed to return */
+ tftf_testcase_printf("System didn't reboot properly\n");
+
+ return TEST_RESULT_FAIL;
+}
diff --git a/tftf/tests/tests-manual.mk b/tftf/tests/tests-manual.mk
index bd8132bb..67e24609 100644
--- a/tftf/tests/tests-manual.mk
+++ b/tftf/tests/tests-manual.mk
@@ -1,11 +1,12 @@
#
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
TESTS_SOURCES += \
$(addprefix tftf/tests/runtime_services/standard_service/psci/api_tests/, \
+ system_reset/test_system_reset.c \
mem_protect/test_mem_protect.c \
psci_stat/test_psci_stat.c \
reset2/reset2.c \
@@ -18,4 +19,4 @@ endif
ifeq (${NEW_TEST_SESSION},1)
$(error Manual tests require NEW_TEST_SESSION=0 to persist test results across reboots)
-endif \ No newline at end of file
+endif
diff --git a/tftf/tests/tests-manual.xml b/tftf/tests/tests-manual.xml
index 15a9609f..e7c29e09 100644
--- a/tftf/tests/tests-manual.xml
+++ b/tftf/tests/tests-manual.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright (c) 2018, Arm Limited. All rights reserved.
+ Copyright (c) 2018-2019, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
-->
@@ -9,6 +9,10 @@
<testsuites>
+ <testsuite name="System Reset Test" description="Validate SYSTEM_RESET PSCI call">
+ <testcase name="System Reset" function="test_system_reset" />
+ </testsuite>
+
<testsuite name="PSCI STAT" description="Test PSCI STAT support System level">
<testcase name="for stats after system reset" function="test_psci_stats_after_reset" />
<testcase name="for stats after system shutdown" function="test_psci_stats_after_shutdown" />
diff --git a/tftf/tests/tests-reboot.mk b/tftf/tests/tests-reboot.mk
index b0f57384..ad80973f 100644
--- a/tftf/tests/tests-reboot.mk
+++ b/tftf/tests/tests-reboot.mk
@@ -6,6 +6,7 @@
TESTS_SOURCES += \
$(addprefix tftf/tests/runtime_services/standard_service/psci/api_tests/, \
+ system_reset/test_system_reset.c \
mem_protect/test_mem_protect.c \
psci_stat/test_psci_stat.c \
reset2/reset2.c \
diff --git a/tftf/tests/tests-reboot.xml b/tftf/tests/tests-reboot.xml
index fa4da137..a0728723 100644
--- a/tftf/tests/tests-reboot.xml
+++ b/tftf/tests/tests-reboot.xml
@@ -9,6 +9,10 @@
<testsuites>
+ <testsuite name="System Reset Test" description="Validate SYSTEM_RESET PSCI call">
+ <testcase name="System Reset" function="test_system_reset" />
+ </testsuite>
+
<testsuite name="PSCI STAT" description="Test PSCI STAT support System level">
<testcase name="for stats after system reset" function="test_psci_stats_after_reset" />
</testsuite>