Skip to content

Release candidate for mbed-os-5.11.5 #9805

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 109 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
e7e5931
Mutex-protect mbedtls_hardware_poll
kjbracey Jan 29, 2019
d7b58e9
FUTURE_SEQUANA_M0_PSA - fix CM4 starting address
alzix Feb 10, 2019
275572c
tests-netsocket-tls: TLSSOCKET_ECHOTEST deletes socket on failure case
Feb 7, 2019
70d8214
tests-network-interface: drops unreferenced variable
Feb 7, 2019
f886fc6
platform: includes string.h needed by memcpy and strlen
Feb 7, 2019
fe9020b
FUTURE_SEQUANA: SPI HAL fixes
lrusinowicz Feb 8, 2019
bd056c6
K64/ARM: Update to 2-region model for HEAP and Stack Memory
mprse Feb 5, 2019
8482fb7
Revert "MIMXRT1050_EVK: Add IAR support in the exporter"
0xc0170 Feb 11, 2019
a4ed281
Force adding mbed-os root to include dirs
Jan 13, 2019
2636b7e
Check source relative to ROOT on secure targets
Feb 10, 2019
1b8fe3e
Update test.py
Feb 11, 2019
36bf40c
BLE - Nordic: Release crypto cell when not in use.
pan- Jan 14, 2019
42d9fdd
Greentea UDPSOCKET_RECV_TIMEOUT increase time tolerance
michalpasztamobica Feb 1, 2019
b88d69d
Greentea Socket bind tests made ipv6-aware
michalpasztamobica Feb 1, 2019
4a92a13
Greentea DNS test: added debug print
michalpasztamobica Feb 1, 2019
3f11bf5
TLSSocket returns WOULD_BLOCK error instead of ALREADY
michalpasztamobica Feb 1, 2019
035ecc1
Restore MBEDTLS_PSA_CRYPTO_C for PSA targets
alzix Feb 4, 2019
b2b7afe
Fix general block device test to ensure unique block address per test
Feb 10, 2019
19b50ef
Ensure unique block address for multi threaded test. The addresses do…
Feb 10, 2019
693245d
Fix crypto AC mgmt
ccli8 Feb 11, 2019
e5e9e4f
Hook crypto interrupt handler without NVIC_SetVector
ccli8 Feb 11, 2019
3926223
Remove unnecessary header files in crypto-misc.cpp
ccli8 Feb 11, 2019
306943a
Cellular: Fix socket bind tests for BG96
Jan 29, 2019
0ed5e80
Cellular: Fix socket's send and receive boundaries for BG96
Jan 29, 2019
b8712b3
Cellular: Fix UDPSOCKET_SENDTO_INVALID test for BG96
Feb 8, 2019
182f229
REALTEK_RTL8195AM daplink timestamp from os.environ
alekla01 Feb 11, 2019
3930d2e
targets: QUECTEL: Fix build warning
Feb 1, 2019
e8ce42a
STM32 GPIO: use maximum speed
jeromecoutant Feb 4, 2019
46478ab
tests-netsocket-udp: UDPSOCKET_ECHOTEST_NONBLOCK restores non-blocking
Jan 31, 2019
1b5fdaf
tests-netsocket-udp: UDPSOCKET_ECHOTEST_NONBLOCK execution time limit
Jan 31, 2019
b705934
Add MBEDTLS_ENTROPY_NV_SEED to NUCLEO_F411RE to fix the build
Feb 12, 2019
3204ce5
Prefixed string to properly be parsed as bytes
Feb 12, 2019
b63f255
Removed decode since deeper tools always return strings
Feb 12, 2019
64b263c
FUTURE_SEQUANA: Fixed Arduino signal mappings
lrusinowicz Feb 12, 2019
c632480
Add WIFI support for RDA target UNO_91H
caixue1102 Jan 7, 2019
c4e6275
Doxygen correction
Jan 10, 2019
8fe844d
platform: fix build warning in mbed_error
Feb 12, 2019
9891168
Greentea tests: set correct port to test against google.com
michalpasztamobica Feb 12, 2019
88c5b8d
target: UBLOX: Fix build warning in UBLOX_AT_CellularNetwork.cpp
Feb 12, 2019
1b0f7af
nanostack: icmpv6: fix build warning
Feb 12, 2019
8e84316
features: nanostack: fix warning in thread_extension.h
Feb 12, 2019
3525854
btle: fix build warning about unused clockConfiguration
Feb 12, 2019
1c88e0f
ESP8266: connect() can handle ESP's errors.
michalpasztamobica Feb 7, 2019
c05fca2
revert: "Refactor sleep tracing driver identifier to be pointer to th…
Feb 11, 2019
1406185
Add release notes section to PR template
orenc17 Feb 13, 2019
d17a5c8
Do not provide a default Pelion host address.
bridadan Feb 6, 2019
bb2e413
Add .inc as a header file type.
bridadan Feb 13, 2019
ec3093b
tools/utils: ensure default build profiles are processed first
Feb 14, 2019
f14828e
Add flash sum check
Feb 14, 2019
9c519c2
Including CTest explicitly
Feb 4, 2019
c433a14
Proper size checking for link ADR commands
Feb 4, 2019
523a8ce
Updating unit tests
Feb 4, 2019
b96ec17
Update mbed-coap to version 4.7.4
Feb 11, 2019
de35a15
Reverting to original doxy configuration
Feb 13, 2019
c71f1d4
Fix IntelliSense in VSCode export
ngraziano Feb 9, 2019
a476830
Vscode export: remove path separator conversion
ngraziano Feb 11, 2019
a245a17
Vscode export: replace obsolete ${workspaceRoot}
ngraziano Feb 11, 2019
0b8bcb0
readme: add list of licenses - not Apache 2.0
0xc0170 Jan 24, 2019
fabf99f
readme: license update
0xc0170 Feb 12, 2019
f2897a9
readme: storage license under one folder
0xc0170 Feb 12, 2019
656ab6e
license: rename to apache 2.0 txt file
0xc0170 Feb 13, 2019
0c104f2
license: add license file containing folders with non apache license
0xc0170 Feb 13, 2019
f68aa8c
readme: license file reference fix
0xc0170 Feb 13, 2019
22a288d
readme: fix space and . in license
0xc0170 Feb 14, 2019
38fa21d
Fix typo in LICENSE
Feb 15, 2019
4a58fa1
Add articles to README.md
Feb 15, 2019
783485f
Remove pyocd requirement and update icetea.
bridadan Feb 14, 2019
da5c3a8
tools: export: MCUXpresso: fix case inconsistencies in .templ file names
Feb 15, 2019
6be5ad0
ESP8266: connect() returns OK in non-blocking calls
michalpasztamobica Feb 15, 2019
631acd4
ONME-3949 Configuration options for STM_EMAC buffer counts
Jan 9, 2019
1f5fdbc
BLE:Cordio: ATTS setting for write cback should use bitwise or
desmond-blue Feb 19, 2019
dae6a75
Greentea: Remove TLSSocket_simultaneous test
michalpasztamobica Feb 15, 2019
fb4441f
Update Nanostack_HAL licenses and copyright year
Feb 19, 2019
7824c79
support in more types then just RSA_KEYPAIR
Feb 18, 2019
31b9ce2
cmsis conf: change license to apache 2.0
0xc0170 Feb 14, 2019
b6fe528
wifi test: add license info
0xc0170 Feb 14, 2019
e3e8d49
test mbedmicro: fix licenses
0xc0170 Feb 14, 2019
75ba44a
check release: add license header
0xc0170 Feb 14, 2019
aaa2b2b
tools: add license headers
0xc0170 Feb 15, 2019
a43ef52
copyright 2019 fix
0xc0170 Feb 15, 2019
7049b58
tools: fix hashbang
0xc0170 Feb 18, 2019
81f7aa6
memap: remove not needed comment prior future import
0xc0170 Feb 19, 2019
6cbe7a7
tools: move string description after import modules
0xc0170 Feb 19, 2019
2283274
PSOC6: enable export to CMake
vmedcy Feb 5, 2019
bb3c206
tools/export: move hex_files selection to base Exporter class
vmedcy Feb 19, 2019
c79e3fd
PSOC6: update PDL to the latest version
vmedcy Feb 15, 2019
42376c0
PSOC6: minor updates to Cypress HAL
vmedcy Feb 15, 2019
91df4c9
PSOC6: do not reconfigure BT GPIO pins in CYW43XXX HCIDriver
vmedcy Feb 15, 2019
cd4165b
PSOC6: update BSP generated sources with latest configurator
vmedcy Feb 15, 2019
c0a6e95
Add config header to assembly compilation
Feb 19, 2019
2a7f5e2
nRF52 serial: Tighten/simplify atomics
kjbracey Feb 5, 2019
79d8b3a
PSOC6: fix port_write API
vmedcy Feb 20, 2019
f329c7b
adv builder helper now returns an object
ConradBraam Feb 20, 2019
8fa17b8
license: use .md extension
0xc0170 Feb 20, 2019
9f04913
Change EventFlag timeout paramter
kegilbert Feb 20, 2019
b87ee6c
Added new target RHOMBIO_L476DMW1K
guialonsoalb Feb 20, 2019
3c223d9
added licence identifier texts
guialonsoalb Feb 20, 2019
c31635f
Change in license identifier, removed commented dead code
guialonsoalb Feb 21, 2019
49d5a4a
Adding STM32_L475 as a new MTB target
Feb 20, 2019
f4fc79e
Adding SPDX license identifier
Feb 20, 2019
a3007f6
Adding SPDX license identifer for all new files
Feb 20, 2019
ceb5c6e
Removing redundant code comments
Feb 20, 2019
7a716b5
Changing SPDX license identifier to BSD-3-Clause
Feb 21, 2019
7309bd9
Remove ITM from NRF52_DK and DELTA_DFBM_NQ620 targets
TacoGrandeTX Feb 19, 2019
774ee68
STM32 LPTICKER (LPTIM): correct init execution after bootloader
jeromecoutant Feb 21, 2019
f5eb87c
Revert "nRF52 serial: Tighten/simplify atomics"
Feb 21, 2019
42b1afa
Revert "support in more types then just RSA_KEYPAIR"
Feb 22, 2019
71ebf82
Revert "Add MBEDTLS_ENTROPY_NV_SEED to NUCLEO_F411RE to fix the build"
Feb 22, 2019
b83fb2b
Revert "Restore MBEDTLS_PSA_CRYPTO_C for PSA targets"
Feb 22, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 11 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
### Description

