Commit f7633a55aa moved the tests for the
POSIX_SEMAPHORES Option Group from the tests/posix/common testsuite to
its own dedicated testsuite.
However, there was a copy-paste error. Previously, tests would have been
run only once when dynamic threads were enabled, and then skipped when
dynamic threads were disabled, since that follows the posix programming
model better. However, dynamic threads were never actually enabled after
moving to the new testsuite. So all tests were effectively skipped.
Add the necessary options to prj.conf in order to ensure that there are
sufficient dynamic threads available to run the testsuite.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
There is no reason to use a 5s wait time in tests. This can add up quite
significantly across multiple platforms that execute in real-time under
qemu (or even just on real hardware).
Speedup observed with qemu_cortex_a53/qemu_cortex_a53/smp
Before:
```
START - test_named_semaphore
PASS - test_named_semaphore in 5.688 seconds
```
After:
```
START - test_named_semaphore
PASS - test_named_semaphore in 0.783 seconds
```
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Commit 7e8ee25479 moved the tests for the
POSIX_RW_LOCKS Option Group from the tests/posix/common testsuite to
its own dedicated testsuite.
However, there was a copy-paste error. Previously, tests would have been
run only once when dynamic threads were enabled, and then skipped when
dynamic threads were disabled, since that follows the posix programming
model better. However, dynamic threads were never actually enabled after
moving to the new testsuite. So all tests were effectively skipped.
Add the necessary options to prj.conf in order to ensure that there are
sufficient dynamic threads available to run the testsuite.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
I just happened to try to run this testsuite manually today and
noticed that it was being skipped due to a copy-paste error.
This test was migrated from tests/posix/common, where tests
were skipped for non-dynamic threads, since it would mostly
duplicate tests that had already been run.
However, while migrating, the condition to skip tests was
mistakenly left in when it should not have been.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
timer_create() will error if there are no dynamic threads to
run the SIGEV_THREAD handler, causing the test to fail (where
it was previously expected to pass).
Ensure that there is at least 1 dynamic thread available to
the POSIX API.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Previously, these tests were part of tests/posix/common.
In an effort to tie feature tests to specific POSIX features
(Option Groups), these tests were moved to a separate suite in a
previous commit.
However, the memory requirements for the legacy
tests/posix/common testsuite were significantly higher while the
memory requirements for tests in tests/posix/c_lib_ext are
significantly lower.
Remove the minimum flash and ram requirements to run the test so
that it passes tests on the integration platform qemu_cortex_m0.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add one integration platform per testsuite to reduce the number
of issues reported by the qa log level introduced in #86571.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
When a queue has been unlinked but not removed the name pointer is set to
NULL. The queue is still in the list when adding new queues and the name
pointer is passed to strcmp.
Signed-off-by: Jari Tervonen <jari.tervonen@nordicsemi.no>
native_posix is being removed as it has reached its end of life in 4.2,
after being deprecated since 4.0.
Remove the twister support for native_posix[//64] and therefore all
references to them from the testcases and samples yamls, so twister
does not error out.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This changes the board override to track the nodelabel rather than the
absolute node path, which happened to have changed in 0edc89c63b
breaking the test.
Verified with:
west build -p -b qemu_x86_tiny/atom tests/posix/common -T \
portability.posix.common.userspace
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Previously, intel_ish platforms would fail to link due to
missing `arch_mem_map()` and `arch_mem_unmap()` symbols due
to nuances in the x86 architecture on those platforms.
A separate commit has made MMU a non-user-configurable option,
which removes the ambiguity in POSIX.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Building portability.posix.timers with clang warns:
tests/posix/timers/src/nanosleep.c:180:2: error: variable 'actual_ns' is
used uninitialized whenever switch default is taken
[-Werror,-Wsometimes-uninitialized]
default:
^~~~~~~
tests/posix/timers/src/nanosleep.c:197:15: note: uninitialized use
occurs here
zassert_true(actual_ns >= exp_ns, "actual: %llu expected: %llu",
^~~~~~~~~ actual_ns, exp_ns);
subsys/testsuite/ztest/include/zephyr/ztest_assert.h:275:41: note:
^~ expanded from macro 'zassert_true'
subsys/testsuite/ztest/include/zephyr/ztest_assert.h:194:14: note:
expanded from macro 'zassert'
_zassert_va(cond, default_msg, COND_CODE_1(__VA_OPT__(1),
^~~~ (__VA_ARGS__), (NULL)))
subsys/testsuite/ztest/include/zephyr/ztest_assert.h:191:16: note:
expanded from macro '_zassert_va'
_zassert_base(cond, default_msg, msg, ##__VA_ARGS__)
^~~~
subsys/testsuite/ztest/include/zephyr/ztest_assert.h:180:14: note:
expanded from macro '_zassert_base'
z_zassert(cond, _msg ? ("(" default_msg ")") :
^~~~ (default_msg), __FILE__, \
tests/posix/timers/src/nanosleep.c:152:20: note: initialize the variable
'actual_ns' to silence this warning
uint64_t actual_ns;
^
= 0
Not really necessary since there is a zassert_unreachable(), but doesn't
hurt to initialize the variable.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Rather than disabling -Wunused-value for the entire file, explicitly
mark variables that are unused.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Instead of disabling the -Wunused-variable warning for the entire file,
we can explicitly mark the variables that are unused with __unused.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves mqueue into a singular
testsuite at tests/posix/message_passing app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
qemu_x86/atom was failing tests/posix/fs in
test_fs_readdir_threadsafe for some reason and only for that
platform.
All other platforms pass the testsuite properly with the dirent
declared on the stack.
Declare the dirent object statically so that qemu_x86/atom will
pass test cases.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Declare _POSIX_C_SOURCE in a consistent way for both the
posix/options library as well as the tests/posix/fs
testsuite.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves clock, sleep, nanosleep and timer
into a singular testsuite at tests/posix/timer app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
Move the functionality of POSIX_FILE_SYSTEM_R to its own
compilation unit and remove the unnecessary dependency on
POSIX_FILE_SYSTEM.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The default stack size was causing qemu_arc/qemu_arc_em and
qemu_arc/qemu_arc_hs to fail when a dirent object was
stack-allocated.
Increase the default stack size to accomodate for additional
usage.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Previously, a NULL pointer was passed as the second argument to
readdir_r(). This is incorrect. The passed pointer should be
to a valid, externally-allocated struct direct.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves tests in the xsi_threads_ext
option group into a singular testsuite tests/posix/xsi_threads_ext
app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
Move the previously singular env testsuite to be with the
other features that are part of the POSIX_SINGLE_PROCESS
Option Group.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add the POLLPRI constant defined by POSIX and test for it.
Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
Add the nfds_t type defined by POSIX and test for it.
Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
For a long time now, it's been possible to call
`pthread_attr_init()` and have it just to The Right Thing (TM)
without having to statically assign a stack.
Remove the stale comment and commented-out code.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The pthread_pressure test was not a typical test per se. It was
a benchmark in search of the proper home.
Let's move it to the correct place in the Zephyr tree, add a
doc, and provide some reporting.
Currently, k_threads out-perform pthreads by almost a factor of
2. The theoretical maximum performance of pthreads would be at
parity of k_threads, since pthreads are a wrapper around kernel
threads. It would be great to reduce the gap.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
One of the tests is failing since it was split out in 1a633609a0
triggering an assertion:
ASSERTION FAIL [((((size_t)(16)) << 10) - (((uintptr_t) (&_end)) -
0x20000000)) >= 8192] @
WEST_TOPDIR/zephyr/lib/libc/newlib/libc-hooks.c:139
Fix it by making the min_flash and min_ram parameters up to overall
test level.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves pthread_attr into a singular
testsuite at tests/posix/threads/ext app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves signal tests into a singular
testsuite at tests/posix/signals app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves spinlock into a singular
testsuite at tests/posix/spinlocks app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves fnmatch, getopt and getentropy
into a singular testsuite at tests/posix/c_lib_ext app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
This build would fail in CI for reasons that are not obvious.
```
west twister -i -p qemu_arc/qemu_arc_em \
-s tests/posix/common/portability.posix.common.userspace
scripts/build/gen_kobject_placeholders.py did not reserve \
enough space for kobject rodata.
```
It's the only platform that fails this way.
Exclude it from this test temporarily until #82059 is fixed.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves syslog into a singular
testsuite at tests/posix/xsi_system_logging app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
This commit adds test to assert that thread specific data is deallocated
on thread termination.
Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
What looks to be a copy-paste typo was not caught in
code review.
Change .rwlocks to nothing and move the filter to the
common area.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves stropts into a singular
testsuite at tests/posix/xsi_streams app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
Previously, twister would fail due to a warning being escalated to
an error because CONFIG_NET_TEST was set.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves rwlocks into a singular
testsuite at tests/posix/rwlocks app directory.
Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>