Skip to content

Greentea tests: user-configurable timeouts #9718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions TESTS/netsocket/dns/dns_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ void hostbyname_cb(void *data, nsapi_error_t result, SocketAddress *address);
void do_asynchronous_gethostbyname(const char hosts[][DNS_TEST_HOST_LEN], unsigned int op_count, int *exp_ok, int *exp_no_mem, int *exp_dns_failure, int *exp_timeout);
void do_gethostbyname(const char hosts[][DNS_TEST_HOST_LEN], unsigned int op_count, int *exp_ok, int *exp_no_mem, int *exp_dns_failure, int *exp_timeout);

namespace dns_global {
#ifdef MBED_GREENTEA_TEST_DNSSOCKET_TIMEOUT_S
static const int TESTS_TIMEOUT = MBED_GREENTEA_TEST_DNSSOCKET_TIMEOUT_S;
#else
static const int TESTS_TIMEOUT = 10 * 60;
#endif
}

/*
* Test cases
*/
Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/dns/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static void net_bringdown()
// Test setup
utest::v1::status_t test_setup(const size_t number_of_cases)
{
GREENTEA_SETUP(10 * 60, "default_auto");
GREENTEA_SETUP(dns_global::TESTS_TIMEOUT, "default_auto");
net_bringup();
return verbose_test_setup_handler(number_of_cases);
}
Expand Down
4 changes: 4 additions & 0 deletions TESTS/netsocket/tcp/tcp_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ int fetch_stats(void);
int split2half_rmng_tcp_test_time(); // [s]

namespace tcp_global {
#ifdef MBED_GREENTEA_TEST_TCPSOCKET_TIMEOUT_S
static const int TESTS_TIMEOUT = MBED_GREENTEA_TEST_TCPSOCKET_TIMEOUT_S;
#else
static const int TESTS_TIMEOUT = (10 * 60);
#endif
static const int TCP_OS_STACK_SIZE = 2048;

static const int RX_BUFF_SIZE = 1220;
Expand Down
4 changes: 4 additions & 0 deletions TESTS/netsocket/tls/tls_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ int fetch_stats(void);
int split2half_rmng_tls_test_time(); // [s]

namespace tls_global {
#ifdef MBED_GREENTEA_TEST_TLSSOCKET_TIMEOUT_S
static const int TESTS_TIMEOUT = MBED_GREENTEA_TEST_TLSSOCKET_TIMEOUT_S;
#else
static const int TESTS_TIMEOUT = (10 * 60);
#endif
static const int TLS_OS_STACK_SIZE = 2048;

static const int RX_BUFF_SIZE = 1220;
Expand Down
4 changes: 4 additions & 0 deletions TESTS/netsocket/udp/udp_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ int fetch_stats(void);
int split2half_rmng_udp_test_time(); // [s]

namespace udp_global {
#ifdef MBED_GREENTEA_TEST_UDPSOCKET_TIMEOUT_S
static const int TESTS_TIMEOUT = MBED_GREENTEA_TEST_UDPSOCKET_TIMEOUT_S;
#else
static const int TESTS_TIMEOUT = 480;
#endif
}

/*
Expand Down
7 changes: 6 additions & 1 deletion TESTS/network/emac/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ using namespace utest::v1;
utest::v1::status_t test_setup(const size_t number_of_cases)
{
#if !MBED_CONF_APP_ECHO_SERVER
#ifdef MBED_GREENTEA_TEST_EMAC_TIMEOUT_S
GREENTEA_SETUP(MBED_GREENTEA_TEST_EMAC_TIMEOUT_S, "default_auto");
#else
GREENTEA_SETUP(1400, "default_auto");
#endif
#endif // #ifdef MBED_GREENTEA_TEST_EMAC_TIMEOUT_S
#endif // #if !MBED_CONF_APP_ECHO_SERVER

return verbose_test_setup_handler(number_of_cases);
}

Expand Down
4 changes: 4 additions & 0 deletions TESTS/network/interface/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ using namespace utest::v1;
// Test setup
utest::v1::status_t test_setup(const size_t number_of_cases)
{
#ifdef MBED_GREENTEA_TEST_INTERFACE_TIMEOUT_S
GREENTEA_SETUP(MBED_GREENTEA_TEST_INTERFACE_TIMEOUT_S, "default_auto");
#else
GREENTEA_SETUP(480, "default_auto");
#endif
return verbose_test_setup_handler(number_of_cases);
}

Expand Down
4 changes: 4 additions & 0 deletions TESTS/network/wifi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ using namespace utest::v1;

utest::v1::status_t test_setup(const size_t number_of_cases)
{
#ifdef MBED_GREENTEA_TEST_WIFI_TIMEOUT_S
GREENTEA_SETUP(MBED_GREENTEA_TEST_WIFI_TIMEOUT_S, "default_auto");
#else
GREENTEA_SETUP(360, "default_auto");
#endif
return verbose_test_setup_handler(number_of_cases);
}

Expand Down