Page MenuHomeFreeBSD

Start testing the rc(8) framework (beginning with *_oomprotect)
ClosedPublic

Authored by 0mp on Jul 7 2022, 6:30 PM.
Tags
Referenced Files
Unknown Object (File)
Feb 9 2024, 8:20 AM
Unknown Object (File)
Feb 9 2024, 5:34 AM
Unknown Object (File)
Jan 3 2024, 4:27 AM
Unknown Object (File)
Dec 23 2023, 4:09 AM
Unknown Object (File)
Dec 23 2023, 12:08 AM
Unknown Object (File)
Dec 21 2023, 11:21 PM
Unknown Object (File)
Dec 21 2023, 11:21 PM
Unknown Object (File)
Dec 21 2023, 11:21 PM

Details

Summary

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.

MFC after: 2 weeks

Test Plan

A proper test is to rebuild the system with the patch and run the tests:

cd /usr/tests/libexec/rc
kyua test

A quick test for this change only is:

set -eu

cd libexec/rc/tests
objdir="$(make -V .OBJDIR)"

make

if ! sudo -i -- sh -c "cd $objdir && kyua test"; then
        sudo -i -- sh -c "cd $objdir && kyua report --results-file=LATEST --verbose"
fi

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

0mp requested review of this revision.Jul 7 2022, 6:30 PM
0mp added a project: rc.
0mp added a subscriber: a.wolk_fudosecurity.com.
0mp retitled this revision from libexec/rc/tests: Test *_oomprotect in rc.subr to Start testing the rc(8) framework (beginning with *_oomprotect).Jul 7 2022, 6:35 PM

Remove unnecessary pkills

Make sure that *_oomprotect=all protects existing children (see https://reviews.freebsd.org/D35747).

Update mtree. Now cd /usr/tests/libexec/rc && kyua test passes on a fresh installation without any issues

0mp edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Jul 22 2022, 5:58 PM