Commit graph

880 commits

Author SHA1 Message Date
Jukka Rissanen
ba026941a1 net: ipv6: Fix IPv6 prefix comparision
If the prefix length % 8 is not 0, then the remaining
bit length was calculated incorrectly and the prefixes
were claimed to match even though they might not be the
same.

Adding a test cases for testing this properly.

Coverity-CID: 157591

Change-Id: I9cb5a73d5cc211ec183176400fa5e2dfd209e2da
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:18 +02:00
Michael Scott
4aad767328 net: linkaddr: calculate linkaddr storage addr size via config
- Introduce NET_LINK_ADDR_MAX_LENGTH which is either 6 or 8
  depending on whether CONFIG_NET_L2_IEEE802154 is used
- Instead of being a placeholder single index array of uint8_t,
  let's use NET_LINK_ADDR_MAX_LENGTH to assign the size of the
  "addr" array field in the net_linkaddr_storage structure.
- Now that the "addr" field of net_linkaddr_storage contains the
  true size of the link address, we can remove "storage" field
  which was hard coded to 8 bytes (2 uint32_t's).
- Fix 2 references to the "storage" field of the net_linkaddr_storage
  structure.

Change-Id: I2ea12058280b289f65085964eb7d503d4fd260c2
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-20 16:23:16 +02:00
David B. Kinder
ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Anas Nashif
2bc9d69981 build: abstract emulation and replace qemu goal with run
This will replace the current goal of 'make qemu' with 'make run' and
moves Qemu handling into its own file and into the boards instead of
being architecture specific.

We should be able to add new boards that support some other type of
emulation (by adding scripts/Makefile.<emu type>) and allow the board to
define their own options for the use type of emulation.

'make qemu' will still work, however it will be deprecated, starting
with this commit it is recommended to use 'make run'.

Jira: ZEP-359
Change-Id: I1cacd56b4ec09421a58cf5d010e22e9035214df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:47 +00:00
Anas Nashif
f6e039062a kernel: remove dependency on CONFIG_NANO_TIMERS/TIMEOUTS
Remove legacy option and use SYS_CLOCK_EXISTS where appropriate.

Change-Id: I3d524ea2776e638683f0196c0cc342359d5d810f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-08 18:09:52 +00:00
Andy Ross
a5b694fbbc net: tcp: Select correct source address for SYNACK packets
The source address for a TCP SYNACK must (obviously) be the same as
the destination address of the SYN that produced it.  But the existing
IP packet creation routines would simply fill in a default address
from the net_context struct, which is correct for *established*
connections, but for the listening socket is generally INADDR_ANY
(i.e. all zeroes) and will result in an arbitrary choice for source
address (e.g. a link-local address on the same interface) which can
easily be wrong.

So we need to pass the correct address all the way down from the SYN
packet handler code through the net_ipv*_create() packet creation
functions.  This requires lots of API plumbing, but relatively little
logic change.

Change-Id: Ic368f8cef6689f8a27cbafd5933a4964d5cc457e
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-01-06 08:21:15 -05:00
Anas Nashif
66cfcc26bc tests: introduce Makefile.test
To customise test builds and support test related features such as time
stamps and a boot banner, introduce a Makefile variant that is dedicated
to testing.

Initially we introduce a new config overlay that is used for all tests, in
this case we enable BOOT_BANNER and BUILD_TIMESTAMP. This will print the
current version and the date, useful when reporting bugs and also an
indicator that the system has booted before the test has started.

For example:

[QEMU] CPU: qemu32
***** BOOTING ZEPHYR OS v1.6.99 - BUILD: Dec 21 2016 19:57:13 *****
tc_start() - Test Nanokernel CPU and thread routines
Initializing nanokernel objects
...
..

Change-Id: I224318cdeb55a301964ea366dbc577e2e3a09175
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:48:44 +00:00
Tomasz Bursztyka
a1aa08c288 net: ip: Improve logging by adding a dedicated sys_log level
Let's make net stack having its own level of debugging through sys_log.
It replaces NET_DEBUG by NET_LOG_ENABLED, which is then semantically
better: someone wanting to log the errors might want that not only for
debugging.

Along with it, CONFIG_NET_LOG_GLOBAL option is added, in order to enable
all available logging in network stack. It is disabled by default but
might be found useful when warning/errors need to be logged, so it is
then unnecessary to selectively enable by hand all CONFIG_NET_DEBUG_*
options.

It is possible, locally, to override CONFIG_SYS_LOG_NET_LEVEL by setting
the level one want to NET_SYS_LOG_LEVEL. This can be useful on samples
or tests.

Change-Id: I56a8f052340bc3a932229963cc69b39912093b88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:20 +01:00
Tomasz Bursztyka
4869dc9786 net: tests: Add platforms whitelist to http header unit test
quark_d2000_crb does not build as ROM and RAM space are way too little
for it.

Change-Id: I1a5992dcd49f90fa6604cd8ab76db7e170be7cd4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:20 +01:00
Flavio Santes
ac7300611c net: Restructure network protocols
This commit restructures the network protocols. Changes applied are:

- Move lib/iot/ to subsys/net/lib
- Move network protocol headers to include/net
- Move lib/iot/zoap/link-format.h to include/net/zoap_link_format.h
  and link-format.c to zoap_link_format.c
- Move tests/iot/ to tests/net/lib/
- Adapt sample code
- Adapt build system
- Modify doxygen paths

Change-Id: I37085fa4cc76a8a8e19a499ecb4e87b451120349
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-02 10:03:19 +01:00
Vinicius Costa Gomes
c538bb6602 tests/zoap: Add test for payload size
Add a test for the available space for the payload, so the problem with
the payload length doesn't regresses.

Change-Id: Ifef541d8428947eb482729aa773a7e9ddd2b6f81
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:19 +01:00
Tomasz Bursztyka
0a1617365f net: buf: Change NET_BUF_DEBUG to NET_BUF_LOG and add a level option
It will be thus possible to enable only the error logging, or the other
sys_log levels.

Change-Id: I0c0ed789f7cfbb4811320e8f8249151288274873
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka
56f25b49a9 tests: net: Fix format issues
Fixes:
error: format '%u' expects argument of type 'unsigned int'

Change-Id: I02aaaea79150967d7831d89d0c05427bf2685708
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Flavio Santes
a73a5bc41e tests/tcp: Initialize buffer to NULL
This commit initializes some net_buf variables to NULL to solve the
issue reported by Coverity: "Memory illegal accesses (UNINIT)".

Coverity-CID: 157610
Coverity-CID: 157611
Coverity-CID: 157612
Coverity-CID: 157617
Coverity-CID: 157619
Coverity-CID: 157620
Coverity-CID: 157622
Coverity-CID: 157624
Coverity-CID: 157626
Coverity-CID: 157627
Coverity-CID: 157628

Change-Id: I98a1ea5db4c169f69e3fa3d5de4c0ed7fdf1820a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Anas Nashif
6ce672d753 net: remove unused variable pkt1
Change-Id: I987765a6020b7d5b5ff8fd1213dfc4b9a13cdf7f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-15 14:33:02 +00:00
Anas Nashif
200c4031dd net: remove unused variable dis
Change-Id: Iec80bd13532b17d36fbe1b3d07f31b8f481859d9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-15 14:32:52 +00:00
Tomasz Bursztyka
ca4ac62611 net: tests: Remove unused variables from dhcpv4 unit test
Fixes this:
error: ‘zero_addr’ defined but not used [-Werror=unused-const-variable=]
...

Change-Id: I5b0baf597e62f3206e15638a63e129503b76b048
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-15 14:34:16 +01:00
Johan Hedberg
d659bb020e net: buf: Remove redundant user_data_size from buffers
Since the user data size is now stored in the pool there's very little
value in storing it as well per-buffer.

Change-Id: I17a99123b232423c52a2179b4eccd813728d51b1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-15 09:58:17 +02:00
Johan Hedberg
71c7c01819 net: buf: Remove the need for net_buf_pool_init()
In order to keep the initialization process light-weight, remove
net_buf_pool_init() and instead perform the initialization of the pool
and buffers in a "lazy" manner. This means storing more information
in the pool, and removing any 'const' members from net_buf. Since
there are no more const members in net_buf the buffer array can be
declared with __noinit, which further reduces initialization overhead.

Change-Id: Ia126af101c2727c130651b697dcba99d159a1c76
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-15 09:58:02 +02:00
Johan Hedberg
45bc46d42e net: buf: Introduce net_buf_destroy() wrapper
This is only for use with custom destroy callbacks, so that the
application gets isolated away from the details of how exactly the
buffers are managed. This opens up the possibility of switching away
from k_fifo to potentially better solutions, such as k_lifo.

Change-Id: I0d8322fdec3500d8ae060ae471b9448aeaa4572a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-15 08:45:05 +02:00
Marcus Shawcroft
954baea90b random: Restructure RANDOM Kconfig
Restructure the RANDOM Kconfig to match the structure used in other
drivers with a single top level menu.  Move the true random number
generators to appear first in the menu, with pseudo generators at the
bottom.  Do not present pseudo generators if a true random generator
is presented.

This change implies that tests, samples and applications that require
the random driver interface must now select CONFIG_RANDOM_GENERATOR.

In order for tests and samples to build (and run) on platforms that
have no random driver it remains necessary to select
the CONFIG_TEST_RANDOM_GENERATOR.

Note that CONFIG_TEST_RANDOM_GENERATOR retains its original purpose of
enabling a random driver that delivers non random numbers for the
purpose of testing only.

Change-Id: I2e28e44b4adf800e64a885aefe36a52da8aa455a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13 22:50:18 +00:00
Johan Hedberg
c3e08c8fea net: buf: Redesigned pool & buffer allocation API
Until now it has been necessary to separately define a k_fifo and
an array of buffers when creating net_buf pools. This has been a bit
of an inconvenience as well as blurred the line of what exactly
constitutes the "pool".

This patch removes the NET_BUF_POOL() macro and replaces it with a
NET_BUF_POOL_DEFINE() macro that internally expands into the buffer
array and new net_buf_pool struct with a given name:

	NET_BUF_POOL_DEFINE(pool_name, ...);

Having a dedicated context struct for the pool has the added benefit
that we can start moving there net_buf members that have the same
value for all buffers from the same pool. The first such member that
gets moved is the destroy callback, thus shrinking net_buf by four
bytes. Another potential candidate is the user_data_size, however
right not that's left out since it would just leave 2 bytes of padding
in net_buf (i.e. not influence its size). Another common value is
buf->size, however that one is also used by net_buf_simple and can
therefore not be moved.

This patch also splits getting buffers from a FIFO and allocating a
new buffer from a pool into two separate APIs: net_buf_get and
net_buf_alloc, thus simplifying the APIs and their usage. There is no
separate 'reserve_head' parameter anymore when allocating, rather the
user is expected to call net_buf_reserve() afterwards if something
else than 0 headroom is desired.

Change-Id: Id91b1e5c2be2deb1274dde47f5edebfe29af383a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-13 21:41:53 +00:00
Anas Nashif
918740d15b tests: net: exclude quark_d2000_crb
Not enough memory on this device with 8K of SRAM

Change-Id: I359cce806098cac7e0e2a9e00ce40c91bc535c5b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-05 16:44:46 +00:00
Jukka Rissanen
3eaec41ab8 net: Moved net/ to subsys/net
* Moved networking code into subsys/net.
* Renamed net/yaip to net/ip at the same time.
* Fixed the tests/net to compile
* Fixed the Makefiles and Kconfig files in subsys/net
  to use the new location of the IP stack

Change-Id: Ie45d9e8cb45a93fefdf969b20a81e3b1d3c16355
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:20 +02:00
Jukka Rissanen
368ef49331 tests: net: ipv6: Add test for neighbor advertisement
Check that we change the ll address in neighbor cache
properly when receiving NA.

Change-Id: Ib0373751abebdfe1c5e83fd38ec91b9587797e32
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:18 +02:00
Jukka Rissanen
e2a4432e85 tests: net: ipv6: Wrong IP address was added to cache
Peer address is used when sending NS so that it is added
properly to neighbor cache.

Change-Id: I51c2e236a0b137f7ab086a782f3baced13aa3ee3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:18 +02:00
Jukka Rissanen
bd9f9e7cde tests: net: ipv6: Fix prefix test
Also disable prefix lifetime overflow test as it does not work
properly.

Change-Id: I54c8716f6a6d4f5bec76b0a61fe0e18e983924f4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:18 +02:00
Anas Nashif
47b27514a3 test: net: remove nano/micro tests
Change-Id: I57898f5d9f050a2301504a3df43feb2bd1e6d4fc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-02 12:41:17 +02:00
Anas Nashif
3d97803c02 tests: net: remove qemu.pid file and bad filters
Change-Id: I26ef207fdebab674a89d54efeb3f4a1a3c4258f6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen
68ea9377e6 net: Make native IP stack the default
As the native IP stack is now the default, there is no need
for corresponding Kconfig option.

Change-Id: I08e4992f540f928a2b7378e8803e634e38725348
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen
6b43821f20 net: Remove legacy Contiki based uIP stack
This commit removes the legacy Contiki based uIP stack.
The new native IP stack must be used after this commit.

The commit also removes following things:
- legacy cc2520 driver
- legacy ethernet drivers
- legacy IP stack samples

and changes these things:
- disabled tests that only work for legacy IP stack
- select new IP stack by default
- enable random number generator by default as it is needed
  by the new IP stack

Change-Id: I1229f9960a4c6654e9ccc6dac14a7efb9394e45d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Ravi kumar Veeramally
72c71e8310 net: ieee802154: Add offset based reassembly feature
Current reassembly of 802.15.4 packets works only if fragments are
in correct order. But as per RFC 6282 reassembly should be based on
offset parameter in fragmentation header.

Change-Id: Icdcb10b9aa8f5837063b0201a64f8eb050c75681
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:41:11 +02:00
Jukka Rissanen
f4be98b4bb tests: net: Change the tag of network tests to net
There were different tags defined in testcase.ini files for
networking tests. Unify these and change the tag to "net"
in all networking tests. This makes it easy to execute
all network tests via sanitycheck.

Change-Id: I8ce7ccf8cccca35234602e37f6568db0b986d181
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:11 +02:00
Jukka Rissanen
d048b5c9d1 tests: buf: Do not depend on IP stack
The net_buf tests were including net_ip.h which requires some
extra config options to be usable when the new native IP stack
is used. In order to avoid this dependency, define struct in6_addr
locally in the source file.

Change-Id: Iafe0d2b5b507665baaed23f5e2c55a9d9a300d47
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:11 +02:00
Tomasz Bursztyka
a54d5607ad tests: ieee802154: Fix compilation error in fragment test
Which happens only when internal DEBUG is set to 1

Change-Id: I175943f32065ae81b1a4453dde40f36738c28084
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:09 +02:00
Leandro Pereira
6b9b9a6f75 net: tcp: Provide NET_TCP_FLAGS macro
Instead of having to write "NET_TCP_BUF(buf)->flags & NET_TCP_CTL"
every single time, provide a NET_TCP_FLAGS macro that expands to this
expression.

Change-Id: Ie876c538599fabae6b800a53613b6ad17dc45620
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2016-12-02 12:41:08 +02:00
Tomasz Bursztyka
85a8f8e6fa net: trickle: Using unified kernel API
Dropping legacy API. This commit also contains updated
unit tests in order to pass the test.

Change-Id: Ibc7426837e2f4f23bb5f3ed3719635c5c3d0ed0f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
06362ff5c6 tests: net: Using unified kernel API
Dropping legacy API.

Change-Id: Ife835e38fb03e909e89c3060771f42d1cfa12164
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Jukka Rissanen
1b58d970ca net: ipv6: Move unspecified address getter to ipv6.c
More logical place for net_ipv6_unspecified_address() is in ipv6.c
instead of net_if.c. Removing the net_if_ipv6_unspecified_addr()
variant as it is no longer needed.

Change-Id: Ib5b4f6748030a8bf50fb848a87eef2968e2bcbc8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:04 +02:00
Tomasz Bursztyka
b52f8f1fa1 tests: net: TCP Context needs to be listening before running accept
Change-Id: I433ddac41afcb055cd45e2e7fc4c26ed8c56e3c2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:02 +02:00
Tomasz Bursztyka
64e7dc2caa tests: net: Unified kernel is now default and only one
Adapting all unit tests so:

- main task's prj.mdef is already provided by unified kernel with a
default stack of 2kb.
- unified is the only kernel to be used now, removing unecessary kernel
type make option.
- removing all NANOKERNEL/MICROKERNEL related #ifdefs and so on.

Change-Id: I9b853dbd2aef971d355188cbf7fe2ececaaa80c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:02 +02:00
Leandro Pereira
ad1a9d088d net: tcp: Add better type safety for connection handlers
This creates a `struct net_conn_handle` that's only used as an opaque
pointer.  The purpose is to avoid assigning a void* to a void** in
connection registering/unregistering functions, avoiding a
previously-caught bug by issuing an incompatible pointer types warning:

	warning: passing argument 7 of 'net_tcp_register' from
		incompatible pointer type [-Wincompatible-pointer-types]

Suggested by Andy Ross in 5beec6.  This particular commit didn't catch
any bugs, but the one caught in 5beec6 wouldn't exist if this were in
place at the time.

Change-Id: I5c13fb4c5826adce6397feb7b400d36e426c4a87
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2016-12-02 12:41:02 +02:00
Jukka Rissanen
c15b467d42 net: tests: Send IPv6 hop-by-hop option to IP stack
Added a test to send HBH option to IP stack. Currently
the test will always pass, activate some more debugging
to see what the IP stack is doing with the option.

Change-Id: Id0ab1590eb8216f5f67c4d43ce2e882186334198
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:01 +02:00
Jukka Rissanen
dffafbd290 net: tests: Unit tests for RPL
Change-Id: I5c2c4dd4eb8a8af77bd0d8db06b09a25871893b3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
cac9d1b3cf net: Add support for embedding extra data to routing entries
This can be used to store routing protocol specific data
into neighbor entry. By default no extra data is allocated.

Change-Id: Iabff0a1df676398a47b86adbc398c4f566dcc40a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:58 +02:00
Jukka Rissanen
c38dd8870c tests: net: 6lo: Make sure no error in microkernel
Microkernel test for 6lo was giving error because the
prj.mdef file was refering to wrong function name.

Change-Id: I4197c509fb266a908eb03cc0bda34e39c66b229c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:57 +02:00
Tomasz Bursztyka
91c3f06e97 tests: net: Moving IEEE 802.15.4 fragmentation test in proper place
fragment is only about testing 15.4 6lo fragmentation, so let's put it
in dedicated tests/net/ieee802154/ directory.

Change-Id: Ib838600e571753ab976c74dac78ee774f628c2ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:56 +02:00
Tomasz Bursztyka
593fc81bf4 tests: net: Multiple test will go inside ieee802154
So reordering files in order to put more specific tests in it.

Change-Id: I000bc5efb8442d02e9a50e1b85cb45e0bec12789
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:56 +02:00
Tomasz Bursztyka
831bfcb048 net: ieee802154: Improve 6lo frag reassemble API
No reassembly logic is changed besides removing the final reassembled
pointer. Instead of requiring such pointer, let's just use the frag one.
Such changes will ease the usage of ieee802154_reassemble():
the given frag buffer, in case it finally got reassembled and thus
provided a NET_CONTINUE verdict, will directly be handled by net_core.

This makes things consistent as well with verdicts:
- in case of NET_OK, buf has been consumed and thus unrefed
- in case of NET_DROP, buf needs to be unrefed by caller
- in case of NET_CONTINUE, buf is updated with reassembled and
  decompressed data packet, up to net_core to handel it accordingly.

Change-Id: Ibd1588debd22a7f4571b36713dd46bf8b1d88329
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:56 +02:00
Tomasz Bursztyka
34988043a4 net: ieee802154: Reverse 6lo fragmentation verdict
As soon as fragment is put into the cache and as long as it is not
identified to be the last one: let's return NET_OK to notifiy the
fragment has been consumed by ieee802154 L2.

That way, net_core will not try to interpret it - and fail - unnecessary
increasing the drop statistics.

On the contrary, once the buffer is fully reassemble, let's return
NET_CONTINUE in order to let net_core consume the buffer relevantly.

Change-Id: I715b687e451f4643656e122b0d119f114696340b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:56 +02:00
Tomasz Bursztyka
2887bbf7fc tests: ieee802154: Make the test ready to handle multi fragments buffer
Buffer sent by 802.15.4 L2 might have more than one fragment, thus
handling it properly.

Change-Id: I12fef8a9c5de56615c3a084c57f438e71b320fcf
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:56 +02:00
Vinicius Costa Gomes
86b1ef7b7b tests/zoap: Fix extra unref on net_buf fragments
Since "22e919872206b1d net: Adapt to new behavior of net_buf_frag_add"
net_buf_frag_add() takes onwership of the fragment, so this _unref()
after a net_buf_frag_add() is wrong.

Change-Id: I1559c2978cf8d800891d6e752478537fbee7c02b
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:55 +02:00
Vinicius Costa Gomes
3aa352e622 tests/zoap: Port observer tests to the native stack
This enables the tests for the observer feature to be run using the
native IP stack.

Change-Id: I325dcd1f5d9fffe3821eed1bd950a717e5f17b67
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:55 +02:00
Ravi kumar Veeramally
78502f1804 net: tests: Update DHCPv4 test results based on events
Earlier test results was updated as soon as test server ACK client
dhcpv4 request. But update results on IPv4 address add event on
interface.

Change-Id: I212309a4d1d2eae88f73470e00754db1d6fecda5
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:54 +02:00
Marcus Shawcroft
f903cb3763 net: dhcpv4: Implement XID
RFC2131 requires that a client must choose XIDs in order to minimize
the chance of collision with another client.  Selection of a random
XID at boot is a valid approach. Adjust the XID representation from
array of bytes to the more convenient uint32_t representation,
initialize the XID to a random number and increment for each request.

Refactor the dhcp test case to generate response messages with the XID
from the received message.

Change-Id: I93f180e6aa02430f807e0a97186577dc956fb653
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-02 12:40:53 +02:00
Jukka Rissanen
7f4275ef52 iot/zoap: Temporarily disable block size transfer test
The test "Test block sized transfer" does not work with
new IP stack so disable it temporarily for new stack.
This needs to be fixed later.

Change-Id: Ie89dd101270ab9b8a9b056757de79cd3da009180
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:53 +02:00
Ravi kumar Veeramally
d3b21f0171 net: tests: Add unit tests for net_nbuf_write/insert utilites
Change-Id: I4df5672777af2c27511465b72ea17b7b5e0c8e8f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:53 +02:00
Anas Nashif
e6bbc5003c net: do not depend on ARCH
Rename project configuration to be architecture independent and do not use ARCH
in Makefile.

Change-Id: Ic793751e3187bc74fd14cec929754d691b01a799
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-02 12:40:52 +02:00
Jukka Rissanen
1c3c26a1f9 net: tests: Add TCP unit tests
This provides only initial set of functionality tests
for TCP. More tests are to be written.

Change-Id: I157fed85f561523bf063732ce86eaae551c2d384
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:52 +02:00
Ravi kumar Veeramally
c689fd6f1a net: Rename net_nbuf_write to net_nbuf_append
Current net_nbuf_write() api just appends data to last fragment. And
doesn't write data based on offset. That's why renaming this api.

New net_nbuf_write() apis based on offset will be coming soon.

Change-Id: Ie8e13e5f6091a279b62b6d8b0b3928a5187e75b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:51 +02:00
Vinicius Costa Gomes
dc45748d50 iot/zoap: Port to the native stack
This ports zoap to the native stack.

Just for reference, and totally not scientific, here are the numbers
using the old stack:

$ size outdir/qemu_x86/zephyr.elf
   text	   data	    bss	    dec	    hex	filename
  34657	  10316	  16916	  61889	   f1c1	outdir/qemu_x86/zephyr.elf

With yaip:

$ size outdir/qemu_x86/zephyr.elf
   text	   data	    bss	    dec	    hex	filename
  30575	   9148	   6164	  45887	   b33f	outdir/qemu_x86/zephyr.elf

Jira: ZEP-818

Change-Id: I7992a3e2af7d419081ee5a64d7cc2d49fb628ead
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:50 +02:00
Ravi kumar Veeramally
ead511ddae net: Fix net_nbuf_read corner cases
Valid case:
 1) If the offset is more than current fragment length, adjusts offset
    from next relevant fragment and starts reading or skipping.
 2) If the read or skip length is more than available data length,
    then throw an error.

