Commit graph

1715 commits

Author SHA1 Message Date
Kumar Gala 805d69c288 tests: protection: Fix building on ARC
Added a case for ARC in the test so it builds.  ARC MPU has execute
permision bit so we can enable the NO_EXECUTE_SUPPORT testing.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-15 08:49:53 -05:00
Johan Hedberg 255edcfde2 Bluetooth: Mesh: Provisioning: Add NetKeyIndex to complete callback
It may be useful for the app to know what the initial NetKeyIndex that
it was given during provisioning is.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 70cbcef576 Bluetooth: Mesh: Rename health server code from health to health_srv
This is in anticipation of soon adding health client support, which
could then cause confusion due to the ambiguous API names.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 3b252ca2be Bluetooth: Mesh: Rename configuration server code from cfg to cfg_srv
Now that there's support for configuration client as well, rename cfg
to cfg_srv to avoid any confusion.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 0ef7c6e09a Bluetooth: Mesh: Add more flexible APIs for provisioning bearers
Add the ability to track the provisioning bearer through an extra
parameter to link_open/close. Also introduce new public functions to
enable/disable specific provisioning bearers. This also means that one
now needs to explicitly enable provisioning bearers after calling
bt_mesh_init().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg a81fa43a59 Bluetooth: Mesh: Use proper _t suffix for typedefs
To be consistent with the coding style, use a _t suffix for typedefs.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Andrew Boie 02d6c11f1d tests: mheap_api_concept: test k_calloc()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-11-14 12:50:10 -08:00
Punit Vara 4a9a0e209a tests: context: convert legacy test to ztest
Use ztest apis in legacy test to support ztest
framework.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-11-14 10:02:43 -08:00
Punit Vara eeb4cd24ab tests: work_queue: Convert legacy test to ztest
Make use of ztest apis to support ztest framework.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-11-14 10:02:02 -08:00
Punit Vara 1604a9351f tests: timer_monotonic: Migrate legacy test to ztest
Use ztest macros and apis in legacy test to support ztest
framework.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-11-14 09:50:12 -08:00
Andy Ross a9f0f445ba tests/kernel/pipe: fix uninitialized semaphore
The end_sema k_sem was only initialized on one of the several paths
that used it, leading to some crazy clobber-the-run-queue behavior
that was dependent on linkage order (see the linked bug) when end_sema
and the pipe object were made non-static..

Adding a k_sem_init() call fixes the corrupt issue, but really the
right thing is to use the DEFINE macro, so do that instead.  Note that
that the initializer changes the linkage order too (by putting the
semaphore in a separate segment), so... yeah, it's actually impossible
to prove that this patch in isolation resolves the issue seen without
manual validation.

Issue: https://github.com/zephyrproject-rtos/zephyr/issues/4366

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-11-14 09:47:19 -08:00
Johan Hedberg 588887c9b7 Bluetooth: Mesh: Add primary address to provisioning complete callback
It may be useful for the app to know that the local node's primary
address is.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +02:00
Johan Hedberg 2a1e16c2a3 Bluetooth: Mesh: Add skeleton for Configuration Client Model
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +02:00
Andrzej Puzdrowski 2adbed8d6d tests: subsys: dfu: mcuboot: fix return value not handling issue
Function flash_read was calling without checking return value.
(Coverity CID: 178794)
This patch cover this issue.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-11-14 06:58:54 -05:00
Robert Chou 1d70a39d1b net: samples: replace tag zoap with coap
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-11-14 06:42:57 -05:00
Johan Hedberg e2e74f705b Bluetooth: Mesh: shell: Add basic skeleton
Add a basic shell skeleton for Mesh, containing basic command for
initialization, provisioning and reset.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 11:03:58 +02:00
Punit Vara 85be9db682 tests: fatal: convert legacy test to ztest
Clear checkpatch errors and make use of ztest apis to
support ztest framework.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-11-13 16:35:27 -05:00
Johan Hedberg af512e5498 Bluetooth: tests/shell: Rename Arduino 101 conf file for cmake
The conf file name must be of the form prj_<board>.conf for it to be
automatically chosen for a given board.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-13 15:10:20 +02:00
Johan Hedberg 9bdd8d6b60 Bluetooth: tests: Update tester documentation for cmake
Remove references to make-centric build process, and refer to the
steps in a more neutral way (which is equally applicable to using
either make or ninja as the generator type).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-12 15:05:49 +02:00
Johan Hedberg a30d876a6c Bluetooth: tests: Remove explicit setting of QEMU_EXTRA_FLAGS
The needed options to QEMU_EXTRA_FLAGS now get set from a single
central place, so applications don't need to do it anymore.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-12 15:05:49 +02:00
Johan Hedberg 6249ae7cda Bluetooth: tests/mesh: Update lpn.conf with saner defaults
Use the default values for scan latency and receive delay, and enable
useful logging, like that for LPN.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 22:17:43 +03:00
Johan Hedberg 58b476fb33 Bluetooth: tests/mesh: Remove manual LPN enabling
The default of the stack is now to automatically enable LPN
functionality after a given timeout.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 22:17:43 +03:00
Szymon Janc 1a50ee1fe0 Bluetooth: btp: Add initial commands for Mesh service
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-11-10 14:44:23 +02:00
Sebastian Bøe c7832bd343 cmake: Use -serial bt-server when CONFIG_BT
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Anas Nashif 9b12769479 tests: use cmake to build object benchmarks
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Johan Hedberg 3a0b1b435e tests: bluetooth/mesh: Enable beacon by default
There are some PTS tests, which expect the IUT to send some beacons
after provisioning, so enable the feature by default.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-07 18:59:06 +03:00
Aska Wu a9b2d57664 tests: sockets: Check the value-result argument
The addrlen of accept() and recvfrom() should be updated to the actual
value of source address.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-11-06 20:59:05 +02:00
Johan Hedberg a022e950b5 Revert "tests: mesh: Convert legacy test to use ztest"
This reverts commit b66a6acad7.