<!--
<!--
Required
Add here detailed changes summary, testing results, dependencies
Add here detailed changes summary, testing results, dependencies
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html (Pull request template)
-->


### Pull request type

<!--
<!--
Required
Please add only one X to one of the following types. Do not fill multiple types (split the pull request otherwise).
Please note this is not a GitHub task list, indenting the boxes or changing the format to add a '.' or '*' in front
Expand All @@ -26,8 +26,15 @@

### Reviewers

<!--
<!--
Optional
Request additional reviewers with @username
-->

### Release Notes

<!--
Optional
In case of breaking changes, functionality changes or refactors, please add release notes here.
For more information, please see [the contributing guidelines](https://os.mbed.com/docs/mbed-os/latest/contributing /workflow.html#pull-request-types).
-->
File renamed without changes.
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Unless specifically indicated otherwise in a file, files are licensed under the Apache 2.0 license,
as can be found in: LICENSE-apache-2.0.txt

Folders containing files under different permissive license than Apache 2.0 are listed below. Each folder should contain its own README file with license specified for its files. The original license text is included in those source files.

- [cmsis](./cmsis) - MIT, BSD-3-Clause
- [components/802.15.4_RF/mcr20a-rf-driver](./components/802.15.4_RF/mcr20a-rf-driver) - BSD-3-Clause
- [features/cryptocell/FEATURE_CRYPTOCELL310](./features/cryptocell/FEATURE_CRYPTOCELL310) - ARM Object Code and Header Files License
- [features/FEATURE_BOOTLOADER](./features/FEATURE_BOOTLOADER) - PBL
- [features/FEATURE_BLE/targets](./features/FEATURE_BLE/targets) - BSD-style, PBL, MIT-style
- [features/lorawan](./features/lorawan) - Revised BSD
- [features/lwipstack](./features/lwipstack) - BSD-style, MIT-style
- [features/nanostack/sal-stack-nanostack](./features/nanostack/sal-stack-nanostack) - BSD-3-Clause
- [features/storage](./features/storage) - BSD-style, MIT
- [features/netsocket/emac-drivers](./features/netsocket/emac-drivers) - BSD-style
- [features/frameworks/unity/unity](./features/frameworks/unity/unity) - MIT
- [features/unsupported](./features/unsupported) - MIT-style, BSD-style
- [rtos](./rtos) - MIT
- [drivers](./drivers) - MIT
- [TESTS/mbed_hal/trng/pithy](./TESTS/mbed_hal/trng/pithy) - BSD-3-Clause
- [tools/data/rpc](./tools/data/rpc) - MIT
- [targets](./targets) - PBL, BSD-style, MIT-style, Zlib-style, Public-domain
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ The [release notes](https://os.mbed.com/releases) detail the current release. Yo

## License and contributions

The software is provided under [Apache-2.0 license](LICENSE). Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more info.
The software is provided under the [Apache-2.0 license](LICENSE-apache-2.0.txt). Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more information.

This project contains code from other projects. The original license text is included in those source files. They must comply with our [license guide](https://os.mbed.com/docs/latest/reference/license.html)
This project contains code from other projects. The original license text is included in those source files. They must comply with our [license guide](https://os.mbed.com/docs/latest/reference/license.html).

Folders containing files under different permissive license than Apache 2.0 are listed in the [LICENSE](LICENSE) file.

## Getting started for developers

Expand Down
26 changes: 26 additions & 0 deletions TESTS/mbed_drivers/flashiap/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@

#include "mbed.h"

// Debug available
#ifndef FLASHIAP_DEBUG
#define FLASHIAP_DEBUG 0
#endif

#if FLASHIAP_DEBUG
#define DEBUG_PRINTF(...) printf(__VA_ARGS__)
#else
#define DEBUG_PRINTF(...)
#endif

using namespace utest::v1;


Expand All @@ -37,6 +48,21 @@ void flashiap_init_test()
FlashIAP flash_device;
uint32_t ret = flash_device.init();
TEST_ASSERT_EQUAL_INT32(0, ret);

uint32_t flash_start = flash_device.get_flash_start();
uint32_t flash_size = flash_device.get_flash_size();
utest_printf("Flash address: 0x%08x, size: %d\n", flash_start, flash_size);
uint32_t address = flash_start;
int num = 0;
while (flash_size) {
uint32_t sector_size = flash_device.get_sector_size(address);
// Make sure all sectors sum up to the total flash size
TEST_ASSERT(flash_size >= sector_size);
DEBUG_PRINTF("\tsector %3d: address 0x%08x, size %8d\n", num++, address, sector_size);
flash_size -= sector_size;
address += sector_size;
}

ret = flash_device.deinit();
TEST_ASSERT_EQUAL_INT32(0, ret);
}
Expand Down
17 changes: 17 additions & 0 deletions TESTS/mbedmicro-mbed/attributes/attributes.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed_toolchain.h"

#include <stdio.h>
Expand Down
17 changes: 17 additions & 0 deletions TESTS/mbedmicro-mbed/attributes/weak.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed_toolchain.h"

int testWeak1()
Expand Down
17 changes: 17 additions & 0 deletions TESTS/mbedmicro-mbed/static_assert/test_c.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright (c) 2015-2019 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed_assert.h"
#define THE_ANSWER 42

Expand Down
17 changes: 17 additions & 0 deletions TESTS/mbedmicro-mbed/static_assert/test_cpp.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed_assert.h"
#define THE_ANSWER 42

Expand Down
1 change: 1 addition & 0 deletions TESTS/netsocket/dns/asynchronous_dns_cancel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void ASYNCHRONOUS_DNS_CANCEL()
count++;
} else {
// No memory to initiate DNS query, callback will not be called
printf("Error: No memory to initiate DNS query for %s\n", dns_test_hosts[i]);
data[i].result = NSAPI_ERROR_NO_MEMORY;
data[i].value_set = true;
}
Expand Down
9 changes: 9 additions & 0 deletions TESTS/netsocket/tcp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ void drop_bad_packets(TCPSocket &sock, int orig_timeout)
sock.set_timeout(orig_timeout);
}

nsapi_version_t get_ip_version()
{
SocketAddress test;
if (!test.set_ip_address(NetworkInterface::get_default_instance()->get_ip_address())) {
return NSAPI_UNSPEC;
}
return test.get_ip_version();
}

static void _ifup()
{
NetworkInterface *net = NetworkInterface::get_default_instance();
Expand Down
1 change: 1 addition & 0 deletions TESTS/netsocket/tcp/tcp_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

NetworkInterface *get_interface();
void drop_bad_packets(TCPSocket &sock, int orig_timeout);
nsapi_version_t get_ip_version();
void fill_tx_buffer_ascii(char *buff, size_t len);
nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock);
nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock);
Expand Down
9 changes: 8 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address_invalid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ void TCPSOCKET_BIND_ADDRESS_INVALID()
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind("190.2.3.4", 1024);
nsapi_error_t bind_result = NSAPI_ERROR_OK;
if (get_ip_version() == NSAPI_IPv4) {
bind_result = sock->bind("190.2.3.4", 1024);
} else if (get_ip_version() == NSAPI_IPv6) {
bind_result = sock->bind("fe80::ff01", 1024);
} else {
TEST_FAIL_MESSAGE("This stack is neither IPv4 nor IPv6");
}
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
Expand Down
9 changes: 8 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,14 @@ void TCPSOCKET_BIND_WRONG_TYPE()
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
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);
SocketAddress sockAddr;
if (get_ip_version() == NSAPI_IPv4) {
sockAddr = SocketAddress(addr_bytes, NSAPI_IPv4, 80);
} else if (get_ip_version() == NSAPI_IPv6) {
sockAddr = SocketAddress(addr_bytes, NSAPI_IPv6, 80);
} else {
TEST_FAIL_MESSAGE("This stack is neither IPv4 nor IPv6");
}
nsapi_error_t bind_result = sock->bind(sockAddr);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
9 changes: 6 additions & 3 deletions TESTS/netsocket/tls/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,12 @@ Case cases[] = {
Case("TLSSOCKET_SEND_REPEAT", TLSSOCKET_SEND_REPEAT),
Case("TLSSOCKET_SEND_TIMEOUT", TLSSOCKET_SEND_TIMEOUT),
Case("TLSSOCKET_NO_CERT", TLSSOCKET_NO_CERT),
#ifndef __IAR_SYSTEMS_ICC__
Case("TLSSOCKET_SIMULTANEOUS", TLSSOCKET_SIMULTANEOUS)
#endif
// Temporarily removing this test, as TLS library consumes too much memory
// and we see frequent memory allocation failures on architectures with less
// RAM such as DISCO_L475VG_IOT1A and NUCLEO_F207ZG (both have 128 kB RAM)
// This test also fails for IAR, due to wrong heap configuration in the linker
// script - see https://github.com/ARMmbed/mbed-os/issues/8306
// Case("TLSSOCKET_SIMULTANEOUS", TLSSOCKET_SIMULTANEOUS)
};