In case of an error, frag is 'NULL' pos is '0xffff'. Rest of the cases
are successful read and skip.

Change-Id: I88c4b85e14e5821f681966b5148ba9519b91cca4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:49 +02:00
Ravi kumar Veeramally
712f0c90db net: tests: Add 6lo context based unit tests
Change-Id: I73e18d830d1dcd4f5181b0de74cb7818086504a3
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:48 +02:00
Ravi kumar Veeramally
e68625345a net: Add support for 6lo context based compression
RFC 6282, 3.1.1 (If SAC == 1 and M = 0, DAC = 1).
Source and Destination address compression support if addresses are
based on context based information from Router Advertisement message.

Change-Id: I23a3bf4f111016a8e54be5f0181a113353ad4b88
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:48 +02:00
Ravi kumar Veeramally
e8f40a970a net: tests: Add sample 6CO context data to IPv6 RA test
Test is only for parsing 6CO data. Nothing more than that.

Change-Id: I7e5851f389216473379a9e50b83dfb03fbe1e68e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:48 +02:00
Vinicius Costa Gomes
42c3969ad8 tests/net/nbuf: Fix invalid memory access
The memcmp() could reach after the buffer that is used for verification
ends, which was causing this test to fail on the qemu_cortex_m3 board.

Change-Id: Ia05df823f201d9017acb35c7634fa506389ae9f1
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:48 +02:00
Vinicius Costa Gomes
61bb244ab1 tests/net/nbuf: Fix wrong size to linearize() call
linearize() expects the amount of room available in the buffer.