The mesh test app is (at least for now) only supposed to be manually
run. It e.g. contains special configurations for feature-specific
testing using the Bluetooth PTS.

The ztest conversion that was done to the app doesn't really make any
sense since nothing of essence is tested by the ztest hooks and
everything that the app intends to be tested need manual action either
way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-06 13:22:24 -05:00
Jukka Rissanen 2486694eb9 net: http: Create HTTP library that uses net-app
Create http library that uses net-app instead of net_context
directly. The old HTTP API is deprecated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Aska Wu 6bbb5f2094 net: tests: Add tests for net pkt address parsing
Add IPv6/TCP, IPv6/UDP, IPv4/TCP, IPv4/UDP address parsing test cases.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-11-06 14:09:46 +02:00
Ramakrishna Pallala a44e88df2a tests: kernel: timer: Fix TC_PRINT format specifiers
Pass Zephyr type format specifiers to TC_PRINT().

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-11-03 10:59:43 -07:00
Punit Vara d8f85d736d tests: static_idt: convert legacy test to ztest
Migrate testcase to ztest and use ztest macros

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-11-03 12:55:56 -04:00
Nirmala Devi 44a3514a33 Uart: Added testcase support for drivers using only poll mode
Signed-off-by: Nirmala Devi <nirmala.devix.m@intel.com>
2017-11-03 10:53:17 -04:00
Punit Vara c2f60ebe56 tests: bitfield: Convert legacy test case to ztest
migrate testcase to ztest and use ztest macros.

Signed-off-by: Punit Vara <punit.vara@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-02 18:32:56 -04:00
Punit Vara e2a974497b tests: mslab: convert legacy test to ztest
This patch removes checkpatch warnings as well as
make use of ztest apis to convert legacy test to ztest.

Signed-off-by: Punit Vara <punit.vara@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-02 18:20:32 -04:00
Punit Vara 658a5a2ddb tests: rpl: convert legacy test in ztest
This patch makes use of ztest apis to make output unified with
other test cases

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-11-02 17:22:59 -04:00
Punit Vara cb81b5ebb4 tests: mem_pool: convert legacy test in ztest
Make legacy test case use of ztest test api to support
test framework

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-11-02 17:18:38 -04:00
Anas Nashif 36bc8d797f tests: add testcase.yaml to multicore power
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-02 15:53:04 -04:00
Adithya Baglody edd072e730 tests: benchmarking: cleanup of the benchmarking code.
The kernel will no longer reference the code written in the
test folder.

GH-1236

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-11-02 09:01:06 -04:00
Aska Wu 34b5ca6122 tests: sockets: Add TCP test cases
- Test ipv4/ipv6 send() and recv().
- Test ipv4/ipv6 sendto() and recvfrom().
- Test ipv4/ipv6 sendto() and recvfrom() with NULL dest address.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-11-01 15:08:39 +02:00
Leandro Pereira da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira 059bd32a26 tests: mcuboot: Check results from flash write/read functions
Coverity-ID: 177215
Coverity-ID: 177216
Coverity-ID: 177217
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-31 18:52:09 -04:00
Leandro Pereira 7929db12bb tests: icmpv6: Assert that net_pkt and net_buf could be allocated
Coverity-ID: 177215

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-31 18:52:09 -04:00
Leandro Pereira 972992c524 tests: dns_resolve: Fix NULL pointer derefence if iface is NULL
Coverity-ID: 173653

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-31 18:52:09 -04:00
Anas Nashif 1efce2b3cc tests: removed stray bitfield.c file
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Anas Nashif 0ef69a3361 tests: minor cleanup for fp_sharing test
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Anas Nashif a7b45d0bfc tests: gen_inc_file: fix include syntax
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Punit Vara aeb6a7e323 tests: 6lo: convert legacy test to ztest with cleanup
Test uses ztest and coding cleanup errors along with
warnings are removed through this patch

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-10-31 09:49:20 +02:00
Anas Nashif 780324b8ed cleanup: rename fiber/task -> thread
We still have many places talking about tasks and threads, replace those
with thread terminology.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-30 18:41:15 -04:00
Andrew Boie 4c305a51e9 tests: schedule_api: slightly increase stack size
Two tests were on the knife-edge of their current stack limit and
were overflowing when UART system calls were added and userspace
enabled.

Test case stack sizes are often pulled out of thin air, the current
value of 256 was just a guess.

Kick these stacks up to 384; verified with sanitycheck --all that
this doesn't break anything.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Jukka Rissanen 0e7c8edc92 net: context: Make sure we honor timeout when waiting data
The call to net_context_recv() with timeout returned -ETIMEDOUT
even when data was returned properly and there was no timeout.

Fixes #4565

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-30 17:18:11 +02:00
Aska Wu 939aad913f tests: sockets: Make udp test cases self-contained
Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-10-30 14:53:13 +02:00
Punit Vara 68e00378d0 tests: trickle: convert legacy test to ztest
This patch makes legacy test to use ztest APIs.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-10-30 11:11:34 +02:00
Vikram Singh Shekhawat cbbec3db70 tests: entropy: Add Entropy driver test case
This test runs with ztest suite. It will verify get_entropy
operation of entropy driver.

Signed-off-by: Vikram Singh Shekhawat <vikramx.shekhawat@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-28 23:06:51 -04:00
Tomasz Bursztyka 1b77ee12ea samples/net: Reducing prj*.conf files by relevantly removing 6Lo option
If NET_L2_IEEE802154 and NET_IPV6 are enabled:
- NET_6LO is enabled
- NET_L2_IEEE802154_FRAGMENT is enabled

Thus removing setting this config options to yes where applicable.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-28 14:28:02 -04:00
Punit Vara 273c0fdcfb tests: ztest: Add formatting in assert APIs
All ztest_* apis now support format specifier which will
evetually help to pass variable arguments to ztest assert
apis in different test cases while showing error messages.

Signed-off-by: Punit Vara <punit.vara@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-28 13:09:33 -04:00
Sebastian Bøe b7eaeb9f0a cleanup: Use quote include instead of system include
When the header file is located in the same directory as the source
file it is better to use a relative quote-include, e.g.

