Add a simple existence check that pthread_atfork() has
some kind of implementation. The function is mandatory
by all conforming POSIX systems.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
All these tests where filtered for the whole POSIX
architecture, but quite a few of them can be run in
native_sim.
So let's filter out native_posix(_64) in general,
(allowing other native simulator based targes),
and filter for thsi arch out explicitly the 2 tests
which need NEWLIB as this arch does not provide it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
These tests cannot be run on the native_posix(_64) targets,
so let's filter them explicitly. Before they were filtered
due to the "filter", but using platform_exclude is faster.
Also the tests that depend on newlib cannot be run
in this architecture at all, so let's filter them by
architecture too.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The timer check does not work properly for platforms
which have a system tick timer with a period that
does not properly divide the configured time interval.
In those, depending on when the timer is started and
stopped, one signal less may be received.
This is for example the case for nrf5x platforms,
where the system tick timer is driven by a 32.768KHz
clock.
=> Correct the test, to accept receiving 1 signal
too little during the wait.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The infinite loop during the test needs to be broken
with a small delay when built for native targets.
Let's add it.
Note that this delay is only added for ARCH_POSIX targets
and not any other.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This test should be compiled without host headers
when built without the host libC, and at the same
time, it does not support building with the host
libC, so let's remove the condition that includes
the host libC header to avoid extra confusion.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The infinite loop during the stress needs to be broken
with a small delay when built for native targets.
Let's add it.
Note that this delay is only added for ARCH_POSIX targets
and not any other.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The comparison of cycles we get with k_cycle_get_32 may be
incorrect if counter wrap happened. In case of ARC HSDK and
ARC HSDK4xD platforms we have high counter clock frequency
(500MHz or 1GHz) so counter wrap quite likely to happen if
we wait long enough. As in some test cases we wait more than
1 second, there are significant chances to get false-positive
assertion.
So let's skip nanosleep testcase for ARC HSDK and ARC HSDK4xD
boards.
The proper fix is to use k_cycle_get_64 in this test case,
but we need to provide k_cycle_get_64 support for ARC HSDK and
ARC HSDK4xD platforms first.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
as posix nanosleep is actually call us, so we need use a
higher clock to compare the result. try to use k_cycle_64
as possible.
Co-authored-by: Christopher Friedt <cfriedt@meta.com>
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
in test_nanosleep_execution, the
actual_ns = k_cyc_to_ns_ceil64((now - then * selection));
is wrong, according to posix driver code
lib/posix/clock.c
line: 156
if ((flags & TIMER_ABSTIME) == 0) {
ns += uptime_ns;
}
so we need change to
actual_ns = k_cyc_to_ns_ceil64((now + then * selection));
fixing: #62889
Co-authored-by: Christopher Friedt <cfriedt@meta.com>
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
This sets the stack size appropriate for SPARC. Tested on the board
configurations qemu_leon3 and gr716a_mini.
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
Zephyr's code base uses MP_MAX_NUM_CPUS to
know how many cores exists in the target. It is
also expected that both symbols MP_MAX_NUM_CPUS
and MP_NUM_CPUS have the same value, so lets
just use MP_MAX_NUM_CPUS and simplify it.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The test case allocate struct k_thread thread in the stack. This will
lead the random initial value of thread and thus cause the test cases
randomly hang. To fix such issue, move the declartion of struct k_thread
thread outside the function as a stacic variable.
Signed-off-by: Jaxson Han <jaxson.han@arm.com>
Rework RAM disk driver to be configured using devicetree and
support multiple instances.
This patch also removes a copy of the RAM disk driver,
tests/subsys/fs/fat_fs_dual_drive/src/disk_access_test_drv.c,
that was there for testing multiple disk drivers support.
Bonus: one SYS_INIT() less and a memory region can be exported to the
host.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Adds error and lower bounds tests for the posix clock_nanosleep
function. Refactors common test functions to be shared by both
clock_nanosleep and nanosleep tests.
Signed-off-by: Tom Finet <tom.codeninja@gmail.com>
Correct the Kconfig with 64BIT condition instead of 64_BIT.
Slightly refine the if condition as they are mutually exclusive.
Signed-off-by: Jaxson Han <jaxson.han@arm.com>
This reverts commit d24880e358.
The issue was fixed by a2d29025038dece141ab71545c83166384821369.
Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
This follows the same convention that has already been adopted by Intel
Alder Lake and Raptor Lake boards.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
extends the char buffer in the strsignal function to cover the
entire range of `int`
Had to use `-INT_MAX` as the compiler resolves
```
STRINGIFY(INT_MIN)
```
to:
```
(-2147483647 - 1)
```
instead of:
```
-2147483648
```
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
For platforms that select Kconfig option CONFIG_KERNEL_COHERENCE,
the receive buffer used in mq_timedreceive() must not be on the
stack. This is because the k_msgq that underlies the POSIX mqueue
will attempt to perform a direct to buffer copy from the sender
when there is a waiting reader.
Fixes#60796
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
A thread that has been previously detached using
`pthread_detach()` should not be able to be joined. A recent
change made it so that `pthread_join()` would always report
success (0), even when `ret` (return value) had an error.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The test is failing for (so far) unknown reasons, blocking several PRs.
Exclude it until a proper investigation finds the root cause.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Test names were changed recently to change
"test_posix_pthread_..." to "test_..." for brevity.
Make the same change to "test_posix_pthread_barrier".
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Most Zephyr testsuites do not break tests down to the level of
granularity that `nanosleep()` tests, and this change makes
reports less verbose.
This change makes the `nonosleep()` test cases
significantly less verbose.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The POSIX testsuite should be run with standard POSIX
header locations.
Additionally, reorder headers to follow the recommendation
in #41543.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
There were a number of tests that started with `test_posix_..`.
The `test_` prefix is necessary, but the `posix_` part is self-
evident, so it makes sense to shorten that.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>