Change-Id: I1062912f76951758177b7dd6588e7e0ae280dc03
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:48 +02:00
Vinicius Costa Gomes
f2236bb2d7 tests/net: Exclude tests needing more RAM than available
Quark D2000 doesn't not have enough RAM for these tests.

Change-Id: Iba79eaadb15eb8f1eae4bfdbc6865985d3da3fd3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:48 +02:00
Ravi kumar Veeramally
918703cba3 net: tests: Decrease the required buffers count
Buffer leaks are fixed in 6lowpan compression and ieee802154
fragmentation. So lower the count in tests.

Change-Id: Ic9581f898156fedc20a3e445be8b7a466ee15d99
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:47 +02:00
Tomasz Bursztyka
08b748432b tests: Add network core event tests
A fake network device and interface are setup. Test implies add and
removing an IPv6 address which should trigger the related notification.

Change-Id: I6035cfbfaf80c8f4352b5d31b47ca1445434d926
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:47 +02:00
Tomasz Bursztyka
af703e1106 net: Normalizing net_mgmt API names
While doing some documentation for it, I realized names were not all
good and it missed some stuff:

- what belongs to event should contain "event" in it
- we have a structur as callback so let's type the handler as a handler
- let's add the request handler signature

Change-Id: I18822cbcdc3c10e33600d6db38abab5ca73a228c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:46 +02:00
Flavio Santes
7e7f72b104 net: Fix tests/net/nbuf/Makefile
Use ?= for the CONF_FILE variable to match the default assignement for
BOARD ?= qemu_x86.