Specification specification(greentea_setup, cases, greentea_teardown, greentea_continue_handlers);
Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/tls/tlssocket_echotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ void TLSSOCKET_ECHOTEST()
if (tlssocket_connect_to_echo_srv(*sock) != NSAPI_ERROR_OK) {
printf("Error from tlssocket_connect_to_echo_srv\n");
TEST_FAIL();
return;
delete sock;
return;
}

int recvd;
Expand Down
4 changes: 2 additions & 2 deletions TESTS/netsocket/tls/tlssocket_handshake_invalid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ void TLSSOCKET_HANDSHAKE_INVALID()
TLSSocket sock;
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.open(NetworkInterface::get_default_instance()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.set_root_ca_cert(tls_global::cert));
TEST_ASSERT_EQUAL(NSAPI_ERROR_NO_CONNECTION,
sock.connect("google.com", MBED_CONF_APP_ECHO_SERVER_DISCARD_PORT_TLS));
TEST_ASSERT_EQUAL(NSAPI_ERROR_AUTH_FAILURE,
sock.connect("google.com", 443)); // 443 is https port.
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.close());
}

Expand Down
47 changes: 33 additions & 14 deletions TESTS/netsocket/udp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,26 @@

using namespace utest::v1;

namespace {
Timer tc_bucket; // Timer to limit a test cases run time
}