than a system include like

Avoiding the use of system includes in these cases is beneficial
because;

* The source code will be easier to build because there will be fewer
system include paths.

* It is easier for a user to determine where a quote-include header
  file is located than where a system include is located.

* You are less likely to encounter aliasing issues if the list of
  system include paths is minimized.

Authors:
Anas Nashif
Sebastian Bøe

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-28 07:11:53 -04:00
Punit Vara 9544b7eca4 tests: context: Make legacy test to use ztest API
Use ztest APIs in test case to make output unified with other test
cases.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-10-26 14:51:00 +03:00
Punit Vara a29f67beed tests: route: Convert legacy test to use ztest framework
This patch makes use of ztest apis to make output unified with other
test cases.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-10-26 12:55:22 +02:00
Paul Sokolovsky cdfdac394a tests: net: tcp: Update for clean up in seqno handling
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-25 14:19:04 +03:00
Robert Chou 7aa223174a net: coap: empty payload with payload marker is malformed
From RFC 7252, section 3
"The absence of the Payload Marker denotes a zero-length payload.
The presence of a marker followed by a zero-length payload MUST
be processed as a message format error."

Check empty payload when COAP_MARKER is found and add a test case to
cover it

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-25 13:21:53 +03:00
Ravi kumar Veeramally a3a1772218 net: tests: Add more CoAP test cases
More test cases related to malformed packets (invalid options).

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-25 10:54:25 +03:00
Jukka Rissanen 964f399813 tests: net: coap: Use proper array for payload
The payload variable was one byte long but we read 32 bytes
from it.

Coverity-CID: 178064
Fixes #4397

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-24 11:31:16 +03:00
Adithya Baglody 990809799b tests: protection: Enable the complete test suit for qemu_x86.
Using the PAE page tables it is possible to disable code execution
form RAM.

JIRA:ZEP-2511

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-10-23 10:13:07 -07:00
Ravi kumar Veeramally ca642fbf62 net: tests: Add more testcases to 6lo tests
Add more testcases of SAC 1 and SAM 00 combinations to 6lo tests.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-20 10:33:28 +03:00
Andrew Boie 967ee03271 tests: thread_init: run in user mode
main.c and test_thread_init.c merged.

All tests which don't require cooperative priorities now running in
user mode.

Userspace tag added to testcase.yaml.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Andrew Boie c725e64b64 tests: lifecycle_api: run in user mode
Some unnecessary k_thread_abort() removed.

userspace tag added to testcase.yaml.

Suspend/resume, spawn_forever, and spawn_priority tests remain in
supervisor mode due to the priority requests they make.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Andrew Boie a9557ef219 tests: custom_data: run in user mode
main.c and test_customdata_api.c merged.

Preemptive priority case now run in user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Andrew Boie 60e6632e65 tests: stack_api: run in user mode when possible
All non ISR tests now run in user mode.

userspace added to testcase.yaml tag list.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Andrew Boie bcd3803180 tests: msgq: run in user mode when possible
Unnecessary k_thread_abort() removed from test_msgq_purge_when_put.

A single global msgq object is now shared instead of being declared
on thread stacks, except for an ISR test case which has had its
semaphore renamed.

Moved k_sem_init() call from msgq_thread() to test_msgq_thread()
to fix a race condition.

userspace tag added to testcase.yaml.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Andrew Boie bf7d53395e tests: semaphore: run some threads in user mode
main.c and test_sema_contexts.c merged

userspace tag added to testcase.yaml

stack-allocated semaphore in test_sema_thread2thread now just uses
the global semaphore with the same name.

ISR tests run in supervisor mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Andrew Boie 39d55ac6a9 tests: alert_api: run in user mode
main.c and test_alert_contexts.c merged.

User threads can't look inside the alert structures, so an extra
variable 'htype' introduced to track expectations for any given
alert object in alert_recv().

Alert objects have to be initialized by supervisor threads since
they register callbacks. An array of toplevel alert objects created
and initialized in test_main(), replacing the ones that used to
live on thread stacks.

Added userspace tag to testcase.yaml

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Andrew Boie 776a084216 tests: mutex: run in user mode
Main thread grants itself access to objects it or its children need
and does the rest of the test case in user mode.

Statically defined threads now all run in user mode, with permissions
granted via K_THREAD_ACCESS_GRANT().

Added userspace tag to testcase.yaml.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Andrew Boie 610f5d1ce7 tests: obj_validation: add to userspace tests
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-19 15:07:45 -07:00
Tomasz Bursztyka 81b9c8fcf6 net/utils: Make net_hexdump_frags being able to print ll reserve
If requested only and with colors with right SYS_LOG Kconfig options.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-19 05:33:23 -04:00
Luiz Augusto von Dentz 15c115bc61 tests: fifo: Add prj_poll.conf
This enables testing k_fifo test with CONFIG_POLL=y.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-10-18 13:02:52 -04:00
Kumar Gala 3316b78268 tests: net: lib: dns_resolve: bump min memory to over 20k
We are failing on all systems with 20k of memory so bump up the limit
needed to build this test.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-18 09:47:19 -05:00
David B. Kinder 4600c37ff1 doc: Fix misspellings in header/doxygen comments
Occasional scan for misspellings missed during PR reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 19:40:29 -04:00
Mariusz Skamra f1753ae0f3 Bluetooth: tester: Add Attribute Value Changed event implementation
This adds implementation of previously introduced BTP event.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-10-17 21:28:14 +03:00
Mariusz Skamra 204c468d16 Bluetooth: btp: Add new event to indicate GATT attribute value change
Attribute Value Changed Event will be used to indicate characteristic
or descriptor value change in local GATT Server database.
Event will be triggered when PTS performed ATT Write operation
successfully.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-10-17 21:28:14 +03:00
Jukka Rissanen faeab7f2bf tests: net: app: Simple testcases for net-app testing
These are simple tests for net-app testing. These do not try to
actually send anything to net but test mainly net-app setup and
close functionality.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-17 14:07:14 -04:00
Andrew Boie c5c104f91e kernel: fix k_thread_stack_t definition
Currently this is defined as a k_thread_stack_t pointer.
However this isn't correct, stacks are defined as arrays. Extern
references to k_thread_stack_t doesn't work properly as the compiler
treats it as a pointer to the stack array and not the array itself.