Change-Id: I0b6cf1e967eeb437d99aa7286cf560426d48fbf9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:46 +02:00
Tomasz Bursztyka
8b1953f740 tests: net: Add net management event sender/receiver tests
It mimics how event could be thrown through a dedicated thrower (a
fiber). The amount and event it can throw is gived through parameters.

Change-Id: I484bc72bdb730a77ce976b0b2998411d9918b7fc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:46 +02:00
Tomasz Bursztyka
ec1d2c5a48 tests: net: Add a basic network management API test
Testing if net_mng() works.

Change-Id: I303cffa206859184a503ba8efe392b673b162e43
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:45 +02:00
Ravi kumar Veeramally
1ce3550779 net: tests: Add RA message unit tests.
Basic unit tests for Router Advertisement message handler.

Change-Id: Ia99cd160632972a12e2099a3ff6e41e6ea48ff9b
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:45 +02:00
Jukka Rissanen
d8cb2fb161 net: Make sure buf is correct one in net_nbuf_write()
The buf parameter cannot point to a data fragment in
net_nbuf_write() because we need to use user data inside
that function and the fragments do not have that information.

Change-Id: I45b9c23869df08a0852bd99c0b453210ad2300b5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:45 +02:00
Ravi kumar Veeramally
913c1f29ca net: Add unit tests for new nbuf API's
Tests for net_nbuf_read, net_nbuf_write and net_nbuf_skip API's.

