Skip to content

Adjustment of netsocket tests to the lossy mesh network limitation. #11654

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 20, 2019
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
12 changes: 11 additions & 1 deletion TESTS/netsocket/dns/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "nsapi_dns.h"
#include "events/EventQueue.h"
#include "dns_tests.h"
#include "ip6string.h"

using namespace utest::v1;

Expand Down Expand Up @@ -165,7 +166,16 @@ static void net_bringup()
net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
tr_info("MBED: IP address is '%s'", net->get_ip_address() ? net->get_ip_address() : "null");
const char *address = net->get_ip_address();

#define MESH 3
#if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
printf("Waiting for GLOBAL_UP\n");
while (net->get_connection_status() != NSAPI_STATUS_GLOBAL_UP) {
ThisThread::sleep_for(500);
}
#endif
printf("MBED: IP address is '%s'\n", address ? address : "null");
}

static void net_bringdown()
Expand Down
12 changes: 11 additions & 1 deletion TESTS/netsocket/tcp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "utest.h"
#include "utest/utest_stack_trace.h"
#include "tcp_tests.h"
#include "ip6string.h"

#ifndef ECHO_SERVER_ADDR
#error [NOT_SUPPORTED] Requires parameters for echo server
Expand Down Expand Up @@ -76,7 +77,16 @@ static void _ifup()
NetworkInterface *net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
tr_info("MBED: TCPClient IP address is '%s'", net->get_ip_address() ? net->get_ip_address() : "null");
const char *address = net->get_ip_address();

#define MESH 3
#if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
printf("Waiting for GLOBAL_UP\n");
while (net->get_connection_status() != NSAPI_STATUS_GLOBAL_UP) {
ThisThread::sleep_for(500);
}
#endif
printf("MBED: TCPClient IP address is '%s'\n", address ? address : "null");
}

static void _ifdown()
Expand Down
12 changes: 11 additions & 1 deletion TESTS/netsocket/tls/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "tls_tests.h"
#include "cert.h"
#include "CellularDevice.h"
#include "ip6string.h"

#ifndef ECHO_SERVER_ADDR
#error [NOT_SUPPORTED] Requires parameters for echo server
Expand Down Expand Up @@ -70,7 +71,16 @@ static void _ifup()
NetworkInterface *net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
tr_info("MBED: TLSClient IP address is '%s'\n", net->get_ip_address() ? net->get_ip_address() : "null");
const char *address = net->get_ip_address();

#define MESH 3
#if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
printf("Waiting for GLOBAL_UP\n");
while (net->get_connection_status() != NSAPI_STATUS_GLOBAL_UP) {
ThisThread::sleep_for(500);
}
#endif
printf("MBED: TLSClient address is '%s'\n", address ? address : "null");
}

static void _ifdown()
Expand Down
12 changes: 11 additions & 1 deletion TESTS/netsocket/udp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "utest.h"
#include "utest/utest_stack_trace.h"
#include "udp_tests.h"
#include "ip6string.h"

#ifndef ECHO_SERVER_ADDR
#error [NOT_SUPPORTED] Requires parameters for echo server
Expand Down Expand Up @@ -63,7 +64,16 @@ static void _ifup()
NetworkInterface *net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
tr_info("MBED: UDPClient IP address is '%s'", net->get_ip_address() ? net->get_ip_address() : "null");
const char *address = net->get_ip_address();

#define MESH 3
#if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
printf("Waiting for GLOBAL_UP\n");
while (net->get_connection_status() != NSAPI_STATUS_GLOBAL_UP) {
ThisThread::sleep_for(500);
}
#endif
printf("MBED: UDPClient IP address is '%s'\n", address ? address : "null");
}

static void _ifdown()
Expand Down