Skip to content

Greentea netsocket and network tests improvements #8780

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 1 commit into from
Nov 24, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ASYNCHRONOUS_DNS_NON_ASYNC_AND_ASYNC()
TEST_ASSERT(strlen(addr.get_ip_address()) > 1);
}

semaphore.wait();
semaphore.wait(100);

TEST_ASSERT(data.result == NSAPI_ERROR_OK);

Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/tcp/tcp_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock);
int split2half_rmng_tcp_test_time(); // [s]

namespace tcp_global {
static const int TESTS_TIMEOUT = 960;
static const int TESTS_TIMEOUT = 480;
static const int TCP_OS_STACK_SIZE = 2048;

static const int RX_BUFF_SIZE = 1220;
Expand Down
4 changes: 2 additions & 2 deletions TESTS/netsocket/tcp/tcpsocket_recv_timeout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ void TCPSOCKET_RECV_TIMEOUT()
TEST_FAIL();
goto CLEANUP;
}
printf("MBED: recv() took: %dms\n", timer.read_ms());
TEST_ASSERT_INT_WITHIN(50, 150, timer.read_ms());
printf("MBED: recv() took: %dus\n", timer.read_us());
TEST_ASSERT_INT_WITHIN(51, 150, (timer.read_us() + 500) / 1000);
continue;
} else if (recvd < 0) {
printf("[pkt#%02d] network error %d\n", i, recvd);
Expand Down
9 changes: 6 additions & 3 deletions TESTS/network/interface/networkinterface_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ void NETWORKINTERFACE_STATUS()
}
TEST_ASSERT_EQUAL(NSAPI_STATUS_GLOBAL_UP, status);

net->disconnect();
err = net->disconnect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);

status = wait_status_callback();
TEST_ASSERT_EQUAL(NSAPI_STATUS_DISCONNECTED, status);
Expand Down Expand Up @@ -123,7 +124,8 @@ void NETWORKINTERFACE_STATUS_NONBLOCK()
}
TEST_ASSERT_EQUAL(NSAPI_STATUS_GLOBAL_UP, status);

net->disconnect();
err = net->disconnect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);

status = wait_status_callback();
TEST_ASSERT_EQUAL(NSAPI_STATUS_DISCONNECTED, status);
Expand All @@ -150,7 +152,8 @@ void NETWORKINTERFACE_STATUS_GET()
wait(0.5);
}

net->disconnect();
err = net->disconnect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);

TEST_ASSERT_EQUAL(NSAPI_STATUS_DISCONNECTED, net->get_connection_status());
}
Expand Down