diff --git a/features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp b/features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp index 0ca08e7a3f9..87244df0609 100644 --- a/features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp +++ b/features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp @@ -153,6 +153,9 @@ static void kvstore_init() res = kvstore->init(); TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, res); +#if DEVICEKEY_ENABLED + DeviceKey::get_instance().generate_root_of_trust(); +#endif } //deinit the blockdevice @@ -902,9 +905,6 @@ int main() total_num_cases++; } } -#if DEVICEKEY_ENABLED - DeviceKey::get_instance().generate_root_of_trust(); -#endif Specification specification(greentea_test_setup, cases, total_num_cases, greentea_test_teardown_handler, default_handler); diff --git a/features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp b/features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp index 19cc07dec33..3aab1eb6be0 100644 --- a/features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp +++ b/features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp @@ -152,6 +152,9 @@ static void kvstore_init() res = kvstore->init(); TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, res); +#if DEVICEKEY_ENABLED + DeviceKey::get_instance().generate_root_of_trust(); +#endif } //deinit the blockdevice @@ -885,9 +888,6 @@ int main() } } -#if DEVICEKEY_ENABLED - DeviceKey::get_instance().generate_root_of_trust(); -#endif Specification specification(greentea_test_setup, cases, total_num_cases, greentea_test_teardown_handler, default_handler);