@@ -127,15 +127,10 @@ utest::v1::status_t case_teardown_handler(const Case *const source, const size_t
127
127
return greentea_case_teardown_handler (source, passed, failed, reason);
128
128
}
129
129
130
- Case cases[] = {
131
- Case (" PSA attestation get token" , check_initial_attestation_get_token, case_teardown_handler),
132
- };
133
-
134
- Specification specification (greentea_test_setup, cases);
135
-
136
- int main ()
130
+ utest::v1::status_t case_setup_handler (const Case *const source, const size_t index_of_case)
137
131
{
138
- psa_status_t status = mbed_psa_reboot_and_request_new_security_state (PSA_LIFECYCLE_ASSEMBLY_AND_TEST);
132
+ psa_status_t status;
133
+ status = mbed_psa_reboot_and_request_new_security_state (PSA_LIFECYCLE_ASSEMBLY_AND_TEST);
139
134
TEST_ASSERT_EQUAL (PSA_SUCCESS, status);
140
135
#if (defined(COMPONENT_PSA_SRV_IPC) || defined(MBEDTLS_ENTROPY_NV_SEED))
141
136
uint8_t seed[MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE] = {0 };
@@ -147,5 +142,17 @@ int main()
147
142
/* don't really care if this succeeds this is just to make crypto init pass*/
148
143
mbedtls_psa_inject_entropy (seed, MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE);
149
144
#endif
145
+ return greentea_case_setup_handler (source, index_of_case);
146
+ }
147
+
148
+
149
+ Case cases[] = {
150
+ Case (" PSA attestation get token" , case_setup_handler, check_initial_attestation_get_token, case_teardown_handler),
151
+ };
152
+
153
+ Specification specification (greentea_test_setup, cases);
154
+
155
+ int main ()
156
+ {
150
157
return !Harness::run (specification);
151
158
}
0 commit comments