Commit Graph

291 Commits (mbed_lib_rev160)

Author SHA1 Message Date
Shrikant Tudavekar 42529e4713 measure the time over a longer range 2018-03-14 14:48:09 -05:00
Filip Jagodzinski 8bfc1668f6 Tests: Drivers: TimerEvent: Add tests 2018-03-14 14:48:09 -05:00
Maciej Bocianski 41d8f0f465 sleep_manager_racecondition: fix for slow devices
sleep_manager_racecondition test fix for devices with low CPU clock

This RP contains fix for sleep_manager_racecondition test
for very slow devices (like NRF51). It fixes the test itself
as well as side effects of fix introduced in
 #5046 (us ticker: fix fire interrupt handling)

The idea of the test was to test race condition between main thread
and interrupt handler calling the same function.
To efficiently test this, each handler call should interrupt
main thread to make race more likely.
On very slow devices (like NRF51) when we set very low ticker period
(e.g less then 1000us for NRF51) there is no much time for thread scheduling.
On such slow devices, setting period to 500 us cause that
main thread is scheduled very rarely and only handler is
constantly called making test unreliable.
Fix introduced in #5046 (us ticker: fix fire interrupt handling)
changed fire_interrupt function implementation causing more
interrupt tailing thus even less time for main thread scheduling.
After introduction of #5046 (us ticker: fix fire interrupt handling)
when running sleep_manager_racecondition test on NRF51
(with ticker1.attach_us(&sleep_manager_locking_irq_test, 500);)
test is failing with timeout due to the fact that interrupt
handler is constantly called and main thread is never scheduled.
2018-02-23 17:08:31 -06:00
Veijo Pesonen 3b57945404 Fix WIFI-CONNECT-PARAMS-CHANNEL-FAIL Greentea test case
The test case is executed succesfully when usage of wrong channel is detected
2018-02-23 17:08:31 -06:00
jeromecoutant f6d1258d21 NETSOCKET pressure tests configuration 2018-02-23 17:08:31 -06:00
Przemyslaw Stekiel 9ea3d2fb65 tests-events-timing - print debug info only in case of failure.
In the 'Testing accuracy of equeue semaphore' test case result is printed out in each loop iteration.
Since debug prints should not exist in the final test version I suggest to print information only in case of failure.
Additionally time needed to print single info is equal to ~25 ms (K64F/GCC_ARM). The while loop is designed to execute until 20000 ms elapses, so this print has also impact on number of times the loop is executed (number of semaphore accuracy checks).
2018-02-23 17:08:30 -06:00
adbridge 27109bebd8 Revert "Correct test `socket_sigio`"
This reverts commit b812918f90.
2018-02-12 11:12:54 +00:00
Wolfgang Betz b812918f90 Correct test `socket_sigio`
A call to

    `TCPSocket::recv(void *data, nsapi_size_t size)`

returns, following the mbed documentation, the number of received bytes on
success, and a negative error code on failure.

So in case of success, the return value depends on both the value of parameter
`size` but also on the amount of data already available. This means, that the
value returned can be lower than or equal to the `size` of the `data` buffer
passed as argument to the call.

Therefore, in the cases of `test_tcp_hello_world()` & `find_substring()`
(i.e. test `socket_sigio`), the calls to `TCPSocket::recv()` might return from
one byte up to `sizeof(buffer) - 1` (i.e. 511) bytes for each single call,
while the tests expect to receive the whole response string with a single call.

This commit applies a fix to this situation by implementing a receive loop
which exits once there is no data anymore available to be read from the socket.
2018-02-09 14:39:45 +00:00
Maciej Bocianski 14e48e53ab test-mbed_drivers-ticker: improve two ticker test accuracy
test_case_2x_callbacks test was redesigned to eliminate ticker rescheduling and improve time mesure accuracy.

Constant ticker rescheduling (detach()/attach_us() calls)
was causing the gap between consecutive callback calls was not exact 1ms
but 1ms + time needed to call the callback and attach new one.
New design just uses two tickers to update counter alternatively every 1ms without rescheduling them
2018-02-09 14:18:46 +00:00
Maciej Bocianski 2c617c549c test-mbed_drivers-ticker: fix ticker cross attach
This commit fixes ticker cross-schedule bug in test_case_2x_callbacks subtest

In effect of this bug:
    ticker_callback_1_switch_to_2 was called only once
    ticker2 was never been fired because it was repeatedly detached just before fire and attached again
2018-02-09 14:18:46 +00:00
Przemyslaw Stekiel 9690089280 Add Transaction class unit test. 2018-02-09 14:18:45 +00:00
Maciej Bocianski bec8d758fe Add FileHandle tests 2018-02-09 14:18:45 +00:00
Przemyslaw Stekiel 47656776dd Add RTC time test. 2018-01-27 00:57:57 -06:00
Senthil Ramakrishnan a22d968996 Fix tcp_hello_world test to receive all the data from http response 2018-01-27 00:57:20 -06:00
Senthil Ramakrishnan 70c0af19b9 ESP8266 test config and tcp_echo test fix for ESP8266 2018-01-27 00:57:20 -06:00
Marcus Chang be43b20eaf Increase clock tolerance in Flash HAL test
The current 0.1% clock tolerance is too small for certain platforms
which natural variance is larger than this. This commit increases the
tolerance to 0.5% instead.

