aboutsummaryrefslogtreecommitdiff
path: root/tftf
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2019-10-04 14:56:26 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2019-10-04 14:56:26 +0000
commit1ca3102141319bd514c296ddc256f92e321780a2 (patch)
tree24f574d395c7abe26334c9b6dc25c7d7dfddfe92 /tftf
parent7d3054a7a194a43546b65b7c5d814b8212e2e01e (diff)
parent807c61553fde97d41d29713b7e0159536f3ab680 (diff)
downloadtf-a-tests-1ca3102141319bd514c296ddc256f92e321780a2.tar.gz
Merge "Added SYSTEM_RESET test case"
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>