casaroli opened a new pull request, #4059: URL: https://github.com/apache/nuttx-apps/pull/4059
depends-on: apache/nuttx/pull/21904 depends-on: apache/nuttx/pull/21898 ## Summary Add `testing/sched/pgrptest`, a test of process groups and sessions (`CONFIG_SCHED_PROCESS_GROUPS`, apache/nuttx#TBD). The test checks `setpgid()`, `getpgid()`, `setsid()` and `getsid()` and their errors (`EINVAL`, `ESRCH`, `EPERM`, `EACCES` after `posix_spawn()`), `kill(0)`, `kill(-pgid)` and `killpg()` to each process of a process group, `POSIX_SPAWN_SETPGROUP` and `POSIX_SPAWN_SETSID`, `waitpid()` of the processes of a group, and the INTR character of a pseudo-terminal to its foreground process group. The children are the test program again, started with `posix_spawn()`, so most cases run in a flat build without `fork()`. The `fork()` cases print SKIP without `fork()`, and the terminal case without `CONFIG_PSEUDOTERM_SUSV1` and `CONFIG_TTY_SIGINT`. The program prints one line per case and returns 1 if a case fails. The first nuttx PR adds `CONFIG_SCHED_PROCESS_GROUPS`. #21898 fixes the error path of `exec_module()`: without it, the checks where `posix_spawn()` must fail crash a kernel build. ## Impact A new test program, default n. Its Kconfig option depends on `SCHED_PROCESS_GROUPS`, `SCHED_WAITPID`, `LIBC_EXECFUNCS` and `PIPES`, so no configuration builds it until it is enabled. No other app changes. ## Testing | Configuration | nuttx master | nuttx with the two PRs, `CONFIG_SCHED_PROCESS_GROUPS=y` | |---|---|---| | qemu-armv8a:knsh (kernel, QEMU with HVF) | 10 of 35 FAIL (test compiled against the export) | 35 PASS | | qemu-armv8a:nsh (flat, Make build) | the option does not exist: the test cannot be enabled | 32 PASS, 1 SKIP (no `fork()`) | | qemu-armv8a:citest (flat, CMake build, QEMU TCG) | cannot be enabled | 31 PASS, 2 SKIP (no `fork()`, no pseudo-terminal) | | rv-virt:pnsh64 (protected, rv64) | cannot be enabled | builds | ostest exits with status 0 in each of these runs. `tools/checkpatch.sh -c -u -m -g` of nuttx passes on the commit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