Sample output from time_cpu_cycles called repeatedly in init,
before running any flash tests:

[1515706585.63][CONN][RXD] diff: 49316
[1515706585.69][CONN][RXD] diff: 49256
[1515706585.75][CONN][RXD] diff: 49286
[1515706585.81][CONN][RXD] diff: 49256
[1515706585.87][CONN][RXD] diff: 49225
[1515706585.94][CONN][RXD] diff: 49286
[1515706585.99][CONN][RXD] diff: 49317
[1515706586.06][CONN][RXD] diff: 49255
[1515706586.12][CONN][RXD] diff: 49286
[1515706586.18][CONN][RXD] diff: 49285
[1515706586.24][CONN][RXD] diff: 49286
[1515706586.31][CONN][RXD] diff: 49347
[1515706586.36][CONN][RXD] diff: 49347
[1515706586.43][CONN][RXD] diff: 49286
[1515706586.49][CONN][RXD] diff: 49286
[1515706586.55][CONN][RXD] diff: 49256
[1515706586.61][CONN][RXD] diff: 49286
[1515706586.68][CONN][RXD] diff: 49346
[1515706586.74][CONN][RXD] diff: 49347
[1515706586.80][CONN][RXD] diff: 49256

Notice the outliers will cause intermittent CI failures.
2018-01-27 00:57:19 -06:00
jeromecoutant 8a2a182bfe lp_timer test : add a minimum delta value 2018-01-12 15:01:44 +00:00
Maciej Bocianski bb2028828f mem_trace tests refactoring 2018-01-12 15:01:43 +00:00
Mika Leppänen 3dc3201d26 Tests for wifi emac interface 2018-01-12 15:01:43 +00:00
Seppo Takalo bbe11de7e0 Remove destruction of WiFi interface in test runs
Most of our IP stacks don't allow removal of interfaces so
interface destructor can not reliably clean up. Therefore we
cannot rely its behaviours in test case.

Instead run interface->disconnect() in case interface was already
created.
2018-01-02 15:22:04 +00:00
Veijo Pesonen 25614152ae Greentea test case WIFI-CONNECT-NOCREDENTIALS- accept also parameter error if AP is not found 2018-01-02 15:22:04 +00:00
Veijo Pesonen 29b0bedd3b Security protocol made configurable via json 2018-01-02 15:22:04 +00:00
Veijo Pesonen 0680821652 remove disconnect from test cases as it's going to be called implicitly from get_interface-function 2018-01-02 15:22:04 +00:00
Veijo Pesonen 4d154b8e20 Greentea WIFI-CONNECT-SECURE must use NSAPI_SECURITY_WPA_WPA2 2018-01-02 15:22:04 +00:00
Veijo Pesonen 42c328f770 Greentea WIFI-SCAN - make possible to disable check against assumed channel
It's possible that a device does not support setting the channel to be used.
In case channel is not set by the device lets disable the check.
2018-01-02 15:22:04 +00:00
Veijo Pesonen ac4ff65c26 Greentea Wifi testcase fixes
Call disconnect when connect has been tested. Also instead of waiting
for parameter error in case of missing SSID give missing SSID error
code.
2018-01-02 15:22:04 +00:00
TomoYamanaka 6852fffd49 Change the "thread" test main for Cortex-A
In pararell threads of "thread" test is a simple thread, but it seems that there is a difference in the stack used between Cortex-A and Cortex-M.
As a result of check, in Cortex-A, program aborts because of the lack of stack when PARALLEL_THREAD_STACK_SIZE is 384, workes properly when PARALLEL_THREAD_STACK_SIZE is 512 at least.
2018-01-02 15:22:03 +00:00
TomoYamanaka 3ca6dbf864 Change the "malloc" test main for Cortex-A
"malloc" test is used a simple thread that executes only malloc and free, but it seems that there is a difference in the stack used between Cortex-A and Cortex-M.
As a result of check, in Cortex-A, program aborts because of the lack of stack  when THREAD_STACK_SIZE is 256, workes properly when THREAD_STACK_SIZE is 512 at least. Since it seems that the definition processing of "DEFAULT_STACK_SIZE" was gone from Mbed OS by updating CMSIS5/RTX5, I setted 512 directly for Cortex-A.
2018-01-02 15:22:03 +00:00
TomoYamanaka edc0b1896d Modify 2-byte code of "heap and stack" test main for Cortex-A
I modified "space" character from 2-byte code to 1-byte code in "heap and stack" test main.
2018-01-02 15:22:03 +00:00
Veijo Pesonen 0415dfcdc6 Greentea Wifi testcase fixes
Replace 'TEST_PASS' with 'return'
2017-12-20 16:05:44 +00:00
Veijo Pesonen 77f4a559db Greentea Wifi testcase fixes
ONME-3266 Greentea testcase WIFI-SCAN fails arbitrarily
ONME-3278 Greentea testcase WIFI-SET-CREDENTIAL doesn't try WEP with valid credentials
ONME-3279 Greentea testcase WIFI-GET-RSSI uses arbitrary RSSI value limits
ONME-3280 Greentea testcase WIFI-CONNECT-PARAMS-VALID-SECURE assumes WPA2
2017-12-20 16:05:44 +00:00
Russ Butler e97b38f804 Fix deficiency in the race test
The test for construction of local static objects doesn't check
to see if the object returned has been fully initialized. Because
of this, an error with ARMCC was not detected.