Change-Id: I77f702dda8c9df7892120f47ff03a6b256191d31
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:28 +02:00
Jukka Rissanen
338c2be888 net: tests: Add initial set of IPv6 tests
Change-Id: Ib68b38a809068ca14ee9307e9ea605f03611ebd3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:28 +02:00
Jukka Rissanen
fb9af2523d net: tests: Increase the timeout of trickle tests
One second timeout seems to be too short as some test runs
fail when run in Jenkins.

Change-Id: Ifb01929148415961712468e3cc85387aac5eb2bb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:28 +02:00
Jukka Rissanen
66d3601dd5 net: tests: Add tests for route management API
Change-Id: Ic2f8d2d270f63baa0a16ae76f248485bc00eef08
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:27 +02:00
Tomasz Bursztyka
640d524f69 net: tests: Add a simple IEEE 802.15.4 Beacon frame test
It's an empty beacon frame, juste to validate the Beacon frame parsing
logic.

Change-Id: I90916eb87187c9eae9b2267f34dc93bee554d4b5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:26 +02:00
Ravi kumar Veeramally
2a9d75ac1c net: tests: Add DHCPv4 client unit tests
Change-Id: Ief15927975bb0398c39c656068ec8c73c4f62e82
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:26 +02:00
Ravi kumar Veeramally
846201d049 net: tests: Remove broadcast and multicast tests from ARP
If ethernet address is broadcast or multicast, l2 layer does not
send any ARP messages. Handle this scenario in ethernet tests.

Change-Id: I8e11832803e1539887152447090d1286c7fa3eb0
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:26 +02:00
Jukka Rissanen
c427e9bbd6 net: Context accept cb needs to return failure code
If the connection establishment has an error, the accept
callback needs to be able to return that error to user space
so that the application can know about it.
This is especially important in TCP where application needs
to start to listen again if reset is sent during connection
establishment.

Change-Id: I55f36e4f101c7237c1288f09baf6e602b33da2b3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:25 +02:00
Jukka Rissanen
84ffca2eb1 net: tests: Add unit test for net_nbuf_pull functionality
Change-Id: I929f7c6eed21aca0f92975b96380a91e5e50587f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:25 +02:00
Jukka Rissanen
96e629c877 net: Fix remaining debug option naming issues
Some of the DEBUG options for the new IP stack still used
the CONFIG_NETWORK_IP_STACK_DEBUG_ prefix.

Change-Id: I8f039ac5e303a7c571a870403ce17d758db540d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:25 +02:00
Tomasz Bursztyka
becf74743b net: Split debug Kconfig options from legacy to new stack
- new stack options are renamed and placed in their respective menus
- new stack Kconfig gets normalized (tabs vs spaces, etc...)

Change-Id: Ia68f6589fed464bbdd76dc0812775684b2f94a58
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Jukka Rissanen
58a7ada44c net: Add network address length to user API
Add socklen_t addrlen parameter to net_context_bind(),
net_context_sendto() and accept callback.

Currently the address length option is not really mandatory
as we can figure out the length from the address family.
But if we are going to support other protocol address families
it might be needed.

Change-Id: I59206465c3259050c469c5b2150221646a9a08d7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:24 +02:00
Jukka Rissanen
103a98d173 net: tests: Fix printf modifiers in new IP stack unit tests
Because of printk fixes in master, some of the networking
unit tests will fail in next merge.

Change-Id: I3e28aae72c0c10b402b78c0f406ecb3513b967a7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:23 +02:00
Ravi kumar Veeramally
0d76826a0d net: tests: Extented 6lo unit tests
Earlier all unit tests are with IPv6 and UDP as next header.
Modified tests with IPv6 only, IPv6 + UDP and IPv6 + IPHC next
headers.

Change-Id: Ie02cecb37e07ceae8a06a0653e2ccdfe0db91239
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:23 +02:00
Jukka Rissanen
2eb01fe191 net: tests: Enable unit tests for the new IP stack
We are not just checking the test build but this time
the tests are also run.

Change-Id: I7b0b24c51dfc2dc58f290cca7a593be431b8077f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
9c62543f62 net: Follow file naming in ieee802154 l2 stack
For consistency as well as for helping when grepping etc.

Change-Id: Ib5e6b3369e510dd2b996f735d801c2b80291ad7f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Jukka Rissanen
c03028f1f1 net: tests: Test Trickle algorithm
This is only meant for the new IP stack.

Change-Id: I643b0556f87423f09555274749db93397ef66c59
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:21 +02:00
Ravi kumar Veeramally
ae1ce83dd1 net: tests: Add fragmentation unit tests for 802.15.4
Change-Id: I5722f86c00c76921e94f6f2a8e9add8960498107
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:21 +02:00
Ravi kumar Veeramally
fe4a4efe78 net: Add support for IEEE 802.15.4 re-assembly
Reassembly IEEE 802.15.4 fragments as per it's datagram size
and datagram tag. Uncompress IP header fragment as soon as it
arrives. Size matches only after uncompression of IP header with
total length.

Support added for multiple IP packet reception. Default is one full
IP packet at a time. Cache size can be modified via Kconfig option
(NET_L2_IEEE802154_FRAGMENT_REASS_CACHE_SIZE).

Note: If you increase the size by 1 means, you should have N number
of data buffers available at max.
e.g. One full IP packet (1280 MTU) needs 15~16 data fragments means,
multiply size by same number of fragments. It requires more memory.

Offset based reassembly yet to be done (fragments can come in any order
[e.g. mesh]). Now assuming that fragments are in right order.

Change-Id: I17baee30a1087eb9ec6dc25f03ed64bbe0df2917
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:21 +02:00
Ravi kumar Veeramally
dc36bdb89d net: Integrate 6lo and 802.15.4 fragmentation
Change-Id: I348656e0049d79f4dfdaba7909ad0b770f3ee922
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:21 +02:00
Ravi kumar Veeramally
8743ac7ec8 net: tests: Add unit tests for 6lo IPv6 dispatch
Change-Id: I962b1f94b6b2ba6ef2429ef0deca3ee5352df3d8
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:20 +02:00
Ravi kumar Veeramally
1725ac66d7 net: Add 6lowpan without compression header support
Add support for IPv6 header dispatch (without IPv6 compression
and uncompression). Only IPv6 dispatch header will be added at the
beginning of the buffer.

