[Bug 236857] Fix sysctl check for some sys/audit/process-control tests

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Mar 28 20:30:50 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236857

--- Comment #3 from Enji Cooper <ngie at FreeBSD.org> ---
(In reply to Olivier Cochard from comment #2)

Let me rephrase for clarity; the test should be something of the form:

if (sysctlbyname(...) == -1) {
    if (errno == ENOTDIR || errno == ENOENT) {
        atf_tc_skip("not testing; : %s", capname, strerror(errno));
    } else {
        /* something happened with the sysctlbyname call; report the error */
    }
}

Also, I realize that there's already a macro for this, called
`ATF_REQUIRE_FEATURE(..)`.

If you change the call to `ATF_REQUIRE_FEATURE("security_capability_mode");`,
it will "do the right thing".

You'll need to add...

`#include <freebsd_test_suite/macros.h>`

... to the source file and also add `CFLAGS+= -I${SRCTOP}/tests` to the
Makefile.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-testing mailing list