If the recvfrom() in the test returns EAGAIN, try again in order
to make sure that we have really received the data.
Fixes#27963
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add some tests for testing AF_PACKET and SOCK_DGRAM type
sockets. These are sockets where Ethernet header is automatically
added, caller just needs to provide upper stack header.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Only one LOG_MODULE_REGISTER() is allowed in the files that are
linked together. The other files must use LOG_MODULE_DECLARE()
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
TCP2 uses slightly more network packets and connections in the
socket poll test, so increase the values for the test.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The tests were failing when run on those boards that had
physical Ethernet support. In that case there were three Ethernet
interfaces, two simulated ones for testing, and the third one
was provided by the board. This extra Ethernet interface caused
the test to fail as the test was sending data to wrong interface.
Fixes#27238Fixes#26568
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is a test, and the function is called with K_FOREVER, so it's not
supposed to fail.
Fixes: #25735
CID: 210582
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
If we have multiple network interfaces and we are waiting incoming
network packets, make sure to honor the bind of the socket so that
correct socket will receive data in certain network interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Unit test code requires IPv6 to be ready. Select
CONFIG_NET_CONFIG_NEED_IPV6=y to ensure that.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Unit test code requires IPv6 to be ready. Select
CONFIG_NET_CONFIG_NEED_IPV6=y to ensure that.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This socket is shared by all the test cases which run in
different threads. Just make it a global object here.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
If we are calling sendmsg() without any aux data, then msg_controllen
is 0 and msg_control is NULL. Check these allowed values properly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we are calling sendmsg() for a connected socket, then msg_namelen
is 0 and msg_name is NULL. Check these allowed values properly.
Also modify unit tests so that we test this scenario.
Fixes#25925
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
... because it is (required).
This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.
In this particular case, REQUIRED turns this harmless looking log
statement:
-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
Cannot specify sources for target "app" which is not built by
this project.
... into this louder, clearer, faster and (last but not least) final
error:
CMake Error at CMakeLists.txt:5 (find_package):
Could not find a package configuration file provided by "Zephyr" with
any of the following names:
ZephyrConfig.cmake
zephyr-config.cmake
Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
"Zephyr_DIR" to a directory containing one of the above files. If
"Zephyr" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Kernel objects were being directly accessed without previously
calling k_thread_access_grant().
This change allows each test that requires an asynchronous
event to send it to a common work queue with correct
permissions.
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Tests should always start with test_, otherwise detection of subtests
will not work through sanitycheck.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit removes the redundant `LOG` and `LOG_IMMEDIATE` selections
in `prj.conf`, since the `TEST_LOGGING_DEFAULTS`, which is enabled by
default for all tests, selects `LOG` and `LOG_MINIMAL`.
This effectively allows the test to run with the default test logging
policy, set by the testing subsystem.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Mention in websocket API documentation that the timeout value
is in milliseconds. Check timeout values properly using K_TIMEOUT_EQ()
macro.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Using find_package to locate Zephyr.
Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.
Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.
It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
By changing the various *NET_DEVICE* macros. It is up to the device
drivers to either set a proper PM function or, if not supported or PM
disabled, to use device_pm_control_nop relevantly.
All existing macro calls are updated. Since no PM support was added so
far, device_pm_control_nop is used as the default everywhere.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add a simple test to verify that the bind() can be called multiple
times if AF_PACKET is set and there are multiple network interfaces
in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The test name did not reflect the purpose of the test.
Also add "poll" tag so that we can more easily launch just
this test.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
This is bad practice and may conceal issues on platforms
not in the whitelist.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Make sure that resolving IPv4 address but returning IPv6 address
(and vice versa) is failing and we catch that scenario.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Got several sanity failures with this information
Assertion failed at tests/net/socket/poll/src/main.c:76: \
test_poll: (tstamp >= 30U && tstamp <= 30 + FUZZ is false)
In one of the failed tests, the tstamp was 50. Dunno what is
wrong here but in order to proceed with this, increasing the
timeout temporarily. This commit can be removed if the root
cause for this timeout is figured out.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Moving Kconfig options from testcase.yaml file to prj.conf so
that we can run the test app easily from command line and without
sanitycheck.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>