Change-Id: I7400a4dd115ac3b4b3d9deecd3cdb9ea292573fb
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:20 +02:00
Ravi kumar Veeramally
9217b68f3c net: Change 6lo API returned parameter
6lowpan compression and uncompression done on original
input buffer. So no need to return paramter as net_buf *.
If the compression or uncompression fails, unref the buffer
as it cannot be used further.

Change-Id: I64f496e22b2008a91a358fff65de1b87659cd9eb
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:20 +02:00
Ravi kumar Veeramally
142ca7f01e net: tests: Fix 6lo tests
UDP length was wrongly set and test count was hardcoded.

Change-Id: Iade959e1b8c3580b43aa2a9ff1fc10eb5a462f2f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:20 +02:00
Tomasz Bursztyka
4e7efd4bcb tests: net: Add a IEEE 802.15.4 ACK replies test
- Parsing a proper ACK reply
- Generating a ACK reply from a data packet requesting it, and comparing
  it to a proper one.

Change-Id: I1717fedc899eafa0aa849e1e253f02cd3dc3d4fc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:18 +02:00
Tomasz Bursztyka
11c9b8dac7 tests: Add grounds for IEEE 802.15.4 stack tests.
First test is a unit test for frame parsing

Change-Id: I080d64a71fe4b6ff00e071a0cdee97ab9cd922d5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:18 +02:00
Tomasz Bursztyka
3560f58293 net: L2 might need private data per-interface
Allocate the right amount of space for L2's context.

Change-Id: Ia2f4f4162334e9e9c26dc95230abdfde5986e052
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:18 +02:00
Jukka Rissanen
04a65534e1 net: Change srctree to ZEPHYR_BASE in Makefiles
This is related to changes in commit 7dcbbc39e7
("build: move from srctree to ZEPHYR_BASE for app include paths")

Change-Id: Ie902ed66bb74188ed54aae44e2f4289f954ec351
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:17 +02:00
Jukka Rissanen
498f9e04de net: tests: Unit tests for user space socket API
Change-Id: Ifd149e4f4313abde4cead135f7533f26dec6bdf7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:15 +02:00
Jukka Rissanen
9331b2bc7b net: Add net_conn pointer to callback
When a UDP packet has been received and if a watcher match
is found, then a callback is called. It is useful to have
a pointer to net_conn when calling the callback.

Change-Id: Ifa97b37c22b1fc9cac7eadfba23aa68dfd473fda
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:15 +02:00
Jukka Rissanen
1932d4c3ec net: Convert network connection to use sockaddr
As the net_conn needs port information, use struct sockaddr
internally as it has the port numbers built in.

Change-Id: Idb1c87afa956dfe55dc8d533d867fa7845545b12
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:15 +02:00
Jukka Rissanen
f88da0fa36 net: tests: UDP unit test had incorrect ll address length
Change-Id: Ie3231c6fda2faf49f4767a78250b923bedb2d293
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:14 +02:00
Jukka Rissanen
432f3b3914 net: tests: udp: Print debug info only when activated
No need to print debug prints if debugging is not activated.

Change-Id: I42a6453b4f3e11106119561b580ebea41e56452d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:14 +02:00
Jukka Rissanen
2658ac7a73 net: IP address lookup functions return interface
When checking the IP address from network interface, return
also the used network interface.

Change-Id: If7b8385193da4cb1b469f697e219cfae3b6477dd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:14 +02:00
Tomasz Bursztyka
a1fde2bff8 net: Fix dedicated IPv4 function for net_if
IPv4/6 functions follows this scheme: net_if_ipv<4/6>_<name>.
Applying that to net_if_set_gw/net_if_set_netmask which are IPv4
functions.

Change-Id: I2dcbb16ce81cfdffbfbb5cae24ad76ddf2b9919a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:14 +02:00
Ravi kumar Veeramally
c1ee601962 net: tests: Add unit tests for 6lowpan functionality
Change-Id: Ie13a05300e05fdc536fcb4ec64e323789704ba8b
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:14 +02:00
Tomasz Bursztyka
97daa51c80 net: Cleanup net_if's documentation
Change-Id: Idd139ee5f56c8b55119db69582393fe2906eae74
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:13 +02:00
Tomasz Bursztyka
b8e3415264 net: Let's use inline function for type checking for net_nbuf
Using macros does not let the compiler verifying about the type we are
providing, which usually give an error easier to understand.
Also, this will let the compiler deciding how to actually optimize
(inline or not) the code.

Change-Id: Iba49590b620ef0a1bd0ed5621453524fcfea747c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:13 +02:00
Jukka Rissanen
55dcaf9e22 net: tests: Fix project file for IP address tests
Disable IPv6 DAD and ND for IP address test as there is
no need to do neighbor discovery in the test. We also
would like to see network interface debugging and use
dummy L2 driver instead of ethernet one.

Change-Id: Ia9f218c8d4c13afa1482302691d2ef72af4a7b13
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:13 +02:00
Jukka Rissanen
894e42d025 net: tests: Fix IP address test so that it will not crash
The driver_api pointer was set to NULL and send() pointer
was missing which caused a crash in TX fiber.

Change-Id: I7204c975691476dd9ab2c61bfd11b7664343e47c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:13 +02:00
Jukka Rissanen
fe16af1e06 net: tests: ICMPv6 was missing random number config
Change-Id: Ibcfa6662f30727a31cc2fa371e8a3ec3923db3cd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:12 +02:00
Jukka Rissanen
b9b1dec6a3 net: tests: Turning off IPv6 for ARP tests
ARP is IPv4 only so no need to have IPv6 functionality.

Change-Id: Ie70242f5763ba4945c311898643414851f7e8660
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:12 +02:00
Jukka Rissanen
f42c8126eb net: tests: Unit tests for net_nbuf_push()
These tests will verify that we can successfully insert
some space in front of the net_buf fragment chain.

Change-Id: Idf52ed56c52d66268783fb4fecd44b70fc852734
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:12 +02:00
Jukka Rissanen
a1a17d5a98 net: tests: Fix ARP test so that it will not crash
The driver_api pointer was set to NULL which will cause
a crash in TX fiber.

Change-Id: If1c9a1e44904970f3a0019741eaaad4bf62d2c73
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:12 +02:00
Jukka Rissanen
87fd856041 net: tests: Unit tests for UDP handler
Simple UDP protocol testing.

Change-Id: I3ee37ff93127245a80fdf31856a95d9efc403862
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:12 +02:00
Jukka Rissanen
f923adb038 net: tests: Add unit tests for net_nbuf_copy()
The tests will make sure net_nbuf_copy() works as expected.

Change-Id: I48dc3b794c70ec4d6436feb76508952c88bbf09b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:11 +02:00
Jukka Rissanen
9818cc7b1d net: ARP unit test needs to be run from fiber
The ARP unit test is not able to pass packets between fiber
and task. Because of this the test is run from fiber.

Change-Id: I1825a0abdc1b04a78de76d58425f4d2a2ce26ab7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:10 +02:00
Jukka Rissanen
53caa13652 net: Refactored ARP packet header handling
The ARP packet header contained ethernet header. This is very
confusing so separate the link layer header. Fixed also the
unit tests to run properly.