Declaring as an unsized array of k_thread_stack_t doesn't work
well either. The least amount of confusion is to leave out the
pointer/array status completely, use pointers for function prototypes,
and define K_THREAD_STACK_EXTERN() to properly create an extern
reference.

The definitions for all functions and struct that use
k_thread_stack_t need to be updated, but code that uses them should
be unchanged.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-17 08:24:29 -07:00
Mariusz Skamra 4d831a7bdd Bluetooth: tester: Fix include service attribute user data
GATT Server:
According to the API, include service declaration user data
points to the first service attribute to include.

bt_gatt_include structure is valid only for client role.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-10-17 17:30:50 +03:00
Anas Nashif 5c24704e1c tests: nffs: cleanup configs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Anas Nashif d411eca92f tests: Bluetooth: simplify BT init test
Use common keys and simplify. Remove stray tmp file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Anas Nashif 40acd7e153 tests: timer: remove obsolete CONFIG_NANO_TIMEOUTS
Cleanup testcase as well.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Anas Nashif 7076613b22 tests: errno: using new extra_configs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Anas Nashif 4bc6e27fda tests: aio: use depends on
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Anas Nashif 116aadf936 tests: adc_simple: use depends_on for testcase
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Anas Nashif 0b5c0498a5 tests: adc_api: use new testcase scheme and cleanup
Remove the many .conf files and use extra_configs instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Andrew Boie a2b40ecfaf userspace handlers: finer control of init state
We also need macros to assert that an object must be in an
uninitialized state. This will be used for validating thread
and stack objects to k_thread_create(), which must not be already
in use.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-16 19:02:00 -07:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Andrew Boie 3bfc80bc95 x86: disable the MMU on 'reg' and 'min' footprint
A space-constrained device wouldn't enable this feature.
Fixes build errors since these tests constrain the size of
the IDT.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-13 12:56:14 -07:00
Andrew Boie b2bce21572 ztest: add user thread support
We add macros to define test cases that should be run with the CPU
in user mode, if the CPU supports it.

ztest_test_suite() declarations are now static as they can't go on
the main thread stack; the data gets shared between multiple threads.
It's better here anyway as a large test suite could fill up the main
stack, which is by default reduced to 512 bytes.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-13 12:17:13 -07:00
Tomasz Bursztyka ea0aee2bb3 drivers/ieee802154: Stop exposing old radio API functions
set_ieee_addr, set_short_addr and set_pan_id are now unused by L2, so
removing their exposure through the radio API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Tomasz Bursztyka b2726e14a6 drivers/ieee802154: Implement get_capabilities in existing drivers
Further support will need work per-driver basis, as soon as the L2 will
be able to make usage of such support.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Andrew Boie e5b5407ece tests: obj_validation: cleanup
Improved test coverage to reflect current policy and converted to
ztest.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-12 16:26:28 -05:00
Andrew Boie 7e3d3d782f kernel: userspace.c code cleanup
- Dumping error messages split from _k_object_validate(), to avoid spam
  in test cases that are expected to have failure result.

- _k_object_find() prototype moved to syscall_handler.h

- Clean up k_object_access() implementation to avoid double object
  lookup and use single validation function

- Added comments, minor whitespace changes

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-12 16:26:28 -05:00
Andrew Boie cee72411e4 userspace: move _k_object_validate() definition
This API only gets used inside system call handlers and a specific test
case dedicated to it. Move definition to the private kernel header along
with the rest of the defines for system call handlers.

A non-userspace inline variant of this function is unnecessary and has
been deleted.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-11 17:54:47 -07:00
Andrew Boie 22118bf772 tests: obj_validation: only run if HW supported
The test should only run on platforms where CONFIG_USERSPACE
dependencies are met.

Remove the whitelist, the filter will capture the right platforms.

Fixes: #4050

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-11 09:50:05 -07:00
Kumar Gala 0bfd810d13 i2c: deprecate use of union dev_config
There are several issues with the dev_config union used as a
convenience when calling the i2c_configure api.  One, the union is well
name spaced protected and doesn't convey use with just i2c.  Second
there are assumptions of how the bits might get packed by the union
which can't be guaranteed.  Since the API takes a u32_t lets change in
tree uses to using the macros to setup a u32_t and make the union as
deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-11 10:45:12 -04:00
Anas Nashif 15fdd5e072 ztest: add missing includes
ztest unit tests run on the host system, so provide those empty files to
make it build host tests. Those files are auto-generated and not
available when building unit tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-11 09:21:05 -05:00
Piotr Mienkowski c4688ea58c tests: tickless: Add support for Atmel SAM family
This patch updates tickless testcase replacing existing support
for Atmel SAM3X with support for the whole Atmel SAM family.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-10-10 10:50:55 -04:00
Tomasz Bursztyka dedecdaed8 tests/net: Add a test for net_mgmt_event_notify_with_info()
As previous test without info, this one will be thrown with/without
receiver 1 and 2 times.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-09 10:53:17 +03:00
Tomasz Bursztyka c3a7b4342d tests/net: Fixing parameters alignment in mgmt test
Commit be8a106cb3 messed up the alignment. Removing also the useless
comments.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-09 10:53:17 +03:00
Tomasz Bursztyka 8e25695937 net/mgmt: Make event notifiers able to pass info to listeners
Adding net_mgmt_event_notify_with_info() which lets the event notifier
to pass dedicated data along with the event. The size of data that can
be passed must be limited to the biggest data passed (which will be
currently IPv6 + prefix).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-09 10:53:17 +03:00
Ravi kumar Veeramally 86fe6a3bd6 net: tests: Update CoAP tests to use new API
ZoAP tests are modified to use new CoAP API. Also modified tests
name from 'zoap' to 'coap'.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Maureen Helm d5894a17d0 tests: adc: Remove custom hexiwear_k64 configuration
Instead of having a board-specific config for this adc test, enable the
required battery-sense circuit by default at the board level when the
adc driver is enabled.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-05 17:54:00 -04:00
Anas Nashif 6c8d01e6bb tests: nffs: fix include
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif a2a9622225 tests: add fs tag to filesystem tests
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 08:43:50 -04:00
Anas Nashif c6a8014e1c subsys: fs: consolidate elm FAT kconfig options
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 08:43:50 -04:00
Anas Nashif 3580ba539e subsys: fs: consolidate nffs kconfig options
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 08:43:50 -04:00
Aska Wu 7c60eadd58 tests: sockets: Add tests of sendto() and recvfrom()
- Add test cases of ipv4/ipv6 sendto() and recvfrom()
- Set the main stack size to 2048 to enable both ipv4 and ipv6 on
  qemu_x86.
