Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Mar 2019 20:30:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        testing@freebsd.org
Subject:   [Bug 236857] Fix sysctl check for some sys/audit/process-control tests
Message-ID:  <bug-236857-32464-vwqVeXayBf@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-236857-32464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-236857-32464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236857

--- Comment #3 from Enji Cooper <ngie@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(...) =3D=3D -1) {
    if (errno =3D=3D ENOTDIR || errno =3D=3D 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+=3D -I${SRCTOP}/tests` to the
Makefile.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236857-32464-vwqVeXayBf>