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>
We are trying to pass 64-bit value to the driver, but we only
allocate space for an integer. This will not work and will cause
invalid memory access.
Fixes#18205
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add new tests that make sure that sendmsg() works when using
connected UDP socket and when not setting msghdr destination
address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that SO_TXTIME socket option can be set and get.
Verify also that TX time is passed properly to network device
driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the socket descriptor is invalid (fd < 0), there is no
need to try to close it.
Coverity-CID: 198949
Fixes#16785
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Test AF_NET_MGMT API getsockopt() and setsockopt() functions that
they work properly when called from kernel or from userspace.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
move misc/mutex.h to sys/mutex.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
If user supplies AF_UNSPEC, we need to do two queries, one for
IPv4 A record and one for IPv6 AAAA record.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Some MPU systems require region power-of-two alignment
and can't automatically use remaining RAM for the newlib
heap. Set it for this case. Fixes this test on mps2_an385.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The file descriptor was not closed after the test which caused
Coverity to complain about resource leak.
Coverity-CID: 198640
Fixes#16493
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
- Delete CONFIG_TEST_USERSPACE=n no-ops because it's the default
since commit 7b1ee5cf13
- Some tests have a "userspace" tag pretending to TEST_USERSPACE but
don't and vice versa: fix missing or spurious "userspace" tags in
testcase.yaml files.
Tests have a _spurious_ "userspace" tag when they PASS this command
cause none should pass:
./scripts/sanitycheck --tag=userspace -p qemu_x86 \
--extra-args=CONFIG_TEST_USERSPACE=n \
--extra-args=CONFIG_USERSPACE=n | tee userspace.log
All tests run by this command must either fail to build or fail to run
with some userspace related error. Shortcut to look at all test
failures:
zephyr_failure_logs() {
awk '/see.*log/ {print $2}' "$@"
}
Tests _missing_ "userspace" tag FAIL to either build or to run with some
userspace related error when running this:
./scripts/sanitycheck --exclude=userspace -p qemu_x86 \
--extra-args=CONFIG_TEST_USERSPACE=n \
--extra-args=CONFIG_USERSPACE=n | tee excludeuserspace.log
Note the detection methods above are not 100% perfect because some
flexible tests like tests/kernel/queue/src/main.c evade them with #ifdef
CONFIG_USERSPACE smarts. Considering they never break, it is purely the
test author's decision to include or not such flexible tests in the
"userspace" subset.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
As the getaddrinfo() test is suppose to be self contained, then
we will need to install handler for the sent DNS query. After we
receive the query in process_dns() thread, we verify that the
query was sent properly. We do not return DNS reply back to
the caller in this case as we do not want to create DNS server
just for this simple test application. This can be changed later
if we get DNS server functionality in Zephyr network stack.
Fixes#15193
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Unlike CONFIG_HW_STACK_PROTECTION, which greatly helps
expose stack overflows in test code, activating
userspace without putting threads in user mode is of
very limited value.
Now CONFIG_TEST_USERSPACE is off by default. Any test
which puts threads in user mode will need to set
CONFIG_TEST_USERSPACE.
This should greatly increase sanitycheck build times
as there is non-trivial build time overhead to
enabling this feature. This also allows some tests
which failed the build on RAM-constrained platforms
to compile properly.
tests/drivers/build_all is a special case; it doesn't
put threads in user mode, but we want to ensure all
the syscall handlers compile properly.
Fixes: #15103 (and probably others)
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This lets us quickly filter tests that exercise userspace
when developing it.
Some tests had a whitelist with qemu_cortex_m3; change
this to mps2_an385, which is the QEMU target with an
MPU enabled.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We need all the socket APIs to work from user mode.
tests/net/socket/misc now runs in userspace.
Fixes: #15227
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The test is designed to run in user mode, but was disabled
for some reason.
Re-enable, and add mps2_an385 to the whitelist as this is
the QEMU target that emulates an MPU.
Fixes: #15228
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Don't depend on CONFIG_NET_SOCKETS_POSIX_NAMES being defined (e.g.,
it's going to conflict with POSIX API).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
If peer socket closed, the other side should get 0 from recv(), and
should get in stable manner (no matter how much time went from the
closure and/or how many times recv() is called).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
As written originally, the tests assumed that if k_uptime_get_32()
returns times in milliseconds, that it also has millisecond
resolution. That however doesn't have to be the case, and indeed,
default timer interrupt period used by Zephyr is 10ms, and so system
time is incremented in such units. So, instead of "<= 1" tests to
account for timing increment, use "<= FUZZ".
For blocking tests, increase the timeout from previously used 10ms,
so we can reliably tests delays under the conditions described.
Also, enable CONFIG_QEMU_TICKLESS_WORKAROUND. Most other
timing-related tests have this enabled, and it may affect
stability of QEMU testing too.
Fixes: #12994
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Basic test for poll() behavior. UDP sockets are used for simplicity
so far (poll-related paths for UDP and TCP are similar, though later
adding TCP explicitly for full coverage may be useful).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The idea is that we should have many, many tests. The only reasonable
way to achieve that is by making tests easy and pleasant to write,
and that requires common, easy to reuse infrastructure.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
1. Consistently use prepare_sock helpers.
2. Test not just client->server sending, but sending reply.
3. Send large packets (>1 net_buf fragment), not just small.
4. Check POSIX behavior on recv()ing datagram incompletely (the rest
should be discarded and next recv() should read next datagram.
5. More cleanroom testing, e.g. explicitly reinitialize input params
on each call (without assumptions that they're left with suitable
values from previous calls), clear input buffers before each read
operations, etc.
6. Reformat code. Previously it was very sparse, giving long test
functions, and thus impression that tests are complicated and hard
to write.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Move to latest cmake version with many bug fixes and enhancements.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.
Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.
Fixes#11343Fixes#11659
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>