- Use net app for network setup.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-10-03 14:40:05 +03:00
Savinay Dharmappa b4fc0738a4 tests: driver: adc: change the sampling delay
patch fix the issue of unable to read from adc by setting
appropriate sampling delay.

The sampling delay should be set to resolution of adc + 2.
In adc qmsi driver the sampling delay received form application
is subtracted from resolution of adc + 2 , if the resultant value
is less than zero then zero is set as sampling delay. So in the
adc_simple application when 12 is passed as sampling delay driver
sets it as zero. So 26 is the minimum sampling delay should be
set in application for a adc with resolution of 12. The reason
to choose 30 was to maintain same value of sampling
delay between adc_simple and adc_api application.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-09-30 13:40:59 -04:00
Jukka Rissanen 80bfd25a6c tests: net: Add IPv4 multicast address tests
These tests test the IPv4 multicast address add, lookup and
removal functions found for network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-29 11:34:06 +03:00
Johan Hedberg d712a4e1a3 Bluetooth: Mesh: Remove local network interface Kconfig option
From section 3.4.5.3 in the Mesh Profile Specification 1.0:

    "A node shall implement a Local Network Interface."

Removing the Kconfig option also helps clean up quite a lot of code.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-27 16:33:06 +03:00
Andrew Boie b60867fb32 tests: add CONFIG_APPLICATION_MEMORY test
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-25 19:22:02 -07:00
Andrew Boie 2450ce4867 tests: consolidate memory protection tests
All moved under tests/kernel/mem_protect to reduce clutter. Many more
tests are coming for 1.10 and 1.11.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-24 13:32:21 -04:00
Grzegorz Kolodziejczyk 4e916f40f7 tests: nffs_fs_api: Add performance test for nffs
This adds performance test for nffs with open, close, read, write and
unlink sub test cases.

Origin: Original

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2017-09-22 06:54:48 -04:00
Grzegorz Kolodziejczyk cb69933208 tests: nffs_fs_api: Add ported NFFS test suite
This patch adds NFFS test suite ported from Mynewt. The test cases are
pretty much the same as in original implementation, however some of
them had to be adjusted to cover differences in Mynewt and Zephyr
filesystem APIs. Also the code was reformatted in some places to make
checkpatch happy.

All test cases from "basic" group can be also run on nRF52840 (nRF52 and
nRF51 do not have enough RAM to run all tests as-is).

Origin: Apache Mynewt NFFS
URL: https://github.com/apache/mynewt-nffs/tree/master
Commit: 6639f7a432e70db00ef25d5e558aedbe503a3c9a
Purpose: NFFS test suite
Maintained-by: Zephyr

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2017-09-22 06:54:48 -04:00
Youvedeep Singh ca5e408aa1 tests: benchmark: Configure External timer to 32 bit mode for nrf SOCs
nrf SOCs use external timer for measuring benchmarking stats.
Earlier this timer is programmed in 24 bit mode, due to which
is is getting expired in some of benchmark stats like mutex
lock/unlock. So configuring to 32 bit mode to avoid overflow.

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-09-20 22:23:30 -04:00
Youvedeep Singh 42add9b65c tests: benchmark: Fixing some of missing KPIs stats for ARM based SOC
Some of benchmark stats were not reported for nrf52/52 based SOCs.
This was because nrf based SOCs use external timer.
In timing info some of benchmark stats still use systick based APIs.
Due to which benchmarking number was not getting reported. So change
it to timer based for nrf.

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-09-20 22:23:30 -04:00
Jukka Rissanen 43aa12fe25 net: dns: Do not resolve IPv6 address if IPv6 is disabled
If IPv6 is disabled, then it is useless to try to resolve
IPv6 address because "struct sockaddr" does not have enough
space to store IPv6 address.

Fixes #1487

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-20 08:55:06 +03:00
Jukka Rissanen 7830e60252 tests: Add testing for embedding a hex file
Add a simple test which generates a file that can be included
into a .c file. Then verify in zephyr that the file contains
the same bytes as the original file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-18 14:56:16 -04:00
Punit Vara b66a6acad7 tests: mesh: Convert legacy test to use ztest
This test case makes this test case use ztest apis and
adds CONFIG_ZTEST in all configuration

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-13 09:48:34 -04:00
Punit Vara 7ce27c6b49 tests: bluetooth: Use ztest apis
This patch converts legacy test case to use ztest apis.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-13 09:48:34 -04:00
Punit Vara c4c5eabc61 tests: init: use ztest APIs
This patch converts legacy test case to use ztest apis.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-13 09:48:34 -04:00
Jukka Rissanen 91b6964de1 tests: net: ipv6: Make sure test case compiles and runs
Fixing regression, address family is now called sa_family.

The testcase.yaml file was missing so no tests were actually run.

After making test to run, it was also failing because link address
was accessed before first fragment was set. This caused null pointer
access.

Fixes #1474

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-13 09:07:49 -04:00
Andrew Boie 6781e9908d tests: schedule_api: add extra stack size
Fixes a stack overflow on Xtensa.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-12 22:31:18 -04:00
Jukka Rissanen e71a31e22f net: Wrong networking defines used in the code
There were bunch of config options in tests/net, net-shell and
wpan_serial sample, and those options had wrong name so they
were ignored by the code.

