diff options
author | Soby Mathew <soby.mathew@arm.com> | 2019-10-04 14:56:26 +0000 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2019-10-04 14:56:26 +0000 |
commit | 1ca3102141319bd514c296ddc256f92e321780a2 (patch) | |
tree | 24f574d395c7abe26334c9b6dc25c7d7dfddfe92 | |
parent | 7d3054a7a194a43546b65b7c5d814b8212e2e01e (diff) | |
parent | 807c61553fde97d41d29713b7e0159536f3ab680 (diff) | |
download | tf-a-tests-1ca3102141319bd514c296ddc256f92e321780a2.tar.gz |
Merge "Added SYSTEM_RESET test case"
-rw-r--r-- | tftf/tests/runtime_services/standard_service/psci/api_tests/system_reset/test_system_reset.c | 32 | ||||
-rw-r--r-- | tftf/tests/tests-manual.mk | 5 | ||||
-rw-r--r-- | tftf/tests/tests-manual.xml | 6 | ||||
-rw-r--r-- | tftf/tests/tests-reboot.mk | 1 | ||||
-rw-r--r-- | tftf/tests/tests-reboot.xml | 4 |
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 000000000..41eb7af18 --- /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 bd8132bb0..67e246090 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 15a9609fc..e7c29e092 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 b0f573841..ad80973ff 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 fa4da1373..a0728723e 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> |