aboutsummaryrefslogtreecommitdiff
path: root/libexec/rc/tests
Commit message (Collapse)AuthorAgeFilesLines
* rc tests: Add a test to check for warnings from rcorderMark Johnston2025-10-081-0/+12
| | | | | | Reviewed by: des MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D52954
* rc.subr: Drop duplicate SPDX tag in test scriptDag-Erling Smørgrav2025-08-011-2/+0
| | | | | | | | | I added a tag in the correct place in the previous commit, and somehow managed to miss that there was already one in the wrong place. Fixes: 7f04c09fe745 Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc.
* rc.subr: Fix wait_for_pidsDag-Erling Smørgrav2025-08-011-0/+27
| | | | | | | | | | | | | It looks like this function was intended to loop and print an update whenever at least one of the waited-for processes terminates. However, the default behavior of pwait is to block until none of the watched processes exist. Use pwait -o instead so it only blocks until at least one process terminates, and add a test. Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: siderop1_netapp.com, kevans Differential Revision: https://reviews.freebsd.org/D51691
* rc_subr_test: Bump some sleep timeoutsMark Johnston2025-07-131-2/+2
| | | | | | | | | | | | | | | | | | The test verifies that the rc framework will OOM-protect a process spawned by rc. It just wraps a 5-second /bin/sleep invocation as part of this test. The rc framework uses procctl to set the OOM-protect bit after the process has started, i.e., it uses procctl -p. So, with a 5 second timeout, it's possible for the process to exit before procctl actually runs, if the system is heavily loaded. (I see this failure occasionally with KMSAN configured and many tests running in parallel.) Bump the timeout to reduce the risk of this happening. The timeout value is arbitrary since the test will stop the rc process, i.e., we don't have to wait for 60 seconds to elapse before the test passes. MFC after: 1 week
* rc/tests: Fix process flags checks using ps(1)Olivier Certner2025-05-071-2/+2
| | | | | | | | | | | | | | | These checks use ps(1) with both the '-p' and '-a' flags, which worked so far as ps(1)'s '-a' option was buggy. Since the fix in commit "ps(1): Make '-a' and '-A' always show all processes" (93a94ce731a89b56), such a command-line always selects all processes, making the specified '-p' useless and the test wrong. Remove the useless '-a'. While here, remove the redundant '-x', as '-p' implies '-x' by default. MFC after: 1 day Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50201
* rc/tests: Skip oomprotect tests in a jailMateusz Piotrowski2024-10-141-0/+8
| | | | | | | | oomprotect cannot be used in a jail. Reviewed by: bnovkov, christos, markj Approved by: bnovkov (mentor), christos (mentor), markj (mentor) MFC after: 1 week
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* rc: Start testing the rc(8) framework (beginning with *_oomprotect)Mateusz Piotrowski2022-07-262-0/+106
This change adds 2 tests to make sure that the *_oomprotect variable sets the protection against OOM killer properly within rc(8) scripts. This is also adding the first tests for the rc(8) framework. More tests will be added as we go. PR: 256148 Approved by: des MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35745