Fixes #1428

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-12 08:37:53 -04:00
Anas Nashif 6fa67585e2 cleanup: remove obsolete nano_work.h
Empty file that is a left-over from the migration to unified kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 19:24:12 -04:00
Anas Nashif 46f66f4295 kconfig: generalised stack protection options
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 09:42:35 -07:00
Anas Nashif b1991eba94 cleanup: remove the whitespaces before the # character
Indenting preprocessor directives reduces the code readability, because
it make preprocessor directives harder to spot.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 12:41:07 -04:00
Andrzej Puzdrowski 8e4e3e682f tests: subsys: Add tests for new DFU modules
Added tests for the mcuboot interface module and the image
storage module.
Both tests are checking flash content produced by modules verified.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-09-11 11:37:43 -04:00
Punit Vara de3f3a9bd4 tests: xip: Remove unnecessary prints
Remove unnecessary prints and update function name

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-11 09:53:14 -04:00
Punit Vara e04f8276ad tests: irq_offload: Use SYS_LOG_INF instead of TC_PRINT
Do not print messages by default on console for test cases.
Use SYS_LOG_INF which provides functionality to choose print whenever
require.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-11 09:53:14 -04:00
Punit Vara 425262aaf2 tests: ztest: add system logging header file
This patch eliminates need to add logging/sys_log.h in test
cases which required to use this header file.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-11 09:53:14 -04:00
Ricardo Salveti 9b453e0298 tests: kernel: threads: add specific test tags
Extend test tags to make it easier to filter threads related tests.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-09-10 10:02:18 -04:00
Nirmala Devi 8189330ca9 tests/object_footprint: fix path to Kconfig specification
This was failing to set the proper path to KBUILD_KCONFIG
and hence correcting it.

Signed-off-by: Nirmala Devi <nirmala.devix.m@intel.com>
2017-09-10 10:01:08 -04:00
Andrew Boie 7d627c5971 k_thread_create(): allow K_FOREVER delay
It's now possible to instantiate a thread object, but delay its
execution indefinitely. This was already supported with K_THREAD_DEFINE.

A new API, k_thread_start(), now exists to start threads that are in
this state.

The intended use-case is to initialize a thread with K_USER, then grant
it various access permissions, and only then start it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-07 16:35:04 -07:00
Andrew Boie d76f0a9644 tests: add object validation test case
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-07 16:33:33 -07:00
Andrew Boie d182d0c298 tests: gen_isr_table: don't set compiler opt
Instead, just set -O0 for the particular function which needs it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-07 16:33:33 -07:00
Andrew Boie 6acd75b2b8 tests: gen_isr_table: set default BOARD properly
This test doesn't work on x86, which doesn't use gen_isr_tables.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-07 16:33:33 -07:00
Andrew Boie a0fd10facf arm_irq_vector_table: don't change optimization
This is unnecessary.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-07 16:33:33 -07:00
Ruslan Mstoi 47f4af4310 Bluetooth: tester: Fix bt-stack-tester to unix domain socket
/tmp/bt-stack-tester is not a pipe, but unix domain socket.
This commit fixes respective "make run" errors:

qemu-system-arm: -serial pipe:/tmp/bt-stack-tester: Could
not open '/tmp/bt-stack-tester': No such device or address

qemu-system-arm: -serial pipe:/tmp/bt-stack-tester: could
not connect serial device to character backend
'pipe:/tmp/bt-stack-tester

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2017-09-07 05:53:01 -05:00
Leandro Pereira fa5f231e4d tests: lib: json: Enable test case
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-09-07 05:49:17 -05:00
Andy Ross 637087cc56 tests/kernel/mem_pool/mem_pool_api: Fix stack sizes
The (artificially small) ISR stack was overflowing on this test when
CONFIG_DEBUG was enabled on qemu_x86.  Really there's no reason to be
restricting stack size at all in a memory pool test, just remove those
settings and use the defaults, which are fine.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-09-06 17:17:15 -07:00
Jukka Rissanen bd425e6857 net: dns: Do not resolve numeric IP address
If the query name is already in numeric format, there is no
need to send the query string to DNS server as we can just
convert it ourselves.

Jira: ZEP-2562

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-31 14:33:59 -04:00
Jukka Rissanen 0bde2df491 net: tests: Add tests for IP address parsing
Add IPv4 and IPv6 address parsing tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-31 14:33:59 -04:00
Youvedeep Singh 91063a33a4 tests: benchmark: timing_info: Add support for nrf series processors
nrf SOC uses nrf rtc timer (not sys tick), which is 32kHz,
whereas CPU runs at higher speed (nrf52 runs at 64MHz).
So 32Khz is too slow to measure critical kernel parameters.

This patch does :-
1. Add support for nrf SOC for timing_info benchmarking.
2. Uses SOC timer to measure kernel parameters.

Jira: ZEP-2314

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-08-31 14:25:31 -04:00
Youvedeep Singh 76b577e180 tests: benchmark: timing_info: Change API/variable Name.
The API/Variable names in timing_info looks very speicific to
platform (like systick etc), whereas these variabled are used
across platforms (nrf/arm/quark).
So this patch :-
1. changing API/Variable names to generic one.
2. Creating some of Macros whose implimentation is platform
depenent.

Jira: ZEP-2314

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-08-31 14:25:31 -04:00
Tomasz Bursztyka 3e2e1c3e09 tests/ieee802154: Fix a coverity warning
Jira: ZEP-2539
Coverity-CID: 173636

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-31 08:56:05 -04:00
Savinay Dharmappa 3c9fb93dc5 tests: bluetooth: tester: Make UART usage consistent
We use UART1 for UART pipe in a number of qemu tests, so lets do the
same thing for the bluetooth test and move the bluetooth uart to UART2.

