1. Fixing astyle and docs
2. Extra mutex lock was removed
3. Bytes are updated when send/recv > 0 and not in case of -ve error
4. Review comments
5. Guard statistics implementation in test with MBED_NW_STATS_ENABLED
Added smarter rounding of times in recv_timeout and increased the delta by one, to allow "off-by-one" errors.
Reverted commit 88eea6a, reducing TESTS_TIMEOUT back to 480.
Introduced a 100ms timeout for waiting on asynchronous DNS resolution.
Improved error handling on disconnects.
When DEVICE_LPTICKER is defined set_time() only works correctly on
the first call. This test calls set_time() twice and ensures the
time set by both calls is correct. This test only runs if
DEVICE_RTC or DEVICE_LPTICKER is defined.
It will be too hard to try to intercept and continue from a trapped
error once error functions are marked [[noreturn]], so make the error
return tests conditional on error trapping being disabled.
1. Add flash config files.
2. Flash used is MX25U3235F, include information for this
device in the flash config file
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
mbed.h was added in test, via greentea and utest header files. 'mbed.h' is removed
from header files and required header file and namespace is added to CPP/C files
Static Thread methods and signal methods have been deprecated. Remove
all references in the main code, and most of the tests. Some tests of
the deprecated APIs themselves remain.
This is fix for issue 8368.
Test is causing some problems on `REALTEK_RTL8195AM` and `ARM` compiler. There is some kind of memory issue. Probably there is not enough memory space for global data provided by the test. Data definitions have been moved into test function body so, they will land on stack. With this fix the test works on `REALTEK_RTL8195AM/ARM`.
Increase delta to 500 us. This value is still short enough to detect
incorrect behavior of the sleep_manager_can_deep_sleep_test_check() fun,
but allows the targets with low LP timer accuracy to pass, i.e.
NUCLEO_F429ZI.
You are allowed in POSIX / ANSI C to read and write on the same stream, but you
have to do an fseek in between read and write call (getc->fseek->putc)
Thanks @Alex-EEE for sharing the fix: https://github.com/ARMmbed/mbed-os/pull/7749
Added test case for verification of the behavior
Heap statistics are used for analysing heap stats, but it doesn't tell anything
about real heap usage or malloc overheads. Adding `overhead_size` element
will help users to get the real heap usage.
There is no problem with this test during the morph, but some issue has been noticed while testing new Jenkins CI in Oulu on NRF52_DK.
I was able to reproduce the issue locally. The difference between morph and local run is that CPU statistics are enabled on morph. This makes the difference and test passes.
The sleep test case perform sleep for 100 us, 200 us, ... ,1000 us in loop (us ticker wakes the board) and verifies if sleep time matches the assumption.
I got the following results:
sleep wake-up after
100 us ~100 us ok
200 us ~200 us ok
300 us ~300 us ok
400 us ~400 us ok
500 us ~14 us (??)
When requested sleep time is equal to 500 us some unexpected interrupt occurs which wakeup the board and force the test to fail.
Register state just after exit from sleep:
Control and State Register: 0x00400000 (ISRPENDING - Interrupt pending flag is set).
NVIC Interrupt Set-pending Register[0]: 0x00000004 (UARTE0_UART0_IRQn) or 0x00000200 (TIMER1_IRQn - timer used by us ticker).
UART interrupt is generated because of green-tea transmission. We know that it is performed while test is executed since we need to wait before going into deep-sleep since otherwise the transmission will be broken. So to take care of UART interrupt we need to wait before sleep test in the same way like it is done in deep-sleep test.
Test case was assuming that secure and unsecure SSID were on different
channels.
This is not a requirement and it should be OK to run on same channel.
Fixed the testcase by using +1 on channel number to get a wrong channel.
2.4GHz and 5GHz channels might be using the same SSID. Wifi scan
might also fail occasionally to find secure- and unsecure channels
on same scan so lets not assume that we'll find both.
Add a test to ensure that devices have at least 2K free ram
and 2K free heap. This test should be the first test that fails
due to running out of ram or heap.
Change the base time value to more realistic:
START_TIME = 1537789823 # GMT: Monday, 24 September 2018 11:50:23
This fix has been proposed by STM in order to enhance test efficiency.
Current test version did not detect problem with RTC reset on F1 family boards since the base time was too small.
- code refactoring and preparation for enabling DPI/QPI tests
- reduced multiple test count to 4
- use common flash config header for all MX25RXX35F chips
- fix sector erase max time on N25Q128A
Remove the double free RTOS tests since this was never defined
behavior of CMSIS-RTOS. This allows testing to pass.
The RTX commit which caused this test to start failing is:
c3b123ef4256f65537e2597af475fc20ec9a383e
RTX5: updated MemoryPoolFree (removed count check) [SDCMSIS-801]
Note - Double freeing an element from a memory pool was never safe.
The error return value when double freeing was misleading since memory
corruption may still be occurring in that case. For more information
on this see SDCMSIS-801.
Increase timeout for EMAC tests. Old timeout (600 seconds) was not
enough for slower devices to complete the tests.
Check that connection was successful when running test case
emac_test_initialize.
Main idea of introduced changes is to ease adding support for new flash chips
Major changes:
- move implementation of all memory chip specific functions to memory config file (no weak functions)
- add support for 1-2-2 write
To handle timer rollovers the test tests-mbed_hal-common_tickers_freq
calls intf->set_interrupt(0). For this to work correctly the ticker
implementation must fire an interrupt on every rollover event though
intf->set_interrupt(0) was called only once. Whether an interrupt will
fire only once or multiple times is undefined behavior which
cannot be relied upon.
To avoid this undefined behavior this patch continually schedules an
interrupt and performs overflow detection on every read. This also
removes the possibility of race conditions due to overflowCounter
incrementing at the wrong time.
The thread stack size was restricted due to some boards have really limited RAM sizes,
and out of heap memory on multiple threads tests.
The side effect was on the debug profile build, the tests will get stack overflow.
We need the build the test with debug profile in order to do the code coverage analysis.
So increased the thread stack size on FastModel targets.
FastModels targets are simulator running on the x86 hosts.
As the nature of non-RealTime x86 OS and FastModels, timing accuracy is not guaranteed
So skipping the time drifting tests on FastModel targets
When the define LPTICKER_DELAY_TICKS is set deep sleep can be randomly
disallowed when using the low power ticker. This is because a Timer
object, which locks deep sleep, is used to protect from back-to-back
writes to lp tickers which can't support that. This causes tests which
assert that deep sleep is allowed to intermittently fail.
To fix this intermittent failure this patch adds the function
sleep_manager_can_deep_sleep_test_check() which checks if deep sleep
is allowed over a duration. It updates all the tests to use
sleep_manager_can_deep_sleep_test_check() rather
than sleep_manager_can_deep_sleep() so the tests work even if deep
sleep is spuriously blocked.
I'm submitting a test plan for Mbed OS sockets, so that we have
reference that describes wanted behaviour, required test environment,
and priorities of test cases.
This servers as a both documentation and specification. It needs to live
with source code, as opposed to Handbook, because it will be extend, modified
and fixed for faster cycle than what should be done for Handbook.
Part of this document (How to run -section) will be submitted to Handbook
with links to this.
Test is giving problems in some networks. Could be that DNS server
is regarding repeated DNS enquiries on the test to be caused by
malfunctioning device.
This is solution to issue #7724.
Ticker free tests have been removed since ticker free function has been implemented only for CI boards.
Implementation for the remaining platforms will be done on feature branch feature-hal-ticker-free.
RTX waits, such as sem.wait(N), delays for between N-1 and N cycles.
As lp_ticker is not so accurate as us_ticker,
sometines, wait is expiring just before the lp_timeout.
In `ticker speed` test case execution time of ticker API functions is measured using Timer object. Test replaces original ticker handler for testing purposes, so test should not relay on higher level ticker based features(like Timer).
Use low level ticker API for time measuring.
DEVICE_EMAC is defined only for boards with default Ethernet emac.
It is not defined for example for Realtek RTL8195AM board that
does not have Ethernet. Removed the check for device emac from emac
greentea tests.
Made to prevent timeout if a single test case fails. The goal is that
each test case might wait only half of the remaining time reserved for
running TCP test cases.
In mbed-os-tests-mbed_hal-common_tickers/Microsecond ticker overflow test, some targets
would fail to catch specified ticker value near overflow in time and so fail. This commit
alleviates the issue by checking ticker value range rather than one exact ticker value near
overflow.
Serial buffer must be flushed before entering deep sleep mode. In the test this is done by the additional delay which is implemented on the busy loop which decrements given value down to 0 (`void wait_cycles(volatile unsigned int cycles)`). This solution is not appropriate since it is very target specific and the cycles value has been already increased few times. Additionally very big number of loop cycles which is suitable for fast targets may take much longer on slower boards and results in test timeout.
It has been verified that 20ms is sufficient delay for the green-tea transmission. In this test we cannot simply use `wait_ms(20)` since this potentially may put board to sleep and wake up using lp ticker. The test re-initialzies the lp ticker(disables ticker interrupt) and this operation may break the schedule and time tracing by the upper layer. But we can use us ticker which is not affected by this test. The solution is to add a delay routine based on busy loop and us ticker only. This way are able to wait exactly 20 ms.
The test sometimes fails on NRF51_DK (test case: "Test: LowPowerTimer - time measurement 1 ms.") in morph tests.
The test verifies if LowPowerTimer class correctly counts elapsed time. Sometimes we got measured ~1600 us for delay 1000 us (delta 550 us).
The delay is performed using `wait_us()` function which for delays greater than or equal to 1 ms (our case) calls `Thread::wait((uint32_t)ms);`. This causes rescheduling and potentially can put board into sleep (deep sleep mode is disabled by `wait_us()`). For our test purposes we don't need rescheduling/sleep since this actions takes extra time and have influence on the time measurement accuracy.
The solution is to implement function for delay which is based on busy loop and uses us ticker. It has been verified that this solves the problem. With this fix when measurement of 1 ms is repeated 1000 times we got usually measured time equal to ~1080 us, and sometimes ~1300us (checked that this is caused by systick interrupt handling). Since this is test for drivers layer and the results are acceptable I decided to not disabling systick in the test).
As we do not include rtx_lib header file anymore, these symbols are not available.
Use core util for if ISR is active. And for OS tick, pull in os_tick header file.
Mark mbed-os-tests-mbed_hal-common_tickers/time_cpu_cycles not in-lined.
Otherwise, time_cpu_cycles may be in-lined somewhere and takes different
CPU cycles on invocation.
Increase timeout for netsocket TCP and UDP tests. Old timeout
(240 seconds) was not enough for slower devices to complete the
tests.
Accept error codes NSAPI_ERROR_CONNECTION_TIMEOUT and
NSAPI_ERROR_NO_CONNECTION when running test wifi_connect_secure_fail
The new configuration make Error history tracking switched off by default and enabled by using the config flag MBED_CONF_PLATFORM_ERROR_HIST_ENABLED.
Config flag MBED_CONF_PLATFORM_ERROR_ALL_THREADS_INFO enables printing info of all threads. This will be turned off by default.