#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
mbed_stats_socket_t udp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
#endif

void drop_bad_packets(UDPSocket &sock, int orig_timeout)
{
nsapi_error_t err;
sock.set_timeout(0);
while (true) {
err = sock.recv(NULL, 0);
if (err == NSAPI_ERROR_WOULD_BLOCK) {
break;
}
}
sock.set_timeout(orig_timeout);
}
static void _ifup()
{
NetworkInterface *net = NetworkInterface::get_default_instance();
Expand All @@ -51,17 +67,14 @@ static void _ifdown()
printf("MBED: ifdown\n");
}

void drop_bad_packets(UDPSocket &sock, int orig_timeout)

nsapi_version_t get_ip_version()
{
nsapi_error_t err;
sock.set_timeout(0);
while (true) {
err = sock.recvfrom(NULL, 0, 0);
if (err == NSAPI_ERROR_WOULD_BLOCK) {
break;
}
SocketAddress test;
if (!test.set_ip_address(NetworkInterface::get_default_instance()->get_ip_address())) {
return NSAPI_UNSPEC;
}
sock.set_timeout(orig_timeout);
return test.get_ip_version();
}

void fill_tx_buffer_ascii(char *buff, size_t len)
Expand All @@ -71,6 +84,11 @@ void fill_tx_buffer_ascii(char *buff, size_t len)
}
}

