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
F102614937: D35745.diff
Thu, Nov 14, 8:20 PM
Unknown Object (File)
Wed, Nov 13, 12:46 PM
Unknown Object (File)
Sat, Nov 2, 2:53 AM
Unknown Object (File)
Sat, Nov 2, 2:53 AM
Unknown Object (File)
Sat, Nov 2, 2:53 AM
Unknown Object (File)
Sat, Nov 2, 2:53 AM
Unknown Object (File)
Sat, Nov 2, 2:53 AM
Unknown Object (File)
Sat, Nov 2, 2:52 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