Skip to content

Greentea tests ignore bind returning UNSUPPORTED #9175

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
7 changes: 6 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ void TCPSOCKET_BIND_ADDRESS()
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
SocketAddress sockAddr = SocketAddress(get_interface()->get_ip_address(), 80);
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(sockAddr));
nsapi_error_t bind_result = sock->bind(sockAddr);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address_invalid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void TCPSOCKET_BIND_ADDRESS_INVALID()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->bind("190.2.3.4", 1024));
nsapi_error_t bind_result = sock->bind("190.2.3.4", 1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void TCPSOCKET_BIND_ADDRESS_NULL()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(NULL, 1024));
nsapi_error_t bind_result = sock->bind(NULL, 1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void TCPSOCKET_BIND_ADDRESS_PORT()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(get_interface()->get_ip_address(), 80));
nsapi_error_t bind_result = sock->bind(get_interface()->get_ip_address(), 80);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void TCPSOCKET_BIND_PORT()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(1024));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

delete sock;

Expand Down
9 changes: 8 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_port_fail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ void TCPSOCKET_BIND_PORT_FAIL()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(1024));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
delete sock;
return;
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

TCPSocket *sock2 = new TCPSocket;
if (!sock2) {
Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_unopened.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ void TCPSOCKET_BIND_UNOPENED()
if (!sock) {
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_SOCKET, sock->bind(1024));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_SOCKET, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_wrong_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ void TCPSOCKET_BIND_WRONG_TYPE()
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
char addr_bytes[16] = {0xfe, 0x80, 0xff, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
SocketAddress sockAddr = SocketAddress(addr_bytes, NSAPI_IPv4, 80);
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->bind(sockAddr));
nsapi_error_t bind_result = sock->bind(sockAddr);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/udp/udpsocket_bind_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ void UDPSOCKET_BIND_ADDRESS()
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
SocketAddress sockAddr = SocketAddress(get_interface()->get_ip_address(), 80);
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(sockAddr));
nsapi_error_t bind_result = sock->bind(sockAddr);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/udp/udpsocket_bind_address_invalid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void UDPSOCKET_BIND_ADDRESS_INVALID()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->bind("190.2.3.4", 1024));
nsapi_error_t bind_result = sock->bind("190.2.3.4", 1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/udp/udpsocket_bind_address_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void UDPSOCKET_BIND_ADDRESS_NULL()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(NULL, 1024));
nsapi_error_t bind_result = sock->bind(NULL, 1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/udp/udpsocket_bind_address_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void UDPSOCKET_BIND_ADDRESS_PORT()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(get_interface()->get_ip_address(), 80));
nsapi_error_t bind_result = sock->bind(get_interface()->get_ip_address(), 80);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/udp/udpsocket_bind_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ void UDPSOCKET_BIND_PORT()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(1024));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

delete sock;

Expand Down
9 changes: 8 additions & 1 deletion TESTS/netsocket/udp/udpsocket_bind_port_fail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ void UDPSOCKET_BIND_PORT_FAIL()
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->bind(1024));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
delete sock;
return;
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, bind_result);
}

UDPSocket *sock2 = new UDPSocket;
if (!sock2) {
Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/udp/udpsocket_bind_unopened.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ void UDPSOCKET_BIND_UNOPENED()
if (!sock) {
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_SOCKET, sock->bind(1024));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_SOCKET, bind_result);
}

delete sock;

Expand Down
7 changes: 6 additions & 1 deletion TESTS/netsocket/udp/udpsocket_bind_wrong_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ void UDPSOCKET_BIND_WRONG_TYPE()
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
char addr_bytes[16] = {0xfe, 0x80, 0xff, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
SocketAddress sockAddr = SocketAddress(addr_bytes, NSAPI_IPv4, 80);
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock->bind(sockAddr));
nsapi_error_t bind_result = sock->bind(sockAddr);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, bind_result);
}

delete sock;

Expand Down