diff --git a/TESTS/netsocket/tcp_echo/main.cpp b/TESTS/netsocket/tcp_echo/main.cpp index 19af7763b5..637e1cf596 100644 --- a/TESTS/netsocket/tcp_echo/main.cpp +++ b/TESTS/netsocket/tcp_echo/main.cpp @@ -64,7 +64,9 @@ void test_tcp_echo() #if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT) printf("TCP: Connect to %s:%d\r\n", MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT); - SocketAddress tcp_addr(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT); + SocketAddress tcp_addr; + net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr); + tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT); #else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */ char recv_key[] = "host_port"; char ipbuf[60] = {0}; diff --git a/TESTS/netsocket/tcp_echo_parallel/main.cpp b/TESTS/netsocket/tcp_echo_parallel/main.cpp index e73d53fc64..837a675fcd 100644 --- a/TESTS/netsocket/tcp_echo_parallel/main.cpp +++ b/TESTS/netsocket/tcp_echo_parallel/main.cpp @@ -132,7 +132,7 @@ void test_tcp_echo_parallel() printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address()); #if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT) - tcp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR); + net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr); tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT); #else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */ char recv_key[] = "host_port"; diff --git a/TESTS/netsocket/tcp_packet_pressure/main.cpp b/TESTS/netsocket/tcp_packet_pressure/main.cpp index d0ae9b9490..ff7d648da6 100644 --- a/TESTS/netsocket/tcp_packet_pressure/main.cpp +++ b/TESTS/netsocket/tcp_packet_pressure/main.cpp @@ -149,7 +149,9 @@ void test_tcp_packet_pressure() TCPSocket sock; #if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT) - SocketAddress tcp_addr(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT); + SocketAddress tcp_addr; + net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr); + tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT); #else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */ char recv_key[] = "host_port"; char ipbuf[60] = {0}; diff --git a/TESTS/netsocket/tcp_packet_pressure_parallel/main.cpp b/TESTS/netsocket/tcp_packet_pressure_parallel/main.cpp index 85f5cb2f27..50b7d7c209 100644 --- a/TESTS/netsocket/tcp_packet_pressure_parallel/main.cpp +++ b/TESTS/netsocket/tcp_packet_pressure_parallel/main.cpp @@ -282,7 +282,7 @@ void test_tcp_packet_pressure_parallel() printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address()); #if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT) - tcp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR); + net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr); tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT); #else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */ char recv_key[] = "host_port"; diff --git a/TESTS/netsocket/udp_dtls_handshake/main.cpp b/TESTS/netsocket/udp_dtls_handshake/main.cpp index b36191fa3f..cf1617994b 100644 --- a/TESTS/netsocket/udp_dtls_handshake/main.cpp +++ b/TESTS/netsocket/udp_dtls_handshake/main.cpp @@ -91,7 +91,6 @@ void test_udp_dtls_handshake() { printf("]\r\n"); UDPSocket sock; - SocketAddress udp_addr(ipbuf, port); sock.set_timeout(MBED_CFG_UDP_DTLS_HANDSHAKE_TIMEOUT); for (int attempt = 0; attempt < MBED_CFG_UDP_DTLS_HANDSHAKE_RETRIES; attempt++) { @@ -102,7 +101,8 @@ void test_udp_dtls_handshake() { buffer[i] = udp_dtls_handshake_pattern[i] >> 4; } - err = sock.sendto(udp_addr, buffer, udp_dtls_handshake_count); + err = sock.sendto(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT, + buffer, udp_dtls_handshake_count); printf("UDP: tx -> %d\r\n", err); TEST_ASSERT_EQUAL(udp_dtls_handshake_count, err); diff --git a/TESTS/netsocket/udp_echo/main.cpp b/TESTS/netsocket/udp_echo/main.cpp index 3989bb74d6..cb989e34c4 100644 --- a/TESTS/netsocket/udp_echo/main.cpp +++ b/TESTS/netsocket/udp_echo/main.cpp @@ -70,7 +70,9 @@ void test_udp_echo() { sock.set_timeout(MBED_CFG_UDP_CLIENT_ECHO_TIMEOUT); #if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT) - SocketAddress udp_addr(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT); + SocketAddress udp_addr; + net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &udp_addr); + udp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT); #else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */ char recv_key[] = "host_port"; char ipbuf[60] = {0}; diff --git a/TESTS/netsocket/udp_echo_parallel/main.cpp b/TESTS/netsocket/udp_echo_parallel/main.cpp index 369ac66a30..c493caff8f 100644 --- a/TESTS/netsocket/udp_echo_parallel/main.cpp +++ b/TESTS/netsocket/udp_echo_parallel/main.cpp @@ -194,7 +194,7 @@ void test_udp_echo_parallel() printf("UDP client IP Address is %s\n", net->get_ip_address()); #if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT) - udp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR); + net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &udp_addr); udp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT); #else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */ char recv_key[] = "host_port"; diff --git a/TESTS/netsocket/udp_packet_pressure/main.cpp b/TESTS/netsocket/udp_packet_pressure/main.cpp index 7b626476a1..6d3d35f084 100644 --- a/TESTS/netsocket/udp_packet_pressure/main.cpp +++ b/TESTS/netsocket/udp_packet_pressure/main.cpp @@ -152,7 +152,9 @@ void test_udp_packet_pressure() UDPSocket sock; #if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT) - SocketAddress udp_addr(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT); + SocketAddress udp_addr; + net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &udp_addr); + udp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT); #else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */ char recv_key[] = "host_port"; char ipbuf[60] = {0}; diff --git a/TESTS/netsocket/udp_packet_pressure_parallel/main.cpp b/TESTS/netsocket/udp_packet_pressure_parallel/main.cpp index c281cee42f..088ea6d538 100644 --- a/TESTS/netsocket/udp_packet_pressure_parallel/main.cpp +++ b/TESTS/netsocket/udp_packet_pressure_parallel/main.cpp @@ -302,7 +302,7 @@ void test_udp_packet_pressure_parallel() printf("MBED: UDPClient IP address is '%s'\n", net->get_ip_address()); #if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT) - udp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR); + net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &udp_addr); udp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT); #else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */ char recv_key[] = "host_port"; diff --git a/tools/test_configs/ESP8266Interface.json b/tools/test_configs/ESP8266Interface.json index eba1c0cb4a..546471048d 100644 --- a/tools/test_configs/ESP8266Interface.json +++ b/tools/test_configs/ESP8266Interface.json @@ -13,7 +13,7 @@ }, "echo-server-addr" : { "help" : "IP address of echo server", - "value" : "\"195.34.89.241\"" + "value" : "\"echo.mbedcloudtesting.com\"" }, "echo-server-port" : { "help" : "Port of echo server", @@ -21,7 +21,7 @@ }, "tcp-echo-prefix" : { "help" : "Some servers send a prefix before echoed message", - "value" : "\"u-blox AG TCP/UDP test service\\n\"" + "value" : null }, "tcp-client-echo-buffer-size" : { "help" : "Number of bytes to be send to echo server", diff --git a/tools/test_configs/EthernetInterface.json b/tools/test_configs/EthernetInterface.json index b758c33fb0..fc8a4b8215 100644 --- a/tools/test_configs/EthernetInterface.json +++ b/tools/test_configs/EthernetInterface.json @@ -13,7 +13,7 @@ }, "echo-server-addr" : { "help" : "IP address of echo server", - "value" : "\"195.34.89.241\"" + "value" : "\"echo.mbedcloudtesting.com\"" }, "echo-server-port" : { "help" : "Port of echo server", @@ -21,7 +21,7 @@ }, "tcp-echo-prefix" : { "help" : "Some servers send a prefix before echoed message", - "value" : "\"u-blox AG TCP/UDP test service\\n\"" + "value" : null } }, "target_overrides": { diff --git a/tools/test_configs/HeapBlockDeviceAndEthernetInterface.json b/tools/test_configs/HeapBlockDeviceAndEthernetInterface.json index feedcae388..2c69e88974 100644 --- a/tools/test_configs/HeapBlockDeviceAndEthernetInterface.json +++ b/tools/test_configs/HeapBlockDeviceAndEthernetInterface.json @@ -13,7 +13,7 @@ }, "echo-server-addr" : { "help" : "IP address of echo server", - "value" : "\"195.34.89.241\"" + "value" : "\"echo.mbedcloudtesting.com\"" }, "echo-server-port" : { "help" : "Port of echo server", @@ -21,7 +21,7 @@ }, "tcp-echo-prefix" : { "help" : "Some servers send a prefix before echoed message", - "value" : "\"u-blox AG TCP/UDP test service\\n\"" + "value" : null }, "sim-blockdevice": { "help": "Simulated block device, requires sufficient heap", diff --git a/tools/test_configs/OdinInterface.json b/tools/test_configs/OdinInterface.json index eff3929dab..f8041a2cc2 100644 --- a/tools/test_configs/OdinInterface.json +++ b/tools/test_configs/OdinInterface.json @@ -13,7 +13,7 @@ }, "echo-server-addr" : { "help" : "IP address of echo server", - "value" : "\"195.34.89.241\"" + "value" : "\"dragon.u-blox.com\"" }, "echo-server-port" : { "help" : "Port of echo server", diff --git a/tools/test_configs/Odin_EthernetInterface.json b/tools/test_configs/Odin_EthernetInterface.json index feedcae388..8bac388b57 100644 --- a/tools/test_configs/Odin_EthernetInterface.json +++ b/tools/test_configs/Odin_EthernetInterface.json @@ -13,7 +13,7 @@ }, "echo-server-addr" : { "help" : "IP address of echo server", - "value" : "\"195.34.89.241\"" + "value" : "\"dragon.u-blox.com\"" }, "echo-server-port" : { "help" : "Port of echo server", diff --git a/tools/test_configs/RealtekInterface.json b/tools/test_configs/RealtekInterface.json index 8e9f5419d7..36afe16cc5 100644 --- a/tools/test_configs/RealtekInterface.json +++ b/tools/test_configs/RealtekInterface.json @@ -13,7 +13,7 @@ }, "echo-server-addr" : { "help" : "IP address of echo server", - "value" : "\"195.34.89.241\"" + "value" : "\"echo.mbedcloudtesting.com\"" }, "echo-server-port" : { "help" : "Port of echo server", @@ -21,7 +21,7 @@ }, "tcp-echo-prefix" : { "help" : "Some servers send a prefix before echoed message", - "value" : "\"Realtek Ameba TCP/UDP test service\\n\"" + "value" : null }, "sim-blockdevice": { "help": "Simulated block device, requires sufficient heap",