int split2half_rmng_udp_test_time()
{
return (udp_global::TESTS_TIMEOUT - tc_bucket.read()) / 2;
}

#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLE
int fetch_stats()
{
Expand All @@ -81,20 +99,20 @@ int fetch_stats()
// Test setup
utest::v1::status_t greentea_setup(const size_t number_of_cases)
{
GREENTEA_SETUP(480, "default_auto");
GREENTEA_SETUP(udp_global::TESTS_TIMEOUT, "default_auto");
_ifup();
tc_bucket.start();
return greentea_test_setup_handler(number_of_cases);
}

void greentea_teardown(const size_t passed, const size_t failed, const failure_t failure)
{
tc_bucket.stop();
_ifdown();
return greentea_test_teardown_handler(passed, failed, failure);
}

Case cases[] = {
Case("UDPSOCKET_ECHOTEST", UDPSOCKET_ECHOTEST),
Case("UDPSOCKET_ECHOTEST_NONBLOCK", UDPSOCKET_ECHOTEST_NONBLOCK),
Case("UDPSOCKET_OPEN_CLOSE_REPEAT", UDPSOCKET_OPEN_CLOSE_REPEAT),
Case("UDPSOCKET_OPEN_LIMIT", UDPSOCKET_OPEN_LIMIT),
Case("UDPSOCKET_RECV_TIMEOUT", UDPSOCKET_RECV_TIMEOUT),
Expand All @@ -110,10 +128,11 @@ Case cases[] = {
Case("UDPSOCKET_BIND_WRONG_TYPE", UDPSOCKET_BIND_WRONG_TYPE),
Case("UDPSOCKET_BIND_UNOPENED", UDPSOCKET_BIND_UNOPENED),
Case("UDPSOCKET_SENDTO_INVALID", UDPSOCKET_SENDTO_INVALID),
Case("UDPSOCKET_ECHOTEST", UDPSOCKET_ECHOTEST),
Case("UDPSOCKET_ECHOTEST_BURST", UDPSOCKET_ECHOTEST_BURST),
Case("UDPSOCKET_ECHOTEST_NONBLOCK", UDPSOCKET_ECHOTEST_NONBLOCK),
Case("UDPSOCKET_ECHOTEST_BURST_NONBLOCK", UDPSOCKET_ECHOTEST_BURST_NONBLOCK),
Case("UDPSOCKET_SENDTO_REPEAT", UDPSOCKET_SENDTO_REPEAT),
Case("UDPSOCKET_ECHOTEST", UDPSOCKET_ECHOTEST),
Case("UDPSOCKET_ECHOTEST_BURST", UDPSOCKET_ECHOTEST_BURST),
};

Specification specification(greentea_setup, cases, greentea_teardown, greentea_continue_handlers);
Expand Down
Loading