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
F107157873: D35745.id107891.diff
Sat, Jan 11, 12:27 AM
F107122280: D35745.diff
Fri, Jan 10, 11:18 AM
Unknown Object (File)
Mon, Jan 6, 9:29 PM
Unknown Object (File)
Thu, Dec 26, 12:09 AM
Unknown Object (File)
Thu, Dec 19, 5:05 PM
Unknown Object (File)
Nov 28 2024, 1:40 PM
Unknown Object (File)
Nov 15 2024, 12:43 AM
Unknown Object (File)
Nov 15 2024, 12:40 AM

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