Jira: ZEP-2412.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-08-30 10:07:07 -05:00
Carles Cufi b7a5fab4cf Bluetooth: controller: Add Read Static Addresses VS command
Implement the first Vendor-Specific Command of the Zephyr specification
other than the 3 mandatory ones already present in the codebase, along
with a Kconfig option to enable and disable the presence of the VS
commands.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-08-30 08:18:42 -04:00
Luiz Augusto von Dentz d229ec07ad Bluetooth: tester: Fix using invalid elements with k_fifo
The documentation of k_fifo_put mentions that the items must have 32
bits reserved for kernel use as that is where the sys_snode_t pointer
is placed but this detail was not taken into consideration when
designing the cmd_queue which access each element as a btp_cmd.

Note: This probably used to work just because k_fifo_get used to place
data directly into thread's swap_data so the kernel never really touched
the list but with the changes to use k_poll the list is always updated
exposing this issue.

Jira: ZEP-2568

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-30 08:16:16 -04:00
Anas Nashif de8b88bb0b license: fix license identifiers
Also add copyright headers and license tags where missing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-29 07:42:09 -04:00
Inaky Perez-Gonzalez a132b2ac41 tests/object_footprint: fix build error due to bad Kconfig specification
This was failing to build when the PWD was not that of the
tests/benchmarks/object_footprint because it was asking to load
$(PWD)/Kconfig.

Kconfig shall be specified with no directory location, as the file
will be imported relative to to Zephyr app's directory.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-08-28 18:29:56 -04:00
Jukka Rissanen e0dd4ff74a tests: net: mld: Ignore already joined error when sending report
The verify_send_report() failed in quark_se_c1000_devboard because
the multicast group was already joined. We can safely ignore this
error for this specific test.

Fixes #1240

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-25 22:15:33 -04:00
Luiz Augusto von Dentz 26cd8cefd1 Bluetooth: shell: Enable CONFIG_BT_SHELL for arduino_101
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-25 15:32:38 -04:00
Luiz Augusto von Dentz 251a8a8c28 test: queue: Add test for multiple threads using k_queue_get
This tests the situation when there are multiple threads calling
k_queue_get which was causing issues when using k_poll.

Jira: ZEP-2553

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-25 09:00:46 -04:00
Luiz Augusto von Dentz 7d01c5ecb7 poll: Enable multiple threads to use k_poll in the same object
This is necessary in order for k_queue_get to work properly since that
is used with buffer pools which might be used by multiple threads asking
for buffers.

Jira: ZEP-2553

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-25 09:00:46 -04:00
Anas Nashif b8e2ed02b0 tests: kernel: mutex: minor rework
Rename task -> thread and use main as the entry thread saving 512
bytes of RAM.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-24 14:49:24 -04:00
Anas Nashif 5a938df11b tests: mslab: use main thread
Fix legacy naming and function names to be tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-24 09:29:14 -07:00
Anas Nashif 704f879f8a tests: ztest: call test_main() without arguments
Arguments are not needed and in some cases are being set as unused in
the same function. The test_main function is called from ztest main
routine without any arguments.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-24 09:29:14 -07:00
Anas Nashif a2affd75d2 tests: benchmarks: use main thread for benchmark
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-24 09:29:14 -07:00
Kumar Gala 9075e1e368 tests: crypto: mbedtls: set a code size constraint
We have a few systems with small amounts of flash that this test can't
fit into.  For now I set the limit right above 32k, however that might
need to get bumped up if we have any systems with flash sizes between
32k and 64k.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-08-24 10:26:33 -04:00
Leandro Pereira aa0e931ecc tests: gpio: Add support for ESP32
Adds an #elif for ESP32 boards.  Connect a wire from pin IO2 to pin IO4
so that the test can be executed.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-23 10:28:59 -04:00
Anas Nashif 67c83d8033 tests: footprint: add testcase.yaml to object tests
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-22 16:37:30 -04:00
Andrew Boie 176e48745e object_footprint: don't adjust IDT size
The size of the interrupt descriptor table is not really
relevant to this test.

If any driver enabled for the target board gets enabled and
has a priority level outside the IDT range, gen_idt.py is properly
reporting an error. The old C-based gen_idt seems to have allowed
this to slide by.

Issue: ZEP-2496
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-22 16:37:30 -04:00
Vinayak Kariappa Chettimada 6a39ed084f Bluetooth: controller: Add Minimum Number of Used Channels Proc
Add implementation to support Bluetooth 5.0 Minimum Number
of Used Channels Procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-08-21 08:41:56 -04:00
Leandro Pereira dd740c164b tests: crypto: Do not use unitialized variable
The `z` vector was not initialized in the call to
uECC_vli_nativeToBytes(), resulting in undefined behavior.  Use the
properly initialized `exp_z` array instead.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-19 07:48:07 -04:00
Paul Sokolovsky dcb80f7ab8 net: struct sockaddr should have field "sa_family"
POSIX requires struct sockaddr's field to be named "sa_family"
(not just "family"):
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html

This change allows to port POSIX apps easier (including writing
portable apps using BSD Sockets compatible API).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-18 16:34:51 -04:00
Tomasz Bursztyka 9034d73f1d tests/dns_resolve: Fix possible NULL dereference
Coverity-CID: 173653

Jira: ZEP-2531

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 14:10:01 -04:00
Tomasz Bursztyka 8e77ef5493 tests/zoap: Fix possible NULL pointer dereference
Coverity-CID: 173648

Jira: ZEP-2535

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 14:10:01 -04:00
Punit Vara f381b421f0 tests: ztest: remove confusing tc_start() in ztest framework
This patch removes "tc_start()" string with "starting test" and
arranges PRINT_LINE appropriatly.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-08-16 21:29:00 -04:00
David B. Kinder 81f7c82625 doc: fix misspellings and missing EOF newlines
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-08-16 17:38:41 -05:00
Andrew Boie 5996bca13b schedule_api: fix stack overflow on xt-sim
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-16 10:59:10 -07:00
Andrew Boie 222f37ded9 tests: schedule_api: fix variable shadowing
The array of k_thread "t" was declared non-static in 2 different
C files. Make them static.

Semaphores only used in local C file now declared static.

