Commit Graph

620 Commits (a2c9781682452c7ed256bdac7c01a85f69716cfc)

Author SHA1 Message Date
Mika Leppänen 3f47963aff Updated greentea TCP tests to use default interface 2018-08-21 10:55:49 +03:00
Mika Leppänen aa80d6d14b Updated greentea DNS tests to use default interface 2018-08-21 10:55:49 +03:00
Mika Leppänen 5fa2edc73f Updated greentea EMAC tests to use default interface 2018-08-21 10:55:49 +03:00
Donatien Garnier 3c599feee7 Add Greentea tests for shared pointer 2018-08-20 18:49:26 +01:00
Russ Butler 00b8e24446 Fix rollover handling in ticker frequency test
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.
2018-08-17 11:59:01 -05:00
Russ Butler f68958df4e Fix tests to work with LPTICKER_DELAY_TICKS
Fix the HAL common_tickers and sleep tests so they work correctly when
the define LPTICKER_DELAY_TICKS is set.
2018-08-17 11:58:55 -05:00
Qinghao Shi 3c302d9d9b Increase the thread stack size on FastModel targets
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.
2018-08-17 17:46:29 +01:00
Qinghao Shi 891c4ed244 Skip time drifting test on FastModels 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
2018-08-17 17:46:28 +01:00
Russ Butler 472ababfef Update deep sleep lock check in tests
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.
2018-08-17 09:29:41 -05:00
Russ Butler 1bbf43ad38 Add test for ticker suspend and resume
Unit test the functions ticker_suspend and ticker_resume.
2018-08-17 09:29:40 -05:00
Cruz Monrreal 3c25b96441
Merge pull request #7786 from mikaleppanen/dns_repeat_to_ext
Moved ASYNCHRONOUS_DNS_SIMULTANEOUS_REPEAT under mbed extended tests
2018-08-16 17:57:36 -05:00
David Saada 876b5f755b FlashIAP & NVStore tests: Skip test if overwriting code in flash. 2018-08-16 21:59:45 +03:00
Cruz Monrreal 3795d394e5
Merge pull request #7741 from mprse/disable_ticker_free_tests
tests-mbed_hal-common_tickers: disable ticker free test cases.
2018-08-16 09:07:09 -05:00
Nir Sonnenschein 2b8eb5ec0e
Merge pull request #7752 from maciejbocianski/timer_test_fix
tests-mbed_drivers-timer: change delay method
2018-08-14 19:42:43 +03:00
Mika Leppänen 199244cf9c Moved ASYNCHRONOUS_DNS_SIMULTANEOUS_REPEAT under mbed extended tests
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.
2018-08-14 10:21:48 +03:00
Maciej Bocianski efe9e44208 tests-mbed_drivers-timer: change delay method 2018-08-10 09:52:07 +02:00
David Saada 75bc3d36cc RTOS threads test: Handle out of memory cases 2018-08-09 17:32:48 +03:00
Przemyslaw Stekiel 20f3d87283 tests-mbed_hal-common_tickers: disable ticker free test cases.
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.
2018-08-09 14:27:05 +02:00
jeromecoutant f532159b61 Timeout tests : unstable result
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.
2018-08-09 10:13:17 +02:00
kegilbert 9b53d1256f Replace mbed_mem_tracing_enabled macro with config option 2018-08-06 13:44:12 -05:00
Martin Kojtal 5f3923250c crc test: manual fix cases
Leave as it is for readability
2018-08-03 11:24:31 +01:00
Martin Kojtal e52bb68f93 tests: astyle fix
All tests should comply to our coding standard now
2018-08-03 10:23:38 +01:00
Cruz Monrreal 8f7024a226
Merge pull request #7383 from davidsaada/david_flashiap_timing_test
FlashIAP: Add timing test
2018-08-02 23:08:54 -05:00
Cruz Monrreal ae40a09036
Merge pull request #7508 from mprse/ticker_free
Ticker free() - requirements, pseudo code, tests, implementation
2018-08-02 23:05:14 -05:00
David Saada 7cf5b3a008 FlashIAP: Add timing test 2018-08-02 18:39:07 +03:00
Przemyslaw Stekiel 2fe6b98922 tests-mbed_hal-common_tickers: use low level ticker API for time measuring.
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.
2018-08-02 15:24:29 +02:00
Przemyslaw Stekiel 6eb66ccd7a TESTS-MBEDMICRO-RTOS-MBED-SYSTIMER: include ticker_free() function in the ticker interface. 2018-08-02 09:48:36 +02:00
Przemyslaw Stekiel 6874fde3d3 TESTS-MBED_DRIVERS-TIMER: include ticker_free() function in the ticker interface. 2018-08-02 09:48:36 +02:00
Martin Kojtal d5f70f0d21
Merge pull request #7465 from davidsaada/david_tests_not_enough_memory
Skip a few tests if not enough memory can be allocated for them
2018-08-01 15:03:45 +02:00
Mika Leppänen d35f5b08ec Removed device emac check from emac greentea tests
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.
2018-07-31 13:18:17 +03:00
Cruz Monrreal 5d4f636bb1
Merge pull request #7578 from VeijoPesonen/conn_failure_tolerance
Makes Greentea TCP test cases to timeout less in connection errors
2018-07-26 10:29:48 -05:00
Veijo Pesonen dd6ec037d7 Makes Greentea TCP test cases to timeout less in connection errors
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.
2018-07-26 09:39:04 +03:00
Przemyslaw Stekiel 239ce02142 tests-mbed_hal-common_tickers: add ticker_free() functional tests. 2018-07-25 08:54:51 +02:00
Cruz Monrreal a252e5ed96
Merge pull request #7530 from jeromecoutant/PR_RTOS_TICKLESS
RTOS SYSTIMER test error in TICKLESS mode
2018-07-23 10:13:50 -05:00
jeromecoutant 2550f3d09e Systimer test : compilation error with MBED_TICKLESS
Issue occurs when "MBED_TICKLESS" is added in mbed_app.json,
not when "MBED_TICKLESS" is added in targets.json
2018-07-19 15:50:16 +02:00
ccli8 49fe946b74 Fix some targets fail to pass ticker overflow test
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.
2018-07-19 10:05:16 +08:00
Cruz Monrreal e9e1ff997d
Merge pull request #7302 from OpenNuvoton/nuvoton_m2351_v1.1
Support Nuvoton's NUMAKER_PFM_M2351 target
2018-07-18 08:49:55 -05:00
Jimmy Brisson e9d56092c4 Remove unused storage api test 2018-07-16 14:12:00 -05:00
David Saada a224ca764a Skip a few tests if not enough memory can be allocated for them. 2018-07-16 17:21:21 +03:00
Cruz Monrreal 56dd4bfb24
Merge pull request #7436 from deepikabhavnani/update_sys
Update stats to fetch Mbed OS version info
2018-07-14 06:29:22 -05:00
Cruz Monrreal def1ef2390
Merge pull request #7494 from mprse/lp_ticker_deep_sleep_delay_fix
tests-mbed_hal-lp_ticker: change implementation of the delay before deep-sleep.
2018-07-13 17:33:55 -05:00
Deepika b05d105493 Update stats to fetch Mbed OS version info 2018-07-13 11:58:49 -05:00
Przemyslaw Stekiel 832e8b3f36 tests-mbed_hal-lp_ticker: change implementation of the delay before deep-sleep.
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.
2018-07-12 13:29:13 +02:00
ccli8 43b98cf405 Fix Greentea test code with Cortex-M23/M33
Enlarge stack size of forked thread for Cortex-M23/M33 targets
2018-07-12 18:01:27 +08:00
Przemyslaw Stekiel b1b4f6e2ad tests-mbed_drivers-lp_timer: change delay method
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).
2018-07-11 11:44:27 +02:00
Cruz Monrreal 93233c4f5d
Merge pull request #7364 from 0xc0170/fix_storage_rtos
Fix storage rtos types - remove including internal header file
2018-07-05 14:29:46 -05:00
Cruz Monrreal a2376f0d3b
Merge pull request #7342 from maciejbocianski/kernel_tick_count_test
Add kernel ticker test
2018-07-05 10:36:58 -05:00
Maciej Bocianski cc6f4c5a66 add kernel ticker test 2018-07-02 13:48:06 +02:00
Martin Kojtal dd332471a8 test: fix os tick linkage
os_tick header file is C only, mangling would cause problems here
2018-06-29 11:43:26 +01:00
Martin Kojtal fcadf0b4f7 tests: fix internal symbols from RTX
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.
2018-06-29 11:43:25 +01:00
Martin Kojtal df821aa483 test: fix thread storage size 2018-06-28 15:12:24 +01:00
ccli8 b18f690b39 Fix Greentea test code
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.
2018-06-26 13:47:24 +08:00
Cruz Monrreal ea47342f81
Merge pull request #7214 from SenRamakri/sen_ErrorOptimAndConfig
Error handling configuration updates and Optimization for exception handling
2018-06-25 10:10:49 -05:00
Cruz Monrreal 1087c0a959
Merge pull request #7283 from juhaylinen/update-greentea-tests
Update Greentea netsocket and wifi tests
2018-06-21 10:05:26 -05:00
ccli8 9416a32636 Enlarge wait time for flushing serial buffer in Greentea test code
Original wait time is not enough for UART to flush out before deepsleep on some targets.
2018-06-21 15:55:14 +08:00
Juha Ylinen 3c32b3ada7 Update Greentea netsocket and wifi tests
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
2018-06-21 09:01:15 +03:00
Senthil Ramakrishnan baa44eb3f2 Limit error filename capture to 64 chars, wrapping tests with right configs and astyle fixes. 2018-06-20 11:56:32 -05:00
Senthil Ramakrishnan cbb12e326d Updates to configuration flags used in error handling implementation.
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.
2018-06-20 11:56:31 -05:00
Cruz Monrreal 7b7dfc634b
Merge pull request #7216 from mikaleppanen/gt_async_dns
Asynchronous DNS greentea tests
2018-06-19 21:47:18 -05:00
Martin Kojtal 19c795c312
Merge pull request #7224 from OpenNuvoton/nuvoton_fix_greentea_deepsleep
Fix Greentea test code with deepsleep
2018-06-19 14:24:09 +02:00
Mika Leppänen ef14f549e4 Asynchronous DNS greentea tests
Added tests for asynchronous DNS.
2018-06-19 11:18:22 +03:00
ccli8 39a6fa9609 Enlarge wait time in Greentea test function test_deepsleep
Original wait time is not enough for UART to flush out before deepsleep on some targets.
2018-06-19 09:23:53 +08:00
Cruz Monrreal f54067d6c2
Merge pull request #7208 from mikaleppanen/add_long_emac_echo_test
Added long echo sequence test to EMAC tests
2018-06-18 10:08:13 -05:00
Cruz Monrreal bfb43799af
Merge pull request #7209 from jarlamsa/udpsocket_echo_packetloss
Tolerate packet loss up to 30% in udp echo tests
2018-06-15 10:20:44 -05:00
Anna Bridge d66dfcb13a
Merge pull request #7036 from maciejbocianski/hal_ticker_feature_merging
tests-mbed_hal-sleep fix
2018-06-15 12:12:31 +01:00
Anna Bridge 245a9aab4b
Merge pull request #7128 from davidsaada/david_lpc_flash_api_fix
Fix flash_program_page API in LPC boards.
2018-06-15 11:15:23 +01:00
Cruz Monrreal 8d88bb0ba5
Merge pull request #7202 from ARMmbed/cmonr-patch-error_handling-test
Corrected casting issue with an assert within the error_handling test
2018-06-14 19:22:38 -05:00
Jarno Lamsa 6bdefd3041 Tolerate packet loss up to 30% in udp echo tests 2018-06-14 10:16:26 +03:00
Cruz Monrreal e93aaabff3
Only exclude RTOS-specifc tests in error_handling
Allows for other tests to run if no RTOS is present.
2018-06-13 10:33:37 -05:00
Cruz Monrreal 5fe241bac9
Wrapped test around MBED_CONF_RTOS_PRESENT
Wrapping a #define to prevent test from being run when no RTOS is present.
2018-06-13 09:28:53 -05:00
Cruz Monrreal 0a528ff558
Merge pull request #6831 from mprse/hal_crc_test
Add HAL CRC test and header file
2018-06-13 08:47:11 -05:00
Cruz Monrreal 6999d25f4d
Merge pull request #6935 from maciejbocianski/ticker_test_fix
ticker test improvement
2018-06-13 08:46:41 -05:00
Mika Leppänen 0334cd1679 Added long echo sequence test to EMAC tests
Test echoes 50000 random length ethernet frames between CTP echo
server and device.
2018-06-13 16:22:41 +03:00
Cruz Monrreal 6fa560930c
Corrected casting issue with an assert within the error_handling test
Discovered via https://github.com/ARMmbed/mbed-os/pull/7105.
If both values are negative values, they are casted in such a way that -1 != -1. This small commit fixes that.
2018-06-12 22:09:51 -05:00
David Saada 9e5efbcfd5 Fix flash_program_page API in LPC boards.
This API allocates a program buffer of 256 on the stack to ensure alignment.
However, FlashIAP driver already ensures this alignment of the user data.
2018-06-12 15:09:05 +03:00
Cruz Monrreal 10b859779d
Merge pull request #7103 from mikaleppanen/test_updat_lpc17xx
Greentea test updated for NXP lpc17xx
2018-06-11 08:55:20 -05:00
Maciej Bocianski 53548e212b fix and enable sleep_usticker_test
Increases tolerance value for sleep_usticker_test to cover extra time needed
for cpu stats computation (for more details see MBED_CPU_STATS_ENABLED).
Prevent scheduling interrupt during ticker initialization (in lp_ticker_init)
while test execution.
2018-06-11 10:07:34 +02:00
Maciej Bocianski 27bf6cff4f ticker test improvement
Make multiticker test more reliable when scheduling very early interrupts.
When very early interrupt is scheduled (e.g now + 2[ticks]) then it's likely
that it won't be fired in some circumstances and as a result there is overdue
event in queue. That overdue event can be mistakenly scheduled again by
`Ticker::detach` (detach calls schedule if head was removed). That's why we
should check interrupts counter immediately after wait period and before detach loop
2018-06-08 15:37:59 +02:00
Przemyslaw Stekiel 511f3703c3 HAL CRC test: Fix out of memory issue on NULCLEO_F070RB, NULCLEO_F072RB/IAR
Allocate test case array on stack since memory limits on some boards.
2018-06-07 15:06:24 +02:00
Juha Ylinen 44ce63e586 Add targets to Greentea EMAC tests
Update test configuration file for WicedInterface
2018-06-07 12:11:38 +03:00
Przemyslaw Stekiel 1eed0b960d Add HAL CRC test and test header file. 2018-06-07 10:17:21 +02:00
Martin Kojtal eddaa8b51b
Merge pull request #6515 from marcemmers/mbed_ticker_api
Only schedule mbed_ticker interrupt if queue->head is changed
2018-06-05 14:14:52 +02:00
Maciej Bocianski fb28c41be1 enable HAL sleep test 2018-06-05 06:56:48 +02:00
Maciej Bocianski 0ed26e58a0 HAL sleep test fix
Prevents ticker upper layer initialization during test execution
2018-06-05 06:56:47 +02:00
Cruz Monrreal 583d77f04d
Merge pull request #7070 from ithinuel/increase_tolerance_for_systick_less_devices
set the tolerance to 5% if NO_SYSTICK is enabled
2018-06-04 10:42:04 -05:00
Mika Leppänen 35f064fc69 Changed TCP socket test to use shared buffers
Changed RX and TX buffers used in TCP socket tests to global variables
to conserve memory.
2018-06-04 13:51:32 +03:00
Mika Leppänen 9095b037aa Updated EMAC test environment for LPCxx boards
Updated EMAC memory manager to use libservice nsdynmemlib
for EMAC memory buffers. Located the nsdynmemlib buffer heap
to DMA safe memory bank on LPCxx boards. Optimized placement of
static variables on EMAC test environment for LPCxx boards to
maximize available memory.
2018-06-04 13:51:16 +03:00
Cruz Monrreal 52cb119571
Merge pull request #7059 from deepikabhavnani/os_verison_fix
OS version not update in mbed_stats
2018-05-31 12:54:52 -05:00
Cruz Monrreal 26b5f9782f
Merge pull request #7005 from kivaisan/loraradio_tests
Lora: Add greentea tests for LoRaRadio API
2018-05-31 10:12:05 -05:00
Wilfried Chauveau 3745c73e91 set the tolerance to 5% if NO_SYSTICK is enabled 2018-05-31 13:05:37 +01:00
deepikabhavnani d764a7c627 OS version is not available in code, need a fix for this in next patch release 2018-05-30 08:57:47 -05:00
Marc Emmers 046cf1dc58 Ticker test: Add ticker_irq_handler call because the time reaching the previous interrupt_timestamp would have triggered one anyway 2018-05-30 11:36:21 +02:00
Veijo Pesonen 3e6bc32df6 Makes UDPSOCKET_SENDTO_INVALID part of the netsocket extended test set 2018-05-30 12:17:53 +03:00
Kimmo Vaisanen 4ba82c0892 Lora: Add greentea tests for LoRaRadio API
This LoRaRadio test set adds basic tests which can be run with a single HW.
2018-05-29 15:00:49 +03:00
Przemyslaw Stekiel 12be24c98c tests-mbed_hal-common_tickers: Fix increment test case implementation
In case when base tick count is different than next tick count check first if the difference is equal to 1 tick (this is what we are looking for) if not then decrease the tick count.

Repeat counting process few times before incrementing the number of cycles in case when base tick count is equal to next tick count.
2018-05-28 12:39:09 +02:00
Martin Kojtal 501a7b6949
Merge pull request #7009 from bulislaw/merge_feature_branches_for_5.9
Bring in improved HAL APIs to master
2018-05-28 12:31:14 +02:00
Bartek Szatkowski 4ae6491fd5 Disable sleep tests as they are unstable 2018-05-27 23:31:20 -05:00
Bartek Szatkowski 817bf0b092 Disable intermittently failing sleep test 2018-05-27 23:31:20 -05:00
Bartek Szatkowski a305d849a8 Rename LOWPOWERTIMER to LPTICKER 2018-05-25 13:06:56 -05:00
Przemyslaw Stekiel 500be1fbac Fix tolerance definition in ticker tests. 2018-05-25 13:04:23 -05:00