Enable the Bare Metal green tea test

-PSA test framework uses the RTOS threads to run test cases so added MBED_CONF_RTOS_PRESENT to all the test cases.
pull/11821/head
RAJKUMAR KANAGARAJ 2019-11-06 03:15:49 -08:00
parent e4164bee51
commit f30dd1cef2
14 changed files with 59 additions and 3 deletions

View File

@ -18,7 +18,9 @@
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#if defined(MBED_CONF_RTOS_PRESENT)
#include "rtos.h"
#endif
using namespace utest::v1;

View File

@ -16,6 +16,10 @@
* limitations under the License.
*/
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA attestation test case requires RTOS to run.
#else
#include "psa/crypto.h"
#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
@ -157,3 +161,4 @@ int main()
}
#endif // ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
#endif // !defined(MBED_CONF_RTOS_PRESENT)

View File

@ -16,8 +16,8 @@
* limitations under the License.
*/
#ifndef TARGET_PSA
#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets.
#if !defined(TARGET_PSA) || !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets and RTOS.
#else
#include "greentea-client/test_env.h"
@ -238,4 +238,4 @@ int main()
return !Harness::run(specification);
}
#endif // TARGET_PSA
#endif // TARGET_PSA || !defined(MBED_CONF_RTOS_PRESENT)

View File

@ -1,9 +1,13 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance attestation test cases requires RTOS to run.
#else
void test_entry_a001(val_api_t *val_api, psa_api_t *psa_api);
int main(void)
{
test_start(test_entry_a001, COMPLIANCE_TEST_ATTESTATION);
}
#endif

View File

@ -1,6 +1,10 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s001(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p001, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -1,6 +1,9 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#include "lifecycle.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s002(val_api_t *val_api, psa_api_t *psa_api);
@ -16,3 +19,4 @@ int main(void)
test_start(test_entry_p002, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -1,5 +1,8 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s004(val_api_t *val_api, psa_api_t *psa_api);
@ -15,3 +18,4 @@ int main(void)
test_start(test_entry_p004, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -1,6 +1,10 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s005(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p005, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -1,6 +1,10 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s006(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p006, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -1,6 +1,10 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s007(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p007, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -1,6 +1,10 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s008(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p008, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -1,6 +1,10 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s009(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p009, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -1,6 +1,10 @@
#include "val_interfaces.h"
#include "pal_mbed_os_intf.h"
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
#else
#ifdef ITS_TEST
void test_entry_s010(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
@ -15,3 +19,4 @@ int main(void)
test_start(test_entry_p010, COMPLIANCE_TEST_STORAGE);
#endif
}
#endif

View File

@ -135,9 +135,11 @@ int test_start(test_entry_f test_f, compliance_test_type type)
{
test_g = test_f;
type_g = type;
#if defined(MBED_CONF_RTOS_PRESENT)
MBED_ASSERT((type > COMPLIANCE_TEST_START) && (type < COMPLIANCE_TEST_END));
Thread thread(osPriorityNormal, TEST_STACK_SIZE, NULL);
thread.start(main_wrapper);
thread.join();
#endif
return 0;
}