@@ -36,7 +36,6 @@ void mbed_val_test_exit(void)
36
36
if (IS_TEST_FAIL (status) || IS_TEST_SKIP (status))
37
37
{
38
38
GREENTEA_TESTSUITE_RESULT (false );
39
- return ;
40
39
}
41
40
else
42
41
{
@@ -58,93 +57,81 @@ val_status_t mbed_val_execute_non_secure_tests(uint32_t test_num, client_test_t
58
57
{
59
58
val_status_t status = VAL_STATUS_SUCCESS;
60
59
int32_t test_status = VAL_STATUS_SUCCESS;
61
- boot_t boot = {.state = BOOT_NOT_EXPECTED};
62
60
psa_handle_t handle;
63
61
uint32_t i = 1 ;
64
62
test_info_t test_info;
65
63
char testcase_name[100 ] = " " ;
66
64
bool continue_test = true ;
67
65
68
66
test_info.test_num = test_num;
69
- if (boot.state == BOOT_NOT_EXPECTED || boot.state == BOOT_EXPECTED_CRYPTO)
67
+
68
+ mbed_val_print (PRINT_TEST, " [Info] Executing tests from non-secure\n " , 0 );
69
+ while (tests_list[i] != NULL )
70
70
{
71
- mbed_val_print (PRINT_TEST, " [Info] Executing tests from non-secure\n " , 0 );
72
- while (tests_list[i] != NULL )
71
+ memset (testcase_name, 0 , 100 );
72
+ sprintf (testcase_name, " Check%d" , i);
73
+ GREENTEA_TESTCASE_START (testcase_name);
74
+ if (server_hs == TRUE )
73
75
{
74
- memset (testcase_name, 0 , 100 );
75
- sprintf (testcase_name, " Check%d" , i);
76
- GREENTEA_TESTCASE_START (testcase_name);
77
- if (server_hs == TRUE )
78
- {
79
- /* Handshake with server tests */
80
- test_info.block_num = i;
81
- status = mbed_val_execute_secure_test_func (&handle, test_info,
82
- SERVER_TEST_DISPATCHER_SID);
83
- if (VAL_ERROR (status))
84
- {
85
- mbed_val_set_status (RESULT_FAIL (status));
86
- mbed_val_print (PRINT_ERROR, " [Check%d] START\n " , i);
87
- return status;
88
- }
89
- else
90
- {
91
- mbed_val_print (PRINT_DEBUG, " [Check%d] START\n " , i);
92
- }
93
- }
94
-
95
- /* Execute client tests */
96
- test_status = tests_list[i](NONSECURE);
97
-
98
- if (server_hs == TRUE )
99
- {
100
- /* Retrive Server test status */
101
- status = mbed_val_get_secure_test_result (&handle);
102
- }
103
-
104
- if (test_status != VAL_STATUS_SUCCESS)
105
- {
106
- status = VAL_STATUS_ERROR;
107
- }
108
-
109
- if (IS_TEST_SKIP (status))
110
- {
111
- mbed_val_set_status (status);
112
- mbed_val_print (PRINT_DEBUG, " [Check%d] SKIPPED\n " , i);
113
- GREENTEA_TESTCASE_FINISH (testcase_name, 1 , 0 );
114
- continue_test = false ;
115
- }
116
- else if (VAL_ERROR (status))
76
+ /* Handshake with server tests */
77
+ test_info.block_num = i;
78
+ status = mbed_val_execute_secure_test_func (&handle, test_info,
79
+ SERVER_TEST_DISPATCHER_SID);
80
+ if (VAL_ERROR (status))
117
81
{
118
82
mbed_val_set_status (RESULT_FAIL (status));
119
- if (server_hs == TRUE )
120
- mbed_val_print (PRINT_ERROR, " [Check%d] FAILED\n " , i);
121
- GREENTEA_TESTCASE_FINISH (testcase_name, 0 , 1 );
122
- continue_test = false ;
83
+ mbed_val_print (PRINT_ERROR, " [Check%d] START\n " , i);
84
+ return status;
123
85
}
124
86
else
125
87
{
126
- if (server_hs == TRUE )
127
- mbed_val_print (PRINT_DEBUG, " [Check%d] PASSED\n " , i);
128
- GREENTEA_TESTCASE_FINISH (testcase_name, 1 , 0 );
129
- continue_test = true ;
88
+ mbed_val_print (PRINT_DEBUG, " [Check%d] START\n " , i);
130
89
}
90
+ }
131
91
132
- if (!continue_test)
133
- {
134
- return status;
135
- }
92
+ /* Execute client tests */
93
+ test_status = tests_list[i](NONSECURE);
136
94
137
- i++;
95
+ if (server_hs == TRUE )
96
+ {
97
+ /* Retrive Server test status */
98
+ status = mbed_val_get_secure_test_result (&handle);
138
99
}
139
- }
140
- else
141
- {
142
- /* If we are here means, we are in second run of this test */
143
- status = VAL_STATUS_SUCCESS;
144
- if (boot.state != BOOT_EXPECTED_S)
100
+
101
+ if (test_status != VAL_STATUS_SUCCESS)
145
102
{
146
- mbed_val_print (PRINT_DEBUG, " [Check1] PASSED \n " , 0 ) ;
103
+ status = VAL_STATUS_ERROR ;
147
104
}
105
+
106
+ if (IS_TEST_SKIP (status))
107
+ {
108
+ mbed_val_set_status (status);
109
+ mbed_val_print (PRINT_DEBUG, " [Check%d] SKIPPED\n " , i);
110
+ GREENTEA_TESTCASE_FINISH (testcase_name, 1 , 0 );
111
+ continue_test = false ;
112
+ }
113
+ else if (VAL_ERROR (status))
114
+ {
115
+ mbed_val_set_status (RESULT_FAIL (status));
116
+ if (server_hs == TRUE )
117
+ mbed_val_print (PRINT_ERROR, " [Check%d] FAILED\n " , i);
118
+ GREENTEA_TESTCASE_FINISH (testcase_name, 0 , 1 );
119
+ continue_test = false ;
120
+ }
121
+ else
122
+ {
123
+ if (server_hs == TRUE )
124
+ mbed_val_print (PRINT_DEBUG, " [Check%d] PASSED\n " , i);
125
+ GREENTEA_TESTCASE_FINISH (testcase_name, 1 , 0 );
126
+ continue_test = true ;
127
+ }
128
+
129
+ if (!continue_test)
130
+ {
131
+ return status;
132
+ }
133
+
134
+ i++;
148
135
}
149
136
return status;
150
137
}
@@ -325,6 +312,6 @@ val_status_t mbed_val_wd_reprogram_timer(wd_timeout_type_t timeout_type)
325
312
}
326
313
327
314
328
- }
315
+ } // extern "C"
329
316
330
317
0 commit comments