Change-Id: I8b00bde280ad9f49494766370acb2a8e9cade033
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:10 +02:00
Jukka Rissanen
e04639cb66 net: tests: Fix unit test for IP utils
Change-Id: I7e14ec17656fdcc985000dba6fb67e90a053dfde
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:08 +02:00
Jukka Rissanen
21a491c065 net: tests: Fix unit test for IP addresses
Change-Id: Ia0b3b2846078a18b9b342c3aa99ea201d06d1642
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:08 +02:00
Jukka Rissanen
f1532fe647 net: tests: Fix unit test for ARP
Change-Id: I962c00500c57f0f49314d10765b821976679e39b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:08 +02:00
Jukka Rissanen
4695e53391 net: tests: Add unit tests for neighbor cache handling
Change-Id: I1518c102232a607a9c0f91bf5fd71e4b3183a419
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:07 +02:00
Jukka Rissanen
feaef3626e net: tests: Additional tests for ICMPv4 checksum verification
Change-Id: I21566c9365b8abc5753f6bedba55a3fb494745b9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:05 +02:00
Jukka Rissanen
f6dc86c678 net: tests: Fixed the ARP test
Now uses net_nbuf_ll() to point to link layer header.
Also the ARP req test passes properly.

Change-Id: If649ff19a064490bff33d03b4ce70ef11bfa7cd5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:05 +02:00
Jukka Rissanen
7eff526e3b net: tests: Unit tests for the IPv4 ARP code
Change-Id: I607ffdbffc7348fae70272c7add57456fcaf79af
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:04 +02:00
Jukka Rissanen
6e3c12a820 net: tests: Add tests for IPv4 netmask, gateway and subnet compare
Unit tests added for checking network interface netmask, gateway
and IPv4 subnet compare utility functions.

Change-Id: I5b4a07d6a064097ab41ad6552d14181b1631eb53
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:04 +02:00
Jukka Rissanen
1bf6a529a1 net: tests: Tweak the IP address test to use new net_if API
Instead of using hard coded net_if, get the default network
interface using net_if_get_default() function.

Change-Id: I6248555ce57ae5196adea7baa9db325660a71255
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:04 +02:00
Jukka Rissanen
5580cdcc54 net: Add unit tests for ICMPv6 handler
Change-Id: Ibdbe82ed56f110e2e0c6443700863632ee1ef56b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:03 +02:00
Jukka Rissanen
4445e53f1e net: tests: Unit tests for network utilities
Right now there are tests for IP packet checksum calculation.

Change-Id: I1e9e72d01d4690728269c4484f8628350cf95729
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:03 +02:00
Jukka Rissanen
e467c009e5 net: tests: Add more IPv6 address getters unit tests
Change-Id: I0ab22af76073c02c93eb205686472f69b58a1107
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:02 +02:00
Jukka Rissanen
7851aecc1c net: tests: Add IPv4 address unit tests
These tests will check that caller is able to set IPv4 address
to a network interface and check if an address is one of the
assigned to a network interface.

Change-Id: I8aa748c40fbc02eef50ccf76d10a0057ef29021b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:02 +02:00
Jukka Rissanen
c3deb96dd7 net: tests: Add IPv6 address manipulation unit tests
Change-Id: Ide3bce35dcfd3ec31bfe3cd842a87ca3b639ba4f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:02 +02:00
Jukka Rissanen
2ade6ddb60 net: tests: Add unit test for IP and MAC address printing
Change-Id: Ida0901fa9687814932119d006459de12e6a229d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:02 +02:00
Jukka Rissanen
9821cb6eb4 net: tests: Temporarily remove nbuf unit test
Tests have issues right now so these will be activated later.

Change-Id: Ib5549f9ed5600a20b2cfddbddcde8e7f7b297eef
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:01 +02:00
Jukka Rissanen
69b8c675a6 net: Add nbuf buffer API
User should use the net_nbuf API that is supporting a concept
of RX, TX and DATA buffers, instead of using directly the net_buf
low level API.

Change-Id: I3b8f5f13cd37d42d2322a58b35573e117d520c54
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:00 +02:00
Anas Nashif
e5b157bc1e net: buf: move test to unified kernel
Change-Id: I6757d32c8e9c713b73f160d46d4fbe4111ac73c1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-28 20:17:23 +00:00
Szymon Janc
2f45faba8c net: buf: Use unified k_fifo API for FIFOs
Only net_receive() is using non-special value for net_buf_get_timeout
so this change is included here. Other users are using special values
which are already correctly handling ticks vs ms change.

Change-Id: Ib12d34ac5a546b36fa7b35615f082c82a256bd07
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 06:00:17 +00:00
Anas Nashif
d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Kumar Gala
6f6632ddc5 tests: Mark a bunch of testcases that are memory (RAM) limited
These testcases can't build on common platforms with 16K or less of
memory.