Use of variable 't' in thread_tslice() no longer shadows global
definition.

Fixes build errors with XCC compiler.

Increase RAM requirement to 20K.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-16 10:59:10 -07:00
Andy Ross 40e669e798 tests/kernel: Add pthread API test
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-08-15 19:42:07 -04:00
Carles Cufi fc965e5554 Bluetooth: controller: Split Ext Scan Filter Policies out
Since Extended Scanner Filter Policies is an independent feature from
Controller-based Privacy, split it out so it can be built independently
and included without it.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-08-15 22:55:15 +03:00
Gil Pitney 4f67a6c76d cc3200: Remove TI cc3200 SOC and LaunchXL board support
Per ZEP-1958, Phase 2 of adding CC3220sf LaunchXL support,
was to "deprecate the CC3200 launchxl support in Zephyr
(redundant to the CC3220)."

Effectively, the CC3220 SOC replaces the CC3200.

This patch removes the following:
* the imported CC3200 SDK
* CC3200 SOC, board, DTS files.
* adjusts other files where cc3200 was mentioned.

Also, it fixes explicit references to CC3200 in generic
CC32xx driver files.

Jira: ZEP-1958

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-08-15 11:02:48 -05:00
Luiz Augusto von Dentz 4c6007756c tests: work_q: Add test for k_delayed_work_cancel
This adds a test that attempts to submit a work with 0 timeout thus
causing it to immediatelly be submitted to the queue so it is pending
execution which is then cancelled with k_delayed_work_cancel.

Note this can only be done with coop threads with the same or higher
priority otherwise the work_q thread is wakeup before
k_delayed_work_cancel takes place, thus why test_delayed_cancel uses
K_HIGHEST_THREAD_PRIO.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-15 08:49:09 -04:00
Luiz Augusto von Dentz c1fa82b3c6 work_q: Make k_delayed_work_cancel cancel work already pending
This has been a limitation caused by k_fifo which could only remove
items from the beggining, but with the change to use k_queue in
k_work_q it is now possible to remove items from any position with
use of k_queue_remove.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-15 08:49:09 -04:00
Luiz Augusto von Dentz 84db641de6 queue: Use k_poll if enabled
This makes use of POLL_EVENT in case k_poll is enabled which is
preferable over wait_q as that allows objects to be removed for the
data_q at any time.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-15 08:49:09 -04:00
Luiz Augusto von Dentz 42d9aa785d tests: queue: Add tests for k_queue_remove
Add another list of elements which is removed before k_queue_get is
called.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-15 08:49:09 -04:00
Anas Nashif 2de59023dc tests: update min ram requirements and filters
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-14 13:28:42 -04:00
Anas Nashif e0e559001f tests: kernel: reduce thread stack size for pend
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-14 13:28:42 -04:00
Anas Nashif 4c7233b84d tests: json: reduce ztest stack size
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-14 13:28:42 -04:00
Anas Nashif 41febf2e7a tests: benchmarks: reduce message size
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-14 13:28:42 -04:00
Carles Cufi d5c13a7530 Bluetooth: controller: Rename Kconfig prefix
Rename the BT_CONTROLLER prefix used in all of the Kconfig variables
related to the Bluetooth controller to BT_CTLR.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-08-14 15:44:56 +03:00
Kumar Gala f319660ce5 tests: json: only build if newlib isn't configured
Right now we have various type conflicts between the json library and
newlib.  Until these are resolved only build the json test if newlib
isn't enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-08-13 09:06:10 -04:00
Michał Kruszewski 178191ce68 test: spi: Define asynchronous stack with K_THREAD_STACK_DEFINE.
Previous stack definition caused following warning: passing argument 2
of 'k_thread_create' from incompatible pointer type.

Signed-off-by: Michał Kruszewski <michal.kruszewski@nordicsemi.no>
2017-08-10 13:55:17 -04:00
Wayne Ren f8d061faf7 arch: arc: add nested interrupt support
* add nested interrupt support for interrupts
   + use a varibale exc_nest_count to trace nest interrupt and exception
   + regular interrupts can be nested by regular interrupts and fast
interrupts
   + fast interrupt's priority is the highest, cannot be nested
* remove the firq stack and exception stack
   + remove the coressponding kconfig option
   + all interrupts (normal and fast) and exceptions will be handled
     in the same stack (_interrupt stack)
   + the pros are, smaller memory footprint (no firq stack), simpler
     stack management, simpler codes, etc.. The cons are, possible
     10-15 instructions overhead for the case where fast irq nests
     regular irq
* add the case of ARC in test/kernel/gen_isr_table

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-10 12:47:15 -04:00
Youvedeep Singh 1c856d2b10 tests: kernel: Stress test for preemptive scheduling.
Tests if preemptive threads are picked up as per priority.
This creates 10 threads with priority in increasing order
from 1 to N and each thread prints an Alphabet.
This test fails when threads are picked up out of order.

Jira: ZEP-2370

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-08-09 21:44:53 -04:00
Youvedeep Singh ee5d84ca9a tests: kernel: Stress test for round robin scheduling.
This creates 10 threads with equal priority and tests predictibility
of picking all threads in round robin fashion. Test fails when any
thread consumes more time than time slice allocated to it or threads
are not scheduled in round robin fashion.

Jira: ZEP-2371

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-08-09 21:44:53 -04:00
Punit Vara 3251b9036a tests: neighbor: convert normal test to use ztest
This patch convert net test cases to use ztest framework APIs
which makes output unified to other test cases.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-08-09 21:42:29 -04:00
Punit Vara 2acf077a3a tests: dhcpv4: convert normal test to use ztest
This patch convert net test cases to use ztest framework APIs
which makes output unified to other test cases.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-08-09 21:42:29 -04:00
Niranjhana N 49d2dea875 tests: utils: convert to ztest
- replaced test points with ztest APIs wherever possible
- replaced CONFIG_MAIN_STACK_SIZE with CONFIG_ZTEST_STACKSIZE
  in config file, reduced size to 1024

JIRA: ZEP-2249

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2017-08-09 21:41:30 -04:00