This patch adds an assert to the race_test to ensure that the
object has been properly initialized.
2017-12-20 16:05:43 +00:00
Maciej Bocianski 4b4aeb44ce Add SingletonPtr test 2017-12-20 16:05:43 +00:00
jeromecoutant b0c22d5305 tests-netsocket-socket_sigio
HTTP_SERVER_NAME and HTTP_SERVER_FILE_PATH are replaced by
  MBED_CONF_APP_HTTP_SERVER_NAME and MBED_CONF_APP_HTTP_SERVER_FILE_PATH
  to allow user to make local tests

Test on HTTP connect added as test was always OK even with no connection...
2017-12-20 16:05:42 +00:00
jeromecoutant dd293483ca tests-netsocket-tcp_hello_world
HTTP_SERVER_NAME and HTTP_SERVER_FILE_PATH are replaced by
  MBED_CONF_APP_HTTP_SERVER_NAME and MBED_CONF_APP_HTTP_SERVER_FILE_PATH
  to allow user to make local tests
2017-12-20 16:05:42 +00:00
jeromecoutant 54f495b1be tests-netsocket-tcp_echo
UUID lines are removed as they were not used

default case:
If MBED_CONF_APP_ECHO_SERVER_ADDR and MBED_CONF_APP_ECHO_SERVER_PORT are not defined
test is using Greentea to get server information (code before OS 5.6.1 version)

TCP_ECHO_PREFIX is no more a mandatory step
2017-12-20 16:05:42 +00:00
jeromecoutant 4e46233a4d tests-netsocket-udp_echo
UUID lines are removed as they were not used

default case:
If MBED_CONF_APP_ECHO_SERVER_ADDR and MBED_CONF_APP_ECHO_SERVER_PORT are not defined
test is using Greentea to get server information (code before OS 5.6.1 version)
2017-12-20 16:05:42 +00:00
jeromecoutant 85c12899ce tests-netsocket-gethostbyname
MBED_DNS_TEST_HOST define is replaced by MBED_CONF_APP_DNS_TEST_HOST to allow user to change host name for local tests
2017-12-20 16:05:42 +00:00
Wolfgang Betz 5abc7925cc Split test for secure & unsecure tests 2017-12-20 16:05:42 +00:00
Wolfgang Betz 37637c60b9 Correct WiFi driver name to `X_NUCLEO_IDW0XX1` 2017-12-20 16:05:42 +00:00
Jimmy Brisson 70522bb44b
Merge pull request #5360 from maciejbocianski/thread_fix
threads test adjust to run on devices with small RAM
2017-11-27 10:35:44 -06:00
Jimmy Brisson cfa9e47aee
Merge pull request #5483 from maciejbocianski/heap_and_stack_tests
heap_and_stack test refactoring
2017-11-22 10:15:03 -06:00
Jimmy Brisson 308833b431
Merge pull request #5323 from maciejbocianski/malloc_tests
malloc test refactoring
2017-11-22 10:14:35 -06:00
Maciej Bocianski bc99556151 threads test: increase threads heap size 2017-11-22 12:54:43 +01:00
Jimmy Brisson 593eab2603
Merge pull request #5123 from maciejbocianski/signal_tests
Extends test set for Thread signals
2017-11-20 10:49:58 -06:00
Maciej Bocianski bc103359f7 heap_and_stack test refactoring 2017-11-20 11:24:49 +01:00
Martin Kojtal 56aa7c396f
Merge pull request #5261 from maciejbocianski/ticker_tests2
Extends test set for Ticker class
2017-11-16 16:23:35 +00:00
Martin Kojtal eb5d3fffff
Merge pull request #5403 from mprse/timer_test_delta_fix
Provide fixes for Timer and LowPowerTimer tests.
2017-11-16 16:19:24 +00:00
Russ Butler 93cf15d57c Fix and add test for ConditionVariable
Fix the circular linked list handling in ConditionVariable and add a
test to validate the linked list implementation.
2017-11-15 16:15:27 -06:00
Martin Kojtal 41eb565d9c
Merge pull request #5342 from ARMmbed/feature_cortex_a
Update CMSIS/RTX with Cortex-A support
2017-11-15 11:24:36 +00:00