Repository navigation
testing/ostest: Add pthread_sigqueue test - #3931
Conversation
|
@Swatantra-66 need reduce the size of eic7700-evb/nsh to pass ci. |
fbd40cf to
a3bdcec
Compare
|
@xiaoxiang781216 I have guarded pthread_sigqueue with !CONFIG_BUILD_KERNEL across Makefile, CMakeLists.txt, ostest.h, and ostest_main |
a3bdcec to
8e84439
Compare
8e84439 to
fd3692e
Compare
|
CI failed on |
I don't think it is good to disable tests selectively. Either disable all SIGQUEUE from this board or try to trim it even further. And have the test gates by sigqueue. |
fd3692e to
ff04e58
Compare
|
I have updated the commit:
|
|
As requested, I have separated the TEST_LOOP_SCALE -> TESTING_LOOP_SCALE rename into a dedicated standalone PR: #3941 (along with resolving pre-existing nxstyle issues in spinlock.c). Also, the arm-ti failure on launchxl-tms57004/nsh appears to be an upstream CI environment issue (arm-nuttx-eabi-gcc: command not found) unrelated to pthread_sigqueue. |
ff04e58 to
24e70c1
Compare
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): |
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): |
|
Please rebase |
Add automated unit test for pthread_sigqueue() in ostest to verify signal and payload delivery to a target pthread. Tests error handling for invalid signal numbers and non-existent thread IDs, as well as successful signal dispatch and reception with SA_SIGINFO and SI_QUEUE. Now that pthread_sigqueue() is implemented as a system call (apache/nuttx#21070), the test runs across flat, protected, and kernel builds. Configurable via CONFIG_TESTING_OSTEST_PTHREAD_SIGQUEUE, enabled by default for non-small builds (!DEFAULT_SMALL) and gated by ENABLE_ALL_SIGNALS and !DISABLE_PTHREAD. Progress output and error messages are streamlined to minimize the flash footprint. Signed-off-by: Swatantra Yadav <[email protected]>
8d4acc5
24e70c1 to
8d4acc5
Compare
rebased onto latest master and resolved the Kconfig conflict |
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s):
|
casaroli
left a comment
There was a problem hiding this comment.
The PR body does not match the code. Summary item 2 says the build files and ostest_main.c test CONFIG_DISABLE_PTHREAD and CONFIG_ENABLE_ALL_SIGNALS, but they test CONFIG_TESTING_OSTEST_PTHREAD_SIGQUEUE. The test log shows progress lines that the test no longer prints, and Testing lists only flat builds.
Fix: describe the new Kconfig option, replace the log with one from the current code, and add a protected or kernel build run (for example qemu-armv8a:knsh).
|
Re-triggered to pick up the fix from apache/nuttx#21335 for arm-ti. |
|
@casaroli updated the PR body to document CONFIG_TESTING_OSTEST_PTHREAD_SIGQUEUE, replaced the test log with the streamlined output, and added the protected/kernel verification target (qemu-armv8a:knsh). |
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s):
|
|
another board flash overflow |
|
@xiaoxiang781216 opened apache/nuttx#21370 to shrink nucleo-l432kc:wgen (dropping unused C++ and unused NSH commands to free ~6 KiB flash) |
@jerpelea please approve apache/nuttx#21370. |
Summary
Fixes #3796 by adding automated unit test coverage for the POSIX
pthread_sigqueue()interface inapps/testing/ostest.testing/ostest/pthread_sigqueue.c:pthread_sigqueue()with an invalid signal number fails withEINVAL.pthread_sigqueue()with a non-existent thread ID fails withESRCH.sigactionwithSA_SIGINFOand unblocksSIGUSR1.sival_int = 42) viapthread_sigqueue(), and asserts that the signal handler receives:info->si_signo == SIGUSR1info->si_code == SI_QUEUEinfo->si_value.sival_int == 42pthread_join().Kconfig & Build System Integration:
CONFIG_TESTING_OSTEST_PTHREAD_SIGQUEUEintesting/ostest/Kconfig, enabled by default for non-small builds (default !DEFAULT_SMALL) and dependent onENABLE_ALL_SIGNALS && !DISABLE_PTHREAD.pthread_sigqueue.conCONFIG_TESTING_OSTEST_PTHREAD_SIGQUEUEacross both build systems.pthread_sigqueue_test()inostest.hand invokes it inostest_main.cguarded by#ifdef CONFIG_TESTING_OSTEST_PTHREAD_SIGQUEUE.Impact
pthread_sigqueue()inostest.pthread_sigqueue()is a system call (syscall: Add pthread_sigqueue() to the system call table. nuttx#21070), the test validates signal and payload dispatch across FLAT, PROTECTED, and KERNEL builds.nxstyleandcmake-formatcompliant.Testing
sim:ostest,rv-virt:nshqemu-armv8a:knsh(Validates user-space to kernel-space syscall dispatch and signal return).Test Flow / Execution Log:
Style & Format Verification:
apps/testing/ostest/pthread_sigqueue.c: 0 errors, 0 warningsapps/testing/ostest/ostest_main.c: 0 errors, 0 warningsapps/testing/ostest/ostest.h: 0 errors, 0 warningsapps/testing/ostest/Kconfig: 0 errors, 0 warningsapps/testing/ostest/Makefile: 0 errors, 0 warningsapps/testing/ostest/CMakeLists.txt: 0 errors, 0 warnings