Change-Id: Iade2aa423f42a1f174a5ebb5d183b362917f503e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-03 19:20:19 +00:00
Kumar Gala
bfcf575cbb tests: exclude quark_d2000_crb from net/buf test
Currently the net/buf test fails on quark_d2000_crb due to RAM
overflow:
	region `RAM' overflowed by 2256 bytes

Change-Id: I854960a3c22c7318f5f5e9341ca7aaaf8743d30d
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-01 15:03:04 +00:00
Johan Hedberg
ee0412a7d1 net: tests: Fix net_buf_unref() tests for fragment chains
The net_buf_unref() API will unref all associated fragments, so it's
wrong to assume that no fragment destroy callbacks would be called
when the head buf is unreffed. Instead the right expectation is that
all fragments get unrefed as well.

Change-Id: I00530e4c1cfa5dddbfcbeab9609347873010ff4d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-31 23:53:40 +00:00
Anas Nashif
a32579749b ztest: move ztest to unified kernel
ztest was not working with unified kernel and v1 APIs and not many tests are
using ztest right now, so instead of making it work with old APIs, convert it
to unified kernel completely so that new tests written using ztest would be
unified kenrel based.

Change-Id: Ibfcc7783dcb266abbd388662ba61c4b55d32b10c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 21:38:04 +00:00
Vinicius Costa Gomes
cc9da10aab iot/zoap: Add unit tests for block-wise transfers
Change-Id: Ie529d2989481a6be674632dc256fb3995a9953c3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-25 12:56:51 +00:00
Vinicius Costa Gomes
08e0e86bb0 tests/zoap: Add tests for the observe feature
Change-Id: I993437169715ce57f6c5c9f3e95689f785db65c4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:26 +00:00
Jaakko Hannikainen
6f8e7b33b1 tests: convert tests/net/buf to the new framework
This is a sample how to use the framework in an integration test
environment.

Change-Id: I01619fce06759ed523c8c878e8bbda6d8d87d604
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:41 +00:00
Vinicius Costa Gomes
47e8893654 tests/zoap: Add simple test for retransmission
Change-Id: I3a552f10e02e3880bbeb00b31f31c31414c6f163
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-09-22 00:54:36 +00:00
Vinicius Costa Gomes
3a53a73d8f tests: Add simple CoAP tests
Change-Id: I3d7b11ac5a623eab8e07d484b60c24c8a9a824f1
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-09-12 12:25:24 +00:00
Andrew Boie
d89ddc6441 tests: net: fix incorrect printk() usage
Change-Id: Iee5b94c24e1cce1f3a0e607deee2c5bc73e22d7b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Inaky Perez-Gonzalez
3e63a74514 net/yaip: revert merge
Follow up to TSC decission for further discussion in the networking
WIG.

Change-Id: I148b484dfe308661573e47ed3e60cceed673bddf
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-22 04:43:09 +00:00
Jukka Rissanen
19dc87ea7d net: tests: Additional tests for ICMPv4 checksum verification
Change-Id: I21566c9365b8abc5753f6bedba55a3fb494745b9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:12 +00:00
Jukka Rissanen
99fd48acdd net: tests: Fixed the ARP test
Now uses net_nbuf_ll() to point to link layer header.
Also the ARP req test passes properly.

Change-Id: If649ff19a064490bff33d03b4ce70ef11bfa7cd5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:11 +00:00
Jukka Rissanen
a5b96021a7 net: tests: Unit tests for IPv4 ARP code
Change-Id: I607ffdbffc7348fae70272c7add57456fcaf79af
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:08 +00:00
Jukka Rissanen
9924b41297 net: tests: Add tests for IPv4 netmask, gw and subnet compare
Unit tests added for checking network interface netmask, gateway
and IPv4 subnet compare utility functions.

Change-Id: I5b4a07d6a064097ab41ad6552d14181b1631eb53
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:07 +00:00
Jukka Rissanen
dd42617b2f net: tests: Tweak the IP address test to use new net_if API
Instead of using hard coded net_if, get the default network
interface using net_if_get_default() function.

Change-Id: I6248555ce57ae5196adea7baa9db325660a71255
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:04 +00:00
Jukka Rissanen
663ba2b7f0 net: yaip: Add unit tests for ICMPv6 handler
Change-Id: Ibdbe82ed56f110e2e0c6443700863632ee1ef56b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:56 +00:00
Jukka Rissanen
441a054a07 net: tests: Unit tests for network utilities
Right now there are tests for IP packet checksum calculation.

Change-Id: I1e9e72d01d4690728269c4484f8628350cf95729
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:55 +00:00
Jukka Rissanen
cedd655cdb net: tests: Add more IPv6 address getters unit tests
Change-Id: I0ab22af76073c02c93eb205686472f69b58a1107
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:49 +00:00
Jukka Rissanen
03294c3f75 net: tests: Add IPv4 address unit tests
These tests will check that caller is able to set IPv4 address
to a network interface and check if an address is one of the
assigned to a network interface.

Change-Id: I8aa748c40fbc02eef50ccf76d10a0057ef29021b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:48 +00:00
Jukka Rissanen
eb87a36e44 net: tests: Add IPv6 address manipulation unit tests
Change-Id: Ide3bce35dcfd3ec31bfe3cd842a87ca3b639ba4f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:47 +00:00
Jukka Rissanen
cf673cf585 net: tests: Add unit test for IP and MAC address printing
Change-Id: Ida0901fa9687814932119d006459de12e6a229d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:45 +00:00
Jukka Rissanen
2d7d86bdde net: tests: Temporarily remove nbuf unit test
Tests have issues right now so these will be activated later.

Change-Id: Ib5549f9ed5600a20b2cfddbddcde8e7f7b297eef
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 11:23:04 +00:00
Jukka Rissanen
b7bc53ece9 net: yaip: Add nbuf buffer API
User should use the net_nbuf API that is supporting a concept
of RX, TX and DATA buffers, instead of using directly the net_buf
low level API.

Change-Id: I3b8f5f13cd37d42d2322a58b35573e117d520c54
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:22:24 +00:00
Jukka Rissanen
95f5cd2b9a net: buf: Add tests for net_buf fragmentation
More realistic IPv6 packet creation tests created.
One test creates one big IPv6 packet and manipulates that.
Second test creates a list of IPv6 header + data fragments
and sets some user data in those fragment buffers.

Change-Id: Ic8309ff115e1d735e98c30b3c8292b0d6ffc5f42
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 18:06:11 +00:00
Jukka Rissanen
7d6197cf94 net: buf: Add fragmentation API tests
Add tests for checking that the net_buf fragmentation works ok.

Change-Id: I778f79bae971314b6f19c1bf00ed42e1c2128e99
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 18:05:41 +00:00
Johan Hedberg
c78a5a9aae net: tests: Clean up logging of net_buf tests
Change-Id: I8f82c586c730691c72f8996a25843ba786c73fe6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-09 10:26:38 +03:00
Johan Hedberg
bab34ea49c net: tests: Add task-fiber test for net_buf_get/put
Change-Id: I48c050254fca913c59bfbfd9a160c7d6ca79d53b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-09 10:26:38 +03:00
Johan Hedberg
6d93cbb627 net: tests: Refactor net_buf tests for easier extensibility
Change-Id: I23380b1c78b5a9c8814c037a2d48b3505c99f6ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-06 11:22:23 +03:00
Johan Hedberg
7029d6ed62 net: tests: Remove unnecessary microkernel ifdef for mainloop
Change-Id: Ifbf41aeece7f889eb8f4e836c59df5e830882942
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-06 11:22:23 +03:00
Johan Hedberg
8919bdc573 net: tests: Update net_buf test
Add testing for fragmented buffers to the net_buf test.

Change-Id: Id6c541b86c30ac94931a7086ebb6f1312fbc34f7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-06 08:17:24 +03:00
Johan Hedberg
118a36fc26 net: tests: Fix returning net_buf to free pool
When using a custom destroy callback it's the responsibility of the
callback of placing the buffer back in the free pool.

Change-Id: I5ff99c32bcb31ccc5eb0fad544d86b0c830e7051
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-05 19:28:54 +03:00
Johan Hedberg
e8620aaada Bluetooth: Take advantage of net_buf_get_timeout()
Use the more explicit net_buf_get_timeout() call where it makes sense
(e.g. where we always want to wait or never want to wait).

Change-Id: Id1eabe0ad2f9fa79f7be39e51fefa5161f9cc550
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-02 10:32:29 +00:00
Anas Nashif
60b18711f3 tests: remove duplicate kernel configs and usage of ARCH
Many test configs are the same, remove complexity and duplication by
using just one kernel config where applicable.

This removes the usage of ARCH which is a remnant from the days where
we had to specify the architecture of the board, the architecture is now
part of Kconfig and determined basded on the board configuration.

This will also make it easy adding new architectures to test cases without
having to add an architecture specific config file when it is actually not
needed, for example now that we will enable micro-kernel support on ARC.

Jira: ZEP-238
Change-Id: I143fa3c4629c58329cfeb0c761c7a896fc1ef63a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 16:46:08 +00:00
Andrew Boie
3ea7892410 sanitycheck: allow for more expressive filtering in testcase.ini
The old 'config_whitelist' directive in testcase.ini has been removed.
We use the new expr_parser module to parse a 'filter' directive which
is a boolean expression. This gives a great deal more flexibility
in how tests can be filtered.

To keep the tree bisectable, use of config_whitelist in testcase.ini
converted to the new expression language.

Change-Id: I0617319818c5559c0f0569d2fa73d09b681cac51
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Anas Nashif
74df249dd8 move net/buf test under tests/
This test should be under tests and is not a sample.

Change-Id: Ibb42207f72554516a650625a2cf4cc9cb7a0b021
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00