Some irrelevant errors were printed even if the tests passed.
Make sure that these obsolete errors at not printed so that
sanitychecker does not get confused about them.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
It might be that the test might access null pointer in some cases.
In practice this is not possible as the test is using pre-defined
data when running the test.
Fixes#10777
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Removed obsolete CONFIG_SYS_LOG_* and CONFIG_NET_DEBUG_* options
from various sample and test applications.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Under GNU C, sizeof(void) = 1. This commit merely makes it explicit u8.
Pointer arithmetics over void types is:
* A GNU C extension
* Not supported by Clang
* Illegal across all ISO C standards
See also: https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.
The only directory excluded directory was ext/* since it contains
only imported code.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
*_ll_src/*_ll_dst/*_ll_swap/*_ll_if were not self explanatory, ll
meaning "link layer" it's ambiguous what the names meant.
Changing to:
*_lladdr_src/*_lladdr_dst/*_lladdr_swap/*_lladdr_if to fix this.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
No need to have setup and teardown functions. Teardown will
even cause crash when tearing down last IPv4 test.
Fixes#9617
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Run networking tests for native_posix, qemu_x86 and qemu_cortex_m3
platforms only as the tests are generic enough so no need to run
them in real physical device.
Fixes#9623#9614#9622#9621#9618
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add checks so that we do not overflow the network interface
array. Similar issues was fixed in commit b4dae00741 for
TX timestamp tests.
Fixes#9465
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Refactor usage of net_sprint_ip*() where multiple
invocations are needed per single log call.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Fixes#9462
Coverity ID: 187670
Attempts to recalculate deltaBandwidth with no link lead to division by
zero.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Some locations like DHCPv4 client create a prefilled packet by appending
new fragments in a loop with one byte each via net_pkt_append_u8() which
is wasteful and noisy. This patch adds the new functions
net_pkt_append_memset() which creates fragments as needed in the desired
size and initialises it to the specified value.
This change also adds a unittest for the new function.
Prerequisite for #9287
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
Commit ac92a01f5a changed the net_ipv6_hdr
definition. The ieee802154 fragment test wasn't updated to match this
change.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.
Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.
To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.
This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.
The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This finishes refactor of splitting off net_config library name from
net_app library, started in c60df1311, c89a06dbc. This commit makes
sure that Kconfig options are prefixed with CONFIG_NET_CONFIG_
instead of CONFIG_NET_APP_, and propagates these changes thru the
app configs in the tree.
Also, minor dependency, etc. tweaks are made.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Add system calls for the zsock implementations of socket,
close, bind, connect, listen, accept, sendto, recvfrom,
fcntl, poll, inet_pton, and getaddrinfo.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
As ethernet_api is larger than net_if_api, and we are accessing
ethernet_api elements in ethernet L2 driver, then invalid memory
was accessed in L2 ethernet.c.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that net_if_ipv6_select_src_iface() returns correct network
interface for a given destination address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
With this commit all Qav parameters are tested and the fake driver
properly stores and recalculates info about all the Qav parameters to
make them available for read-back.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
The new mappings require at least two traffic classes so there are fewer
tests than there are for the strict mapping.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
In coap module previous test cases are modified as well as
new test functions are added to increase the code coverage
Signed-off-by: Tarun Kumar Agarwal <tarun.kumar.agarwal@intel.com>
As the test is testing neighbor discovery which needs to know
link addresses, we must run the test using Ethernet L2.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
There are too many individual requests for Qav related parameters. There
are more Qav parameters that need to be supported (and will be supported
soon - both on the GET and SET side). Handling it the way it was handled
so far would render the eth mgmt API dominated by Qav parameters. That
would make the file hard to read and understand.
Instead of that - use a single GET and SET requests for all Qav
parameters. This works by adding a separate enum with Qav request type
to the ethernet_qav_param struct.
Additionally this approach makes it much easier to document it all since
we now have just a single request and documentation comments in the
ethernet_qav_param struct.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
This commit changes how the fake driver stores info about priority
queues. This allows it to test the Qav status API.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Add basic IPv4 Link Local support as described in RFC 3927.
Signed-off-by: Matthias Boesl <matthias.boesl@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Some Ethernet devices can filter out incoming packets through a list of
valid MAC addresses, so let's add a way to expose this capability, using
it through the ethernet device API.
Fixes#7596
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit adds the get_config callback to the fake driver and makes
use of it to get the number of priority queues. That number is in turn
used in Qav tests.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Test that user is able to turn on/off promiscuous mode and
also receive any data from network interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that user is able to toggle promiscuous mode flag
in network interface level and that flag value is passed
to device driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Test in ethernet mgmt level that promiscuous flag is passed
properly to the device driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Current implementation does not handle large extension headers
(e.g HBHO). Which resulted network stack crashes or due to
misinterpretation of lengths network packets are dropped. Also
caused issues while preparing IPv6 packet (e.g. large HBHO header
with IPv6 fragmentation support).
Issues fixed and provided more unit tests.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
No need to run the tests in real hardware as there we can run
out of network buffers that happened with Atmel SAM-E70.
Fixes#8966
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Generate proper error if we run out of network buffers which means
so that the test can fail properly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In some hw like Atmel SAM-E70, the original amount of network
buffers is too small so increasing it slightly.
Also generate proper error if this happens in the test so it
is easier to figure out.
Fixes#8865
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The test app creates two network interfaces, one for simulating
local device and the other one for peer device. Make sure that
the tests use correct network interface in each test. We cannot
guarantee that net_if_get_default() will always return correct
interface in different architectures as that depends how the
net_if structs are placed in corresponding linker section.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In some hw like Atmel SAM-E70, the original amount of network
buffers is too small so increasing it slightly.
Also generate proper error if this happens in the test so it
is easier to figure out.
Fixes#8866
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The cb_[1|2]_called variables were initialized just before running
the test. This was too late as in some cases the Trickle timer
was triggered before the variables were init, which then caused the
test to fail even though there was no actual timer failure.
This was seen with frdm_k64f and when CONFIG_BOOT_DELAY=1000 was set.
Fixes#8658
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>